Tag Archives: oop

Decoration is best, except when it isn’t

I think by now we all know to prefer composition over inheritance. But in a language with a lot of options, what’s the best kind of composition to use? Composing an adventure Consider an adventure game, with objects representing player … Continue reading

Posted in Ruby | Tagged , , | 14 Comments

End your OOP Confusion with the Design Pattern Classifier

The Ruby community has seen a renaissance of interest in classic Object-Oriented thinking lately. We’re talking about Presenters, and DCI, and Data Objects. But with these new discussions come new problems. Namely: the dreaded pattern terminology debate. He says it’s a Decorator. … Continue reading

Posted in Humor | Tagged , | 2 Comments

Object Oriented Programming Books

A few people have asked for recommendations of good foundational Object Oriented Programming texts. The truth is I’m kind of behind on my formal OOP reading, and some of the early texts I read I wouldn’t recommend. My first proper OOP book was … Continue reading

Posted in Books | Tagged , | 19 Comments

Early access beta of “Objects on Rails” Now Available

UPDATE: Objects on Rails is now complete and freely available online. Often, at conferences and users group meetings, I find myself discussing the intersection of Ruby on Rails, Object-Oriented development, and Test-Driven Development, and I’ll mention something like “I prefer to develop my … Continue reading

Posted in Announcements, Books | Tagged , , , , | 27 Comments

You Can’t Subclass Integers in Ruby

This post is mainly just an excuse to test a Gist plugin for WordPress. Occasionally, you might think it would be handy to subclass Numeric types such as Integer. For instance, you might want to create a constrained integer which … Continue reading

Posted in Ruby | Tagged , , , , , | 9 Comments

Demeter: It’s not just a good idea. It’s the law.

Is #try really so bad? In response to my recent post about #try being a code smell, a lot of people made the reasonable objection that the example I used—of using #try on a a Hash—was a pathological case. A … Continue reading

Posted in Ruby | Tagged , , , , , , , , , , , , | 73 Comments