![]() Otherwise, developers should have very good reasons to integrate them into their applications. For example, stored procs are great for database housekeeping or reporting. making it virtually impossible to avoid huge parameter lists (a dozen or more is common!).Įven the most staunch opponents of stored procedures still use them in some circumstances. Moreover, it isn't possible to pass an object as a parameter to most stored procedures - only simple types like string, integer, date/time, etc. Code Duplicaton: Stored procedures require you to violate DRY (Don't Repeat Yourself) principle, since you have to reference database table columns half a dozen times or more. ![]() In fact, modern ORMs use a convention-based approach that eliminates the need for a separate mapping definition. Compare that with an O/R mapper, where all that's needed are class definitions, database table, and mapping file. Then, you need to implement classes and/or methods in your code to call each stored procedure. For starters, you need to have individual stored procedures to execute create, retrieve, update and delete operations for each table, plus a separate stored procedure for each different query that you wish to make. Difficult to Maintain: Stored procedures tend to require much more work to develop and maintain than application code.As such, dropping application logic into stored procedures can be a case of premature optimization. However, with today's lightning fast network speeds, this isn't nearly as big an issue as it once was. Changing Requirements: One of the original use cases for stored procedures was to reduce network traffic.While many DB developers consider Oracle's stored procedures to be of the highest quality, other products' procedures, such as those of MySQL, are less well conceived. ![]()
0 Comments
Leave a Reply. |