$30 off During Our Annual Pro Sale. View Details »

Better OO Design in Rails

Better OO Design in Rails

Slides from a discussion I introduce at Rails Camp 14 and again at rorosyd on 12 November, 2013. Note that these slides only provide a glimpse as they don't include the before and after code examples nor, obviously, the discussion that ensued.

Keith Pitty

November 13, 2013

More Decks by Keith Pitty

Other Decks in Programming


  1. www.cockatoosoftware.com.au Better OO Design in Rails Keith Pitty @keithpitty

  2. www.cockatoosoftware.com.au I have a confession …

  3. www.cockatoosoftware.com.au which class should be responsible?

  4. www.cockatoosoftware.com.au is this class adhering to the Single Responsibility Principle?

  5. www.cockatoosoftware.com.au “A class should do the smallest possible thing; that

    is, it should have a single responsibility.”
  6. www.cockatoosoftware.com.au a better attempt …

  7. www.cockatoosoftware.com.au

  8. www.cockatoosoftware.com.au other OO design principles …

  9. www.cockatoosoftware.com.au managing dependencies

  10. www.cockatoosoftware.com.au creating flexible interfaces

  11. www.cockatoosoftware.com.au duck typing

  12. www.cockatoosoftware.com.au using inheritance appropriately

  13. www.cockatoosoftware.com.au sharing role behaviour with modules

  14. www.cockatoosoftware.com.au composition

  15. www.cockatoosoftware.com.au how well does Rails support good OO design?

  16. www.cockatoosoftware.com.au what about functional programming?

  17. www.cockatoosoftware.com.au what do you think?

  18. www.cockatoosoftware.com.au Some resources “Practical Object-Oriented Design in Ruby” by Sandi

    Metz "Objects on Rails" by Avdi Grimm "Designing Object-Oriented Software" by Rebecca Wirfs-Brock et al "Refactoring: Ruby Edition" by Jay Fields, Shane Harvie and Martin Fowler "Design Patterns in Ruby" by Russ Olsen