Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sub-Classing - 1 Library or 'n' Libraries
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00880249
Message ID:
00880289
Views:
23
Hi Michael,

If you're not using a commercial framework, you should probably have, at minimum, a single "base" library that contains a subclass of each control which inherits directly from VFP. We use a commercial framework (Visual MaxFrame Professional), so that provides our "base" libraries. You can also, if you wish, use the FFC classes that come with VFP as your "base" set of libraries.

In addition to that, here at FTG we have three levels of subclassing -- Dev, App, and Client. At each level, we have a library that holds all the specialty subclasses we create for that level, regardless of the type of control.

So, for instance, our dev-level library for VFP8 work is called F8FWDEV (FTG, VFP8, FrameWork, DEV-level classes). These F8 classes are subclassed from either your "base" library or from the base libaries of your chosen framework.

We would then subclass that for each application, and add the APP library as well; say, the app is called Order Entry, we would subclass that library to OEFWDEV and add the OEFWAPP library to contain the specialty classes for the Order Entry app (this way, we can also enhance or modify the DEV classes if we need them to do something special in OE). If a client needs specific mods to Order Entry (let's say the client is Tasker's Pub -bg-), then we'd subclass the OE libraries, calling them TPFWDEV and TPFWAPP and adding the TPFWCLT library.

This way, it's a breeze to move between versions of VFP and/or framework releases; it's relatively simple to know what classes were designed at what level; and, we never have to go more than three levels deep (well, almost never -- have one client who stuck an intermediate level between App and Client to group certain client modifications, but that's another thread -s-).

On another tack -- in your message, you stated that a new class has to go in a class library. Not true -- some people create all their subclasses (or a large portion of them) in PRG files. I don't wish to start a debate here about which is better or when it's appropriate to do that, but I did wish to bring it to your attention.

HTH.

>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
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform