Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper OOP Technique
Message
 
To
26/12/1999 04:37:42
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00308609
Message ID:
00308613
Views:
20
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform