Prototype它是创造性的设计模式之一。用于创建给定对象的重复/浅副本。当直接创建对象成本高昂时,此模式很有用,例如:如果在查询大型数据库后创建对象,则一次又一次地创建该对象在性能方面并不经济。因此,一旦创建了对象,我们就缓存该对象,并且在将来需要相同的 1