Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object Oriented Programming
Message
De
16/09/1998 18:56:40
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
15/09/1998 16:25:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00134380
Message ID:
00137569
Vues:
18
>>>>Methods of objects are better than UDFs as they allow the encapsulation of data with the behavior.
>>
>>When applicable. There is a price to pay in terms of modeling that is only paid back if reuse is guaranteed. Which in the real world (and I'm talking about the domain here) is not frequent.
>>
>
>I dunno, Marc. Seems to me not much more effort to create business/application objects and use custom methods instead of UDFs even if you never intend to reuse the code.

I think this is not a "two legs bad, four legs good" situation. UDFs have their place, and range of jobs to do; it simply takes some recognition of what should remain as an UDF, and what should be a method.

In FPD, I've had couple of date functions - FDoY() returns January 1st in the year of a given date, NDoY() returns the ordinal number of a date within its year, and ChkDat(date, startdate, enddate) returns a messagebox if Between(date, startdate, enddate)=.f.; now the first two will remain UDFs, while the third became a method in a DateTextBox class. I simply may need those two in any calculation, entirely GUIless, and the third has a GUI and is pretty pointless without a textbox to apply to.

Simply, the class of problems delegated to UDFs is reduced, but still not .null.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform