mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-11 03:13:32 +00:00
* Changed database implementation. Removed static objects. * Fix Logs * Fix 40 errors from checkstyle plugin run. 139 left)) * Fix CacheStore errors from checkstyle plugin 107 left * Fix last errors in checkstyle. * Fix sonar issues * Fix issues in VALIDATE phase * Fix Bug with mongo connection. Used "Try with resources" * Add test * Added docker-compose for mongo db. MongoDb db work fixed. * Provided missing tests * Comments to start Application with mongo. * Fix some broken links * Remove extra space * Update filename * Fix some links in localization folders * Fix link * Update frontmatters * Work on patterns index page * Work on index page * Fixes according PR comments. Mainly Readme edits. * fix frontmatter * add missing png * Update pattern index.md * Add index.md for Chinese translation * update image paths * update circuit breaker image paths * Update image paths for localizations * add generated puml * Add missing image * Update img file extensions * Update the rest of the EN and ZH patterns to conform with the new website Co-authored-by: Victor Zalevskii <zvictormail@gmail.com>
134 lines
3.7 KiB
Plaintext
134 lines
3.7 KiB
Plaintext
@startuml
|
|
package com.iluwatar.servicetoworker {
|
|
class Action {
|
|
+ giant : GiantModel
|
|
+ Action(giant : GiantModel)
|
|
+ setFatigue(fatigue : Fatigue)
|
|
+ setHealth(health : Health)
|
|
+ setNourishment(nourishment : Nourishment)
|
|
+ updateModel(command : Command)
|
|
}
|
|
class App {
|
|
+ App()
|
|
+ main(args : String[]) {static}
|
|
}
|
|
class Command {
|
|
- fatigue : Fatigue
|
|
- health : Health
|
|
- nourishment : Nourishment
|
|
+ Command(fatigue : Fatigue, health : Health, nourishment : Nourishment)
|
|
+ getFatigue() : Fatigue
|
|
+ getHealth() : Health
|
|
+ getNourishment() : Nourishment
|
|
}
|
|
class Dispatcher {
|
|
- actions : List<Action>
|
|
- giantView : GiantView
|
|
+ Dispatcher(giantView : GiantView)
|
|
~ addAction(action : Action)
|
|
+ getGiantView() : GiantView
|
|
+ performAction(s : Command, actionIndex : int)
|
|
+ updateView(giantModel : GiantModel)
|
|
}
|
|
class GiantController {
|
|
+ dispatcher : Dispatcher
|
|
+ GiantController(dispatcher : Dispatcher)
|
|
+ setCommand(s : Command, index : int)
|
|
+ updateView(giantModel : GiantModel)
|
|
}
|
|
class GiantModel {
|
|
- model : GiantModel
|
|
- name : String
|
|
~ GiantModel(name : String, health : Health, fatigue : Fatigue, nourishment : Nourishment)
|
|
~ getFatigue() : Fatigue
|
|
~ getHealth() : Health
|
|
+ getName() : String
|
|
~ getNourishment() : Nourishment
|
|
~ setFatigue(fatigue : Fatigue)
|
|
~ setHealth(health : Health)
|
|
~ setNourishment(nourishment : Nourishment)
|
|
+ toString() : String
|
|
}
|
|
class GiantView {
|
|
- LOGGER : Logger {static}
|
|
+ GiantView()
|
|
+ displayGiant(giant : GiantModel)
|
|
}
|
|
}
|
|
package com.iluwatar.model.view.controller {
|
|
class App {
|
|
+ App()
|
|
+ main(args : String[]) {static}
|
|
}
|
|
enum Fatigue {
|
|
+ ALERT {static}
|
|
+ SLEEPING {static}
|
|
+ TIRED {static}
|
|
- title : String
|
|
+ toString() : String
|
|
+ valueOf(name : String) : Fatigue {static}
|
|
+ values() : Fatigue[] {static}
|
|
}
|
|
class GiantController {
|
|
- giant : GiantModel
|
|
- view : GiantView
|
|
+ GiantController(giant : GiantModel, view : GiantView)
|
|
+ getFatigue() : Fatigue
|
|
+ getHealth() : Health
|
|
+ getNourishment() : Nourishment
|
|
+ setFatigue(fatigue : Fatigue)
|
|
+ setHealth(health : Health)
|
|
+ setNourishment(nourishment : Nourishment)
|
|
+ updateView()
|
|
}
|
|
class GiantModel {
|
|
- fatigue : Fatigue
|
|
- health : Health
|
|
- nourishment : Nourishment
|
|
+ GiantModel(health : Health, fatigue : Fatigue, nourishment : Nourishment)
|
|
+ getFatigue() : Fatigue
|
|
+ getHealth() : Health
|
|
+ getNourishment() : Nourishment
|
|
+ setFatigue(fatigue : Fatigue)
|
|
+ setHealth(health : Health)
|
|
+ setNourishment(nourishment : Nourishment)
|
|
+ toString() : String
|
|
}
|
|
class GiantView {
|
|
- LOGGER : Logger {static}
|
|
+ GiantView()
|
|
+ displayGiant(giant : GiantModel)
|
|
}
|
|
enum Health {
|
|
+ DEAD {static}
|
|
+ HEALTHY {static}
|
|
+ WOUNDED {static}
|
|
- title : String
|
|
+ toString() : String
|
|
+ valueOf(name : String) : Health {static}
|
|
+ values() : Health[] {static}
|
|
}
|
|
enum Nourishment {
|
|
+ HUNGRY {static}
|
|
+ SATURATED {static}
|
|
+ STARVING {static}
|
|
- title : String
|
|
+ toString() : String
|
|
+ valueOf(name : String) : Nourishment {static}
|
|
+ values() : Nourishment[] {static}
|
|
}
|
|
}
|
|
Command --> "-nourishment" Nourishment
|
|
GiantModel --> "-nourishment" Nourishment
|
|
GiantController --> "-giant" GiantModel
|
|
GiantController --> "-dispatcher" Dispatcher
|
|
GiantModel --> "-fatigue" Fatigue
|
|
Dispatcher --> "-actions" Action
|
|
GiantModel --> "-health" Health
|
|
GiantModel --> "-model" GiantModel
|
|
Command --> "-fatigue" Fatigue
|
|
Command --> "-health" Health
|
|
GiantController --> "-view" GiantView
|
|
Action --> "-giant" GiantModel
|
|
Dispatcher --> "-giantView" GiantView
|
|
@enduml |