Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does a PRG class execute faster than a VCX based class?
Message
De
14/08/2005 09:41:21
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
12/08/2005 09:38:44
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01040117
Message ID:
01040774
Vues:
30
Hi Cetin

An scx file is a natural and physical collection of things contained in that screen. A vcx for a compound object is also a physical collection of things contained in that object.

I object ;) to a vcx that contains unrelated things. I agree that there must be a class library, but it is often being used improperly, IMO. For example, putting all date calculation objects into the same vcx as the business objects makes no sense. Before you arbitrarily group things together, I strongly advise you not group them at all.

For that matter, people are also doing things like putting a weekdays function into a payroll screen. Would you instantiate the payroll screen just to get that weekdays function? The weekdays function is not dependant on the payroll screen. Opting to keep the weekdays function outside of the payroll screen leaves that code available for every possible other purpose.

If you put all baseclasses in a single vcx, those classes are all automatically included in your exe. I would put all baseclasses one per vcx, except that I use MaxFrame. Things I subclass from it do go in one class per vcx. It is very liberating! I always remember the class I want and never have to remember where it's hidden.

I would like for there to be a way to organize functions and classes logically/virtually, but not a physical organization.


>:) Why is there a scx file but not ccx file (single object)?
>IMHO Library is not a misconception and serves grouping classes. For the simpliest example, do you keep your baseclasses one per a vcx - somethign like myLabel of myLabel.vcx?
>Cetin
>
>>I think Library is a misconception or at least abused. Granularity is far better than arbitrarily collecting stuff in a set of class libraries. Why is there a class library file, but no class file?
>>
>>
>>
>>>I don't agree. A vcx stands for a classLIBRARY. If I'd just keep my classes in a LIBRARY down to one then LIBRARY is a misconception??? prg is no different in that matter.
>>>Cetin
>>>
>>>>Whichever way you go, keep the number of classes in each prg or vcx down to one. See http://fox.wikis.com/wc.dll?Wiki~PRGvsVCX~VFP and http://fox.wikis.com/wc.dll?Wiki~VFPSetProcedure~VFP
>>>>
>>>>>Hi All,
>>>>>
>>>>>I and a friend are having a discussion on how to best create and maintain classes. He suggested that we programmatically code our classes. I, however, am very comfortable designing/coding classes visually - that is, using the Visual Class Designer.
>>>>>
>>>>>Although one can very well convert a VCX based class (or a Form even) to a PRG class via Class Browser/View Code, the issue of performance and best practices comes to mind.
>>>>>
>>>>>Which executes faster? Is coding classes programatically more popular? Or better practice?
>>>>>
>>>>>Many thanks to anyone who shares his/her insights!
>>>>>
>>>>>Dennis
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform