Placing code in the database
Using application logic
Placing code in the middle tier
Writing good code that runs efficiently isn’t enough to guarantee the success of a project. Deciding where to put the code is just as important as writing it. Code can be written in lots of different places within a system, but each of these places has pro and cons. Frequently, depending upon what the code needs to do, you can make a clear, correct decision about where the code should reside. At other times, you have a variety of acceptable alternatives for placing the code.
Deciding how and where to place code has been a hotly debated topic in the application development world. In client/server development, you had to decide what logic belonged in the database and what logic belonged within the user interface. Since the advent of Web-based systems that run code on an application server, code can reside in even more places. With all these options, the question remains: Which code should be placed where?
This chapter ...