SlideShare a Scribd company logo
1 of 38
Download to read offline
AMIR
               BARYLKO
                THE ROR
               TRILOGY I
               A NEW DEV
                  HOPE
Amir Barylko     RoR Trilogy Part I: A New Dev Hope
WHO AM I?

  • Software     quality expert

  • Architect

  • Developer

  • Mentor

  • Great      cook

  • The    one who’s entertaining you for the next hour!
Amir Barylko                                    RoR Trilogy Part I: A New Dev Hope
RESOURCES

  • Email      & Twitter: amir@barylko.com, @abarylko

  • Slides     & Source: http://www.orthocoders.com/presentations

  • Company        Site: http://www.maventhought.com

  • Try   Ruby online: http://tryruby.org/

  • Learn      RoR online: http://railsforzombies.org/

  • Learn      Ruby with Koans: http://rubykoans.com/
Amir Barylko                                        RoR Trilogy Part I: A New Dev Hope
RUBY INTRO
                Dynamic languages
                    Features
                    Support
                     Classes
                     Mixins


Amir Barylko                        RoR Trilogy Part I: A New Dev Hope
DYNAMIC LANGUAGES

  • High       level

  • Dynamically        typed

  • Runtime        over compile time

  • Closures

  • Reflection

  • Platform       independent
Amir Barylko                           RoR Trilogy Part I: A New Dev Hope
WELCOME TO RUBY

  • Created in mid-90s by         • Automatic
                                           memory
    “Matz” Matsumoto in Japan      management

  • Smalltalk, Perl   influences   • Several
                                          implementations:
                                   MRI, YARB, JRuby
  • Dynamic     typing
                                  • Totally   free!!
  • Object     Oriented



Amir Barylko                                    RoR Trilogy Part I: A New Dev Hope
RUBY FEATURES

  • Everything   is an expression

  • Metaprogramming

  • Closures

  • Garbage    collection

  • Exceptions

  • Operator    overloading, flexible syntax
Amir Barylko                                  RoR Trilogy Part I: A New Dev Hope
RUBY SUPPORT

  • Hundreds        of books

  • User       conferences all over the world

  • Active community (you can create a conference in your own
    city and top Ruby coders will go there to teach others, invite
    them and see)

  • Lots of great web sites: basecamp, twitter, 43 things, hulu,
    scribd, slideshare, Justin.tv

