Design Pattern: Flyweight Pattern

As we need to generate a huge number of objects of the same class, so it will occupy a big amount of memory. To avoid that, we can create objects with only the required elements and keep that in a cache. As only the required properties are there so the number of objects will be smaller now. As the only difference between those objects is their extrinsic properties, we will pass those properties while using that specific object.

Design Pattern: Facade Pattern

Facade pattern adds a new layer to the system, on top of the underlying complex subsystems. This new layer works as an entry point for the client. The client can interact with this new layer, instead of communicating with the subsystems directly. That way the client does not need to be aware of the subsystems and gets a common interface.