CHAPTER 1 The big picture At the other
CHAPTER 1 The big picture At the other extreme, the presentation resides in a module totally separate from the one implementing the business logic, and the interaction between the two is defined by a set of well-known interfaces. This type of application provides the necessary separation between the presentation and the business logic. Why is this separation so crucial? In most cases the developers of the presentation layer and the business logic are different people with different sets of skills. Usually the developers of the presentation layer are graphics designers and HTML developers who are not necessarily skilled programmers. Their main goal is to create an easy-to-use, attractive web page. The goal of programmers who develop the business logic is to create a stable and scalable application that can feed the presentation layer with data. These two developers differ in the tools they use, their skill sets, their training, and their knowledge. When the layers aren t separated, the HTML and program code reside in the same place. Think back to our previous discussions of CGI and web server API extension techniques. Many sites built with those techniques have code (either in a module or a CGI script) that executes during a page request and returns HTML. Imagine how difficult it is to modify the User Interface if the presentation logic, HTML in our example, is embedded directly in a script or compiled code. Though developers can overcome this difficulty by building template frameworks that break the presentation away from the code, this requires extra work for the developer since the extension mechanisms don t natively support such templating. Server pages technologies are not any more helpful with this problem. Many developers simply place Java, VBScript, or other scripting code directly into the same page as the HTML content. Obviously, this implies maintenance challenges as the server pages now contain content requiring the skills of both content developers and programmers. They must check that each updating of content to a specific server goes through without breaking the scripts inside the server page. This check is necessary because the server page is cluttered with code that only the business developer understands. This leaves the presentation developer walking on eggshells out of concern for preserving the work of the business logic developer. Worse, this arrangement can often cause situations in which both developers need to modify a single file, leaving them the tedious task of managing file ownership. This scenario can make maintaining a server pages-based application an expensive effort (which undermines many of the achievements related to server pages). Listing 1.2 A tightly coupled page
Welcome to my dot-com (some program code)
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services