Skip to content

Commit 0685a50

Browse files
committed
iluwatar#1113 Add uml-reverse-mapper plugin
1 parent 55769e9 commit 0685a50

File tree

140 files changed

+7753
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+7753
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@startuml
2+
package com.iluwatar.abstractdocument.domain.enums {
3+
enum Property {
4+
+ MODEL {static}
5+
+ PARTS {static}
6+
+ PRICE {static}
7+
+ TYPE {static}
8+
+ valueOf(name : String) : Property {static}
9+
+ values() : Property[] {static}
10+
}
11+
}
12+
package com.iluwatar.abstractdocument.domain {
13+
class Car {
14+
+ Car(properties : Map<String, Object>)
15+
}
16+
interface HasModel {
17+
+ getModel() : Optional<String>
18+
}
19+
interface HasParts {
20+
+ getParts() : Stream<Part>
21+
}
22+
interface HasPrice {
23+
+ getPrice() : Optional<Number>
24+
}
25+
interface HasType {
26+
+ getType() : Optional<String>
27+
}
28+
class Part {
29+
+ Part(properties : Map<String, Object>)
30+
}
31+
}
32+
package com.iluwatar.abstractdocument {
33+
abstract class AbstractDocument {
34+
- properties : Map<String, Object>
35+
# AbstractDocument(properties : Map<String, Object>)
36+
+ children(key : String, constructor : Function<Map<String, Object>, T>) : Stream<T>
37+
+ get(key : String) : Object
38+
+ put(key : String, value : Object)
39+
+ toString() : String
40+
}
41+
class App {
42+
- LOGGER : Logger {static}
43+
+ App()
44+
+ main(args : String[]) {static}
45+
}
46+
interface Document {
47+
+ children(String, Function<Map<String, Object>, T>) : Stream<T> {abstract}
48+
+ get(String) : Object {abstract}
49+
+ put(String, Object) {abstract}
50+
}
51+
}
52+
AbstractDocument ..|> Document
53+
Car ..|> HasModel
54+
Car ..|> HasPrice
55+
Car ..|> HasParts
56+
Car --|> AbstractDocument
57+
HasModel --|> Document
58+
HasParts --|> Document
59+
HasPrice --|> Document
60+
HasType --|> Document
61+
Part ..|> HasType
62+
Part ..|> HasModel
63+
Part ..|> HasPrice
64+
Part --|> AbstractDocument
65+
@enduml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
@startuml
2+
package com.iluwatar.abstractfactory {
3+
class App {
4+
- LOGGER : Logger {static}
5+
- army : Army
6+
- castle : Castle
7+
- king : King
8+
+ App()
9+
+ createKingdom(factory : KingdomFactory)
10+
+ getArmy() : Army
11+
~ getArmy(factory : KingdomFactory) : Army
12+
+ getCastle() : Castle
13+
~ getCastle(factory : KingdomFactory) : Castle
14+
+ getKing() : King
15+
~ getKing(factory : KingdomFactory) : King
16+
+ main(args : String[]) {static}
17+
- setArmy(army : Army)
18+
- setCastle(castle : Castle)
19+
- setKing(king : King)
20+
}
21+
class FactoryMaker {
22+
+ FactoryMaker()
23+
+ makeFactory(type : KingdomType) : KingdomFactory {static}
24+
}
25+
enum KingdomType {
26+
+ ELF {static}
27+
+ ORC {static}
28+
+ valueOf(name : String) : KingdomType {static}
29+
+ values() : KingdomType[] {static}
30+
}
31+
interface Army {
32+
+ getDescription() : String {abstract}
33+
}
34+
interface Castle {
35+
+ getDescription() : String {abstract}
36+
}
37+
class ElfArmy {
38+
~ DESCRIPTION : String {static}
39+
+ ElfArmy()
40+
+ getDescription() : String
41+
}
42+
class ElfCastle {
43+
~ DESCRIPTION : String {static}
44+
+ ElfCastle()
45+
+ getDescription() : String
46+
}
47+
class ElfKing {
48+
~ DESCRIPTION : String {static}
49+
+ ElfKing()
50+
+ getDescription() : String
51+
}
52+
class ElfKingdomFactory {
53+
+ ElfKingdomFactory()
54+
+ createArmy() : Army
55+
+ createCastle() : Castle
56+
+ createKing() : King
57+
}
58+
interface King {
59+
+ getDescription() : String {abstract}
60+
}
61+
interface KingdomFactory {
62+
+ createArmy() : Army {abstract}
63+
+ createCastle() : Castle {abstract}
64+
+ createKing() : King {abstract}
65+
}
66+
class OrcArmy {
67+
~ DESCRIPTION : String {static}
68+
+ OrcArmy()
69+
+ getDescription() : String
70+
}
71+
class OrcCastle {
72+
~ DESCRIPTION : String {static}
73+
+ OrcCastle()
74+
+ getDescription() : String
75+
}
76+
class OrcKing {
77+
~ DESCRIPTION : String {static}
78+
+ OrcKing()
79+
+ getDescription() : String
80+
}
81+
class OrcKingdomFactory {
82+
+ OrcKingdomFactory()
83+
+ createArmy() : Army
84+
+ createCastle() : Castle
85+
+ createKing() : King
86+
}
87+
}
88+
KingdomType ..+ FactoryMaker
89+
App --> "-castle" Castle
90+
FactoryMaker ..+ App
91+
App --> "-king" King
92+
App --> "-army" Army
93+
ElfArmy ..|> Army
94+
ElfCastle ..|> Castle
95+
ElfKing ..|> King
96+
ElfKingdomFactory ..|> KingdomFactory
97+
OrcArmy ..|> Army
98+
OrcCastle ..|> Castle
99+
OrcKing ..|> King
100+
OrcKingdomFactory ..|> KingdomFactory
101+
@enduml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
@startuml
2+
package com.iluwatar.acyclicvisitor {
3+
interface AllModemVisitor {
4+
}
5+
class App {
6+
+ App()
7+
+ main(args : String[]) {static}
8+
}
9+
class ConfigureForDosVisitor {
10+
- LOGGER : Logger {static}
11+
+ ConfigureForDosVisitor()
12+
+ visit(hayes : Hayes)
13+
+ visit(zoom : Zoom)
14+
}
15+
class ConfigureForUnixVisitor {
16+
- LOGGER : Logger {static}
17+
+ ConfigureForUnixVisitor()
18+
+ visit(zoom : Zoom)
19+
}
20+
class Hayes {
21+
- LOGGER : Logger {static}
22+
+ Hayes()
23+
+ accept(modemVisitor : ModemVisitor)
24+
+ toString() : String
25+
}
26+
interface HayesVisitor {
27+
+ visit(Hayes) {abstract}
28+
}
29+
abstract class Modem {
30+
+ Modem()
31+
+ accept(ModemVisitor) {abstract}
32+
}
33+
interface ModemVisitor {
34+
}
35+
class Zoom {
36+
- LOGGER : Logger {static}
37+
+ Zoom()
38+
+ accept(modemVisitor : ModemVisitor)
39+
+ toString() : String
40+
}
41+
interface ZoomVisitor {
42+
+ visit(Zoom) {abstract}
43+
}
44+
}
45+
AllModemVisitor --|> ZoomVisitor
46+
AllModemVisitor --|> HayesVisitor
47+
ConfigureForDosVisitor ..|> AllModemVisitor
48+
ConfigureForUnixVisitor ..|> ZoomVisitor
49+
Hayes --|> Modem
50+
HayesVisitor --|> ModemVisitor
51+
Zoom --|> Modem
52+
ZoomVisitor --|> ModemVisitor
53+
@enduml

