Prototype

xiaoxiao2021-03-06  102

BenefitsIt lets you add or remove objects at runtime.It lets you specify new objects by varying its values ​​or structure.It reduces the need for subclassing.It lets you dynamically configure an application with classes.

Applicable ScenariosThe classes to instantiate are specified at runtime.You need to avoid building a class hierarchy of factories that parallels the hierarchy of objects.Instances of the class have one of only a few different combinations of state.

转载请注明原文地址:https://www.9cbs.com/read-124962.html

New Post(0)