Added comments for Abstract Factory example.

This commit is contained in:
Ilkka Seppala 2014-08-31 00:15:47 +03:00
parent 601bd6bb98
commit 5aead88e5e
4 changed files with 24 additions and 0 deletions

View File

@ -1,5 +1,14 @@
package com.iluwatar;
/**
*
* The essence of the Abstract Factory pattern is a factory interface (KingdomFactory)
* and its implementations (ElfKingdomFactory, OrcKingdomFactory).
*
* The example uses both concrete implementations to create a king, a castle and an
* army.
*
*/
public class App
{
public static void main( String[] args )

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* Concrete factory.
*
*/
public class ElfKingdomFactory implements KingdomFactory {
public Castle createCastle() {

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* The factory interface.
*
*/
public interface KingdomFactory {
Castle createCastle();

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* Concrete factory.
*
*/
public class OrcKingdomFactory implements KingdomFactory {
public Castle createCastle() {