Files
.github
abstract-document
abstract-factory
acyclic-visitor
adapter
aggregator-microservices
ambassador
api-gateway
arrange-act-assert
async-method-invocation
balking
bridge
builder
business-delegate
bytecode
caching
callback
chain
circuit-breaker
collection-pipeline
combinator
command
commander
composite
converter
cqrs
dao
data-bus
data-locality
data-mapper
data-transfer-object
decorator
delegation
dependency-injection
dirty-flag
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-kit
factory-method
feature-toggle
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
marker
master-worker-pattern
mediator
memento
model-view-controller
model-view-presenter
module
monad
monostate
multiton
mute-idiom
mutex
naked-objects
null-object
object-mother
object-pool
observer
page-object
partial-response
pipeline
poison-pill
priority-queue
private-class-data
producer-consumer
promise
property
prototype
proxy
queue-load-leveling
reactor
reader-writer-lock
repository
resource-acquisition-is-initialization
retry
role-object
saga
semaphore
servant
serverless
service-layer
service-locator
sharding
singleton
spatial-partition
specification
state
step-builder
strangler
strategy
subclass-sandbox
template-method
thread-pool
throttling
tls
tolerant-reader
trampoline
twin
typeobjectpattern
etc
typeobjectpattern.urm.png
typeobjectpattern.urm.puml
src
README.md
pom.xml
unit-of-work
update-method
value-object
visitor
zh
.all-contributorsrc
.gitignore
CONTRIBUTING.MD
LICENSE.md
PULL_REQUEST_TEMPLATE.md
README.md
checkstyle-suppressions.xml
license-plugin-header-style.xml
pom.xml
java-design-patterns/typeobjectpattern/etc/typeobjectpattern.urm.puml

72 lines
1.9 KiB
Plaintext
Raw Normal View History

2019-12-07 18:03:49 +02:00
@startuml
package com.iluwatar.typeobject {
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
class Candy {
~ name : String
~ parent : Candy
~ parentName : String
- points : int
- type : Type
~ Candy(name : String, parentName : String, type : Type, points : int)
~ getPoints() : int
~ getType() : Type
~ setPoints(a : int)
}
~enum Type {
+ crushableCandy {static}
+ rewardFruit {static}
+ valueOf(name : String) : Type {static}
+ values() : Type[] {static}
}
class CandyGame {
- LOGGER : Logger {static}
~ cells : Cell[][]
~ pool : CellPool
~ totalPoints : int
~ CandyGame(num : int, pool : CellPool)
~ adjacentCells(y : int, x : int) : List<Cell>
~ continueRound() : boolean
~ handleChange(points : int)
~ numOfSpaces(num : int) : String {static}
~ printGameStatus()
~ round(timeSoFar : int, totalTime : int)
}
class Cell {
~ candy : Candy
~ positionX : int
~ positionY : int
~ Cell()
~ Cell(candy : Candy, positionX : int, positionY : int)
~ crush(pool : CellPool, cellMatrix : Cell[][])
~ fillThisSpace(pool : CellPool, cellMatrix : Cell[][])
~ handleCrush(c : Cell, pool : CellPool, cellMatrix : Cell[][])
~ interact(c : Cell, pool : CellPool, cellMatrix : Cell[][]) : int
}
class CellPool {
- RANDOM : Random {static}
~ pointer : int
~ pool : List<Cell>
~ randomCode : Candy[]
~ CellPool(num : int)
~ addNewCell(c : Cell)
~ assignRandomCandytypes() : Candy[]
~ getNewCell() : Cell
}
class JsonParser {
~ candies : Hashtable<String, Candy>
~ JsonParser()
~ parse()
~ setParentAndPoints()
}
}
Cell --> "-candy" Candy
Type ..+ Candy
Candy --> "-type" Type
Candy --> "-parent" Candy
CandyGame --> "-pool" CellPool
CellPool --> "-pool" Cell
@enduml