X Tutup
Skip to content

Commit ed81bcf

Browse files
committed
Commented prototype example.
1 parent 2038d69 commit ed81bcf

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* In Prototype we have a factory class (HeroFactoryImpl) producing
6+
* objects by cloning existing ones. In this example the factory's
7+
* prototype objects are given as constructor parameters.
8+
*
9+
*/
310
public class App
411
{
512
public static void main( String[] args )

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Interface for the factory class.
6+
*
7+
*/
38
public interface HeroFactory {
49

510
Mage createMage();

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Concrete factory class.
6+
*
7+
*/
38
public class HeroFactoryImpl implements HeroFactory {
49

510
private Mage mage;

0 commit comments

Comments
 (0)
X Tutup