SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
How (not) to get lost in bigger
Ruby On Rails project
More layers than only MVC
and maybe more mess
- Oliver Kriška - quatermain32@gmail.com
- first e-shop in 2015
- FRI UNIZA 2008 - 2011
- EUBA 2011-2011
- Kadetade 2009 - ...
- Ruby on Rails 2011
- BeeSafe 2013 - ...
- freelancing 2014
- ShopVox (SF - USA) 2014 - ...
Who am I?
fatality
fail
WIN
What is Ruby On Rails?
- 2004
- MVC framework
- Ruby language (1995)
- Optimize for programmer happiness
- Convention over Configuration
- Exalt beautiful code
- Value integrated systems (complete solution)
- Basecamp, GitHub, Shopify, Airbnb, Twitch, SoundCloud, Hulu, Zendesk, Square,
Highrise, Envato Marketplace (Themeforest, Photodune, ...)
by http://rubyonrails.org/doctrine
What is MVC?
- Design Pattern
- Architectural
Pattern
- Model
- View
- Controller
Browser Model
Controller
View
by Google Search
RoR vs MVC?Browser
DBController
Requests
Responses
View
Model
DB Queries
Create/Update
Read
Load Data
Response
Read
What is Shopvox?
- Complex
- Web-based
- Job management
- CRM
- Point of Sale (POS)
- For custom shop and print industry
ShopVOX vs MVC
Controller ModelView
Presenter Query
Service
Why so complicated?
- Fat model
- Fat controller
- Fat view
- Too much logic!!
- Creating Work Order
- ~350 lines
- Model?
- Controller?
- Service per action
- Index Jobs
- ~ 150 lines query
- JSON presenter - ~ 350 lines
- View?
- Presenter
What is Presenter?
- Move logic from html/json template to some class
- Nice & clean template
- Freedom of use
- Speed
- Decorators, Presenters, JSONPresenters(?)
What is Service?
- Move logic from Controllers and Models
- Dynamic validations
- Creating nested models
- Complex logic
- Indexing
- Backup data
- Counting
- Notifications
- Third Party APIs
- Generators (Transaction numbers, Colors, Keys)
What is Query?
- Move logic from Controllers
- Dynamic queries
- Filters/Conditions
- Ordering
- Restrictions
- Calculations
- Stats (pagination, summary)
- Speed
- Loading connected data
- Loading only necessary data
- Jobs query
- 27 parts
- Pos query
- 6 base classes
- 200 lines
- 50 parts

Más contenido relacionado

La actualidad más candente

Scaling and Orchestrating Microservices with OSGi - N Bartlett
Scaling and Orchestrating Microservices with OSGi - N BartlettScaling and Orchestrating Microservices with OSGi - N Bartlett
Scaling and Orchestrating Microservices with OSGi - N Bartlett
mfrancis
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
jistr
 
Alfresco REST API of the future ... is closer than you think
Alfresco REST API of the future ... is closer than you thinkAlfresco REST API of the future ... is closer than you think
Alfresco REST API of the future ... is closer than you think
J V
 

La actualidad más candente (20)

A Ct Os Story
A Ct Os StoryA Ct Os Story
A Ct Os Story
 
Intro cujojs
Intro cujojsIntro cujojs
Intro cujojs
 
Scaling and Orchestrating Microservices with OSGi - N Bartlett
Scaling and Orchestrating Microservices with OSGi - N BartlettScaling and Orchestrating Microservices with OSGi - N Bartlett
Scaling and Orchestrating Microservices with OSGi - N Bartlett
 
Building the ideal betting stack | London Erlang User Group presentation
Building the ideal betting stack | London Erlang User Group presentationBuilding the ideal betting stack | London Erlang User Group presentation
Building the ideal betting stack | London Erlang User Group presentation
 
Async js
Async jsAsync js
Async js
 
Evolution of Rails
Evolution of RailsEvolution of Rails
Evolution of Rails
 
Breathing new life into JSP with OSGi? Why!!! - R Auge
Breathing new life into JSP with OSGi? Why!!! - R AugeBreathing new life into JSP with OSGi? Why!!! - R Auge
Breathing new life into JSP with OSGi? Why!!! - R Auge
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
 
Build Your Own Real-Time Web Service with Elixir Phoenix
Build Your Own Real-Time Web Service with Elixir PhoenixBuild Your Own Real-Time Web Service with Elixir Phoenix
Build Your Own Real-Time Web Service with Elixir Phoenix
 
Lambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in JavaLambda local - A local server for developing AWS Lambda function in Java
Lambda local - A local server for developing AWS Lambda function in Java
 
Java 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
Java 8: Nashorn & avatar.js di Enrico Risa al JUG RomaJava 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
Java 8: Nashorn & avatar.js di Enrico Risa al JUG Roma
 
