behavioral
-
MediatorModeling/DesignPattern 2020. 3. 1. 19:07
1. Overview Mediator encapsulates how a set of objects interact with each other. Due to this encapsulation, there is a loose coupling between the interacting objects. Typically an object explicitly knows about other objects to which it wants to interact i.e. to call a method. In mediator pattern this interaction is within the mediator object and interacting objects only know about the mediator o..
-
MementoModeling/DesignPattern 2020. 3. 1. 19:07
1. Overview When we want to store an object's state without exposing internal details about the state then we can use memento design pattern. The main intent behind saving state is often because we want to restore the object to a saved state Using memento we can ask an object to give its state as a single, sealed object and store it for later use. This object should not expose the state for modi..
-
Chain of responsibilityModeling/DesignPattern 2020. 2. 29. 19:06
1. Overview We need to avoid coupling the code which sends a request to the code which handles that request. Typically the code which wants some request handled calls the exact method on an exact object to processing it, thus the tight coupling. Chain of responsibility solves this problem by giving more than one object, chance to process the request. We create objects which are chained together ..
-
IteratorModeling/DesignPattern 2020. 2. 29. 19:01
1. Overview Iterator allows a way to access elements/children of an aggregate object in sequence while hiding the actual internal data structure used. In Java language, iterators are an integral part of collection frameworks and they are implementations of this design pattern. Iterators are stateful, meaning an iterator object remembers its position while iterating Iterators can become out of sy..
-
CommandModeling/DesignPattern 2020. 2. 29. 16:29
1. Overview We want to represent a request or a method call as an object. Information about parameters passed and the actual operation is encapsulated in an object called command. The advantage of a command pattern is that what would have been a method call is now an object which can be stored for later execution or sent to other parts of code. We can now even queue our command objects and execu..
-
StateModeling/DesignPattern 2020. 2. 26. 00:43
1. Overview State pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes. This pattern is close to the concept of finite-state machines. The state pattern can be interpreted as a strategy pattern, which is able to switch a strategy through invocations of methods defined in the pattern's interface. State design pattern allows ou..
-
StrategyModeling/DesignPattern 2020. 2. 26. 00:42
1. Overview Strategy pattern allows us to encapsulate an algorithm in a class. So we can configure our context or main object with an object of this class, to change the algorithm used to perform given operation. This is helpful if you have many possible variations of an algorithm. A good indication for the applicability of strategy pattern is if we find different algorithms/behaviors in our met..
-
Categorizing Design PatternModeling/DesignPattern 2019. 9. 29. 17:32
1. Overview Design patterns are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs and interactions of objects. The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized into three groups: Creational, Structural, and Behavioral 2. Description 2.1 Cr..