adapter/etc/adapter.urm.puml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@startuml
2+
package com.iluwatar.adapter {
3+
class App {
4+
- App()
5+
+ main(args : String[]) {static}
6+
}
7+
class Captain {
8+
- rowingBoat : RowingBoat
9+
+ Captain()
10+
+ Captain(boat : RowingBoat)
11+
~ row()
12+
~ setRowingBoat(boat : RowingBoat)
13+
}
14+
~class FishingBoat {
15+
- LOGGER : Logger {static}
16+
~ FishingBoat()
17+
~ sail()
18+
}
19+
class FishingBoatAdapter {
20+
- boat : FishingBoat
21+
+ FishingBoatAdapter()
22+
+ row()
23+
}
24+
interface RowingBoat {
25+
+ row() {abstract}
26+
}
27+
}
28+
FishingBoatAdapter --> "-boat" FishingBoat
29+
Captain --> "-rowingBoat" RowingBoat
30+
FishingBoatAdapter ..|> RowingBoat
31+
@enduml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@startuml
2+
package com.iluwatar.aggregator.microservices {
3+
class Aggregator {
4+
- informationClient : ProductInformationClient
5+
- inventoryClient : ProductInventoryClient
6+
+ Aggregator()
7+
+ getProduct() : Product
8+
}
9+
class App {
10+
+ App()
11+
+ main(args : String[]) {static}
12+
}
13+
class Product {
14+
- productInventories : int
15+
- title : String
16+
+ Product()
17+
+ getProductInventories() : int
18+
+ getTitle() : String
19+
+ setProductInventories(productInventories : int)
20+
+ setTitle(title : String)
21+
}
22+
interface ProductInformationClient {
23+
+ getProductTitle() : String {abstract}
24+
}
25+
class ProductInformationClientImpl {
26+
- LOGGER : Logger {static}
27+
+ ProductInformationClientImpl()
28+
+ getProductTitle() : String
29+
}
30+
interface ProductInventoryClient {
31+
+ getProductInventories() : Integer {abstract}
32+
}
33+
class ProductInventoryClientImpl {
34+
- LOGGER : Logger {static}
35+
+ ProductInventoryClientImpl()
36+
+ getProductInventories() : Integer
37+
}
38+
}
39+
Aggregator --> "-informationClient" ProductInformationClient
40+
Aggregator --> "-inventoryClient" ProductInventoryClient
41+
ProductInformationClientImpl ..|> ProductInformationClient
42+
ProductInventoryClientImpl ..|> ProductInventoryClient
43+
@enduml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@startuml
2+
@enduml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@startuml
2+
package com.iluwatar.information.microservice {
3+
class InformationApplication {
4+
+ InformationApplication()
5+
+ main(args : String[]) {static}
6+
}
7+
class InformationController {
8+
+ InformationController()
9+
+ getProductTitle() : String
10+
}
11+
}
12+
@enduml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@startuml
2+
package com.iluwatar.inventory.microservice {
3+
class InventoryApplication {
4+
+ InventoryApplication()
5+
+ main(args : String[]) {static}
6+
}
7+
class InventoryController {
8+
+ InventoryController()
9+
+ getProductInventories() : int
10+
}
11+
}
12+
@enduml

