Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Business Layer Question

    I am trying to convince a colleague that we should move our app's business logic that currently resides in stored procedures to Csharp/VB code behind for the upcoming rewrite of one of our ancient ASP classic applications.

    Would you please share your knowledge of advantages and disadvantages to storing business logic in the code behind instead of stored procedures?

    The main advantages I see to using the code behind as the business logic layer are (in no particular order):

    1) ease of debugging business layer logic - this can be done at compile time
    2) ease of maintainability (touches on advantage 1)
    3) re-usability - encapsulation of classes that can easily be reused.

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,808
    Thanks
    42
    Thanked 199 Times in 198 Posts
    your application should be broken into three tiers: Database, Business, GUI. All inputs from the GUI should then be run through the business layer- think of it as validation. Then the cleaned data should be transported to the database via the database layer.

    housing business logic in stored procs (or any SQL) limits what you can do. SQL is not as powerful as the .net framework- it's intention was not to be a validate/clean... it's intention was to be a repository for your information.

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #3
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Validation is being done at both levels we will be migrating an app from ASP classic using VB script to ASP.net using VB.

    Multiple stored procs have business logic in them that I want to move to the code behind in ASP.net. Most logic resides in the ASP classic pages in vb script.

    There is a DTS package that runs a stored proc with a lot of logic in it as well. Determining payments and what not for customers.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •