[design mode] Flyweight Pattern

  🔥 core Meta sharing mode reduces the memory occupied by objects by sharing the same state shared by multiple objects. The essence of meta mode is caching.   🙁 Problem scenario You are a game map modeler, building complex game maps. Now, you need to build a forest. There are thousands of trees in the forest. No tree has attributes s ...

Posted by Admin32 on Tue, 21 Dec 2021 22:20:04 +0100

[design mode] memo pattern

  🔥 core Memo mode captures the internal state of an object and saves the state outside the object, This allows you to restore the object to its original saved state later.   🙁 Problem scenario You are a poster designer twenty years ago. Recently, a powerful graphics editing software (PS) was born, and you became the first batch of PS ...

Posted by crazy/man on Tue, 21 Dec 2021 20:32:47 +0100