Home arrow JavaScript arrow J2EE Design Patterns: Getting Started
JAVASCRIPT

J2EE Design Patterns: Getting Started


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.

Author Info:
By: A.P.Rajshekhar
Rating: 4 stars4 stars4 stars4 stars4 stars / 20
September 11, 2006
TABLE OF CONTENTS:
  1. · J2EE Design Patterns: Getting Started
  2. · Common Design Patterns at a Glance
  3. · J2EE Design Patterns in the Real World
  4. · View component and DTO

print this article
SEARCH DEVARTICLES

J2EE Design Patterns: Getting Started
(Page 1 of 4 )

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.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials