Posts

C# | Chain of Responsibility Design Pattern | Behavioral Design Pattern

Image
The chain of responsibility pattern creates a chain of receiver objects for a request. This pattern decouples sender and receiver of a request based on type of request. This pattern comes under behavioral patterns. In this pattern, normally each receiver contains reference to another receiver. If one object cannot handle the request, then it passes the same to the next receiver and so on. UML Diagram - Who is what? The classes, interfaces and objects in the above class diagram can be identified as follows: 1.       Approver - Handler abstract class. 2.       Clerk, Assistant Manager & Manager - ConcreteHandler classes. 3.       Loan & LoanEventArgs - These classes are used for internal processing and holds request details.

C# | Proxy Design Pattern | Structural Design Pattern

C# | Flyweight Design Pattern | Structural Design Pattern

C# | Facade Design Pattern | Structural Design Pattern

C# | Decorator Design Pattern | Structural Design Pattern

C# | Composite Design Pattern | Structural Design Pattern

C# | Bridge Design Pattern | Structural Design Pattern

Image
Bridge pattern is used to separate an abstraction from its implementation so that both can be modified independently. This pattern involves an interface which acts as a bridge between the abstraction class and implementer classes and also makes the functionality of implementer class independent from the abstraction class. Both types of classes can be modified without affecting to each other. Bridge Pattern - UML Diagram & Implementation The UML class diagram for the implementation of the bridge design pattern is given below: The classes, interfaces and objects in the above UML class diagram are as follows: 1.       Abstraction This is an abstract class and containing members that define an abstract business object and its functionality. It contains a reference to an object of type Bridge. It can also acts as the base class for other abstractions. 2.       Redefined Abstraction This is a class which inherits from the Abstraction c...