SlideShare uma empresa Scribd logo
Rails Summer of Code
                                     Week 1




Richard Schneeman - @ThinkBohemian
Rails - Week 1
              • Rails Architecture
               • MVC (Model View Controller)
               • ORM (Object Relational Mapping)
               • RESTful (REpresentational STate)
              • Ruby
               • Versus Rails
               • Is Object Oriented
Richard Schneeman - @ThinkBohemian
Rails Architecture
            • Terminology
             • DRY
             • Convention over Configuration
            • Rails Architecture
             • MVC (Model View Controller)
             • ORM (Object Relational Mapping)
             • RESTful (REpresentational State Transfer)
Richard Schneeman - @ThinkBohemian
DRY
                           Don’t Repeat Yourself




                       Reuse, don’t re-invent the...



Richard Schneeman - @ThinkBohemian
Convention over
                    Configuration



             Decrease the number of decisions needed,
         gaining simplicity but without losing flexibility.

Richard Schneeman - @ThinkBohemian
Model-View-Controller
    • Isolates “Domain Logic”
     • Can I See it?
        • View
     • Is it Business Logic?
        • Controller
     • Is it a Reusable Class Logic?
        • Model
Richard Schneeman - @ThinkBohemian
Model-View-Controller
    • Generated By Rails
     • Grouped by Folders
     • Connected “AutoMagically”
       • Models
       • Views
       • Controllers
     • Multiple Views Per Controller
Richard Schneeman - @ThinkBohemian
Object Relational Mapping
    • Maps database backend to ruby objects
    • ActiveRecord (Rail’s Default ORM)
            >> userVariable = User.where(:name => "Bob")
                 Generates:
                    SELECT "users".* FROM "users"
                    WHERE (name = 'bob')
            >> userVariable.name
            => Bob



Richard Schneeman - @ThinkBohemian
Object Relational Mapping
    •   >> userVariable = User .where(:name => "Bob")


                          models/user.rb
             class User < ActiveRecord::Base
             end

         the User class inherits from ActiveRecord::Base




Richard Schneeman - @ThinkBohemian
Object Relational Mapping

      •   >> userVariable = User. where(:name => "Bob")

              where is the method that looks in the database
              AutoMagically in the User Table (if you made one)




Richard Schneeman - @ThinkBohemian
RESTful
                       REpresentational State Transfer

          •   The state of the message matters

              •    Different state = different message




                  “You Again?”                   “You Again?”
Richard Schneeman - @ThinkBohemian
RESTful
                       REpresentational State Transfer

        •   Servers don’t care about smiles

        •   They do care about how you access them

        •   (HTTP Methods)

            •   GET

            •   PUT

            •   POST

            •   DELETE

Richard Schneeman - @ThinkBohemian
RESTful
                       REpresentational State Transfer
        •   Rails Maps Actions to HTTP Methods

            •   GET - index, show, new

            •   PUT - update

            •   POST - create

            •   DELETE - destroy




Richard Schneeman - @ThinkBohemian
Ruby Versus Rails
        •   Ruby - Is a programming Language

            •   Like C# or Python

            •   Can be used to program just about anything,

        •   Rails - Is a Framework

            •   Written using Ruby

            •   Provides common web functionality



Richard Schneeman - @ThinkBohemian
Questions?




Richard Schneeman - @ThinkBohemian

Mais conteúdo relacionado

Semelhante a UT on Rails3 2010- Week 1

Rails3 Summer of Code 2010 - Week 6
Rails3 Summer of Code 2010 - Week 6Rails3 Summer of Code 2010 - Week 6
Rails3 Summer of Code 2010 - Week 6
Richard Schneeman
 
Riding IronRuby on Rails
Riding IronRuby on RailsRiding IronRuby on Rails
Riding IronRuby on Rails
Shay Friedman
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
Chris Richardson
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
Nishant Gandhi
 
Ruby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVCRuby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVC
Shay Friedman
 
The Rise of NoSQL and Polyglot Persistence
The Rise of NoSQL and Polyglot PersistenceThe Rise of NoSQL and Polyglot Persistence
The Rise of NoSQL and Polyglot Persistence
Abdelmonaim Remani
 
REST in Practice
REST in PracticeREST in Practice
REST in Practice
Guilherme Silveira
 
Hadoop World 2011: Hadoop and Netezza Deployment Models and Case Study - Kris...
Hadoop World 2011: Hadoop and Netezza Deployment Models and Case Study - Kris...Hadoop World 2011: Hadoop and Netezza Deployment Models and Case Study - Kris...
Hadoop World 2011: Hadoop and Netezza Deployment Models and Case Study - Kris...
Cloudera, Inc.
 
Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social Games
Paolo Negri
 
Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011
Gavin Heavyside
 
