mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-03 09:13:27 +00:00
Improve Factory Method Javadoc
This commit is contained in:
1 parent
516b127d21
commit
c989f6cb21
1 file changed
+8
-1
@@ -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.
|
||||
* <p>
|
||||
* 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.
|
||||
|
||||
Reference in new issue
Block a user