.circleci
.github
.mvn
abstract-document
abstract-factory
active-object
acyclic-visitor
adapter
aggregator-microservices
ambassador
api-gateway
arrange-act-assert
async-method-invocation
balking
bridge
builder
business-delegate
bytecode
caching
callback
chain-of-responsibility
circuit-breaker
cloud-claim-check-pattern
cloud-static-content-hosting
collection-pipeline
combinator
command
commander
composite
composite-entity
composite-view
converter
cqrs
dao
data-bus
data-locality
data-mapper
data-transfer-object
decorator
delegation
dependency-injection
dirty-flag
domain-model
double-buffer
double-checked-locking
double-dispatch
eip-aggregator
eip-message-channel
eip-publish-subscribe
eip-splitter
eip-wire-tap
etc
event-aggregator
event-asynchronous
event-driven-architecture
event-queue
event-sourcing
execute-around
extension-objects
facade
factory
factory-kit
factory-method
etc
factory-method.urm.png
factory-method.urm.puml
src
.gitignore
README.md
pom.xml
fanout-fanin
feature-toggle
filterer
fluentinterface
flux
flyweight
front-controller
game-loop
guarded-suspension
half-sync-half-async
hexagonal
intercepting-filter
interpreter
iterator
layers
lazy-loading
leader-election
leader-followers
localization
lockable-object
marker
master-worker-pattern
mediator
memento
metadata-mapping
model-view-controller
model-view-presenter
model-view-viewmodel
module
monad
monitor
monostate
multiton
mute-idiom
naked-objects
null-object
object-mother
object-pool
observer
page-object
parameter-object
partial-response
pipeline
poison-pill
presentation
priority-queue
private-class-data
producer-consumer
promise
property
prototype
proxy
queue-load-leveling
reactor
reader-writer-lock
registry
repository
resource-acquisition-is-initialization
retry
role-object
saga
separated-interface
servant
serverless
service-layer
service-locator
sharding
singleton
spatial-partition
special-case
specification
state
step-builder
strangler
strategy
subclass-sandbox
table-module
template-method
thread-pool
throttling
tls
tolerant-reader
trampoline
transaction-script
twin
typeobjectpattern
unit-of-work
update-method
value-object
version-number
visitor
.all-contributorsrc
.gitignore
CONTRIBUTING.MD
LICENSE.md
PULL_REQUEST_TEMPLATE.md
README.md
checkstyle-suppressions.xml
gpl-3.0.txt
lgpl-3.0.txt
license-plugin-header-style.xml
lombok.config
mvnw
mvnw.cmd
pom.xml
56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
![]() |
@startuml
|
||
|
package com.iluwatar.factory.method {
|
||
|
class App {
|
||
|
- LOGGER : Logger {static}
|
||
|
- blacksmith : Blacksmith
|
||
|
+ App(blacksmith : Blacksmith)
|
||
|
+ main(args : String[]) {static}
|
||
|
- manufactureWeapons()
|
||
|
}
|
||
|
interface Blacksmith {
|
||
|
+ manufactureWeapon(WeaponType) : Weapon {abstract}
|
||
|
}
|
||
|
class ElfBlacksmith {
|
||
|
- ELFARSENAL : Map<WeaponType, ElfWeapon> {static}
|
||
|
+ ElfBlacksmith()
|
||
|
+ manufactureWeapon(weaponType : WeaponType) : Weapon
|
||
|
}
|
||
|
class ElfWeapon {
|
||
|
- weaponType : WeaponType
|
||
|
+ ElfWeapon(weaponType : WeaponType)
|
||
|
+ getWeaponType() : WeaponType
|
||
|
+ toString() : String
|
||
|
}
|
||
|
class OrcBlacksmith {
|
||
|
- ORCARSENAL : Map<WeaponType, OrcWeapon> {static}
|
||
|
+ OrcBlacksmith()
|
||
|
+ manufactureWeapon(weaponType : WeaponType) : Weapon
|
||
|
}
|
||
|
class OrcWeapon {
|
||
|
- weaponType : WeaponType
|
||
|
+ OrcWeapon(weaponType : WeaponType)
|
||
|
+ getWeaponType() : WeaponType
|
||
|
+ toString() : String
|
||
|
}
|
||
|
interface Weapon {
|
||
|
+ getWeaponType() : WeaponType {abstract}
|
||
|
}
|
||
|
enum WeaponType {
|
||
|
+ AXE {static}
|
||
|
+ SHORT_SWORD {static}
|
||
|
+ SPEAR {static}
|
||
|
+ UNDEFINED {static}
|
||
|
- title : String
|
||
|
+ toString() : String
|
||
|
+ valueOf(name : String) : WeaponType {static}
|
||
|
+ values() : WeaponType[] {static}
|
||
|
}
|
||
|
}
|
||
|
ElfWeapon --> "-weaponType" WeaponType
|
||
|
OrcWeapon --> "-weaponType" WeaponType
|
||
|
App --> "-blacksmith" Blacksmith
|
||
|
ElfBlacksmith ..|> Blacksmith
|
||
|
ElfWeapon ..|> Weapon
|
||
|
OrcBlacksmith ..|> Blacksmith
|
||
|
OrcWeapon ..|> Weapon
|
||
|
@enduml
|