Design Pattern From Java To Ruby

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Design Pattern From Java To Ruby - Presentation Transcript

    1. Design Pattern -- from Java to Ruby
        • Richard
        • E kohe
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    2. Why use Design Pattern
      • For reuse
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    3. Why use Design Pattern
      • For communication
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Define a Node interface, all of leaf nodes and internal nodes should implements the interface, internal nodes has a list that includes other internal nodes and leaf nodes and it can add sub-nodes. But leaf node can’t have add sub-node method. Multi-level Menus?
    4. Why use Design Pattern
      • For communication
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Composite Pattern Multi-level Menus?
    5. Difference from java to ruby
      • Classes are Objects
      • Messages, not function call
      • Duck Typing
      • Mixin
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    6. Singleton Pattern
      • ensures a class has only one instance, and provides a global point of access to it
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    7. Singleton Pattern www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development You are my only wife You are my only husband
    8. Singleton Pattern -- java
      • Eager loading
      • Lazy loading
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    9. Singleton Pattern -- ruby
      • Ruby built-in singleton
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    10. www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
      • Built-in (Singleton)
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Ruby for Design Pattern
    11. Observer Pattern
      • defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    12. Observer Pattern www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Temperature Detector Subscribe Notify Notify Temprature changed
    13. Observer Pattern -- java www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    14. Observer Pattern -- java www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    15. Observer Pattern -- java
      • Java built-in observer
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    16. Observer Pattern -- ruby
      • Ruby built-in observer
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    17. www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
      • Built-in (Singleton, Observer )
      • Mixin
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Ruby for Design Pattern
    18. Iterator Pattern
      • provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    19. Iterator Pattern www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Count 1 2 3 10
    20. Iterator Pattern -- java www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Merb - Offshore Web Development
      • External Iterator
    21. Iterator Pattern -- java www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Merb - Offshore Web Development
      • Internal Iterator
    22. Iterator Pattern -- ruby
      • Internal Iterator .each
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
      • Built-in (Singleton, Observer, Iterator )
      • Mixin
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Ruby for Design Pattern
      • returns an instance of one of several possible classes, depending on the data provided to it.
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Simple Factory Pattern
    23. www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Simple Factory Pattern
    24. www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Simple Factory Pattern -- java
    25. www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Simple Factory Pattern -- java
      • Classes are Objects
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Simple Factory Pattern -- ruby
      • Built-in (Singleton, Observer, Iterator)‏
      • Mixin
      • Classes are Objects
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Ruby for Design Pattern
      • encapsulates a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Command Pattern
    26. www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Command Pattern Increase temperature command Decrease temperature command
    27. www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Command Pattern -- java
      • Proc
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Command Pattern -- ruby
      • Built-in (Singleton, Observer, Iterator)‏
      • Mixin
      • Classes are Objects
      • Proc
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Ruby for Design Pattern
    28. Make use of ruby advantage www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development Other Design Patterns
    29. Principle
      • DRY – Don't Repeat Yourself
      • Convention Over Configuration
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    30. Resources
      • Design Pattern – Elements of Reusable Object-Oriented Software
        • Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
      • Head First Design Pattern
          • Kathy Sierra, Bert Bates
      • Design Pattern in Ruby
          • Russ Olsen
      www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    31. Q&A happy to discuss and fix my mistakes www.ekohe.com Web Development & Graphic Design China Ruby on Rails Development - Rails Consulting - Rails Services - Merb - Offshore Web Development
    SlideShare Zeitgeist 2009

    + Robbin FanRobbin Fan Nominate

    custom

    955 views, 1 favs, 0 embeds more stats

    published by Richard of Ekohe

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 955
      • 955 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 9
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories