> The former method (code in each instance of the sub-class) has to generate a lot of code at run time (especially because I plan to have about 6-8 different manipulations actuated from a shortcut right-click menu), whereas the latter does it once, and seems a little more streamlined to me. Would it be better to do it that way?
>
> Thanks again. You guys helping us newbies are a real blessing.
>
> Bill vV
I agree with Andy. You want your objects to be as independent as possible. If you keep the functionality within the object it means that you can drop it on any form and it will function. The more objects rely on the existence of other objects (known as tight coupling), the harder it is to reuse those objects.
It takes a while to get used to but unless something is a definite one-off I say to myself - "I want to make this class once and once only and then I can use it in any further apps I have". It's amazing what a time saver it is in the end. It will mean that the base class has more code than you might otherwise have needed but it makes life very easy later. You always know that if there is a bug or you want to alter the behaviour of some part of your system - the code is in only one place.
Cheers,
Jamie
jamie.osborn@foxite.com