Patterns Section Index | Page 3
Which patterns were used by Sun in designing the Enterprise JavaBeans model?
Many design patterns were used in EJB, and some of them are
clearly identifiable by their naming convention. Here are several:
1. Factory Method: Define a interface for creating classes, let a ...more
Do any other major design patterns exist besides the ones described in the GoF book?
Mark Grand's books, Patterns in Java, Volume 1 (Wiley 1998) and Patterns in Java, Volume 2 (Wiley 1999) cover all the GOF as well as several that he and others have developed.
The largest critici...more
What's an example application of the Command design pattern?
There are good examples here and here.more
When would I use the delegation pattern instead of inheritence to extend a class's behavior?
Both delegation and inheritance are important
concepts in object-oriented software design,
but not everyone would label them as patterns.
In particular, the seminal book on design
patterns by the ...more
How can I make sure at most one instance of my class is ever created?
This is an instance where the Singleton design pattern would be used. You need to make the constructor private (so nobody can create an instance) and provide a static method to get the sole instan...more
What major patterns do the Java APIs utilize?
Design patterns are used and supported
extensively throughout the Java APIs. Here are
some examples:
The Model-View-Controller design pattern is
used extensively throughout the Swing API.
Th...more
What mailing lists are available about patterns?
Check out the
Patterns Mailing List page.
Calendar is an abstract class. The getInstance() method tries to instantiate GregorianCalendar() i.e., parent instantiating a derived class. This looks Non-OO? Ex: Calendar a=Calendar.getInstance(); Can somebody explain why is it so?
The Calender class is an abstact class, true, however,the point you missed is that the getInstance()
returns the " Calendar using the default timezone and locale. " , in your case, the GregorianCa...more
What is an example of a design pattern?
Following the lead of the Gang of
Four (GoF), design pattern descriptions
usually contain multiple sections including
Intent
Motivation
Applicability
Structure
Participants
Collaborat...more
Where can I learn more about design patterns?
The best place to start is the seminal work
by Erich Gamma, Richard Helm, Ralph Johnson, and
John Vlissides (collectively known as the
Gang of Four or simply
GoF) entitled ...more
How do I document a design pattern?
A pattern description must address the
following major points:
Pattern Name and Classification
A short, meaningful name for the pattern,
usually only one or two words. Names
...more
Why is the study of patterns important?
As initial software designs are implemented
and deployed, programmers often discover
improvements which make the designs more
adaptable to change. Design patterns capture
solutions that have evol...more
What is a software design pattern?
A design pattern is a
solution to a general
software problem within a
particular context.
Context
A recurring set of situations where
the pattern applies.
Problem
A system of ...more