原型模式




原型模式是创建型模式的一种,其特点在于通过「复制」一个已经存在的实例来返回新的实例,而不是新建实例。被复制的实例就是我们所称的「原型」,这个原型是可定制的。
原型模式多用于创建复杂的或者耗时的实例,因为这种情况下,复制一个已经存在的实例使进程运行更高效;或者创建值相等,只是命名不一样的同类数据。
网站首页 情感咨询 情感美文 情感百科 情感生活 学习充电 旧版美文
| 词汇 | Prototype pattern |
| 分类 | 英语词汇 英语翻译词典 |
| 释义 |
Prototype pattern
中文百科
原型模式![]() ![]() ![]() ![]() 原型模式是创建型模式的一种,其特点在于通过「复制」一个已经存在的实例来返回新的实例,而不是新建实例。被复制的实例就是我们所称的「原型」,这个原型是可定制的。 原型模式多用于创建复杂的或者耗时的实例,因为这种情况下,复制一个已经存在的实例使进程运行更高效;或者创建值相等,只是命名不一样的同类数据。
英语百科
Prototype pattern 原型模式![]() ![]() ![]() ![]() The prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. This pattern is used to: To implement the pattern, declare an abstract base class that specifies a pure virtual clone() method. Any class that needs a "polymorphic constructor" capability derives itself from the abstract base class, and implements the clone() operation. |
| 随便看 |
|
依恋情感网英汉例句词典收录3870147条英语例句词条,基本涵盖了全部常用英语单词的释义及例句,是英语学习的有利工具。