From c989f6cb219ba38ee0c2a76852065095f762f9a8 Mon Sep 17 00:00:00 2001 From: Ilkka Seppala Date: Sat, 3 Oct 2015 21:14:40 +0300 Subject: [PATCH] Improve Factory Method Javadoc --- .../src/main/java/com/iluwatar/factory/method/App.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/factory-method/src/main/java/com/iluwatar/factory/method/App.java b/factory-method/src/main/java/com/iluwatar/factory/method/App.java index 69bda3489..118413564 100644 --- a/factory-method/src/main/java/com/iluwatar/factory/method/App.java +++ b/factory-method/src/main/java/com/iluwatar/factory/method/App.java @@ -2,7 +2,14 @@ package com.iluwatar.factory.method; /** * - * In Factory Method we have an interface ({@link Blacksmith}) with a method for + * The Factory Method is a creational design pattern which uses factory methods to deal + * with the problem of creating objects without specifying the exact class of object + * that will be created. This is done by creating objects via calling a factory + * method either specified in an interface and implemented by child classes, or implemented + * in a base class and optionally overridden by derived classes—rather than by calling a + * constructor. + *

+ * In this Factory Method example we have an interface ({@link Blacksmith}) with a method for * creating objects ({@link Blacksmith#manufactureWeapon}). The concrete subclasses * ({@link OrcBlacksmith}, {@link ElfBlacksmith}) then override the method to produce * objects of their liking.