Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Method Overloading a good or bad thing?
Message
 
À
01/07/2004 18:09:44
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00919869
Message ID:
00921011
Vues:
22
>Craig,
>
>Without overloading you have two choices:
>
>1. Have a separate function that you have to call depending on the number of parameters.
>2. Always pass all parameters.

>
>Doesn't seem to worry those who extol the virtues of Stored Procedures. ;-)

Hi, John. FWIW, in a layered design, the overloaded methods in the middle tier would likely all (ultimately) call the same SP to handle the data request or update. The difference would be that in the method(s) where optional parameters are not passed, those values would be calculated or defaulted to some value (even if NULL) and then some common method (usually the overloaded one that accepts all of the parms) would be called to do the work. If SPs were employed, that common method then would call the SP, passing all parameters.

So, if I'm doing layered development, it seems that SPs don't really need to allow overloading (all IMO, of course). If I do need an SP to accept optional parms or to handle passed NULL values differently (yes, there may be times, such as in searching and reporting SPs), it just has to be coded like in VFP SPs, procedures, functions and methods.

I do realize what you were driving at :-) and I also assume you already knew what I said above (even if you may not agree), but in case anyone lurking hadn't used overloaded methods and SPs together, I thought I'd mention this.

Kelly
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform