Patterns Section Index | Page 3
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
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
There are good examples here and here.more
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
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
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
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
Following the lead of the Gang of Four (GoF), design pattern descriptions usually contain multiple sections including Intent Motivation Applicability Structure Participants Collaborat...more
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
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
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
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