Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sub-Classing - 1 Library or 'n' Libraries
Message
From
24/02/2004 11:23:28
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
24/02/2004 09:47:39
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00880249
Message ID:
00880325
Views:
30
Hi Michael

If you put everything in one primary VCX, but you build an EXE that uses only one control, the EXE will be bigger because all the other controls in that VCX will be included. This may not be an issue, but it becomes one for COM objects.

If you put them all in separate VCXs, your EXE / COM object(s) will be smaller if you only use one control.

If you subclass one of the controls to a new vcx, and you only use that subclass in your exe, you will have both the new vcx and the entire primary vcx in the EXE, even though you're only using one part of the primary vcx.

Say I create a COM object, based on a custom class. In that class I make use of another class to remember the SET TALK setting. If that remember class is based on a class in the primary VCX, the entire primary VCX will be included. If anything in the primary VCX is a subclass. The parent class's VCX will be included etc.

The drawback will be having many vcxs, but with long file naming and subdirectories, they can be organized. The project could end up with many, many class libraries. In actuality, if you have 100 classes in 10 classlibs, versus 100 classes in 100 classes, there is no difference in learning curve.

In a multi-developer shop, there will be less conflict by having separate vcxs.

My rule of thumb is keep everything in separate VCXs unless you have good reason to combine them.

See http://fox.wikis.com/wc.dll?Wiki~VFPSetClasslib~VFP for more info.

>Hi All,
>
>I have a question about sub-classing the VFP controls. Assuming the statement “Sub-Class Everything” is correct. When you create a new class it has to go in a class library. The classes created will be used in all executable programs. Some of these require only a few controls on the form. Others will require several. The question I/We have is: Which is better?
>
>1) Place each sub-classed control into separate libraries. One for a textbox, one for a combobox, grid, form, etc…
>
>2) Or place all of them in the same class library.
>
>TIA
>Mike
>
>P.S. VFP 6 SP5
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform