Category: Java

Iterator Pattern in Java

3 Introduction Normally every object-oriented programming language or otherwise has several data structures or collections of data that are used to hold together large chunks of valuable information but in independent identities. In order to retrieve information from such collections, a tool is required that will access all the information. The role of an iterator […]

Continue Reading

Memento Pattern in Java

3 The concept of this pattern borrows from the meaning of a memento that is normally a remembrance of someone or something from the past. This pattern falls behavioural design patterns as it plays a crucial role in manipulating or changing the state of an object at a certain time. The Memento pattern works towards […]

Continue Reading

Command Pattern

2 Introduction The command pattern is a complex behavioural design pattern that encapsulates all the necessary data for a request under an object. In simpler words, the command pattern is a design pattern that actively converts requests into objects with the commands and method calls of the request embedded in the command object itself. Work […]

Continue Reading

Visitor Design Pattern

2 The Visitor Design Pattern is part of Behavioural Design Patterns in object-oriented programming and is invoked when there are several similar objects in hand on which a certain operation is to be performed. As this pattern is responsible for maintaining communication between two or more objects, it makes sure there is as less coupling […]

Continue Reading

Template Design Pattern in Java

2 The Template Method Design Pattern in Java is an important design pattern that belongs to the group of Behavioural design patterns. This pattern is commonly used whenever a certain algorithm of method creation has to be defined and made a skeleton such that other subclasses can inherit the methods and extend their functionalities and […]

Continue Reading

Strategy Design Pattern in Java

1 Strategy Design Pattern is an important part of Behavioural Designs Patterns in JAVA. The word ‘strategy’ becomes key to be able to understand how this pattern works. A problem can be solved by applying various strategies. Even if all strategies deliver the required output, it is imperative that the most efficient strategy is used […]

Continue Reading

State Design Pattern in Java

1 As this pattern closely follows the behaviour of a particular object, State Design Pattern falls under the Behavioural Design Pattern section. This pattern studies any behavioural changes in an object that will subsequently cause its state to change as well. Lower coupling is promoted when this pattern is implemented. If the context object changes […]

Continue Reading

Singleton Pattern in Java

4 Singleton Pattern is regarded as one of the most fundamental design patterns of JAVA. The name draws from the mathematical idea of a singleton set that only has one element in it. It is its own super-set as well as subset. On mapping it to JAVA, by definition, a Singleton pattern is established when […]

Continue Reading

Prototype Design Pattern in Java

3 This design pattern works to the truest sense of the word ‘Prototype’. Another one of the creational design patterns, the Prototype Design Pattern finds use, where there is a requirement of creating numerous objects, and all of them, will have same or similar attributes. In such cases, a prototype object is created with generalized […]

Continue Reading

Translate »