Every software Application has a business logic associated with it.Change in business logic is regular and inevitable activity. But Some times change is like a knock on Devil’s door and results could be catastrophic. So there are discussions about placement of business logic in Classes(Layer) of Web/Windows applications or in SQL/PL-SQL in form of Stored Procedures/User Defined functions. Both Approaches have their own Pros and Cons. We will discuss both of them one by one.

  • Business logic at SQL(PL\SQL) LevelIn this approach the Business logic is kept mainly at SQL level in form of Stored Procedures or User Defined Functions.
    • Pros:
      • The process to change business logic is easy as we have to have the logic in Stored Procedure or Functions, it doesn’t require change in Business Logic implemented in our application
    • Cons:
      • Implementation of Business logic is little difficult task as compared to handle in .net/Java etc.
  • Business logic at Business Layer of ApplicationIn this approach the business logic is kept at Application level in form of Class or APIs or DLLs
      • Pros:

    It easy to code business logic as compared to SQL. Manipulation is always better at JAVA/.net end.

    • Cons:
      • The process to accommodate change is difficult as compared to changes at SQL level.
      • Change can induce errors at different levels in application.

1 Comment

  1. An additional benefit of DBCOs is increased consistency. If every user and every database activity (with the same requirements) is assured of using the DBCO instead of multiple, replicated code segments, then you can assure that everyone is running the same, consistent code. If each individual user used his or her own individual and separate code, no assurance could be given that the same business logic was being used by everyone. Actually, it is almost a certainty that inconsistencies will occur. Additionally, DBCOs are useful for reducing the overall code maintenance effort. Because DBCOs exist in a single place, changes can be made quickly without requiring propagation of the change to multiple workstations.

Leave a Reply to Malcolm W. Snyder Cancel reply

Your email address will not be published. Required fields are marked *