SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
AMIR BARYLKO
               THE ROR TRILOGY
               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: http://www.orthocoders.com/presentations

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

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

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


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
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
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
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
                    Migrations
                   ActiveRecord
                      Testing
                    Scaffolding

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
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
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
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: http://www.orthocoders.com/presentations

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

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

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


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




Amir Barylko              RoR Trilogy Part I: A New Dev Hope
CLOJURE TRAINING

  • When: Nov       6, 7 & 8

  • More       info: http://www.maventhought.com

  • Goal: LearnClojure and functional programming with real
    hands on examples




Amir Barylko                                RoR Trilogy Part I: A New Dev Hope

Weitere ähnliche Inhalte

Andere mochten auch

Sdec 2011 ask_watchlisten_svt
Sdec 2011 ask_watchlisten_svtSdec 2011 ask_watchlisten_svt
Sdec 2011 ask_watchlisten_svtsdeconf
 
Rackforce the cloud
Rackforce the cloudRackforce the cloud
Rackforce the cloudsdeconf
 
Sdec 2011 ux_agile_svt
Sdec 2011 ux_agile_svtSdec 2011 ux_agile_svt
Sdec 2011 ux_agile_svtsdeconf
 
Pscad agile adoption
Pscad agile adoptionPscad agile adoption
Pscad agile adoptionsdeconf
 
S bueckert sdecmobile
S bueckert sdecmobileS bueckert sdecmobile
S bueckert sdecmobilesdeconf
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojosdeconf
 
G meredith scala
G meredith scalaG meredith scala
G meredith scalasdeconf
 

Andere mochten auch (7)

Sdec 2011 ask_watchlisten_svt
Sdec 2011 ask_watchlisten_svtSdec 2011 ask_watchlisten_svt
Sdec 2011 ask_watchlisten_svt
 
Rackforce the cloud
Rackforce the cloudRackforce the cloud
Rackforce the cloud
 
Sdec 2011 ux_agile_svt
Sdec 2011 ux_agile_svtSdec 2011 ux_agile_svt
Sdec 2011 ux_agile_svt
 
Pscad agile adoption
Pscad agile adoptionPscad agile adoption
Pscad agile adoption
 
S bueckert sdecmobile
S bueckert sdecmobileS bueckert sdecmobile
S bueckert sdecmobile
 
C fowler azure-dojo
C fowler azure-dojoC fowler azure-dojo
C fowler azure-dojo
 
G meredith scala
G meredith scalaG meredith scala
G meredith scala
 

Ähnlich wie Ro r trilogy-part-1

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
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Wen-Tien Chang
 
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
 
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
 
Memory Management in RubyMotion
Memory Management in RubyMotionMemory Management in RubyMotion
Memory Management in RubyMotionMichael Denomy
 
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
 
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
 
Better framework, better life
Better framework, better lifeBetter framework, better life
Better framework, better lifeDaniel Lv
 
MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?Joshua Ballanco
 
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
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patternsAmir Barylko
 
[.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
 

Ähnlich wie Ro r trilogy-part-1 (20)

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
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
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
 
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
 
Memory Management in RubyMotion
Memory Management in RubyMotionMemory Management in RubyMotion
Memory Management in RubyMotion
 
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
 
Ruby On Rails Ecosystem
Ruby On Rails EcosystemRuby On Rails Ecosystem
Ruby On Rails Ecosystem
 
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
 
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)
 
MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?MacRuby: What is it? and why should you care?
MacRuby: What is it? and why should you care?
 
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
 
PRDC12 advanced design patterns
PRDC12 advanced design patternsPRDC12 advanced design patterns
PRDC12 advanced design patterns
 
[.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
 

Mehr von sdeconf

S rogalsky user-storymapping
S rogalsky user-storymappingS rogalsky user-storymapping
S rogalsky user-storymappingsdeconf
 
L phillips apm
L phillips apmL phillips apm
L phillips apmsdeconf
 
J wagner security
J wagner securityJ wagner security
J wagner securitysdeconf
 
Friesens agile adoption
Friesens agile adoptionFriesens agile adoption
Friesens agile adoptionsdeconf
 
Dan perron lim
Dan perron limDan perron lim
Dan perron limsdeconf
 
D alpert ux102
D alpert ux102D alpert ux102
D alpert ux102sdeconf
 
Sdec11.agile ina day
Sdec11.agile ina daySdec11.agile ina day
Sdec11.agile ina daysdeconf
 
D alpert ux101
D alpert ux101D alpert ux101
D alpert ux101sdeconf
 
C maksymchuk android
C maksymchuk androidC maksymchuk android
C maksymchuk androidsdeconf
 
C fowler intro-azure
C fowler intro-azureC fowler intro-azure
C fowler intro-azuresdeconf
 
Booked in agileadoption
Booked in agileadoptionBooked in agileadoption
Booked in agileadoptionsdeconf
 
T bunio active-architecture
T bunio active-architectureT bunio active-architecture
T bunio active-architecturesdeconf
 

Mehr von sdeconf (12)

S rogalsky user-storymapping
S rogalsky user-storymappingS rogalsky user-storymapping
S rogalsky user-storymapping
 
L phillips apm
L phillips apmL phillips apm
L phillips apm
 
J wagner security
J wagner securityJ wagner security
J wagner security
 
Friesens agile adoption
Friesens agile adoptionFriesens agile adoption
Friesens agile adoption
 
Dan perron lim
Dan perron limDan perron lim
Dan perron lim
 
D alpert ux102
D alpert ux102D alpert ux102
D alpert ux102
 
Sdec11.agile ina day
Sdec11.agile ina daySdec11.agile ina day
Sdec11.agile ina day
 
D alpert ux101
D alpert ux101D alpert ux101
D alpert ux101
 
C maksymchuk android
C maksymchuk androidC maksymchuk android
C maksymchuk android
 
C fowler intro-azure
C fowler intro-azureC fowler intro-azure
C fowler intro-azure
 
Booked in agileadoption
Booked in agileadoptionBooked in agileadoption
Booked in agileadoption
 
T bunio active-architecture
T bunio active-architectureT bunio active-architecture
T bunio active-architecture
 

Kürzlich hochgeladen

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Ro r trilogy-part-1

  • 1. AMIR BARYLKO THE ROR TRILOGY 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: http://www.orthocoders.com/presentations • Company Site: http://www.maventhought.com • Try Ruby online: http://tryruby.org/ • Learn RoR online: http://railsforzombies.org/ 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. 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
  • 19. 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
  • 20. 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
  • 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 Migrations ActiveRecord Testing Scaffolding 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. 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
  • 26. 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
  • 27. 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
  • 28. 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
  • 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: http://www.orthocoders.com/presentations • Company Site: http://www.maventhought.com • Try Ruby online: http://tryruby.org/ • Learn RoR online: http://railsforzombies.org/ Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 38. RESOURCES II Amir Barylko RoR Trilogy Part I: A New Dev Hope
  • 39. CLOJURE TRAINING • When: Nov 6, 7 & 8 • More info: http://www.maventhought.com • Goal: LearnClojure and functional programming with real hands on examples Amir Barylko RoR Trilogy Part I: A New Dev Hope