I have a stored procedure used in aound 50 different places within a large application. One of these 50 contexts would require an additional field from this procedure.
I can think of two different approaches:
- Update the stored procedure to return the missing field. That means that I will always request some additional data that will be useless in the 49 of 50 other use-cases.
- Let the stored procedure as it is (withouth the needed additional data). And when I need the additional data (1 of 50 use-cases), query the base after the SP returns to enhance the SP result set into a dedicated DTO. In this case I would add this extra code into my business layer. That means extra code and getting all the data in two queries instead of one.
What would be the best practices?
Aucun commentaire:
Enregistrer un commentaire