Design Pattern: Iterator Pattern in Java
Iterator pattern is used to traverse and iterate through a list of items. This article demonstrates Iterator pattern implementations in Java.
Design Pattern Tutorials
Iterator pattern is used to traverse and iterate through a list of items. This article demonstrates Iterator pattern implementations in Java.
Interpreter pattern is used when we need to represent some language expression or syntax in an Object-Oriented way. Like representing some logical operation or SQL syntax.Based on the implementation this design pattern can evaluate a specific language syntax, and provide the desired response.
Interpreter pattern is used to represent any language operation in Object Oriented Programming context. This article demonstrates Interpreter pattern implementations in Java.
Command pattern is used to encapsulate/wrap a command in an object so that the object can be sent as a parameter and can be used in other places. This article demonstrates Command pattern implementations in Java. Check the following examples.
Command pattern wraps a request/command in an object. Then we can pass the object anywhere and later when we want to execute the command the object can be used.
Chain of Responsibility pattern is used to decouple the request and response handling. Multiple objects create a chain that is used to handle a request. This article demonstrates Chain of Responsibility pattern implementations in Java. Check the following examples.
Chain of Responsibility pattern forms a chain of objects that is responsible for handling a command/operation request. As the responsibility is distributed into one or more objects and a single object is not responsible for handling a request, so that ensures the decoupling of the request sender and processor. The request is sent to the chain of objects without specifying the handler. Which object will handle the request is not predefined, that is decided on-the-fly while processing.
Prototype pattern defines the process of cloning an existing object and creating a new object from that. When we want to simplify the creation process of an object and optimize the performance of object creation, we can clone an existing object and create a new one from that.
Builder pattern is used to hide the complexity of building complex objects from the client and also this pattern is responsible for building objects step-by-step. This article demonstrates Builder pattern implementations in Java.
When we need to construct a complex object, then Builder Pattern comes into play. Builder Pattern will hide the complexity of the object construction from the user. Builder Pattern will allow the complex object to be built step-by-step.