Monthly Archives: March 2004

Varying behavior of individual objects : Decorator Design Pattern

Let’s take a look at a class for a Baseball player. In this example I made it an abstract class but it could just as well have been an interface for this discussion.

And here is an implementation class.

And another implementation class.

When we test them out like this:

We […]

Posted in Design Patterns | Tagged , | Leave a comment