I am working on both parts of a data layer. I get to make procs, and trade object layer which will consume the procs.
What should be determined to remove a best practice?
Here's the scenario I have a table book with the foreign key for the table table page. If I remove the book, then I also want to delete the pages. If the deletion of a page fails, then I want the whole book (transaction).
Should be removed in managed code (by making transactions, removing all items and finally book), or in Proc (again in transaction)?
Or does it matter?
I would say that it depends on your grounds where "logic" for your data Do the deposit.
1) If your stored procedures are mostly "dumb", in which there are simple entries / updates / delete, I will place the dials in the data layer object, where you will have a more complex code.
2) If you have written several complex stored procedures, where you have to check biz rules, keep logic in all SP and keep the data level simple.
In fact, where you want the complexity of lying, do not put many rules in both objects and SP, or the maintenance will be a bitch.
Comments
Post a Comment