JavaScript
  Home arrow JavaScript arrow J2EE Design Patterns: Getting Started
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

J2EE Design Patterns: Getting Started
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    2006-09-11

    Table of Contents:
  • J2EE Design Patterns: Getting Started
  • Common Design Patterns at a Glance
  • J2EE Design Patterns in the Real World
  • View component and DTO

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    J2EE Design Patterns: Getting Started


    (Page 1 of 4 )

    If you have been looking for a good overview of Design Patterns in J2EE, look no further. In this article you will learn about Design Patterns and how they interact with J2EE's tier-based development. It covers three of the most common Design Patterns, and provides a real-world example of Design Patterns in action.

    Recurring problems are the order of the day in both the real world as well as the software world. In the software world, the solutions for these problems are known as Design Patterns. However the Design Patterns for desktop applications and web-based enterprise applications have major differences. Though the design patterns implemented for desktop applications are used in enterprise applications, web-based enterprise applications have their own set of Design Patterns.

    J2EE is no exception. And since J2EE promotes tier-based development, each tier has its own well defined Design Patterns. Hence in the first segment of this discussion, I will focus on the different tiers for which design patterns exist. In the second section, I will discuss the common design patterns for each tier, and the third and fourth sections will provide details for using these in tandem with each other in a tiered application. That’s the agenda for this discussion.

    Tiers in J2EE

    The first question that pops to mind is what really constitutes a tier. According to its definition, a tier “refers to the possibility of having different configurations.” Simply put, a tier is a collection of software designed to provide a particular set of functionalities and interfaces to the outer world. On the basis of functionality or service provided, tiers can be divided into five categories:

    1. Client presentation tier
    2. Server side presentation tier
    3. Server side business logic tier
    4. Server side domain model
    5. Enterprise integration tier

    As you can see, there is a presentation tier on both the server and client sides.  The reason is that the data for presentation has to be taken care of by both sides. On the server side, the technology can vary from servlet to Velocity templates. On the client side, HTML/XHTML and JavaScript takes care of the presentation. Let's look at the details.

    Client presentation tier

    What the client sees comes through this tier. It can be thick, thin or a combination of both. In a thick client, the presentation and application logic would be on the client side, bypassing the server-side presentation and business logic tiers. The best example of a thick/fat client is a Java client developed in Swing or AWT.

    On the other hand, a thin client delegates almost all except some of the presentation and application logic to the server side, especially to the server side presentation tier. An example of a thin client in J2EE is an HTML file. It contains minimal presentation logic such as client-side interactivity using JavaScript. Everything else, including some of the presentation logic, is delegated to the server side presentation tier. That’s what I'll be covering next.

    Server side presentation tier

    According to its definition, the server side presentation tier “Provides the Client Presentation tier with the materials, such as HTML, required to produce the user interface.” With a truly dynamic page. such as one that features a customized layout for each customer, it is this tier that does all the processing. With a thin client it handles all the tasks, such as producing the required HTML code and connecting with either the business logic or the domain layer. This tier is also responsible for controlling the flow of the application, i.e. which page has to be called next and so on. With thick/fat clients, this tier is totally ignored.

    Server side business logic tier

    By definition this tier “Includes the business methods sitting behind an application.” In short, this tier encapsulates all the business logic connected with an enterprise. Though the logic encapsulated by components of this tier does not change from application to application, these encapsulated logics do change from enterprise to enterprise.

    Server side domain model

    The server side domain model “Includes the data model used by the business logic tier, or the 'nouns' of the application.” In other words, the components of this tier reflect the data required by the server side business logic tier. The data is modeled according to the needs of the business. Thick/fat clients sometimes take the service of this tier, bypassing even the server side business logic tier.

    Enterprise integration tier

    According to its definition, the enterprise integration tier “Connects the application to other systems.” It is in this tier that the connections to the external systems are made. External systems include mainframes, ERP systems, other applications, and so on. This connection can take place via CORBA, web services, Message Oriented Middleware or email. In some applications, this tier is excluded.

    That covers the different tiers in enterprise applications. In the next section I will introduce the most commonly used Design Patterns in all the above tiers, except for the fifth tier.

    More JavaScript Articles
    More By A.P.Rajshekhar


       · Design Patterns are standard answers to recurring problems. In this discussion I...
     

    JAVASCRIPT ARTICLES

    - Using Mod_Security to Protect Your Server
    - Detecting and Countering Server Intrusions
    - Securing Your Web Server
    - Building a Secure Web Server
    - Protecting the Server
    - Book Review: Learning the Yahoo! User Interf...
    - Dynamically Generate a Selection List in a R...
    - Intergrate DWR into Your Java Web Application
    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT