Design Patterns

Command Design Pattern — step-by-step Programming tutorial on Progressive Robot

Command Design Pattern

Command Pattern is one of the Behavioral Design Pattern. Command design pattern is used to implement loose coupling in a request-response model. Command Pattern ![command design pattern, command pattern](images/command-design-pattern-section-1.png) In command pattern, the request is send to the invoker and invoker pass it to the encapsulated command object. Command object passes the request to the […]

Read more
State Design Pattern in Java — step-by-step Programming tutorial on Progressive Robot

State Design Pattern in Java

URL: https://www.progressiverobot.com/state-design-pattern-java/ State design pattern is one of the behavioral design pattern. State design pattern is used when an Object change its behavior based on its internal state. State Design Pattern ![state design pattern, state design pattern in java, state pattern](images/state-design-pattern-java-section-1.png) If we have to change the behavior of an object based on its state, […]

Read more
Composite Design Pattern in Java — step-by-step Programming tutorial on Progressive Robot

Composite Design Pattern in Java

Composite pattern is one of the Structural design pattern. Composite design pattern is used when we have to represent a part-whole hierarchy. Composite Design Pattern ![composite pattern, composite design pattern](images/composite-design-pattern-in-java-section-1.png) When we need to create a structure in a way that the objects in the structure has to be treated the same way, we can […]

Read more
Strategy Design Pattern in Java - Example Tutorial — step-by-step Programming tutorial on Progressive Robot

Strategy Design Pattern in Java – Example Tutorial

URL: https://www.progressiverobot.com/strategy-design-pattern-in-java-example-tutorial/ Strategy design pattern is one of the behavioral design pattern. Strategy pattern is used when we have multiple algorithm for a specific task and client decides the actual implementation to be used at runtime. Strategy Pattern ![strategy pattern, strategy design pattern](images/strategy-design-pattern-in-java-example-tutorial-section-1.png) Strategy pattern is also known as Policy Pattern. We define multiple algorithms […]

Read more
DAO Design Pattern — step-by-step Programming tutorial on Progressive Robot

DAO Design Pattern

DAO stands for Data Access Object. DAO [Design Pattern](/community/tutorials/java-design-patterns-example-tutorial) is used to separate the data persistence logic in a separate layer. This way, the service remains completely in dark about how the low-level operations to access the database is done. This is known as the principle of Separation of Logic. DAO Design Pattern With DAO […]

Read more
Template Method Design Pattern in Java — step-by-step Programming tutorial on Progressive Robot

Template Method Design Pattern in Java

URL: https://www.progressiverobot.com/template-method-design-pattern-in-java/ Template Method is a behavioral design pattern. Template Method design pattern is used to create a method stub and deferring some of the steps of implementation to the subclasses. Template Method Design Pattern Template method defines the steps to execute an algorithm and it can provide default implementation that might be common for […]

Read more
Decorator Design Pattern in Java Example — step-by-step Programming tutorial on Progressive Robot

Decorator Design Pattern in Java Example

Decorator design pattern is used to modify the functionality of an object at runtime. At the same time other instances of the same class will not be affected by this, so individual object gets the modified behavior. Decorator design pattern is one of the structural design pattern (such as [Adapter Pattern](/community/tutorials/adapter-design-pattern-java "Adapter Design Pattern in […]

Read more
Thread Safety in Java Singleton Classes — step-by-step Programming tutorial on Progressive Robot

Thread Safety in Java Singleton Classes

Singleton is one of the most widely used creational design pattern to restrict the object creation by applications. In real world applications, resources like Database connections or Enterprise Information Systems (EIS) are limited and should be used wisely to avoid any resource crunch. To achieve this, we can implement Singleton design pattern to create a wrapper class around the resource and limit the number of object created at runtime to one.

Read more
Facade Design Pattern in Java — step-by-step Programming tutorial on Progressive Robot

Facade Design Pattern in Java

Facade Design Pattern is one of the Structural design patterns (such as [Adapter pattern](/community/tutorials/adapter-design-pattern-java "Adapter Design Pattern in Java – Example Tutorial") and [Decorator pattern](/community/tutorials/decorator-design-pattern-in-java-example "Decorator Pattern in Java – Example Tutorial")). Facade design pattern is used to help client applications to easily interact with the system. Facade Design Pattern ![facade design pattern, facade pattern, […]

Read more
Visitor Design Pattern in Java — step-by-step Programming tutorial on Progressive Robot

Visitor Design Pattern in Java

URL: https://www.progressiverobot.com/visitor-design-pattern-java/ Visitor Design Pattern is one of the behavioral design pattern. Visitor Design Pattern Visitor pattern is used when we have to perform an operation on a group of similar kind of Objects. With the help of visitor pattern, we can move the operational logic from the objects to another class. For example, think […]

Read more
CHAT