Amir Barylko                                     RoR Trilogy Part I: A New Dev Hope
CLASSES & OBJECTS

  • Initializer   and instance variables
     class Movie
       def initialize(name)
         @name = name
       end

       def play
         puts %Q{Playing “#{@name}”. Enjoy!}
       end
     end

     m = Movie.new(“Pulp fiction”)
     m.play

     => Playing “Pulp fiction”. Enjoy!


Amir Barylko                                   RoR Trilogy Part I: A New Dev Hope
CLASSES & OBJECTS II

  • Attributes
    class Movie
      # attr reader and writer
      attr_accesor :name

       def initialize(name)
         @name = name
       end
     end

     m = Movie.new('Brazil')
     m.name = “Pulp fiction”

Amir Barylko                     RoR Trilogy Part I: A New Dev Hope
MIXINS

  • One        of the greatest Ruby features!

  • You can define functions in Modules, and get them added to
    your classes.

     • Great     code reuse,

     • Multiple     inheritance alternative.

     • Code      organization

Amir Barylko                                    RoR Trilogy Part I: A New Dev Hope
ENUMERABLE MIXIN

  • Quote      from the standard library documentation:
        ...The Enumerable mixin provides
        collection classes with several
        traversal and searching methods, and
        with the ability to sort.
        The class must provide a method
        each, which yields successive
        members of the collection...


Amir Barylko                                     RoR Trilogy Part I: A New Dev Hope
ENUMERABLE II

  • It   provides useful methods such as:

     • map

     • to_a

     • take_while

     • count

     • inject

Amir Barylko                                RoR Trilogy Part I: A New Dev Hope
MIXIN EXAMPLE

  class MovieLibrary
    include Enumerable

    def each(&block)
      contents.each(&block)
    end
  end




Amir Barylko                  RoR Trilogy Part I: A New Dev Hope
ROR
                        What is it?
               Convention over configuration
                  Model View Controller
                    Code generation
                Dependency Management
                     HTML 5 & UJS

Amir Barylko                            RoR Trilogy Part I: A New Dev Hope
WHAT IS ROR?

  • Web        application development framework

  • Created       by David Heinemeier Hansson

  • With       Rails, you would be done by now!

  • Open        Source & Multi platform

  • Very       easy to learn

  • Comes        with everything out of the box!
Amir Barylko                                       RoR Trilogy Part I: A New Dev Hope
CONVENTION OVER
                CONFIGURATION
  • All   applications share the same structure

  • The    application is generated by the rails command

  • All   the config files are ruby code




Amir Barylko                                      RoR Trilogy Part I: A New Dev Hope
DEPENDENCY MANAGEMENT

  • Gems       are Ruby libraries

  • Dependencies       are managed with tool gem

  • To   install a gem just run: gem install xxxxxx

  • Bundler     is a gem to manage dependencies

  • Just   create a Gemfile and bundler will install all of them


Amir Barylko                                      RoR Trilogy Part I: A New Dev Hope
MODEL VIEW CONTROLLER

  • Model: represents   the data

  • Controllers: Manipulate   the data and prepare it to be shown

  • View: Shows   the data with a particular view engine




Amir Barylko                                    RoR Trilogy Part I: A New Dev Hope
CODE GENERATION

  • Using      rails command:

     • Bootstrap: Generates        basic structure

     • Models: Generated        models and tests

     • Controllers: Generates       controllers, views and tests

     • Scaffolds: Generates      models, controllers, views, routes,
       etc...

Amir Barylko                                         RoR Trilogy Part I: A New Dev Hope
HTML 5 & UNOBTRUSIVE JS

  • Supports    HTML 5 standards

  • data-remote, data-method, data-config, etc...

  • Supports    many JS frameworks

  • JS   code associated to models to handle events, animations, etc

  • Coffeescript!



Amir Barylko                                    RoR Trilogy Part I: A New Dev Hope
ROR GOODNESS
                 Common Structure
                   Automation
                    Scaffolding
                    Migrations
                   ActiveRecord
                      Testing

Amir Barylko                        RoR Trilogy Part I: A New Dev Hope
COMMON STRUCTURE

  •   app
      • assets:    Stylesheets, javascript, images
      • controllers:   Prepare the data for the views
      • helpers:   Helper methods to render views
      • models:    Represent our domain
      • views:  Templates to be rendered
        • each controller has a folder with one
          template per method
        • layouts:Base templates to surround the views


Amir Barylko                              RoR Trilogy Part I: A New Dev Hope
AUTOMATION

  • Rake       is a build tool (similar to ant, msbuild, maven)

  • Has    tasks that can be configured

  • Out    of the box has common tasks for database, testing, etc..

  • List   all the tasks: rake -T

  • Very       useful to automate tasks and to use in CI servers


Amir Barylko                                          RoR Trilogy Part I: A New Dev Hope
SCAFFOLDING

  • Generated     automatically for CRUD operations

  • Controllers

  • Views

  • Tests

  • The    template used can be replaced of modified


Amir Barylko                                   RoR Trilogy Part I: A New Dev Hope
MIGRATIONS

  • Track      the database changes using code

  • No    need to use SQL

  • Upgrades       are easy

  • Versioning     is kept in the database

  • Generated       automatically when creating models


Amir Barylko                                     RoR Trilogy Part I: A New Dev Hope
ACTIVE RECORD

  • Relations       (ActiveModel)

  • Supports        multiple databases

  • Each       table is a class

  • All   attributes are created dynamically

  • Associations       are declared by convention

  • Each       class has CRUD and query operations by default
Amir Barylko                                        RoR Trilogy Part I: A New Dev Hope
TESTING OUT OF THE BOX

  • Many       testing frameworks available

  • No    additional effort to generate them

  • Running       them is part of the Rakefile (automation)

  • Keep       high quality all the way




Amir Barylko                                       RoR Trilogy Part I: A New Dev Hope
MOVIE LIBRARY
                    Demo




Amir Barylko               RoR Trilogy Part I: A New Dev Hope
TOPICS

  • Rails      application structure

  • Database        Migrations

  • Using       scaffolds

  • Model        - View - Controllers

  • Routing

  • Ajax

Amir Barylko                              RoR Trilogy Part I: A New Dev Hope
MORE GOODNESS!
                    Helpers
                    Partials
                     Sass
                    Routing



Amir Barylko                   RoR Trilogy Part I: A New Dev Hope
HELPERS

  • Methods    to assist in the view generation

  • Reusable

  • Associated   to each controller

  • Testable




Amir Barylko                                      RoR Trilogy Part I: A New Dev Hope
PARTIALS

  • Templates      that can be shared

  • Start      with underscore “_”

  • Can    be rendered from views or controllers




Amir Barylko                                   RoR Trilogy Part I: A New Dev Hope
SASS

  • Quote      from sass-lang.com:

           Sass is an extension of CSS3, adding
           nested      rules,     variables,
           mixins,selector inheritance, and
           more.
           It’s translated to well-formatted,
           standard CSS using the command line
           tool or a web-framework plugin.



Amir Barylko                           RoR Trilogy Part I: A New Dev Hope
ROUTING

  • Easy   to configure using routes.rb

  • Supports     REST out of the box

  • Easy   to restrict actions

  • Easy   to alias routes

  • Allows     optional parameters in the routes


Amir Barylko                                       RoR Trilogy Part I: A New Dev Hope
QUESTIONS?
RESOURCES

  • Email      & Twitter: amir@barylko.com, @abarylko

  • Slides     & Source: http://www.orthocoders.com/presentations

  • Company        Site: http://www.maventhought.com

  • Try   Ruby online: http://tryruby.org/

  • Learn      RoR online: http://railsforzombies.org/

  • Learn      Ruby with Koans: http://rubykoans.com/
Amir Barylko                                        RoR Trilogy Part I: A New Dev Hope
RESOURCES II




Amir Barylko              RoR Trilogy Part I: A New Dev Hope

More Related Content

What's hot

Quality web-acceptance
Quality web-acceptanceQuality web-acceptance
Quality web-acceptanceAmir Barylko
 
mvcconf-bdd-quality-driven
mvcconf-bdd-quality-drivenmvcconf-bdd-quality-driven
mvcconf-bdd-quality-drivenAmir Barylko
 
Ro r trilogy-part-1
Ro r trilogy-part-1Ro r trilogy-part-1
Ro r trilogy-part-1sdeconf
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integrationAmir Barylko
 
CPL12-Agile-planning
CPL12-Agile-planningCPL12-Agile-planning
CPL12-Agile-planningAmir Barylko
 
Project Tools in Web Development
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Developmentkmloomis
 
2012 regina TC 102 kanban
2012 regina TC 102 kanban2012 regina TC 102 kanban
2012 regina TC 102 kanbanAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
Social dev camp_2011
Social dev camp_2011Social dev camp_2011
Social dev camp_2011Craig Ulliott
 
Funtional Ruby - Mikhail Bortnyk
Funtional Ruby - Mikhail BortnykFuntional Ruby - Mikhail Bortnyk
Funtional Ruby - Mikhail BortnykRuby Meditation
 
Becoming a more productive Rails Developer
Becoming a more productive Rails DeveloperBecoming a more productive Rails Developer
Becoming a more productive Rails DeveloperJohn McCaffrey
 

What's hot (19)

Quality web-acceptance
Quality web-acceptanceQuality web-acceptance
Quality web-acceptance
 
mvcconf-bdd-quality-driven
mvcconf-bdd-quality-drivenmvcconf-bdd-quality-driven
mvcconf-bdd-quality-driven
 
decoupling-ea
decoupling-eadecoupling-ea
decoupling-ea
 
Ro r trilogy-part-1
Ro r trilogy-part-1Ro r trilogy-part-1
Ro r trilogy-part-1
 
Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
 
CPL12-Agile-planning
CPL12-Agile-planningCPL12-Agile-planning
CPL12-Agile-planning
 
YEG-UG-Capybara
YEG-UG-CapybaraYEG-UG-Capybara
YEG-UG-Capybara
 
Agile planning
Agile planningAgile planning
Agile planning
 
Irb Tips and Tricks
Irb Tips and TricksIrb Tips and Tricks
Irb Tips and Tricks
 
Project Tools in Web Development
Project Tools in Web DevelopmentProject Tools in Web Development
Project Tools in Web Development
 
2012 regina TC 102 kanban
2012 regina TC 102 kanban2012 regina TC 102 kanban
2012 regina TC 102 kanban
 
JRuby in The Enterprise
JRuby in The EnterpriseJRuby in The Enterprise
JRuby in The Enterprise
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Social dev camp_2011
Social dev camp_2011Social dev camp_2011
Social dev camp_2011
 
End of native?
End of native?End of native?
End of native?
 
Prototypejs
PrototypejsPrototypejs
Prototypejs
 
Funtional Ruby - Mikhail Bortnyk
Funtional Ruby - Mikhail BortnykFuntional Ruby - Mikhail Bortnyk
Funtional Ruby - Mikhail Bortnyk
 
Becoming a more productive Rails Developer
Becoming a more productive Rails DeveloperBecoming a more productive Rails Developer
Becoming a more productive Rails Developer
 
Tricks
TricksTricks
Tricks
 

Similar to PRDC-ror-trilogy-part1

sdec11-ror-trilogy-part1
sdec11-ror-trilogy-part1sdec11-ror-trilogy-part1
sdec11-ror-trilogy-part1Amir Barylko
 
A baryklo design-patterns
A baryklo design-patternsA baryklo design-patterns
A baryklo design-patternssdeconf
 
sdec11-Advanced-design-patterns
sdec11-Advanced-design-patternssdec11-Advanced-design-patterns
sdec11-Advanced-design-patternsAmir Barylko
 
PRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsPRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsAmir Barylko
 
10 Things you should know about Ruby
10 Things you should know about Ruby10 Things you should know about Ruby
10 Things you should know about Rubysikachu
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Wen-Tien Chang
 
Code camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsCode camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsAmir Barylko
 
Rake: Not Your Father's Build Tool
Rake: Not Your Father's Build ToolRake: Not Your Father's Build Tool
Rake: Not Your Father's Build Toolfilmprog
 
Getting started with Rails (1), Season 2
Getting started with Rails (1), Season 2Getting started with Rails (1), Season 2
Getting started with Rails (1), Season 2RORLAB
 
Better framework, better life
Better framework, better lifeBetter framework, better life
Better framework, better lifeDaniel Lv
 
Memory Management in RubyMotion
Memory Management in RubyMotionMemory Management in RubyMotion
Memory Management in RubyMotionMichael Denomy
 
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
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First MileGourab Mitra
 
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)Shanda innovation institute
 
