• 19 September

    Adapter design pattern in java

    CodeProjectReal life example: A very simple example is using phone charger. Suppose your mobile phone needs 9 Volts of supply to get charged but main supply is 220 V which is not what you require but it can be a source and you can have something that can get 9 V out of this 220 […]

  • 19 September

    Bridge design pattern in java

    As stated by Gof: “Decouple an abstraction from its implementation so that the two can vary independently”.When there are inheritance hierarchies in both interface and implementation then you loose coupling because of interdependence.In other words,Decoupling interface from implementation and hiding implementation detail of abstraction from client is main objectives of bridge design pattern. Also known […]

  • 12 July

    Decorator Design Pattern

    The Decorator design pattern attach additional responsibilities to an object dynamically.It is wrap up at another object.It will extend functionality of object without affecting any other object.Decorators provide a alternative to subclassing for extending functionality. Also known as: Wrapper When to use it: Use Decoraotor to add responsibilities to individual objects dynamically without affecting other […]