Demystifying Ruby on Rails
Demystifying Ruby on Rails Demystifying Ruby on Rails
Demystifying Ruby on Rails
Johan Pretorius
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau
 
Intro to graphs for HR analytics
Intro to graphs for HR analyticsIntro to graphs for HR analytics
Intro to graphs for HR analytics
Rik Van Bruggen
 
Lean & agile with MongoDB
Lean & agile with MongoDBLean & agile with MongoDB
Lean & agile with MongoDB
Johannes Brandstetter
 
Scaling Your Architecture for the Long Term
Scaling Your Architecture for the Long TermScaling Your Architecture for the Long Term
Scaling Your Architecture for the Long Term
Randy Shoup
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
Jeanho Chu
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
Wen-Tien Chang
 
Synthetic models
Synthetic modelsSynthetic models
Synthetic models
Zoran Nikolovski
 
Cross-platform interaction
Cross-platform interactionCross-platform interaction
Cross-platform interaction
Oleksii Duhno
 
Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01
sagaroceanic11
 

Semelhante a UT on Rails3 2010- Week 1 (20)

Rails3 Summer of Code 2010 - Week 6
Rails3 Summer of Code 2010 - Week 6Rails3 Summer of Code 2010 - Week 6
Rails3 Summer of Code 2010 - Week 6
 
Riding IronRuby on Rails
Riding IronRuby on RailsRiding IronRuby on Rails
Riding IronRuby on Rails
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
 
Ruby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVCRuby on Rails Vs. ASP.NET MVC
Ruby on Rails Vs. ASP.NET MVC
 
The Rise of NoSQL and Polyglot Persistence
The Rise of NoSQL and Polyglot PersistenceThe Rise of NoSQL and Polyglot Persistence
The Rise of NoSQL and Polyglot Persistence
 
REST in Practice
REST in PracticeREST in Practice
REST in Practice
 
Hadoop World 2011: Hadoop and Netezza Deployment Models and Case Study - Kris...
Hadoop World 2011: Hadoop and Netezza Deployment Models and Case Study - Kris...Hadoop World 2011: Hadoop and Netezza Deployment Models and Case Study - Kris...
Hadoop World 2011: Hadoop and Netezza Deployment Models and Case Study - Kris...
 
Scaling Social Games
Scaling Social GamesScaling Social Games
Scaling Social Games
 
Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011Non-Relational Databases at ACCU2011
Non-Relational Databases at ACCU2011
 
Demystifying Ruby on Rails
Demystifying Ruby on Rails Demystifying Ruby on Rails
Demystifying Ruby on Rails
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
 
Intro to graphs for HR analytics
Intro to graphs for HR analyticsIntro to graphs for HR analytics
Intro to graphs for HR analytics
 
Lean & agile with MongoDB
Lean & agile with MongoDBLean & agile with MongoDB
Lean & agile with MongoDB
 
Scaling Your Architecture for the Long Term
Scaling Your Architecture for the Long TermScaling Your Architecture for the Long Term
Scaling Your Architecture for the Long Term
 
Week01 jan19 introductionto_php
Week01 jan19 introductionto_phpWeek01 jan19 introductionto_php
Week01 jan19 introductionto_php
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
Synthetic models
Synthetic modelsSynthetic models
Synthetic models
 
Cross-platform interaction
Cross-platform interactionCross-platform interaction
Cross-platform interaction
 
Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01
 

Mais de Richard Schneeman

Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
Richard Schneeman
 
Rails 3 Beginner to Builder 2011 Week 8
Rails 3 Beginner to Builder 2011 Week 8Rails 3 Beginner to Builder 2011 Week 8
Rails 3 Beginner to Builder 2011 Week 8
Richard Schneeman
 
Rails 3 Beginner to Builder 2011 Week 6
Rails 3 Beginner to Builder 2011 Week 6Rails 3 Beginner to Builder 2011 Week 6
Rails 3 Beginner to Builder 2011 Week 6
Richard Schneeman
 
Rails 3 Beginner to Builder 2011 Week 4
Rails 3 Beginner to Builder 2011 Week 4Rails 3 Beginner to Builder 2011 Week 4
Rails 3 Beginner to Builder 2011 Week 4
Richard Schneeman
 
