JavaServer Page

December 30, 2006

CHAPTER 1 The big picture Listing 1.1 Sample

Filed under: JSP Tag Libraries — webmaster @ 11:29 pm

Dynamic web servers Another issue is the proprietary nature of the server pages. Aside from PHP (an open-source software freely available to most web servers), server pages technologies are only available on a single server (e.g., server side JavaScript on Netscape servers) and sometimes even only on a single operating system (ASP, which relies heavily on COM and is, largely, Microsoft-only). This means that you usually cannot leverage your ASP experience on Netscape and UNIX. Furthermore, the API used to extend the scripting language with low-level services is very different among the various systems; thus, porting complex projects requiring custom language extensions is very difficult. Simply put, when using server pages you lock yourself in with a vendor, which is often an unpleasant arrangement. These disadvantages are insignificant compared to the most egregious shortcoming of server page technologies: the lack of separation between your application s business logic and the presentation logic that displays it. This unfortunate weakness isn t the problem of server page mechanisms alone, in fact all the mechanisms we ve explored thus far have suffered from it. Before we discuss the way to overcome this hurdle we should define the need for separation. 1.3.4 Separating business and presentation logic One of the greatest challenges in web development is in cleanly separating presentation and business logic. All of the web server extension methods we ve looked at so far have suffered from this obstacle. What does it mean to separate these layers? To start with, we can partition any application into two parts: Business logic The portion of the application that solves the business need (e.g., the logic to look into the user s account, draw money, and invest it in a certain stock). Implementing the business logic often requires a great deal of coding and debugging, and is the task of the programmer. Presentation layer Takes the results from the business logic execution and displays them to the user. The goal of the presentation layer is to create dynamic content and return it to the user s browser, which means that those responsible for the presentation layer are graphics designers and HTML developers. If applications are composed of a presentation layer and a business logic layer, what separates them, and why would we want to keep them apart? Clearly there needs to be interaction between the presentation layer and the business logic, since the presentation layer presents the business logic s results. But how much interaction should there be, and where do we place the various parts? At one extreme, the presentation and the business logic are implemented in the same set of files in a tightly coupled manner, so there is no separation between the two.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Java Web Hosting