Showing posts with label JAVA. Show all posts
Showing posts with label JAVA. Show all posts

Sunday, August 16, 2009

Quick Byte Series - Structural Patterns

Continuining with the Quick Byte Series, Lets go through the structural patterns :

Adaptor : converts the existing interface to a new interface that provides compatibility between unrelated classes and can act as wrapper

Bridge : Decouple an abstraction from its implementation so that the two can vary independently.

Composite : Compose objects into tree structures to represent part-whole hierarchies.

Decorator : Attach additional responsibilities to an object dynamically keeping the same interface. Decorators provide a flexible alternative to subclassing for extending functionality.

Facade : Make a complex system simpler by providing a general interface.

Flyweight : Use sharing to support large numbers of fine-grained objects efficiently.

Proxy : Provide a placeholder for another object to control access to it.

Thursday, August 13, 2009

Quick Byte Series - Creational Patterns

We starting a series of Quick Byte sessions where in we will try to get a quick grab of things we already know or atleast are supposed to know. In this first post, Lets get a quick view of Creational Patterns (the ones where in we are more concerned about object creation) :

Singleton : Provides single instance of the class, which is accessible throught out the application. We need to ensure that this is thread safe.

Factory Method : Provides an abstraction and let subclasses decide which class needs to be instantiated based on the provided parameters.

Abstract Factory Method : Layer above the Factory menthod. While in Factory method, we are covering for single object – here in Abstract Factory Method, we cater for multiple products.

Builder : Builder Pattern is used for creating a complex object from simple objects in a step-by-step process.

Prototype : When object creation comes with a cost, Prototype pattern comes to the rescue where in objects are cloned.