Design Patterns in Ruby

Author: Russ Olsen
4.6
All Stack Overflow 11
This Month Stack Overflow 7

Comments

by anonymous   2019-07-21

Ruby uses the concept of Modules as a stand-in (kinda) for interfaces. Design Patterns in Ruby has a lot of really great examples on the differences between the two concepts and why ruby chooses the more flexible alternative to interfaces.

http://www.amazon.com/Design-Patterns-Ruby-Russ-Olsen/dp/0321490452

by user289086   2019-07-21
  • http://rubylearning.com/blog/2010/11/23/dont-know-metaprogramming-in-ruby/
  • http://ruby-metaprogramming.rubylearning.com/
  • http://yehudakatz.com/2009/11/15/metaprogramming-in-ruby-its-all-about-the-self/
  • http://rubyrogues.com/metaprogramming-in-ruby/
  • http://pragprog.com/screencasts/v-dtrubyom/the-ruby-object-model-and-metaprogramming
  • https://github.com/ashbb/ruby_metaprogramming_study_note

These should get you started. and more

  • http://www.vanderburg.org/Speaking/Stuff/oscon05.pdf
  • http://99designs.com/tech-blog/blog/2012/10/30/abusing-ruby-for-fun-and-profit/
  • http://www.amazon.com/Design-Patterns-Ruby-Russ-Olsen/dp/0321490452
  • http://www.apress.com/9781447141259
by anonymous   2019-07-21

All these are good and you might want to consider some Ruby books on metaprogramming because Rails has so much meta programming in it now that you should have a good basic understanding of what it is and how to use it. I suggest the Addison-Wesley Professional Ruby Series, DESIGN PATTERNS IN RUBY by Russ Olsen. Here is a link to it on Amazon. http://www.amazon.com/Design-Patterns-Ruby-Russ-Olsen/dp/0321490452

by anonymous   2019-07-21

Design Patterns in Ruby:

http://www.amazon.com/Design-Patterns-Ruby-Addison-Wesley-Professional/dp/0321490452#reader

by anonymous   2019-07-21

there are a lot of patterns in java land that do not map to a dynamic language like ruby. eventhough there is a whole book about design-patterns in ruby (http://www.amazon.com/Design-Patterns-Ruby-Russ-Olsen/dp/0321490452) most of them are useless.

when you are talking about CRUD, you are probably talking about an HTTP speaking API that you can use to manage some database entities.

in ruby land you probably use rails to do such stuff as it has great support for building RESTfull applications and JSON apis.

so please, PLEASE, do not ever create a DAO or a Repository class in ruby. there is just no need for that (most of the times).

by anonymous   2017-08-20

For me OO didn't 'click' until I read a book about design patterns. If you're already comfortable with concepts like abstract classes, interfaces, etc that's only half the battle.

The next step is figuring out why you should prefer composition over inheritance, how to code to an interface and how to write your classes so that they are decoupled and well-encapsulated. Design patterns show you solutions to common OO problems and help you structure your code adhering to the above guidelines.

I can't recommend any particular books about C++ but the GOF book is the standard on Design Patterns (Java). I prefer books that talk about design patterns in a particular language so that you can get concrete code examples. Design Patterns In Ruby is pretty good, as is PHP: Objects, Patterns and Practice.

I get the feeling that your instructor doesn't particularly know what he's talking about. 'More classes' is pretty useless advice by itself.

by anonymous   2017-08-20

This is the only book you'll need for ruby:

Design Patterns in Ruby

For a beginning book on rails this one is easy to read and teaches most of the fundamentals:

Simply Rails 2

by anonymous   2017-08-20

Use this as your primary book: Design Patterns in Ruby and this as your reference: The Ruby Programming Language.

You will also definitely want to read thoroughly the latter book after you've finished design patterns. Once you absorbed those two this is a nice follow-up: Ruby Best Practices.

As to why the recommendation of design patterns as your primary text see here: Design Patterns