Factory pattern – Design Patterns in Java/J2EE

java-thumbnail

Creational pattern deals with the creation of objects and it hides the complex logic involved in the object creation object from the clients. One of the common creational patterns is the Factory pattern and it is used extensively in Applications. Let us understand what factors should be considered in mind while designing a Factory pattern […]

Singleton Pattern – Design Patterns in Java/J2EE

java-thumbnail

Situations often will demand for the existence of only one object for a particular class in an Application. For example, the existence of only one Database Connection for a particular session, one object referencing the set of Global properties being shared across the various modules, etc. Such classes are candidates to be designated as Singleton […]

Template method Pattern – Design Patterns in Java/J2EE

java-thumbnail

A Template method pattern provides a skeleton for performing any sort of algorithm or an operation, and it allows the sub-classes to re-define part of the logic. Let us directly get into an example to clarify things in a much better manner. For example, if we wish to write a String Decorator class, which decorates […]

State Design Pattern Java Example

java-thumbnail

State design pattern falls under the category of Behavioural patterns. Assume that we have an object and its behavior is largely dependent on the state of its internal variables. State pattern allows, object to behave in different ways depends on the internal state. State pattern is defined in the book Gang of four is, Allows an […]

Close
Please support the site
By clicking any of these buttons you help our site to get better