ambassador/etc/ambassador.urm.puml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@startuml
2+
package com.iluwatar.ambassador.util {
3+
interface RandomProvider {
4+
+ random() : double {abstract}
5+
}
6+
}
7+
package com.iluwatar.ambassador {
8+
class App {
9+
+ App()
10+
+ main(args : String[]) {static}
11+
}
12+
class Client {
13+
- LOGGER : Logger {static}
14+
- serviceAmbassador : ServiceAmbassador
15+
+ Client()
16+
~ useService(value : int) : long
17+
}
18+
class RemoteService {
19+
- LOGGER : Logger {static}
20+
- THRESHOLD : int {static}
21+
- randomProvider : RandomProvider
22+
- service : RemoteService {static}
23+
- RemoteService()
24+
~ RemoteService(randomProvider : RandomProvider)
25+
+ doRemoteFunction(value : int) : long
26+
~ getRemoteService() : RemoteService {static}
27+
}
28+
~interface RemoteServiceInterface {
29+
+ FAILURE : int {static}
30+
+ doRemoteFunction(int) : long {abstract}
31+
}
32+
class ServiceAmbassador {
33+
- DELAY_MS : int {static}
34+
- LOGGER : Logger {static}
35+
- RETRIES : int {static}
36+
~ ServiceAmbassador()
37+
- checkLatency(value : int) : long
38+
+ doRemoteFunction(value : int) : long
39+
- safeCall(value : int) : long
40+
}
41+
}
42+
RemoteService --> "-service" RemoteService
43+
Client --> "-serviceAmbassador" ServiceAmbassador
44+
RemoteService --> "-randomProvider" RandomProvider
45+
RemoteService ..|> RemoteServiceInterface
46+
ServiceAmbassador ..|> RemoteServiceInterface
47+
@enduml

0 commit comments

Comments
 (0)