Evaluating alternative Decorator implementations in Ruby

Evaluating alternative Decorator implementations in Ruby:

Recently, decorators have become a big part of my Ruby on Rails life.

We used them heavily in a recent client project, Harold Giménez wrote a great post about them, Avdi Grimm is writing about them in Objects on Rails, and Jeff Casimir has a great presentation about them.

Until recently, I still had some questions, however, such as:

Should I roll my own decorators?
If I roll my own, what are the tradeoffs of different implementations?
Do I care about the “transparent interface” requirements of the Gang of Four’s decorator definition?
Is it good or bad that the decorated object’s class is the decorator instead of the component?

[Good explanations.]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s