Java/J2EE Design Patterns Interview Questions You'll Most Likely Be Asked: Second Edition
Java/J2EE Design Patterns Interview Questions You'll Most Likely Be Asked: Second Edition
Patterns Interview
Questions
Review these typical interview questions and think about how you would
answer them. Read the answers listed; you will find best possible answers
along with strategies and suggestions.
This page is intentionally left blank
Chapter 1
Introduction to Design
2: What are the types of Java Design Patterns? Explain each one
in detail.
Answer:
There are three types of design patterns supported by Java. They
are as follows:
a) Creational – These design patterns provide different ways
of creating an object of a class without using the new
operator. Some examples are Factory method, Prototype,
Singleton, etc.
b) Behavioral – These design patterns control how objects
communicate with each other and assign responsibility to
objects. Some examples are Chain of Responsibility, Iterator,
Mediator, etc.
c) Structural – These design patterns help to change the
structure of an object or convert the object into a different
form. Example Adapter, Decorator, Proxy, etc.
3: What are the types of J2EE Design Patterns? Give some
examples of each.
Answer:
J2EE Design Patterns can be classified based on the tier on which
they operate that is Design patterns for Presentation Tier, Business
Tier and Integration tier. Some examples of each are as follows:
a) Presentation Tier – Front Controller Design Pattern, View
Helper Design pattern, Intercepting Filter Design Pattern,
Context Object Design Pattern, etc.
b) Business Tier – Business Delegate Design Pattern, Data
Transfer Object Design Pattern, Service Locator Design
Pattern, Value List Handler Design Pattern, etc.
c) Integration Tier – Data Access Object Pattern and Service
Activator Pattern.