>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement