http://qs1969.pair.com?node_id=321178


in reply to Class automators should be standard

One thing I find troubling about MethodMaker is often my class setter/getters change object state beyond that attribute. There's probably a name for this, but I don't know it.

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.

rkg