Java Design Patterns – A Short Writeup

A design pattern is a general, language-independent technique used to solve a class of related problems. A design pattern is a widely accepted solution to a recurring design problem. It is a guideline rather than a specific solution.

An idiom, by contrast, is a low-level pattern that is specific to a programming language.

There are three basic classification of patterns: Creational, Structural and Behavioural.

Creational Patterns
Creational patterns provide/deal with different mechanisms for creation of objects. Creational patterns create the objects for you, rather than you having to instantiate them yourselves. This gives your program more flexibility in deciding which objects need to be created for a given case.

Structural Patterns
Structural Patterns describe how to compose objects and classes to form structures. They are broadly classified as object patterns and class patterns. Class patterns describe relationships with the help of inheritance. Object patterns describe how objects can be composed to form larger structures.

Behavioural Patterns
Behavioural patterns describe various means of communication between collaborating objects in the system. This ensures that the objects are loosely coupled thus avoiding hard-coding and dependencies. They also define how the flow is controlled in a complex application.

This entry was posted in Java and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s