File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
factory-method/src/main/java/com/iluwatar/factory/method Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 22
33/**
44 *
5- * In Factory Method we have an interface ({@link Blacksmith}) with a method for
5+ * The Factory Method is a creational design pattern which uses factory methods to deal
6+ * with the problem of creating objects without specifying the exact class of object
7+ * that will be created. This is done by creating objects via calling a factory
8+ * method either specified in an interface and implemented by child classes, or implemented
9+ * in a base class and optionally overridden by derived classes—rather than by calling a
10+ * constructor.
11+ * <p>
12+ * In this Factory Method example we have an interface ({@link Blacksmith}) with a method for
613 * creating objects ({@link Blacksmith#manufactureWeapon}). The concrete subclasses
714 * ({@link OrcBlacksmith}, {@link ElfBlacksmith}) then override the method to produce
815 * objects of their liking.
You can’t perform that action at this time.
0 commit comments