Categorizing Design Patterns
Patterns focus on different types of problems. Related patterns are grouped
together and assigned a type. This helps programmers to identify similar types
and further it simplifies the process of comparing similar patterns to find the
appropriate one(s) to utilize.
I. Classification of Design Patterns in general spectrum
1. Creational Patterns
2. Structural Patterns
3. Behavioral Patterns
II. JEE-specific Design Patterns
1.
Presentation tier patterns
2. Business tier patterns
3. Data Access tier patterns
1. Creational Patterns
This design category is all about the class instantiation.
Creational pattern uses class-creation patterns and object-creational
patterns. The class-creation pattern uses inheritance effectively in the
instantiation process while object-creation pattern uses delegation to get the
job done. All the creational patterns define the best possible way to
instantiate an object. They describes the best way to create the object
instances. Many times, nature of the created object changes according
to the nature of the program. In such scenarios, we use patterns to give
this a more general and flexible approach, for example a object instance can
be created using a new operator, which is a hard coding methodology ( hard
coding should be the last option to go with).
There are five types of Creational Patterns.
1. Factory Pattern
2. Abstract Factory Pattern
3. Builder Pattern
4. Prototype Pattern
5. Singleton Pattern
2. Structural Patterns
Structural Patterns describe how objects and classes can be combined to form larger structures. The difference between class patterns and object patterns is that class patterns describe abstraction using inheritance and describe how it can be used to provide more useful program interface. Object patterns, on other hand, describe how objects can be associated and composed to form larger, more complex structures.
There are seven structural patterns described. They are as follows:
1. Adapter Pattern
2. Bridge Pattern
3. Composite Pattern
4. Decorator Pattern
5. Facade Pattern
6. Flyweight Pattern
7. Proxy Pattern
3. Behavioral Patterns
Behavioral patterns are those patterns which are specifically
concerned with communication (interaction) between the objects. The interactions
between the objects should be such that they are talking to each other and still
are loosely coupled. The loose coupling is the key to n-tier architectures. In
this, the implementations and the client should be loosely coupled in order to
avoid hard-coding and dependencies.
The behavioral patterns are:
1. Chain of Resposibility Pattern
2. Command Pattern
3. Interpreter Pattern
4. Iterator Pattern
5. Mediator Pattern
6. Momento Pattern
7. Observer Pattern
8. State Pattern
9. Strategy Pattern
10. Template Pattern
11. Visitor Pattern
II JEE-specific
Design patterns
The term
JEE is tossed around a lot because it covers the widest range of applications
development in the enterprise and distributed environments. Infact, the JEE
modules and environment is still growing with a rapid pace. So, it is important
to take advantage of the most efficient and effective strategies while
re-factoring the existing projects and developing newer ones. These efficient
and effective strategies in JEE scenario are known as the JEE-specific Design patterns.
JEE-specific
design patterns identify the minimal set of known problems that application
architecture should solve. These patterns are based on the experiences of the
JEE community (involved with JEE development) to solve the problems.
Classification of JEE Design Patterns :
1. Business Tier Patterns
These business tier patterns tackle problems occuring in
an application resulting from the presentation tier accessing
distributed business services, network performances degradation due to multiple
calls between client and server, memory impact due to retrieval of a large list
of data, and so on. The patterns demonstrated here focus on and solve design
problems occuring in the middle tier of a J2EE application.
Session
Facade Design Pattern
Service Locator Design Pattern
Value List Handler Pattern
2. Presentation Tier Patterns
The presentation tier patterns deal with the common
problems occuring in the presentation layer such as - view management and
navigation, processing of dynamic business data, efficiently accessing the
read-only data, and so on. The patterns under this category focus
on and solve design problems occuring in the presentation tier of a J2EE
application for example :
Fast
Lane Reader Pattern
3. Data Access Tier Patterns
These data access tier patterns tackles best practices
for an application accessing the database or the underlying persistence layer
from the business tier. The patterns
demonstrated here focus on and solve design problems occurring
in the data tier of a J2EE application.
Data
Access Object Design Pattern