Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Proc files vs Proc class
Message
 
À
25/07/1998 00:13:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00121297
Message ID:
00121318
Vues:
12
>I'm wondering what the pros/cons are in using Proc files for UDF's vs. creating Proc Classes to implement UDF's. I've grown accustomed to seeing most VFP developers use Proc files, but in an effort to try to be more 'object' minded I'm wondering if creating proc classes would do the job (perhaps better)? Any insight would be appreciated. Thanks in advance.

Jim,

The rule of thumb that I follow is that if the UDF is an extension of the underlying language then I make it a PRG of its own (I hate proc files becasue they make you include everything in them even if you don't need it), otherwise there should be an object with the responsibility for that behavior. I don't make objects that just hold procedures in their methods.

For example if I create a UDF that formats a city line for an address, well that I would probably put in a PRG. But if I have code that calculates the customer balance from the transactions, that I put in a customer class so that the customer object is responsible for its own calculations.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform