Commented prototype example.

This commit is contained in:
Ilkka Seppala 2014-08-31 08:39:08 +03:00
parent 2038d69d92
commit ed81bcf69b
3 changed files with 17 additions and 0 deletions

View File

@ -1,5 +1,12 @@
package com.iluwatar;
/**
*
* In Prototype we have a factory class (HeroFactoryImpl) producing
* objects by cloning existing ones. In this example the factory's
* prototype objects are given as constructor parameters.
*
*/
public class App
{
public static void main( String[] args )

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* Interface for the factory class.
*
*/
public interface HeroFactory {
Mage createMage();

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* Concrete factory class.
*
*/
public class HeroFactoryImpl implements HeroFactory {
private Mage mage;