Rails 3 Beginner to Builder 2011 Week 3
Rails 3 Beginner to Builder 2011 Week 3Rails 3 Beginner to Builder 2011 Week 3
Rails 3 Beginner to Builder 2011 Week 3
Richard Schneeman
 
Rails 3 Beginner to Builder 2011 Week 2
Rails 3 Beginner to Builder 2011 Week 2Rails 3 Beginner to Builder 2011 Week 2
Rails 3 Beginner to Builder 2011 Week 2
Richard Schneeman
 
Rails 3 Beginner to Builder 2011 Week 1
Rails 3 Beginner to Builder 2011 Week 1Rails 3 Beginner to Builder 2011 Week 1
Rails 3 Beginner to Builder 2011 Week 1
Richard Schneeman
 
Potential Friend Finder
Potential Friend FinderPotential Friend Finder
Potential Friend Finder
Richard Schneeman
 
UT on Rails3 2010- Week 2
UT on Rails3 2010- Week 2UT on Rails3 2010- Week 2
UT on Rails3 2010- Week 2
Richard Schneeman
 

Mais de Richard Schneeman (9)

Scaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQLScaling the Web: Databases & NoSQL
Scaling the Web: Databases & NoSQL
 
Rails 3 Beginner to Builder 2011 Week 8
Rails 3 Beginner to Builder 2011 Week 8Rails 3 Beginner to Builder 2011 Week 8
Rails 3 Beginner to Builder 2011 Week 8
 
Rails 3 Beginner to Builder 2011 Week 6
Rails 3 Beginner to Builder 2011 Week 6Rails 3 Beginner to Builder 2011 Week 6
Rails 3 Beginner to Builder 2011 Week 6
 
Rails 3 Beginner to Builder 2011 Week 4
Rails 3 Beginner to Builder 2011 Week 4Rails 3 Beginner to Builder 2011 Week 4
Rails 3 Beginner to Builder 2011 Week 4
 
Rails 3 Beginner to Builder 2011 Week 3
Rails 3 Beginner to Builder 2011 Week 3Rails 3 Beginner to Builder 2011 Week 3
Rails 3 Beginner to Builder 2011 Week 3
 
Rails 3 Beginner to Builder 2011 Week 2
Rails 3 Beginner to Builder 2011 Week 2Rails 3 Beginner to Builder 2011 Week 2
Rails 3 Beginner to Builder 2011 Week 2
 
Rails 3 Beginner to Builder 2011 Week 1
Rails 3 Beginner to Builder 2011 Week 1Rails 3 Beginner to Builder 2011 Week 1
Rails 3 Beginner to Builder 2011 Week 1
 
Potential Friend Finder
Potential Friend FinderPotential Friend Finder
Potential Friend Finder
 
UT on Rails3 2010- Week 2
UT on Rails3 2010- Week 2UT on Rails3 2010- Week 2
UT on Rails3 2010- Week 2
 

Último

7 Habits of Highly Effective People.pptx
7 Habits of Highly Effective People.pptx7 Habits of Highly Effective People.pptx
7 Habits of Highly Effective People.pptx
gpangilinan2017
 
Assignment 1 (Introductions to Microsoft Power point 2019) kiran.pptx
Assignment 1 (Introductions to Microsoft Power point 2019) kiran.pptxAssignment 1 (Introductions to Microsoft Power point 2019) kiran.pptx
Assignment 1 (Introductions to Microsoft Power point 2019) kiran.pptx
kirannaveed6
 
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotesProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
PsychoTech Services
 
1-CIE-IGCSE-Additional-Mathematics-Topical-Past-Paper-Functions.pdf
1-CIE-IGCSE-Additional-Mathematics-Topical-Past-Paper-Functions.pdf1-CIE-IGCSE-Additional-Mathematics-Topical-Past-Paper-Functions.pdf
1-CIE-IGCSE-Additional-Mathematics-Topical-Past-Paper-Functions.pdf
shahul62
 
Aggression - Applied Social Psychology - Psychology SuperNotes
Aggression - Applied Social Psychology - Psychology SuperNotesAggression - Applied Social Psychology - Psychology SuperNotes
Aggression - Applied Social Psychology - Psychology SuperNotes
PsychoTech Services
 
Understanding of Self - Applied Social Psychology - Psychology SuperNotes
Understanding of Self - Applied Social Psychology - Psychology SuperNotesUnderstanding of Self - Applied Social Psychology - Psychology SuperNotes
Understanding of Self - Applied Social Psychology - Psychology SuperNotes
PsychoTech Services
 

Último (6)

