File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
prototype/src/main/java/com/iluwatar/prototype Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 22
33/**
44 *
5- * In Prototype we have a factory class ({@link HeroFactoryImpl}) producing objects by
6- * cloning the existing ones. In this example the factory's prototype objects are
7- * given as constructor parameters.
5+ * The Prototype pattern is a creational design pattern in software development. It is
6+ * used when the type of objects to create is determined by a prototypical instance,
7+ * which is cloned to produce new objects. This pattern is used to:
8+ * - avoid subclasses of an object creator in the client application, like the abstract factory pattern does.
9+ * - avoid the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword)
10+ * <p>
11+ * In this example we have a factory class ({@link HeroFactoryImpl}) producing objects by
12+ * cloning the existing ones. The factory's prototype objects are given as constructor parameters.
813 *
914 */
1015public class App {
You can’t perform that action at this time.
0 commit comments