diff --git a/Structural/Adapter/README.md b/Structural/Adapter/README.md index 5d77709..3391617 100644 --- a/Structural/Adapter/README.md +++ b/Structural/Adapter/README.md @@ -8,3 +8,8 @@ To translate one interface for a class into a compatible interface. An adapter a * DB Client libraries adapter * using multiple different webservices and adapters normalize data so that the outcome is the same for all + +## UML Diagram + +Adapter UML Diagram +![Alt Adapter UML Diagram](uml.svg) \ No newline at end of file diff --git a/Structural/Adapter/uml.svg b/Structural/Adapter/uml.svg new file mode 100644 index 0000000..04259f1 --- /dev/null +++ b/Structural/Adapter/uml.svg @@ -0,0 +1 @@ +PaperBookInterfaceturnPage()open()EBookInterfacepressNext()pressStart()Bookopen()turnPage()KindlepressNext()pressStart()EBookAdaptereBook : EBookInterface__construct(ebook : EBookInterface)open()turnPage() \ No newline at end of file diff --git a/Structural/Adapter/uml.txt b/Structural/Adapter/uml.txt new file mode 100644 index 0000000..00aec7d --- /dev/null +++ b/Structural/Adapter/uml.txt @@ -0,0 +1,33 @@ +@startuml +interface PaperBookInterface { + +turnPage() + +open() +} + +interface EBookInterface { + +pressNext() + +pressStart() +} + +class Book { + +open() + +turnPage() +} + +class Kindle { + +pressNext() + +pressStart() +} + +class EBookAdapter { + #eBook : EBookInterface + +__construct(ebook : EBookInterface) + +open() + +turnPage() +} + +PaperBookInterface <|.. Book +PaperBookInterface <|.. EBookAdapter +EBookInterface <|.. Kindle +EBookAdapter o-- EBookInterface +@enduml \ No newline at end of file diff --git a/Structural/Bridge/uml.svg b/Structural/Bridge/uml.svg new file mode 100644 index 0000000..8525670 --- /dev/null +++ b/Structural/Bridge/uml.svg @@ -0,0 +1 @@ +Assemblework()Car__construct()manufacture()Motorcycle__construct()manufacture()Producework()Vehicleprotected workShop1protected workShop2__construct()manufacture()Workshopwork() \ No newline at end of file diff --git a/Structural/Bridge/uml.txt b/Structural/Bridge/uml.txt new file mode 100644 index 0000000..88015af --- /dev/null +++ b/Structural/Bridge/uml.txt @@ -0,0 +1,35 @@ +@startuml +class Assemble { + +work() +} + +class Car { + +__construct() + +manufacture() +} + +class Motorcycle { + +__construct() + +manufacture() +} + +class Produce { + +work() +} + +abstract class Vehicle { + protected workShop1 + protected workShop2 + +__construct() + +manufacture() +} + +interface Workshop { + +work() +} + +Workshop <|.. Assemble +Workshop <|.. Produce +Vehicle <|.. Motorcycle +Vehicle <|.. Car +@enduml \ No newline at end of file