Aspect oriented programming
Aspect oriented programmingAspect oriented programming
Aspect oriented programming
 
Developing Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and PayaraDeveloping Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and Payara
 
Torino js
Torino jsTorino js
Torino js
 
Making CLI app in ruby
Making CLI app in rubyMaking CLI app in ruby
Making CLI app in ruby
 
Alfresco REST API of the future ... is closer than you think
Alfresco REST API of the future ... is closer than you thinkAlfresco REST API of the future ... is closer than you think
Alfresco REST API of the future ... is closer than you think
 
Build App with Nodejs - YWC Workshop
Build App with Nodejs - YWC WorkshopBuild App with Nodejs - YWC Workshop
Build App with Nodejs - YWC Workshop
 
Cherokee
CherokeeCherokee
Cherokee
 
React Webinar With CodePolitan
React Webinar With CodePolitanReact Webinar With CodePolitan
React Webinar With CodePolitan
 
APIDays Australia - Openresty for scale
APIDays Australia - Openresty for scaleAPIDays Australia - Openresty for scale
APIDays Australia - Openresty for scale
 

Destacado

Apache Solr crash course
Apache Solr crash courseApache Solr crash course
Apache Solr crash course
Tommaso Teofili
 

Destacado (13)

Building a Large Scale SEO/SEM Application with Apache Solr: Presented by Rah...
Building a Large Scale SEO/SEM Application with Apache Solr: Presented by Rah...Building a Large Scale SEO/SEM Application with Apache Solr: Presented by Rah...
Building a Large Scale SEO/SEM Application with Apache Solr: Presented by Rah...
 
Ruby language overview
Ruby language overviewRuby language overview
Ruby language overview
 
Ruby is Awesome and Rust is Awesome and Building a Game in Both is AWESOME
Ruby is Awesome and Rust is Awesome and Building a Game in Both is AWESOMERuby is Awesome and Rust is Awesome and Building a Game in Both is AWESOME
Ruby is Awesome and Rust is Awesome and Building a Game in Both is AWESOME
 
Node.js'e Hızlı Bir Bakış
Node.js'e Hızlı Bir BakışNode.js'e Hızlı Bir Bakış
Node.js'e Hızlı Bir Bakış
 
From Java To Clojure (English version)
From Java To Clojure (English version)From Java To Clojure (English version)
From Java To Clojure (English version)
 
The road to php 7.1
The road to php 7.1The road to php 7.1
The road to php 7.1
 
Fullstack End-to-end test automation with Node.js, one year later
Fullstack End-to-end test automation with Node.js, one year laterFullstack End-to-end test automation with Node.js, one year later
Fullstack End-to-end test automation with Node.js, one year later
 
Apache Solr crash course
Apache Solr crash courseApache Solr crash course
Apache Solr crash course
 
Functional Programming Principles & Patterns
Functional Programming Principles & PatternsFunctional Programming Principles & Patterns
Functional Programming Principles & Patterns
 
Building Intelligent Search Applications with Apache Solr and PHP5
Building Intelligent Search Applications with Apache Solr and PHP5Building Intelligent Search Applications with Apache Solr and PHP5
Building Intelligent Search Applications with Apache Solr and PHP5
 
CLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.jsCLI utility in ClojureScript running on Node.js
CLI utility in ClojureScript running on Node.js
 
Building a real time, solr-powered recommendation engine
Building a real time, solr-powered recommendation engineBuilding a real time, solr-powered recommendation engine
Building a real time, solr-powered recommendation engine
 
ConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web appsConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web apps
 

Similar a WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.

1st Chinaonrails Open Course
1st Chinaonrails Open Course1st Chinaonrails Open Course
1st Chinaonrails Open Course
Jesse Cai
 
Server-side Web development via Ruby on Rails
Server-side Web development via Ruby on RailsServer-side Web development via Ruby on Rails
Server-side Web development via Ruby on Rails
g3ppy
 

Similar a WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project. (20)

Ruby on Rails best resources for self
Ruby on Rails best resources for selfRuby on Rails best resources for self
Ruby on Rails best resources for self
 
Introducing React to GraysOnline
Introducing React to GraysOnlineIntroducing React to GraysOnline
Introducing React to GraysOnline
 
RubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on RailsRubyConf Bangladesh 2017 - Introduction to Ruby on Rails
RubyConf Bangladesh 2017 - Introduction to Ruby on Rails
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHP
 
Web Development with Node.js
Web Development with Node.jsWeb Development with Node.js
Web Development with Node.js
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
CG_CS25010_Lecture
CG_CS25010_LectureCG_CS25010_Lecture
CG_CS25010_Lecture
 
Introduction To Rails
Introduction To RailsIntroduction To Rails
Introduction To Rails
 
Past, Present and Future of APIs of Mobile and Web Apps
Past, Present and Future of APIs of Mobile and Web AppsPast, Present and Future of APIs of Mobile and Web Apps
Past, Present and Future of APIs of Mobile and Web Apps
 
1st Chinaonrails Open Course
1st Chinaonrails Open Course1st Chinaonrails Open Course
1st Chinaonrails Open Course
 
Ruby on Rails workshop for beginner
Ruby on Rails workshop for beginnerRuby on Rails workshop for beginner
Ruby on Rails workshop for beginner
 
Security Goodness with Ruby on Rails
Security Goodness with Ruby on RailsSecurity Goodness with Ruby on Rails
Security Goodness with Ruby on Rails
 
Ruby On Rails - Rochester K Linux User Group
Ruby On Rails - Rochester K Linux User GroupRuby On Rails - Rochester K Linux User Group
Ruby On Rails - Rochester K Linux User Group
 
Server-side Web development via Ruby on Rails
Server-side Web development via Ruby on RailsServer-side Web development via Ruby on Rails
Server-side Web development via Ruby on Rails
 
Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09Ror Seminar With agilebd.org on 23 Jan09
Ror Seminar With agilebd.org on 23 Jan09
 
Rails Girls: Programming, Web Applications and Ruby on Rails
Rails Girls: Programming, Web Applications and Ruby on RailsRails Girls: Programming, Web Applications and Ruby on Rails
Rails Girls: Programming, Web Applications and Ruby on Rails
 
Wordpress workshop accademia di belle arti di bergamo - 22 04 2015
Wordpress workshop   accademia di belle arti di bergamo - 22 04 2015Wordpress workshop   accademia di belle arti di bergamo - 22 04 2015
Wordpress workshop accademia di belle arti di bergamo - 22 04 2015
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on Rails
 
All Things API Presentation - Gordon Weakleim [HomeAway]
All Things API Presentation - Gordon Weakleim [HomeAway]All Things API Presentation - Gordon Weakleim [HomeAway]
All Things API Presentation - Gordon Weakleim [HomeAway]
 

Último

₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
Diya Sharma
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Último (20)

Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
VVIP Pune Call Girls Mohammadwadi WhatSapp Number 8005736733 With Elite Staff...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 

WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.

  • 1. How (not) to get lost in bigger Ruby On Rails project More layers than only MVC and maybe more mess
  • 2. - Oliver Kriška - quatermain32@gmail.com - first e-shop in 2015 - FRI UNIZA 2008 - 2011 - EUBA 2011-2011 - Kadetade 2009 - ... - Ruby on Rails 2011 - BeeSafe 2013 - ... - freelancing 2014 - ShopVox (SF - USA) 2014 - ... Who am I? fatality fail WIN
  • 3. What is Ruby On Rails? - 2004 - MVC framework - Ruby language (1995) - Optimize for programmer happiness - Convention over Configuration - Exalt beautiful code - Value integrated systems (complete solution) - Basecamp, GitHub, Shopify, Airbnb, Twitch, SoundCloud, Hulu, Zendesk, Square, Highrise, Envato Marketplace (Themeforest, Photodune, ...) by http://rubyonrails.org/doctrine
  • 4. What is MVC? - Design Pattern - Architectural Pattern - Model - View - Controller Browser Model Controller View by Google Search
  • 5. RoR vs MVC?Browser DBController Requests Responses View Model DB Queries Create/Update Read Load Data Response Read
  • 6. What is Shopvox? - Complex - Web-based - Job management - CRM - Point of Sale (POS) - For custom shop and print industry
  • 7. ShopVOX vs MVC Controller ModelView Presenter Query Service
  • 8. Why so complicated? - Fat model - Fat controller - Fat view - Too much logic!! - Creating Work Order - ~350 lines - Model? - Controller? - Service per action - Index Jobs - ~ 150 lines query - JSON presenter - ~ 350 lines - View? - Presenter
  • 9. What is Presenter? - Move logic from html/json template to some class - Nice & clean template - Freedom of use - Speed - Decorators, Presenters, JSONPresenters(?)
  • 10. What is Service? - Move logic from Controllers and Models - Dynamic validations - Creating nested models - Complex logic - Indexing - Backup data - Counting - Notifications - Third Party APIs - Generators (Transaction numbers, Colors, Keys)
  • 11. What is Query? - Move logic from Controllers - Dynamic queries - Filters/Conditions - Ordering - Restrictions - Calculations - Stats (pagination, summary) - Speed - Loading connected data - Loading only necessary data - Jobs query - 27 parts - Pos query - 6 base classes - 200 lines - 50 parts