Introduction to Ruby on RailsTM - PowerPoint PPT Presentation

Loading...

PPT – Introduction to Ruby on RailsTM PowerPoint presentation | free to download - id: 46b9fa-MTRiY



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Introduction to Ruby on RailsTM

Description:

Rails brings into the Framework (as core part of it or as extensions plug-ins) that implement new software concepts * Over-Engineer: Unix Principle do one ... – PowerPoint PPT presentation

Number of Views:154
Avg rating:3.0/5.0
Slides: 55
Provided by: SergioOn
Learn more at: http://www.ssmic.com
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Introduction to Ruby on RailsTM


1
Introduction to Ruby on RailsTM
  • Sergio Ontiveros / Omar Ontiveros
  • Solutionwise Consulting

March, 2009
2
About Solutionwise
  • Rails Application Development
  • Rails Development / Consultancy serving both
    Large Organizations and SMEs
  • Rails Platform Integration (Rails on Java
    infrastructure)
  • Application Migration to Rails
  • Web Development Background
  • Java Platform
  • Web Applications
  • Client/Server Applications
  • .NET (C, ASP.NET)
  • Lotus Domino
  • Software Artisans
  • Involved with Rails / Ruby since 2005
  • Presentation Slides ? www.solutionwise.ca

3
Audience
  • YOU

4
Summary
  • Why Rails
  • What is Rails
  • How does it works
  • Where (How-does it works, part2)
  • Ruby Demo
  • Rails Demo
  • Q A

5
  • WHY

6
Why RoR?
  • Why do I (you) need to know about it?

7
(No Transcript)
8
  • But why is everyone talking about?, what does it
    fix?

9
Its actually not quite true.
10
  • In search of
  • Programmer Happiness

11
Complex?
12
Toolbar Syndrome
What about Tools for Sophisticated Users
(a.k.a. Developers?)
13
Software Renaissance
  • As a cultural movement, it encompassed a
    revival of learning based on classical sources,
    the development of linear perspective in
    painting, and gradual but widespread educational
    reform. Traditionally, this intellectual
    transformation has resulted in the Renaissance
    being viewed as a bridge between the Middle Ages
    and the Modern era.
  • Source http//en.wikipedia.org/wiki/Renaissance

14
Competitive Advantage
  • Constant change Perpetual Renewal of Best
    Practices
  • Conveys practical software paradigms
  • Leverage from developer produced tools
  • Potentially it opens new business opportunities
  • Lower cost (Open Source)

15
Fundamental Programming Principles
  • KISS principle
  • Automate repetitive tasks
  • Dont over engineer solutions
  • Write less code Less to maintain Faster Code
  • Simple may lead to elegant
  • Raising levels of abstraction

16
Your People Matters
  • What keeps Developers motivated
  • Use new technology (yes to some extent)
  • Delivering on time
  • Productivity
  • Economic Compensation
  • Desirable, but what matters is
  • Self-motivation (making and creating stuff)
  • Inherently Passion (for the craft)
  • Prefer tools that are developer friendly
    (Productive)

17
  • WHAT

18
What is RoR?
  • Ruby on RailsTM is an open source web
    application framework that is optimized for
    programmer happiness and sustainable
    productivity. It lets you write beautiful code by
    favoring convention over configuration.
  • Source http//rubyonrails.org/
  • It is intended to be used with an Agile
    development methodology, which is often utilized
    by web developers for its suitability for short,
    client-driven projects.
  • Source http//en.wikipedia.org/wiki/Ruby_on_Rails

19
History
  • Ruby
  • Truly Object Oriented, dynamic, meta-programming
    language
  • Ruby 0.95 in 1995
  • Current Release 1.9.1, most deployed Release
    1.8.6
  • Rails
  • Extracted by David Heinemeier Hansson (DHH) from
    Basecamp, a project management tool by 37signals.
  • CONSTANT CHANGE

20
RoR is Agile
  • Manifesto for Agile Software Development
  • Responding to change over following a plan
  • Working software over comprehensive documentation
  • Customer collaboration over contract negotiation
  • Individuals and interactions over processes and
    tools

21
Philosophy
  • DRY (Dont Repeat Yourself)
  • CoC (Convention Over Configuration) a.k.a
    Smart defaults.
  • Opinionated (.. and now with options)
  • Minimalist

22
YAWF?
  • (Yet Another Web Framework?)

23
Not quite
24
Disruptive
  • Drastic reduction in development timelines.
    (1/10)
  • Prototypes are not thrown away, but rather
    evolved.
  • Shatters existing paradigms.
  • Large applications need complex tools
  • Enterprise Projects must use Enterprise tools.
  • Divide and Conquer (Share nothing)
  • The inner workings should be complex
  • Disposable implementation of business ideas is
    now possible.
  • Create, Extend and Mold your own tools to fit
    your own business domain not the other way
    around.

25
Influential
  • Post-Rails Web Development Era
  • Jboss Seam, Grails, Trails (Java)
  • ASP.NET MVC (.Net )
  • Cake, PhpOnTrax (PHP)
  • Django, Subway (Phyton)
  • Catalyst, Perl on Rails (Perl)
  • Future new Frameworks are measured against RoR,
    in terms of ease of use, simplicity,
    extensibility and practicality.

