Skip to content

Commit 9a4f83e

Browse files
committed
Improve Prototype Javadoc
1 parent 40e378c commit 9a4f83e

File tree

1 file changed

+8
-3
lines changed
  • prototype/src/main/java/com/iluwatar/prototype

1 file changed

+8
-3
lines changed

prototype/src/main/java/com/iluwatar/prototype/App.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
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
*/
1015
public class App {

0 commit comments

Comments
 (0)