7 Habits of Highly Effective People.pptx
7 Habits of Highly Effective People.pptx7 Habits of Highly Effective People.pptx
7 Habits of Highly Effective People.pptx
 
Assignment 1 (Introductions to Microsoft Power point 2019) kiran.pptx
Assignment 1 (Introductions to Microsoft Power point 2019) kiran.pptxAssignment 1 (Introductions to Microsoft Power point 2019) kiran.pptx
Assignment 1 (Introductions to Microsoft Power point 2019) kiran.pptx
 
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotesProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
ProSocial Behaviour - Applied Social Psychology - Psychology SuperNotes
 
1-CIE-IGCSE-Additional-Mathematics-Topical-Past-Paper-Functions.pdf
1-CIE-IGCSE-Additional-Mathematics-Topical-Past-Paper-Functions.pdf1-CIE-IGCSE-Additional-Mathematics-Topical-Past-Paper-Functions.pdf
1-CIE-IGCSE-Additional-Mathematics-Topical-Past-Paper-Functions.pdf
 
Aggression - Applied Social Psychology - Psychology SuperNotes
Aggression - Applied Social Psychology - Psychology SuperNotesAggression - Applied Social Psychology - Psychology SuperNotes
Aggression - Applied Social Psychology - Psychology SuperNotes
 
Understanding of Self - Applied Social Psychology - Psychology SuperNotes
Understanding of Self - Applied Social Psychology - Psychology SuperNotesUnderstanding of Self - Applied Social Psychology - Psychology SuperNotes
Understanding of Self - Applied Social Psychology - Psychology SuperNotes
 

UT on Rails3 2010- Week 1

  • 1. Rails Summer of Code Week 1 Richard Schneeman - @ThinkBohemian
  • 2. Rails - Week 1 • Rails Architecture • MVC (Model View Controller) • ORM (Object Relational Mapping) • RESTful (REpresentational STate) • Ruby • Versus Rails • Is Object Oriented Richard Schneeman - @ThinkBohemian
  • 3. Rails Architecture • Terminology • DRY • Convention over Configuration • Rails Architecture • MVC (Model View Controller) • ORM (Object Relational Mapping) • RESTful (REpresentational State Transfer) Richard Schneeman - @ThinkBohemian
  • 4. DRY Don’t Repeat Yourself Reuse, don’t re-invent the... Richard Schneeman - @ThinkBohemian
  • 5. Convention over Configuration Decrease the number of decisions needed, gaining simplicity but without losing flexibility. Richard Schneeman - @ThinkBohemian
  • 6. Model-View-Controller • Isolates “Domain Logic” • Can I See it? • View • Is it Business Logic? • Controller • Is it a Reusable Class Logic? • Model Richard Schneeman - @ThinkBohemian
  • 7. Model-View-Controller • Generated By Rails • Grouped by Folders • Connected “AutoMagically” • Models • Views • Controllers • Multiple Views Per Controller Richard Schneeman - @ThinkBohemian
  • 8. Object Relational Mapping • Maps database backend to ruby objects • ActiveRecord (Rail’s Default ORM) >> userVariable = User.where(:name => "Bob") Generates: SELECT "users".* FROM "users" WHERE (name = 'bob') >> userVariable.name => Bob Richard Schneeman - @ThinkBohemian
  • 9. Object Relational Mapping • >> userVariable = User .where(:name => "Bob") models/user.rb class User < ActiveRecord::Base end the User class inherits from ActiveRecord::Base Richard Schneeman - @ThinkBohemian
  • 10. Object Relational Mapping • >> userVariable = User. where(:name => "Bob") where is the method that looks in the database AutoMagically in the User Table (if you made one) Richard Schneeman - @ThinkBohemian
  • 11. RESTful REpresentational State Transfer • The state of the message matters • Different state = different message “You Again?” “You Again?” Richard Schneeman - @ThinkBohemian
  • 12. RESTful REpresentational State Transfer • Servers don’t care about smiles • They do care about how you access them • (HTTP Methods) • GET • PUT • POST • DELETE Richard Schneeman - @ThinkBohemian
  • 13. RESTful REpresentational State Transfer • Rails Maps Actions to HTTP Methods • GET - index, show, new • PUT - update • POST - create • DELETE - destroy Richard Schneeman - @ThinkBohemian
  • 14. Ruby Versus Rails • Ruby - Is a programming Language • Like C# or Python • Can be used to program just about anything, • Rails - Is a Framework • Written using Ruby • Provides common web functionality Richard Schneeman - @ThinkBohemian

Notas do Editor