Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper OOP Technique
Message
 
À
26/12/1999 04:37:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00308609
Message ID:
00308613
Vues:
19
Dale,

The rule that I use is this, if the routine being written could be considered as an extension of the underlying language then I make it a UDF otherwise it is a method of some object.

For example: If I am writing code to calculate teh differ4ence between two datatime values and return a string as "## Years, ## Months, ## Days, ## Hours, and ## Seconds" I might create it as a UDF.

If I am writing code to format a mailing address' city line as, "City, State ZipCode" I would make it a method of an object. Probably an address formatting object. Why, because the names of the fields will change from application to application perhaps even from table to table. Handling non-us addresses requires different code, so subclassing could be an advantage. The point is that formatting is not an extension of the underlying language.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform