SlideShare uma empresa Scribd logo
1 de 44
Modern
webdevelopment
     with
 Ruby on Rails
         Robert Glaser
Software Developer at Planetactive
Me

• Studied at Fontys Venlo
• 26 years
• Software Developer at Planetactive - an
  Ogilvy Company in Düsseldorf


          twitter.com/mrreynolds
Planetactive


• Ogilvy / WPP worldwide agency group
• Full service digital marketing agency
So...
Modern?

• What exactly does „modern“ mean?
• „Modern“ is a very subjective and
  opinionated term
• So is Ruby on Rails!
• Created in 2004 by David Heinemeier
  Hansson (DHH) at 37signals
• Extracted from Basecamp
  (basecamphq.com)
• Based on pragmatic solutions for common
  problems
• Opinionated software
• DRY - Don‘t Repeat Yourself
Wait.
There are hundreds of MVC web
          frameworks!
„It‘s a very pragmatic,
                                              very targeted framework
                                           with a strong sense of direction.

                                           You might not share it‘s vision,
                                            but it undeniably has one.“




                  DHH
photo copyright by James Duncan Davidson
Rails is „full stack“...

• ActiveRecord (ORM)
• ActionPack (ActionController, ActionView)
• ActiveSupport (Class Extensions, Helpers)
• ActionMailer
• ActiveResource (REST Mapper)
• Rails (Core Lib)
...with many ingredients
•   Instant start defaults   •   Strong REST support

•   Webserver                •   Session Handling

•   Logger                   •   Middleware (Rack)

•   Staging                  •   Test Framework

•   AJAX                     •   Plugins

•   Webservices              •   Engines

•   Mail                     •   Clean MVC
                                 architecture
•   Debugger
                             •   Scaffolding
•   Caching
ORM

• Database abstraction & persistance ORM
• ActiveRecord also a pattern
• Migrations for incremental schema
  management
YEAH!
I don‘t have to write
        SQL!!!
Yes, but you should
understand what you
      are doing.
Convention over
      configuration
• File naming conventions and assumptions
• DB naming conventions for databases,
  tables, primary- and foreign keys
• Pluralization and singularization through
  String inflectors
• Per-Environment configuration files
DRY - Don‘t Repeat
       Yourself
• Table column names don‘t need to be
  manually defined => read from DB
• Reusing code (e.g. in views via partials)
• Metaprogramming
• DSLs
Model

• Business logic
• Data persistence
• ActiveRecord
View

• Data presentation
• User Interaction
• Template language ERB (Embedded Ruby)
• ActionView
Controller

• Event handling
• Operation on models
• Redirection and rendering
• ActionController
ActionController




ActiveRecord                      ActionView
ActiveRecord
• Conventions (pluralized table names, ...)
• Dynamic getters and setters
• SQL mostly unnecessary
• Entity relations (1:1, 1:n, n:n)
• SQL injection protection
• Validators
• Callbacks
ActionView

• ERB (Embedded Ruby)
• Javascript generators (AJAX)
• XML templates
• Reusing template elements via partials and
  layouts
ActionController
• Actions are public controller methods
• Automatic template rendering
• Multiple formats can easily be supported
• RESTful model representations
• Callbacks
• Complete routing system
• Security (CSRF, IP spoofing, etc.)
REST
• Representational State Transfer
• Representation of resources with only
  HTTP
• Actions on resources defined by HTTP
  methods
• Stateless
• No additional transport layer like SOAP
REST
Testing
• Test environment & database
• Fixtures or Factories, depending on you
• Unit tests for models
• Functional tests for controllers
• Integration tests for workflow
• Automated browser tests via Selenium
Made for agile!
• Test driven development encouraged
• It‘s hard not to test
• Coverage testing via rcov
• Behaviour driven development with Rspec,
  Cucumber or Shoulda (Stories and
  contexts)
• Iterative DB schema evolvement via
  migrations
Libraries, libraries!!


• Plugins
• Ruby Gems (Ruby‘s package management
  system)
So, what is Ruby?
Ruby
• Released 1995 in Japan
• Created by Yukihiro Matsumoto
  „Matz“
• Ruby should feel „natural, not
  simple“
• Ruby should be „more powerful
  than perl, more object-oriented
  than python“
Everything is an object!
True open classes!
Loops
Loops
Classes, objects, loops,
      iterators
Symbols
Symbols
Classes & modules
Mixins
Mixins
Metaprogramming
Exceptions
If you want to use Ruby,
    use it idiomaticly!
Demo time!
Fin!

• Diploma thesis?
• Practical semester?
• Get in touch with me!

Mais conteúdo relacionado

Mais procurados

Florian Koch - Monitoring CoreOS with Zabbix
Florian Koch - Monitoring CoreOS with ZabbixFlorian Koch - Monitoring CoreOS with Zabbix
Florian Koch - Monitoring CoreOS with ZabbixZabbix
 
Use all the buzzwords
Use all the buzzwordsUse all the buzzwords
Use all the buzzwordsJared Faris
 
InterCon - Ruby e Rails
InterCon - Ruby e RailsInterCon - Ruby e Rails
InterCon - Ruby e RailsFabio Akita
 
Beyond the Standards
Beyond the StandardsBeyond the Standards
Beyond the StandardsPaul Bakaus
 
Varnish to the rescue
Varnish to the rescueVarnish to the rescue
Varnish to the rescueleafnode
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 
Under the Hood with MySQL
Under the Hood with MySQLUnder the Hood with MySQL
Under the Hood with MySQLohiocore
 
JBoss, Rails and the cloud
JBoss, Rails and the cloudJBoss, Rails and the cloud
JBoss, Rails and the cloudelliando dias
 
Ruby and Rails for womens
Ruby and Rails for womensRuby and Rails for womens
Ruby and Rails for womenss4nx
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails PresentationChanHan Hy
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compassChris Lee
 
Day 9 - PostgreSQL Application Architecture
Day 9 - PostgreSQL Application ArchitectureDay 9 - PostgreSQL Application Architecture
Day 9 - PostgreSQL Application ArchitectureBarry Jones
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...Hariharan Ganesan
 
Pagelet in action
Pagelet in actionPagelet in action
Pagelet in actionPu Shiming
 
CouchDB Talk JChris NYC
CouchDB Talk JChris NYCCouchDB Talk JChris NYC
CouchDB Talk JChris NYCChris Anderson
 

Mais procurados (18)

Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
 
Florian Koch - Monitoring CoreOS with Zabbix
Florian Koch - Monitoring CoreOS with ZabbixFlorian Koch - Monitoring CoreOS with Zabbix
Florian Koch - Monitoring CoreOS with Zabbix
 
Use all the buzzwords
Use all the buzzwordsUse all the buzzwords
Use all the buzzwords
 
InterCon - Ruby e Rails
InterCon - Ruby e RailsInterCon - Ruby e Rails
InterCon - Ruby e Rails
 
Beyond the Standards
Beyond the StandardsBeyond the Standards
Beyond the Standards
 
Varnish to the rescue
Varnish to the rescueVarnish to the rescue
Varnish to the rescue
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
Mean stack
Mean stackMean stack
Mean stack
 
Under the Hood with MySQL
Under the Hood with MySQLUnder the Hood with MySQL
Under the Hood with MySQL
 
JBoss, Rails and the cloud
JBoss, Rails and the cloudJBoss, Rails and the cloud
JBoss, Rails and the cloud
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Ruby and Rails for womens
Ruby and Rails for womensRuby and Rails for womens
Ruby and Rails for womens
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails Presentation
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compass
 
Day 9 - PostgreSQL Application Architecture
Day 9 - PostgreSQL Application ArchitectureDay 9 - PostgreSQL Application Architecture
Day 9 - PostgreSQL Application Architecture
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
 
Pagelet in action
Pagelet in actionPagelet in action
Pagelet in action
 
CouchDB Talk JChris NYC
CouchDB Talk JChris NYCCouchDB Talk JChris NYC
CouchDB Talk JChris NYC
 

Semelhante a Modern Web Development with Ruby on Rails

Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyAmit Solanki
 
Drupal 6 JavaScript and jQuery
Drupal 6 JavaScript and jQueryDrupal 6 JavaScript and jQuery
Drupal 6 JavaScript and jQueryMatt Butcher
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The JvmQConLondon2008
 
VTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData projectVTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData projectTom Klaasen
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvmdeimos
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Application Architecture Trends
Application Architecture TrendsApplication Architecture Trends
Application Architecture TrendsSrini Penchikala
 
Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco PresentationJuan J. Merelo
 
Rapid Prototyping With J Query
Rapid Prototyping With J QueryRapid Prototyping With J Query
Rapid Prototyping With J QueryBootstrap
 
Scala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud PlatformScala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud PlatformTomoharu ASAMI
 

Semelhante a Modern Web Development with Ruby on Rails (20)

Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
L R U G - JRuby
L R U G - JRubyL R U G - JRuby
L R U G - JRuby
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
Drupal 6 JavaScript and jQuery
Drupal 6 JavaScript and jQueryDrupal 6 JavaScript and jQuery
Drupal 6 JavaScript and jQuery
 
Workin On The Rails Road
Workin On The Rails RoadWorkin On The Rails Road
Workin On The Rails Road
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
VTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData projectVTi Knowledge Database: a LinkedData project
VTi Knowledge Database: a LinkedData project
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
 