Better Framework Better Life
Better Framework Better LifeBetter Framework Better Life
Better Framework Better Lifejeffz
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Charles Nutter
 
Ruby on Rails Crash course
Ruby on Rails Crash courseRuby on Rails Crash course
Ruby on Rails Crash courseandreanodari
 

Similar to PRDC-ror-trilogy-part1 (20)

sdec11-ror-trilogy-part1
sdec11-ror-trilogy-part1sdec11-ror-trilogy-part1
sdec11-ror-trilogy-part1
 
A baryklo design-patterns
A baryklo design-patternsA baryklo design-patterns
A baryklo design-patterns
 
sdec11-Advanced-design-patterns
sdec11-Advanced-design-patternssdec11-Advanced-design-patterns
sdec11-Advanced-design-patterns
 
PRDCW-advanced-design-patterns
PRDCW-advanced-design-patternsPRDCW-advanced-design-patterns
PRDCW-advanced-design-patterns
 
10 Things you should know about Ruby
10 Things you should know about Ruby10 Things you should know about Ruby
10 Things you should know about Ruby
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
Code camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patternsCode camp 2012-advanced-design-patterns
Code camp 2012-advanced-design-patterns
 
Ruby On Rails Ecosystem
Ruby On Rails EcosystemRuby On Rails Ecosystem
Ruby On Rails Ecosystem
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Rake: Not Your Father's Build Tool
Rake: Not Your Father's Build ToolRake: Not Your Father's Build Tool
Rake: Not Your Father's Build Tool
 
