in reply to Class automators should be standard
For example, suppose you have a car object, with attributes of accelerator_setting, gas_in_tank, velocity, etc.
You can get or set the accelerator, but doing so should change the velocity and available gas.
If you use MethodMaker to automagically make getters and setters, the resulting get/set methods are bare-bones basic. And if bare-bones basic isn't what you want, so you need to subclass or rewrite these methods (so that, in this case, pressing the accelerator moves the accelerator and also increases speed and decreases gas), then why use C:MM to create them?
(And imho I don't the appearance of a class which uses C:MM for some getter/setter methods but hand-rolls others... just doesn't fit my code aesthetic.)
Perhaps I am missing something, but that's my problem with automatic method makers. The OO examples in the docs always use independent attributes like name, rank, serial number -- and promoting a solider doesn't change his or her name or number.
The easy stuff is great for C:MM, but not all objects are so simple.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Class automators should be standard
by danb (Friar) on Jan 14, 2004 at 18:43 UTC | |
by rkg (Hermit) on Jan 14, 2004 at 20:52 UTC | |
by danb (Friar) on Jan 15, 2004 at 03:16 UTC |