10/30/2010

A look at important J2EE Design patterns

· Session Façade – Fine-grained EJB applications are highly susceptible to
communications overhead. Session facades provide a service access layer that
hides the complexity of underlying interactions, and consolidates many logical
communications into one larger physical communication. With Entity EJB and other
complex objects, the work required to obtain and interact with such objects is
confusing. A session façade adds a layer of abstraction that masks complexity.

· MVC - The Model-View-Controller design pattern creates a decoupled data access,
data presentation and user interaction layers. The benefits are a higher degree of
maintainability because there are fewer interdependencies between components, a
higher level of reusability as components have distinct boundaries, and easier
configuration as you can implement new views without changing any underlying
code.

· Value Objects – Create a single representation of all the data that an EJB call
needs. By aggregating all of the needed data for a series of remote calls, you can
execute a single remote call instead of many remote ones increasing overall
application performance.

· Data Access Objects - Use a Data Access Object to abstract and encapsulate all
access to the data source. The Data Access Object manages the connection with the
data source to obtain and store data.

· Service Locator - Enterprise applications require the use of distributed components.
It is often a difficult and expensive task to obtain handles to components, like an
EJB’s Home interface. Instead, you can efficiently manage and obtain them through a
Service Locator that centralizes distributed object lookups. You’ll benefit by having a
single point of control and an effective attachment point for a cache.

Design patterns are only a part of the puzzle. You will also want to build a robust build
framework. With J2EE’s object oriented environment, you’ve got an increased
dependency between objects and resources. Since you don’t want to manage all of the
dependencies yourself, you’ll need the build process to track it for you. Couple this
increased complexity with multiple environments (like development, test and deploy
environments), and what seemed like a luxury quickly becomes a necessity

0 comments:

Post a Comment