Tuesday, October 11, 2016

Ruby - Use Struct for "Reification" / OO

http://blog.steveklabnik.com/posts/2012-09-01-random-ruby-tricks--struct-new

Ruby has the Struct construct which author makes use of to "reify" objects to be more Object Oriented. In Java, we'd have to create a separate class for these tiny strongly typed data objects, e.g. by using the "parameter object" pattern.

No comments:

Post a Comment