re7olabini
re7olabinire7olabini
re7olabini
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Application Architecture Trends
Application Architecture TrendsApplication Architecture Trends
Application Architecture Trends
 
Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco Presentation
 
Rapid Prototyping With J Query
Rapid Prototyping With J QueryRapid Prototyping With J Query
Rapid Prototyping With J Query
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Scala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud PlatformScala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud Platform
 
Real World Technologies
Real World TechnologiesReal World Technologies
Real World Technologies
 
Couch Db
Couch DbCouch Db
Couch Db
 

Último

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Último (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Modern Web Development with Ruby on Rails

  • 1. Modern webdevelopment with Ruby on Rails Robert Glaser Software Developer at Planetactive
  • 2. Me • Studied at Fontys Venlo • 26 years • Software Developer at Planetactive - an Ogilvy Company in Düsseldorf twitter.com/mrreynolds
  • 3. Planetactive • Ogilvy / WPP worldwide agency group • Full service digital marketing agency
  • 5. Modern? • What exactly does „modern“ mean? • „Modern“ is a very subjective and opinionated term • So is Ruby on Rails!
  • 6. • Created in 2004 by David Heinemeier Hansson (DHH) at 37signals • Extracted from Basecamp (basecamphq.com) • Based on pragmatic solutions for common problems • Opinionated software • DRY - Don‘t Repeat Yourself
  • 7. Wait. There are hundreds of MVC web frameworks!
  • 8. „It‘s a very pragmatic, very targeted framework with a strong sense of direction. You might not share it‘s vision, but it undeniably has one.“ DHH photo copyright by James Duncan Davidson
  • 9. Rails is „full stack“... • ActiveRecord (ORM) • ActionPack (ActionController, ActionView) • ActiveSupport (Class Extensions, Helpers) • ActionMailer • ActiveResource (REST Mapper) • Rails (Core Lib)
  • 10. ...with many ingredients • Instant start defaults • Strong REST support • Webserver • Session Handling • Logger • Middleware (Rack) • Staging • Test Framework • AJAX • Plugins • Webservices • Engines • Mail • Clean MVC architecture • Debugger • Scaffolding • Caching
  • 11. ORM • Database abstraction & persistance ORM • ActiveRecord also a pattern • Migrations for incremental schema management
  • 12. YEAH! I don‘t have to write SQL!!!
  • 13. Yes, but you should understand what you are doing.
  • 14. Convention over configuration • File naming conventions and assumptions • DB naming conventions for databases, tables, primary- and foreign keys • Pluralization and singularization through String inflectors • Per-Environment configuration files
  • 15. DRY - Don‘t Repeat Yourself • Table column names don‘t need to be manually defined => read from DB • Reusing code (e.g. in views via partials) • Metaprogramming • DSLs
  • 16. Model • Business logic • Data persistence • ActiveRecord
  • 17. View • Data presentation • User Interaction • Template language ERB (Embedded Ruby) • ActionView
  • 18. Controller • Event handling • Operation on models • Redirection and rendering • ActionController
  • 20. ActiveRecord • Conventions (pluralized table names, ...) • Dynamic getters and setters • SQL mostly unnecessary • Entity relations (1:1, 1:n, n:n) • SQL injection protection • Validators • Callbacks
  • 21. ActionView • ERB (Embedded Ruby) • Javascript generators (AJAX) • XML templates • Reusing template elements via partials and layouts
  • 22. ActionController • Actions are public controller methods • Automatic template rendering • Multiple formats can easily be supported • RESTful model representations • Callbacks • Complete routing system • Security (CSRF, IP spoofing, etc.)
  • 23. REST • Representational State Transfer • Representation of resources with only HTTP • Actions on resources defined by HTTP methods • Stateless • No additional transport layer like SOAP
  • 24. REST
  • 25. Testing • Test environment & database • Fixtures or Factories, depending on you • Unit tests for models • Functional tests for controllers • Integration tests for workflow • Automated browser tests via Selenium
  • 26. Made for agile! • Test driven development encouraged • It‘s hard not to test • Coverage testing via rcov • Behaviour driven development with Rspec, Cucumber or Shoulda (Stories and contexts) • Iterative DB schema evolvement via migrations
  • 27. Libraries, libraries!! • Plugins • Ruby Gems (Ruby‘s package management system)
  • 28. So, what is Ruby?
  • 29. Ruby • Released 1995 in Japan • Created by Yukihiro Matsumoto „Matz“ • Ruby should feel „natural, not simple“ • Ruby should be „more powerful than perl, more object-oriented than python“
  • 30. Everything is an object!
  • 32. Loops
  • 33. Loops
  • 42. If you want to use Ruby, use it idiomaticly!
  • 44. Fin! • Diploma thesis? • Practical semester? • Get in touch with me!

Notas do Editor