package com.iluwatar.prototype;

/**
 * 
 * In Prototype we have a factory class ({@link HeroFactoryImpl}) producing objects by
 * cloning the existing ones. In this example the factory's prototype objects are
 * given as constructor parameters.
 * 
 */
public class App {

	/**
	 * Program entry point
	 * @param args command line args
	 */
	public static void main(String[] args) {
		HeroFactory factory;
		Mage mage;
		Warlord warlord;
		Beast beast;

		factory = new HeroFactoryImpl(new ElfMage(), new ElfWarlord(),
				new ElfBeast());
		mage = factory.createMage();
		warlord = factory.createWarlord();
		beast = factory.createBeast();
		System.out.println(mage);
		System.out.println(warlord);
		System.out.println(beast);

		factory = new HeroFactoryImpl(new OrcMage(), new OrcWarlord(),
				new OrcBeast());
		mage = factory.createMage();
		warlord = factory.createWarlord();
		beast = factory.createBeast();
		System.out.println(mage);
		System.out.println(warlord);
		System.out.println(beast);
	}
}

@@ -41,19 +41,487 @@
 %0A * 
-In Prototyp
+The Prototype pattern is a creational design pattern in software development. It is %0A * used when the type of objects to create is determined by a prototypical instance, %0A * which is cloned to produce new objects. This pattern is used to:%0A * - avoid subclasses of an object creator in the client application, like the abstract factory pattern does.%0A * - avoid the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword)%0A * %3Cp%3E%0A * In this exampl
 e we
@@ -623,25 +623,9 @@
 es. 
-In this example t
+T
 he f
@@ -654,19 +654,16 @@
 ects are
-%0A *
  given a

Improve Prototype Javadoc