Sunday, December 16, 2018

Chain of Responsibility Pattern

Chain of Responsibility Pattern (Behavioral Patterns) describes how we handle a single request by a chain of multiple handler objects. The request has to be processed by only one handler object from this chain. If the current handler object is able to process the request, then the request will be processed in the current handler object; otherwise, the current handler object needs to shirk responsibility and push the request to the next chain handler object.


Thursday, December 13, 2018

Factory Method is Creational Pattern. It define an interface which will creating an object, but let subclasses decide which class to instantiate. Factory method pattern returns the instance of a class at run-time depends on the condition/login users/role of user and so on.