Read the description of the Builder Pattern in the Design Patterns book. This should do what you want.
Basically:
Alternatively, and much cooler, you can solve this problem in the CLOS (Common Lisp Object System) way by using Damian Conway's module Class::Multimethod. This module allows you to have dynamic dispatching based on the type of multiple arguments.
Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com
In reply to Re: OO design question
by clemburg
in thread OO design question
by nop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |