java4all@1986 java. Powered by Blogger.

Dsign Patterns in J2EE?

>> Friday, May 27, 2011

There are n.o of design patterns in Java.Mostly we are using eight Design Patterns in Our application.

  • Business Delegate
  • Composite Entity
  • Data Access Object
  • Front Controller
  • Data Transfer Object
  • Service Locator
  • Intercepting Filter
  • MVC
1. Business Delegate:
An intermediate class decouples between presentation-tier clients and business services. 


Where to use & benefits 


  • Simplify the complicated relationship.
  • Reduce coupling.
  • Cache results and references to remote business services.
  • Cut potentially costly round trips
  • Hide the underlying implementation details of business service.
  • Related patterns include.

Composite Entity:
Use a coarse-grained interface to manage interactions between fine-grained or coarse-grained and dependent objects internally. The Composite Entity is a coarse-grained entity bean. It may be the coarse-grained object or hold a reference to the coarse-grained object. Also known as Aggregate Entity. 


Where to use & benefits  


  • Combine coarse-grained object and its related dependent objects into a single entity bean.
  • Multiple clients share persistent objects.
  • Model a network of related business entities.
  • In both local and distributed environment, use remote entity beans to model dependent business objects or fine-grained objects.
  • Improve performance by eliminating the parameter and return value serialization and data transmission costs.
  • Eliminate inter-entity relationships
  • Improve manageability by reducing entity beans.
  • Improve network performance
  • Reduce database schema dependency 
Data Access Object :
Adapt a uniform interface to access multiple databases like relational, unrelational, object-oriented, etc.


Where to use & benefits 


  • Need to access multiple data sources like legacy systems, B2B, LDAP, and so forth.
  • Lack of uniform APIs to address the requirements to access disparate systems.
  • Persistent storage APIs vary depending on the product vendor.
  • Adapt and encapsulate all access to the data source.
  • Hide the data source implementation details from its clients.
  • More portable and less code dependencies in components.
  • Solve differences in the APIs which is used to access different persistent storage mechanisms.
  • Not useful for container-managed persistence.
Front Controller:
Using a single component to process application requests.


Where to use & benefits 


  • JSP or Servlet.
  • Design request handling component.
  • Channel all requests through a single controller.
  • Centralize request processing and view selection.
  • Reduce business logic in a view
  • Improve manageability of security
  • Promote code reuse across requests
  • Avoid code duplication
  • Related patterns include 
Data Transfer Object :

Using a serializable class to act as data carrier, grouping related attributes, forming a composite value and working as a return type from remote business method. Also known as Value object.


 Where to use & benefits 

  • Get related values from remote business method.
  • Fetch multiple values in one trip.
  • Decrease network traffic.
  • Minimize latency and server resource usage.
  • Related patterns include 
ServiceLocator:
Centralizing distributed service object lookups, providing a centralized point of control, acting as a cache that eliminates redundant lookups.

 Where to use & benefits 

  • Lookup object in JNDI, RMI, JMS, etc.
  • Encapsulate any vendor-specific features of lookup process
  • Simplify the lookup process
  • Improve the performance
  • Related patterns include 
 Intercepting Filter:
A pluggable component design to intercept incoming requests and outgoing responses, provide common services in a standard manner (independently) without changing core processing code.

 Where to use & benefits

  • Logging and authentication.
  • Enhance security.
  • Add additional function to existing web application.
  • Decorate main process.
  • Debug.
  • Pre-processing or post-processing for specific clients.
  • Uncompress incoming request.
  • Convert input encoding schema.
  • Being added or removed transparently or declaratively and triggered automatically
  • Improve reusability 
MVC:
The Model/View/Controller(MVC) is an architecture design pattern. Model means data, View means representation and Controller works on data and representation. MVC focuses on decouple the triad relationships among data, representation and controller.

 Where to use & benefits

  • Application architecture design.
  • Any data related design, including non-visual application.
  • Decouple complex object to improve maintainability.
  • Increase object reusability.
  • Achieve design flexibility.
  • Related patterns include 








0 comments:

Post a Comment

FaceBook Login

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

Total Pageviews

STATCOUNTER

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP