Skip to content

Latest commit

 

History

History

Flyweight

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Flyweight

Flyweight pattern is used to reduce the number of objects created and to increase performance. It will use already existing similar kind of object by storing them and creates new object when it's not found.

base

For example, we will make simple game that use 2 sides of player, terrorist and counter-terrorist. We will generate these players with Flyweight pattern.

example

Source