[DRAFT] FlyWeight Design Pattern

Scope

In this wiki, I will walk you around the places in which FlyWeight design pattern is used.

Introduction

Flyweight design pattern is used when we are creating a large number of similar objects. The logic behind this design pattern is to group all similar properties and reduce memory usage.

Objects created may have some properties common across all objects. These properties are known as intrinsic properties. We can create one model object which has all the common properties and share it across all objects. The properties which are unique to each object is known as extrinsic properites.

Example

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s