Skip to content

Commit

Permalink
iluwatar#1113 Add uml-reverse-mapper plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
iluwatar committed Dec 7, 2019
1 parent 55769e9 commit 0685a50
Show file tree
Hide file tree
Showing 140 changed files with 7,753 additions and 0 deletions.
65 changes: 65 additions & 0 deletions abstract-document/etc/abstract-document.urm.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
@startuml
package com.iluwatar.abstractdocument.domain.enums {
enum Property {
+ MODEL {static}
+ PARTS {static}
+ PRICE {static}
+ TYPE {static}
+ valueOf(name : String) : Property {static}
+ values() : Property[] {static}
}
}
package com.iluwatar.abstractdocument.domain {
class Car {
+ Car(properties : Map<String, Object>)
}
interface HasModel {
+ getModel() : Optional<String>
}
interface HasParts {
+ getParts() : Stream<Part>
}
interface HasPrice {
+ getPrice() : Optional<Number>
}
interface HasType {
+ getType() : Optional<String>
}
class Part {
+ Part(properties : Map<String, Object>)
}
}
package com.iluwatar.abstractdocument {
abstract class AbstractDocument {
- properties : Map<String, Object>
# AbstractDocument(properties : Map<String, Object>)
+ children(key : String, constructor : Function<Map<String, Object>, T>) : Stream<T>
+ get(key : String) : Object
+ put(key : String, value : Object)
+ toString() : String
}
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
interface Document {
+ children(String, Function<Map<String, Object>, T>) : Stream<T> {abstract}
+ get(String) : Object {abstract}
+ put(String, Object) {abstract}
}
}
AbstractDocument ..|> Document
Car ..|> HasModel
Car ..|> HasPrice
Car ..|> HasParts
Car --|> AbstractDocument
HasModel --|> Document
HasParts --|> Document
HasPrice --|> Document
HasType --|> Document
Part ..|> HasType
Part ..|> HasModel
Part ..|> HasPrice
Part --|> AbstractDocument
@enduml
101 changes: 101 additions & 0 deletions abstract-factory/etc/abstract-factory.urm.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
@startuml
package com.iluwatar.abstractfactory {
class App {
- LOGGER : Logger {static}
- army : Army
- castle : Castle
- king : King
+ App()
+ createKingdom(factory : KingdomFactory)
+ getArmy() : Army
~ getArmy(factory : KingdomFactory) : Army
+ getCastle() : Castle
~ getCastle(factory : KingdomFactory) : Castle
+ getKing() : King
~ getKing(factory : KingdomFactory) : King
+ main(args : String[]) {static}
- setArmy(army : Army)
- setCastle(castle : Castle)
- setKing(king : King)
}
class FactoryMaker {
+ FactoryMaker()
+ makeFactory(type : KingdomType) : KingdomFactory {static}
}
enum KingdomType {
+ ELF {static}
+ ORC {static}
+ valueOf(name : String) : KingdomType {static}
+ values() : KingdomType[] {static}
}
interface Army {
+ getDescription() : String {abstract}
}
interface Castle {
+ getDescription() : String {abstract}
}
class ElfArmy {
~ DESCRIPTION : String {static}
+ ElfArmy()
+ getDescription() : String
}
class ElfCastle {
~ DESCRIPTION : String {static}
+ ElfCastle()
+ getDescription() : String
}
class ElfKing {
~ DESCRIPTION : String {static}
+ ElfKing()
+ getDescription() : String
}
class ElfKingdomFactory {
+ ElfKingdomFactory()
+ createArmy() : Army
+ createCastle() : Castle
+ createKing() : King
}
interface King {
+ getDescription() : String {abstract}
}
interface KingdomFactory {
+ createArmy() : Army {abstract}
+ createCastle() : Castle {abstract}
+ createKing() : King {abstract}
}
class OrcArmy {
~ DESCRIPTION : String {static}
+ OrcArmy()
+ getDescription() : String
}
class OrcCastle {
~ DESCRIPTION : String {static}
+ OrcCastle()
+ getDescription() : String
}
class OrcKing {
~ DESCRIPTION : String {static}
+ OrcKing()
+ getDescription() : String
}
class OrcKingdomFactory {
+ OrcKingdomFactory()
+ createArmy() : Army
+ createCastle() : Castle
+ createKing() : King
}
}
KingdomType ..+ FactoryMaker
App --> "-castle" Castle
FactoryMaker ..+ App
App --> "-king" King
App --> "-army" Army
ElfArmy ..|> Army
ElfCastle ..|> Castle
ElfKing ..|> King
ElfKingdomFactory ..|> KingdomFactory
OrcArmy ..|> Army
OrcCastle ..|> Castle
OrcKing ..|> King
OrcKingdomFactory ..|> KingdomFactory
@enduml
53 changes: 53 additions & 0 deletions acyclic-visitor/etc/acyclic-visitor.urm.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@startuml
package com.iluwatar.acyclicvisitor {
interface AllModemVisitor {
}
class App {
+ App()
+ main(args : String[]) {static}
}
class ConfigureForDosVisitor {
- LOGGER : Logger {static}
+ ConfigureForDosVisitor()
+ visit(hayes : Hayes)
+ visit(zoom : Zoom)
}
class ConfigureForUnixVisitor {
- LOGGER : Logger {static}
+ ConfigureForUnixVisitor()
+ visit(zoom : Zoom)
}
class Hayes {
- LOGGER : Logger {static}
+ Hayes()
+ accept(modemVisitor : ModemVisitor)
+ toString() : String
}
interface HayesVisitor {
+ visit(Hayes) {abstract}
}
abstract class Modem {
+ Modem()
+ accept(ModemVisitor) {abstract}
}
interface ModemVisitor {
}
class Zoom {
- LOGGER : Logger {static}
+ Zoom()
+ accept(modemVisitor : ModemVisitor)
+ toString() : String
}
interface ZoomVisitor {
+ visit(Zoom) {abstract}
}
}
AllModemVisitor --|> ZoomVisitor
AllModemVisitor --|> HayesVisitor
ConfigureForDosVisitor ..|> AllModemVisitor
ConfigureForUnixVisitor ..|> ZoomVisitor
Hayes --|> Modem
HayesVisitor --|> ModemVisitor
Zoom --|> Modem
ZoomVisitor --|> ModemVisitor
@enduml
31 changes: 31 additions & 0 deletions adapter/etc/adapter.urm.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@startuml
package com.iluwatar.adapter {
class App {
- App()
+ main(args : String[]) {static}
}
class Captain {
- rowingBoat : RowingBoat
+ Captain()
+ Captain(boat : RowingBoat)
~ row()
~ setRowingBoat(boat : RowingBoat)
}
~class FishingBoat {
- LOGGER : Logger {static}
~ FishingBoat()
~ sail()
}
class FishingBoatAdapter {
- boat : FishingBoat
+ FishingBoatAdapter()
+ row()
}
interface RowingBoat {
+ row() {abstract}
}
}
FishingBoatAdapter --> "-boat" FishingBoat
Captain --> "-rowingBoat" RowingBoat
FishingBoatAdapter ..|> RowingBoat
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@startuml
package com.iluwatar.aggregator.microservices {
class Aggregator {
- informationClient : ProductInformationClient
- inventoryClient : ProductInventoryClient
+ Aggregator()
+ getProduct() : Product
}
class App {
+ App()
+ main(args : String[]) {static}
}
class Product {
- productInventories : int
- title : String
+ Product()
+ getProductInventories() : int
+ getTitle() : String
+ setProductInventories(productInventories : int)
+ setTitle(title : String)
}
interface ProductInformationClient {
+ getProductTitle() : String {abstract}
}
class ProductInformationClientImpl {
- LOGGER : Logger {static}
+ ProductInformationClientImpl()
+ getProductTitle() : String
}
interface ProductInventoryClient {
+ getProductInventories() : Integer {abstract}
}
class ProductInventoryClientImpl {
- LOGGER : Logger {static}
+ ProductInventoryClientImpl()
+ getProductInventories() : Integer
}
}
Aggregator --> "-informationClient" ProductInformationClient
Aggregator --> "-inventoryClient" ProductInventoryClient
ProductInformationClientImpl ..|> ProductInformationClient
ProductInventoryClientImpl ..|> ProductInventoryClient
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@startuml
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@startuml
package com.iluwatar.information.microservice {
class InformationApplication {
+ InformationApplication()
+ main(args : String[]) {static}
}
class InformationController {
+ InformationController()
+ getProductTitle() : String
}
}
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@startuml
package com.iluwatar.inventory.microservice {
class InventoryApplication {
+ InventoryApplication()
+ main(args : String[]) {static}
}
class InventoryController {
+ InventoryController()
+ getProductInventories() : int
}
}
@enduml
47 changes: 47 additions & 0 deletions ambassador/etc/ambassador.urm.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@startuml
package com.iluwatar.ambassador.util {
interface RandomProvider {
+ random() : double {abstract}
}
}
package com.iluwatar.ambassador {
class App {
+ App()
+ main(args : String[]) {static}
}
class Client {
- LOGGER : Logger {static}
- serviceAmbassador : ServiceAmbassador
+ Client()
~ useService(value : int) : long
}
class RemoteService {
- LOGGER : Logger {static}
- THRESHOLD : int {static}
- randomProvider : RandomProvider
- service : RemoteService {static}
- RemoteService()
~ RemoteService(randomProvider : RandomProvider)
+ doRemoteFunction(value : int) : long
~ getRemoteService() : RemoteService {static}
}
~interface RemoteServiceInterface {
+ FAILURE : int {static}
+ doRemoteFunction(int) : long {abstract}
}
class ServiceAmbassador {
- DELAY_MS : int {static}
- LOGGER : Logger {static}
- RETRIES : int {static}
~ ServiceAmbassador()
- checkLatency(value : int) : long
+ doRemoteFunction(value : int) : long
- safeCall(value : int) : long
}
}
RemoteService --> "-service" RemoteService
Client --> "-serviceAmbassador" ServiceAmbassador
RemoteService --> "-randomProvider" RandomProvider
RemoteService ..|> RemoteServiceInterface
ServiceAmbassador ..|> RemoteServiceInterface
@enduml
Loading

0 comments on commit 0685a50

Please sign in to comment.