26
RoR and the Organizational Culture
  • Practical
  • Trust
  • Ownership goes in parallel with Responsibility
  • No database hugging.
  • Change is OK
  • We had really somewhat missed the Internet
    boat
  • Richard Roy General Manager Microsoft Dec. 1995

27
Web Development for All
  • Effectively lowering the barrier of entry to Web
    Application Development, without losing
    capabilities or ability to implement features.
  • Heavily reliant on Rubys dynamic behaviour
  • A script collection SD toolkit1 for both highly
    experienced and entry-level developer
  • RoR can be understood as a Domain Specific
    Language (DSL) for developing web applications.

28
It is everywhere
29
2009 Fukuoka Ruby Award
  • Government of Fukuoka Japan raises public
    awareness of the growing software industry and
    Ruby
  • www.f-ruby.com

30
  • HOW

31
ROR Basics
32
Features
  • Open Source
  • MVC
  • RESTful web architecture
  • Single Stack
  • Default Pluggable Single Stack (Rails 3.0)
  • Minimalist
  • Integrated Testing

33
Support in Closed-Source Software
Incident
Solution

34
Support in OSS
RoR API Docs
Interchange
User
Mailing Lists
Forums
35
MVC
2.Event Handler
3.Compute Action
5. Render View
1. User Interaction
6. Read model
4. Read/Write model to database
36
RESTful
  • DATABASE
  • Create
  • Read
  • Update
  • Delete

WEB (HTTP) Post Get Put Delete
  • URLs
  • /my-app/clients/new
  • /my-app/clients/1
  • /my-app/clients/1/edit
  • /my-app/clients/1
  • Standard extensible and scalable integration
    (internal/external)

37
Single Stack
  • APPLICATION LAYERS
  • Database Layer
  • Presentation Layer
  • Business Logic
  • Middleware (M,L)

RoR Stack ActiveRecord ActionView Ruby /
DSL ActiveResource
  • BENEFITS
  • Less integration hassles
  • Improvements in the framework work across layers
  • Layers are optional

38
Default Pluggable Stack
  • Model Mapping (ORM)
  • Active Record or Data Mapper or Sequel
  • View Templates
  • ERb . or Haml
  • Ajax
  • Prototype/Scriptaculous . Or JQuery
  • Controller
  • ActionController or Rails Metal/Rack

39
Minimalist
  • Minimal instruction that performs one task well
  • Additional optional parameters
  • Core is shrinking, extensible features via
    plug-ins

40
Integrated Testing
  • Automated test is critical to accelerate testing
    and avoid regression defects
  • Test coverage (80/20) - Critical for
    non-compiled languages
  • RoR Testing Artifacts
  • Fixtures
  • Functional
  • Integration
  • Unit
  • Mocks

41
  • WHERE

42
Multiplatform
  • MRI (Matzs Ruby Interpreter)
  • MRI 1.8.6 is widely deployed
  • MRI 1.8.7 intended as intermediate step towards
    1.9.1
  • Current Release 1.9.1 ( but wait!)
  • Jruby
  • Release version JRuby 1.1.6 (Update JRuby 1.2.0
    RC2)
  • Compatible w/ MRI 1.8.6 support for 1.9
  • Rubinius
  • Not 100 Rails compatible yet
  • IronRuby
  • Still Alpha

43
Deployments
  • Self-hosting
  • Traditional Mongrel cluster
  • Passenger
  • Cloud Computing
  • Simple, simpler, simplest

44
Considerations when using RoR
  • Encapsulating elements
  • Create your own APIs (abstractions) when possible
  • Automation, automation, automation
  • Source Code Version Control
  • Old code is commented out
  • DB assets not under version control
  • Refactor code as well as your DB Schema
  • Ref www.ambysoft.com/books/refactoringDatabases.h
    tml

45
Getting Ruby and RoR
  • Your favourite database
  • SQLite (default Rails development database)
  • MySQL (appropiate for most projects)
  • PostgreSQL (transactional applications)
  • http//www.ruby-lang.org/en/downloads
  • http//www.rubyonrails.org/download

46
  • RUBY
  • DEMO

47
  • RoR
  • DEMO

48
Future (Present?) for RoR
49
Living interesting times
  • Rails - Rails 3.0 (Summerish 2009)
  • Merging MERB/ project into Rails
  • Progress underway with Rails 2.3
  • Rails Metal and Rack
  • Github Social code sharing
  • Ruby
  • Ruby 1.9.1
  • Block variable scope, Additional Lambda syntax,
    String encoding
  • Other options materialize (Rubinius/IronRuby)

50
  • Conclusions

51
Conclusions
  • It started as an experiment
  • It has transformed Web Applications are developed
  • It has become Enterprise Ready
  • It will continue evolving

52
  • All aboard !!

53
  • Thanks !
  • Presentation available at
  • www. solutionwise.ca/talks/rails-ssmic.html

54
Q A
About PowerShow.com