Jump to content

What is the approach?

- - - - -

  • Please log in to reply
1 reply to this topic

#1
myusername

myusername

    Newbie

  • Members
  • Pip
  • 1 posts
Hello
Using Asp.net3.5/ sql2005.
What is the approach? What should calculate in the database and what to implement in the business lyre??
If I will calculate in the db – I will have less round trips and less resources on the server side host – but less flexible programmatically side..
When to use object oriented programming and when to implement the calculation on database – when what I am looking for is first performance..

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
As with any other programming problem, the correct approach depends on the details of the problem to be solved. I work with a system where some information is calculated in the database, and some is calculated in the application. Also, if the data only exists in the business layer, then there is no round-trip, because it never gets pushed back to the database.

Generally, I think about it this way: what is core functionality of the system vs. what is business logic? Core functionality can live in the DB or in the software layer. Business logic has a nasty habit of changing on you. If your database structure is built around the business logic, it can become brittle and unable to change when the business logic changes. Having to do a significant database migration to update the business logic of your software is painful, as is developing hacks to work around brittle systems.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users