This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ruby and the fly likes Ruby Design Patterns and Testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Ruby Design Patterns and Testing " Watch "Ruby Design Patterns and Testing " New topic
Author

Ruby Design Patterns and Testing

Himalay Majumdar
Ranch Hand

Joined: Sep 28, 2008
Posts: 324
Hi Peter,

Welcome to Java Ranch!
Can you let us know if in your book you demonstrate the use of design patterns and Testing (Test Driven Development) in Ruby.

Thanks,
Himalay


SCJP 1.6, SCWCD 5.0, SCBCD 5.0 [loading..]
Peter Cooper
Author
Greenhorn

Joined: Jul 17, 2009
Posts: 25
Testing is covered but there are not extensive sections where test driven development is practiced (there's a short section when developing a library). Beginning Ruby covers a breadth of topics in a reasonable depth but not any specific things in intense depth. Design patterns, similarly, are not covered specifically. I consider these things to be useful once you reach the proficiency that Beginning Ruby will get a developer to, but then they can move on to Design Patterns in Ruby (which is an awesome book suitable for anyone who's finished BR!)


Author of Beginning Ruby (Apress): http://bit.ly/t31ag
Editor of Ruby Inside and RubyFlow
Himalay Majumdar
Ranch Hand

Joined: Sep 28, 2008
Posts: 324
Thanks Peter.. I have read your previous posts as well. BR is the book that suits me the most.
Michael Sullivan
Ranch Hand

Joined: Dec 26, 2003
Posts: 235
Where testing is covered, is it TestUnit, or some other testing framework like Rspec?

Peter Cooper
Author
Greenhorn

Joined: Jul 17, 2009
Posts: 25
Test::Unit. Mostly because that's the "standard" even if the trend has moved on elsewhere (although Rails creator David Heinemeier Hansson recently said he still uses Test::Unit)

I believe that once you have an idea of what testing is, regardless of the library, you'll find it easy to move on to something else. But, no, this isn't an RSpec book, etc.
Jason Mayer
Ranch Hand

Joined: Oct 16, 2007
Posts: 31
A friend of mine once told me that Design Patterns exist mostly as a way to get around limitations in the language. One of the great things about Ruby (and Groovy, since I'm a zealot) is that you don't tend to have those limitations. There might be some performance improvements you can eek out, or more readable ways to write your code, but those tend to come from experience in my opinion.
Michael Sullivan
Ranch Hand

Joined: Dec 26, 2003
Posts: 235
What we can understand about design patterns is that (for the most part) they are language independent. Design patterns help solve recurring design problems, not necessarily language shortcomings.
Himalay Majumdar
Ranch Hand

Joined: Sep 28, 2008
Posts: 324
I personally dont think we use design patterns in Java due to limitations in the language itself. For any (esp OO language) language it would be needed at some point while building a large enterprise application. Ruby being completely object oriented am sure people follow variety of design patterns in it as well.

Having said that, many design patterns applied for namesake and are not justified, but I think they are almost equally used in every object oriented language.

Its hard to defend this topic by example, but please share your thoughts and correct me if needed.
 
wood burning stoves
 
subject: Ruby Design Patterns and Testing
 
Similar Threads
testing ruby
Is "Ruby Best Practices" like design patterns in Java?
R there any developers here that confess to ignoring modelling 4 developing systems?
passed with 88%
Test-Driven Development