Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the reason for the name of the Flyweight Design Pattern?

Tags:

I'm a non native English speaker, and trying to grasp a better understanding of that design pattern, I'm interested in the origin of that word for naming a pattern. What are the motivations for that name?

As far I know the flyweight design pattern is concerned with a way to support large number of fine-grained objects using sharing.

However, the definitions I'd found for that specific word (flyweight) refers to the boxing category of weight of less than 112 pounds.

So, why the pattern is called in this way?

Sorry if this seems foolish, but I really have no clue.

like image 485
Alex. S. Avatar asked Dec 07 '10 19:12

Alex. S.


People also ask

Why is the flyweight design pattern used?

Flyweight pattern is primarily used to reduce the number of objects created and to decrease memory footprint and increase performance. This type of design pattern comes under structural pattern as this pattern provides ways to decrease object count thus improving the object structure of application.

What is the meaning of Flyweight pattern?

In computer programming, the flyweight software design pattern refers to an object that minimizes memory usage by sharing some of its data with other similar objects. The flyweight pattern is one of twenty-three well-known GoF design patterns.

Is flyweight a design pattern?

Flyweight is a structural design pattern that lets you fit more objects into the available amount of RAM by sharing common parts of state between multiple objects instead of keeping all of the data in each object.

What is flyweight design pattern in Java?

Flyweight is a structural design pattern that allows programs to support vast quantities of objects by keeping their memory consumption low. The pattern achieves it by sharing parts of object state between multiple objects. In other words, the Flyweight saves RAM by caching the same data used by different objects.


1 Answers

Flyweight is a boxing category, for light weight people.

Flyweight pattern is for "light weight" objects (though many of them).

like image 119
Oded Avatar answered Oct 01 '22 18:10

Oded