Slashdot Mirror


Where Does the Business Logic Belong?

logic-Dilemma queries: "I'm currently working in a big project that involves creating tons of reports. These reports require extensively data operation and manipulation in order to be build, and most of that can be handled directly by the DBMS (which would greatly increase performance and implementation time). However, letting all business logic sit in the database implies that we will be extremely attached to one vendor, which kills any attempt at portability. What would you do to tackle this dilemma? Have you ever faced a situation in which the choice between clean design/portability versus performance would change dramatically the whole system design? What have you chosen?"

1 of 92 comments (clear)

  1. Newbie. by KnightStalker · · Score: 0, Redundant

    Business logic is *IMPORTANT*. Therefore, it should be replicated in as many places as possible. Anything that touches the database should have a separate copy of the same logic in it. A handy way to achieve this state, which functions both as a distributed versioning system and a set of backups which is both effective and affective, is, when writing some new code, to find some old code sitting around that does more or less what you want and use the "cut and paste" feature of your editor.

    You'll find it most useful to have as many subtle mutations of the same piece of code around and in production use as possible -- this way, when you need to use one, something that does exactly what you need will be right at hand. Also, that contributes to a healthy "immune system" for your server.

    --
    * And remember, it's spelled N-e-t-s-c-a-p-e, but it's pronounced "Mozilla."