But, that struck me as inelegant. The number of classes is going to be relatively static, so that's not a problem. But, I still have to add a class, then add its string and classname up top.
I thought of using a Factory, but the factory would still need this list somehow. So, I thought about having each class register with the factory as it is compiled, maybe in some sort of BEGIN statement. But, that struck me as unnecessary perl-fu.
Am I just being fussy?
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Object factories
by Aristotle (Chancellor) on Jan 15, 2003 at 22:41 UTC | |
|
Re: Object factories
by tall_man (Parson) on Jan 15, 2003 at 22:26 UTC |