Getting started with Rails (1), Season 2
Getting started with Rails (1), Season 2Getting started with Rails (1), Season 2
Getting started with Rails (1), Season 2
 
Better framework, better life
Better framework, better lifeBetter framework, better life
Better framework, better life
 
Memory Management in RubyMotion
Memory Management in RubyMotionMemory Management in RubyMotion
Memory Management in RubyMotion
 
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...
 
Ruby on Rails : First Mile
Ruby on Rails : First MileRuby on Rails : First Mile
Ruby on Rails : First Mile
 
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
 
Better Framework Better Life
Better Framework Better LifeBetter Framework Better Life
Better Framework Better Life
 
Cucumber in Practice(en)
Cucumber in Practice(en)Cucumber in Practice(en)
Cucumber in Practice(en)
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
 
Ruby on Rails Crash course
Ruby on Rails Crash courseRuby on Rails Crash course
Ruby on Rails Crash course
 

More from Amir Barylko

Functional converter project
Functional converter projectFunctional converter project
Functional converter projectAmir Barylko
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web developmentAmir Barylko
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep diveAmir Barylko
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting trainingAmir Barylko
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessAmir Barylko
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6Amir Barylko
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?Amir Barylko
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideAmir Barylko
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityAmir Barylko
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentAmir Barylko
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilitiesAmir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescriptAmir Barylko
 
Rich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 

More from Amir Barylko (20)

Functional converter project
Functional converter projectFunctional converter project
Functional converter project
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web development
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
No estimates
No estimatesNo estimates
No estimates
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep dive
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting training
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomeness
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6
 
Productive teams
Productive teamsProductive teams
Productive teams
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other side
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivity
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Refactoring
RefactoringRefactoring
Refactoring
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilities
 
Refactoring
RefactoringRefactoring
Refactoring
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
 
Rich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & CoffeescriptRich UI with Knockout.js & Coffeescript
Rich UI with Knockout.js & Coffeescript
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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
 
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
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
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
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
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
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
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...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

PRDC-ror-trilogy-part1

  • 1. AMIR BARYLKO THE ROR TRILOGY I A NEW DEV HOPE Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 2. WHO AM I? • Software quality expert • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour! Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 3. RESOURCES • Email & Twitter: amir@barylko.com, @abarylko • Slides & Source: http://www.orthocoders.com/presentations • Company Site: http://www.maventhought.com • Try Ruby online: http://tryruby.org/ • Learn RoR online: http://railsforzombies.org/ • Learn Ruby with Koans: http://rubykoans.com/ Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 4. RUBY INTRO Dynamic languages Features Support Classes Mixins Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 5. DYNAMIC LANGUAGES • High level • Dynamically typed • Runtime over compile time • Closures • Reflection • Platform independent Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 6. WELCOME TO RUBY • Created in mid-90s by • Automatic memory “Matz” Matsumoto in Japan management • Smalltalk, Perl influences • Several implementations: MRI, YARB, JRuby • Dynamic typing • Totally free!! • Object Oriented Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 7. RUBY FEATURES • Everything is an expression • Metaprogramming • Closures • Garbage collection • Exceptions • Operator overloading, flexible syntax Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 8. RUBY SUPPORT • Hundreds of books • User conferences all over the world • Active community (you can create a conference in your own city and top Ruby coders will go there to teach others, invite them and see) • Lots of great web sites: basecamp, twitter, 43 things, hulu, scribd, slideshare, Justin.tv Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 9. CLASSES & OBJECTS • Initializer and instance variables class Movie def initialize(name) @name = name end def play puts %Q{Playing “#{@name}”. Enjoy!} end end m = Movie.new(“Pulp fiction”) m.play => Playing “Pulp fiction”. Enjoy! Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 10. CLASSES & OBJECTS II • Attributes class Movie # attr reader and writer attr_accesor :name def initialize(name) @name = name end end m = Movie.new('Brazil') m.name = “Pulp fiction” Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 11. MIXINS • One of the greatest Ruby features! • You can define functions in Modules, and get them added to your classes. • Great code reuse, • Multiple inheritance alternative. • Code organization Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 12. ENUMERABLE MIXIN • Quote from the standard library documentation: ...The Enumerable mixin provides collection classes with several traversal and searching methods, and with the ability to sort. The class must provide a method each, which yields successive members of the collection... Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 13. ENUMERABLE II • It provides useful methods such as: • map • to_a • take_while • count • inject Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 14. MIXIN EXAMPLE class MovieLibrary include Enumerable def each(&block) contents.each(&block) end end Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 15. ROR What is it? Convention over configuration Model View Controller Code generation Dependency Management HTML 5 & UJS Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 16. WHAT IS ROR? • Web application development framework • Created by David Heinemeier Hansson • With Rails, you would be done by now! • Open Source & Multi platform • Very easy to learn • Comes with everything out of the box! Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 17. CONVENTION OVER CONFIGURATION • All applications share the same structure • The application is generated by the rails command • All the config files are ruby code Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 18. DEPENDENCY MANAGEMENT • Gems are Ruby libraries • Dependencies are managed with tool gem • To install a gem just run: gem install xxxxxx • Bundler is a gem to manage dependencies • Just create a Gemfile and bundler will install all of them Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 19. MODEL VIEW CONTROLLER • Model: represents the data • Controllers: Manipulate the data and prepare it to be shown • View: Shows the data with a particular view engine Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 20. CODE GENERATION • Using rails command: • Bootstrap: Generates basic structure • Models: Generated models and tests • Controllers: Generates controllers, views and tests • Scaffolds: Generates models, controllers, views, routes, etc... Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 21. HTML 5 & UNOBTRUSIVE JS • Supports HTML 5 standards • data-remote, data-method, data-config, etc... • Supports many JS frameworks • JS code associated to models to handle events, animations, etc • Coffeescript! Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 22. ROR GOODNESS Common Structure Automation Scaffolding Migrations ActiveRecord Testing Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 23. COMMON STRUCTURE • app • assets: Stylesheets, javascript, images • controllers: Prepare the data for the views • helpers: Helper methods to render views • models: Represent our domain • views: Templates to be rendered • each controller has a folder with one template per method • layouts:Base templates to surround the views Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 24. AUTOMATION • Rake is a build tool (similar to ant, msbuild, maven) • Has tasks that can be configured • Out of the box has common tasks for database, testing, etc.. • List all the tasks: rake -T • Very useful to automate tasks and to use in CI servers Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 25. SCAFFOLDING • Generated automatically for CRUD operations • Controllers • Views • Tests • The template used can be replaced of modified Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 26. MIGRATIONS • Track the database changes using code • No need to use SQL • Upgrades are easy • Versioning is kept in the database • Generated automatically when creating models Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 27. ACTIVE RECORD • Relations (ActiveModel) • Supports multiple databases • Each table is a class • All attributes are created dynamically • Associations are declared by convention • Each class has CRUD and query operations by default Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 28. TESTING OUT OF THE BOX • Many testing frameworks available • No additional effort to generate them • Running them is part of the Rakefile (automation) • Keep high quality all the way Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 29. MOVIE LIBRARY Demo Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 30. TOPICS • Rails application structure • Database Migrations • Using scaffolds • Model - View - Controllers • Routing • Ajax Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 31. MORE GOODNESS! Helpers Partials Sass Routing Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 32. HELPERS • Methods to assist in the view generation • Reusable • Associated to each controller • Testable Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 33. PARTIALS • Templates that can be shared • Start with underscore “_” • Can be rendered from views or controllers Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 34. SASS • Quote from sass-lang.com: Sass is an extension of CSS3, adding nested rules, variables, mixins,selector inheritance, and more. It’s translated to well-formatted, standard CSS using the command line tool or a web-framework plugin. Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 35. ROUTING • Easy to configure using routes.rb • Supports REST out of the box • Easy to restrict actions • Easy to alias routes • Allows optional parameters in the routes Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 37. RESOURCES • Email & Twitter: amir@barylko.com, @abarylko • Slides & Source: http://www.orthocoders.com/presentations • Company Site: http://www.maventhought.com • Try Ruby online: http://tryruby.org/ • Learn RoR online: http://railsforzombies.org/ • Learn Ruby with Koans: http://rubykoans.com/ Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 38. RESOURCES II Amir Barylko RoR Trilogy Part I: A New Dev Hope