Skip to content

Commit 5aead88

Browse files
committed
Added comments for Abstract Factory example.
1 parent 601bd6b commit 5aead88

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

abstract-factory/src/main/java/com/iluwatar/App.java

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

3+
/**
4+
*
5+
* The essence of the Abstract Factory pattern is a factory interface (KingdomFactory)
6+
* and its implementations (ElfKingdomFactory, OrcKingdomFactory).
7+
*
8+
* The example uses both concrete implementations to create a king, a castle and an
9+
* army.
10+
*
11+
*/
312
public class App
413
{
514
public static void main( String[] args )

abstract-factory/src/main/java/com/iluwatar/ElfKingdomFactory.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.
6+
*
7+
*/
38
public class ElfKingdomFactory implements KingdomFactory {
49

510
public Castle createCastle() {

abstract-factory/src/main/java/com/iluwatar/KingdomFactory.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+
* The factory interface.
6+
*
7+
*/
38
public interface KingdomFactory {
49

510
Castle createCastle();

abstract-factory/src/main/java/com/iluwatar/OrcKingdomFactory.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.
6+
*
7+
*/
38
public class OrcKingdomFactory implements KingdomFactory {
49

510
public Castle createCastle() {

0 commit comments

Comments
 (0)