Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.04 KB

README.rst

File metadata and controls

57 lines (39 loc) · 1.04 KB

Purpose

To minimise memory usage, a Flyweight shares as much as possible memory with similar objects. It is needed when a large amount of objects is used that don't differ much in state. A common practice is to hold state in external data structures and pass them to the flyweight object when needed.

UML Diagram

Alt Flyweight UML Diagram

Code

You can also find this code on GitHub

Text.php

Text.php

Word.php

Word.php

Character.php

Character.php

TextFactory.php

TextFactory.php

Test

Tests/FlyweightTest.php

Tests/FlyweightTest.php