Storage procedures should be used

zhaozj2021-02-16  123

When I just wrote the code, I heard the sound of such a multi-purpose stored procedure to do O / R mapping that will begin to tend to Anti-stored procedures

Today, I see this sentence in a company's code specification recommendation section "Unless it is necessary, do not implement any business logic during the stored procedure. If there is if your stored procedure is IF, things are not right."

OK, now agreed with the above, simple insert, update, if it contains the business logic, it is to be Anti. Back to step, if the business logic is written in the database, trouble at least a document , Explanation, which business logic is written in the database, why must be a unified management. Instead of today, a developer likes to use SP, and write business logic in the SP; Never write logic in SP. The system is big, this is still not chaotic?

转载请注明原文地址:https://www.9cbs.com/read-7748.html

New Post(0)