Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jamie Osborn
  Where is Jamie Osborn?
 Melbourne
 Australia
 Jamie Osborn
 To: Bill von Valtier
  
 Rochester
 
 Bill von Valtier
 Tags
Subject: RE: Thanks, Jamie
Thread ID: 22293 Message ID: 22335 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Forms
Date: Wednesday, April 16, 2003 1:31:54 AM         
   


> 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

COMPLETE THREAD

Adding objects and event code programmatically Posted by Bill von Valtier @ 4/14/2003 10:39:54 PM
RE: Adding objects and event code programmatically Posted by Jamie Osborn @ 4/15/2003 11:52:58 AM
RE: Thanks, Jamie Posted by Bill von Valtier @ 4/15/2003 10:10:06 PM
RE: Thanks, Jamie Posted by Andy Rice @ 4/16/2003 1:02:28 AM
RE: Thanks, Jamie Posted by Jamie Osborn @ 4/16/2003 1:31:54 AM