diff --git a/Structural/Bridge/uml/uml.png b/Structural/Bridge/uml/uml.png index d378dee..ace71af 100644 Binary files a/Structural/Bridge/uml/uml.png and b/Structural/Bridge/uml/uml.png differ diff --git a/Structural/Bridge/uml/uml.svg b/Structural/Bridge/uml/uml.svg index 8525670..e7b8e4a 100644 --- a/Structural/Bridge/uml/uml.svg +++ b/Structural/Bridge/uml/uml.svg @@ -1 +1 @@ -Assemblework()Car__construct()manufacture()Motorcycle__construct()manufacture()Producework()Vehicleprotected workShop1protected workShop2__construct()manufacture()Workshopwork() \ No newline at end of file +Assemblework()Car__construct(Workshop $workShop1, Workshop $workShop2)manufacture()Motorcycle__construct(Workshop $workShop1, Workshop $workShop2)manufacture()Producework()VehicleworkShop1workShop2__construct()manufacture()Workshopwork() \ No newline at end of file diff --git a/Structural/Bridge/uml/uml.txt b/Structural/Bridge/uml/uml.txt index 88015af..a1100d8 100644 --- a/Structural/Bridge/uml/uml.txt +++ b/Structural/Bridge/uml/uml.txt @@ -4,12 +4,12 @@ class Assemble { } class Car { - +__construct() + +__construct(Workshop $workShop1, Workshop $workShop2) +manufacture() } class Motorcycle { - +__construct() + +__construct(Workshop $workShop1, Workshop $workShop2) +manufacture() } @@ -18,9 +18,9 @@ class Produce { } abstract class Vehicle { - protected workShop1 - protected workShop2 - +__construct() + #workShop1 + #workShop2 + #__construct() +manufacture() } diff --git a/Structural/Composite/uml/uml.png b/Structural/Composite/uml/uml.png index e353446..0009791 100644 Binary files a/Structural/Composite/uml/uml.png and b/Structural/Composite/uml/uml.png differ diff --git a/Structural/Composite/uml/uml.svg b/Structural/Composite/uml/uml.svg index 6c1cb5c..f5c616d 100644 --- a/Structural/Composite/uml/uml.svg +++ b/Structural/Composite/uml/uml.svg @@ -1 +1 @@ -Formprotected elementsrender($indent = 0)addElement(FormElement $element)FormElementrender($indent = 0)InputElementrender($indent = 0)TextElementrender($indent = 0) \ No newline at end of file +Formelements : array|FormElement[]render($indent = 0 : int)addElement(FormElement $element)FormElementrender($indent = 0 : int)InputElementrender($indent = 0 : int)TextElementrender($indent = 0 : int) \ No newline at end of file diff --git a/Structural/Composite/uml/uml.txt b/Structural/Composite/uml/uml.txt index 598a697..933d4b2 100644 --- a/Structural/Composite/uml/uml.txt +++ b/Structural/Composite/uml/uml.txt @@ -1,20 +1,20 @@ @startuml class Form { - protected elements - +render($indent = 0) + #elements : array|FormElement[] + +render($indent = 0 : int) +addElement(FormElement $element) } abstract class FormElement { - +render($indent = 0) + +render($indent = 0 : int) } class InputElement { - +render($indent = 0) + +render($indent = 0 : int) } class TextElement { - +render($indent = 0) + +render($indent = 0 : int) } FormElement <|.. TextElement diff --git a/Structural/DataMapper/uml/uml.png b/Structural/DataMapper/uml/uml.png index 31cb399..fabd1a8 100644 Binary files a/Structural/DataMapper/uml/uml.png and b/Structural/DataMapper/uml/uml.png differ diff --git a/Structural/DataMapper/uml/uml.svg b/Structural/DataMapper/uml/uml.svg index 92d7b9d..e40dd5b 100644 --- a/Structural/DataMapper/uml/uml.svg +++ b/Structural/DataMapper/uml/uml.svg @@ -1 +1 @@ -Userprotected $userIdprotected $usernameprotected $email__construct($id = null, $username = null, $email = null)getUserId()setUserID($userId)getUsername()setUsername($username)getEmail()setEmail($email)UserMapper$user : Userprotected $adapter__construct(DBAL $dbLayer)save(User $user)findById($id)findAll()mapObject(array $row) \ No newline at end of file +User$userId : int$username : string$email : string__construct($id = null : int, $username = null : string, $email = null : string)getUserId()setUserID($userId : int)getUsername()setUsername($username : string)getEmail()setEmail($email : string)UserMapper$adapter : DBAL__construct(DBAL $dbLayer)save(User $user)findById($id : int)findAll()mapObject(array $row) \ No newline at end of file diff --git a/Structural/DataMapper/uml/uml.txt b/Structural/DataMapper/uml/uml.txt index a521833..215a9da 100644 --- a/Structural/DataMapper/uml/uml.txt +++ b/Structural/DataMapper/uml/uml.txt @@ -1,25 +1,24 @@ @startuml class User { - protected $userId - protected $username - protected $email - +__construct($id = null, $username = null, $email = null) + #$userId : int + #$username : string + #$email : string + +__construct($id = null : int, $username = null : string, $email = null : string) +getUserId() - +setUserID($userId) + +setUserID($userId : int) +getUsername() - +setUsername($username) + +setUsername($username : string) +getEmail() - +setEmail($email) + +setEmail($email : string) } class UserMapper { - # $user : User - protected $adapter + #$adapter : DBAL +__construct(DBAL $dbLayer) +save(User $user) - +findById($id) + +findById($id : int) +findAll() - +mapObject(array $row) + #mapObject(array $row) } @enduml \ No newline at end of file diff --git a/Structural/Decorator/uml/uml.png b/Structural/Decorator/uml/uml.png index bb14f3d..e1e83f2 100644 Binary files a/Structural/Decorator/uml/uml.png and b/Structural/Decorator/uml/uml.png differ diff --git a/Structural/Decorator/uml/uml.svg b/Structural/Decorator/uml/uml.svg index 6dc608a..2abab18 100644 --- a/Structural/Decorator/uml/uml.svg +++ b/Structural/Decorator/uml/uml.svg @@ -1 +1 @@ -RendererInterfacerenderData()Decoratorprotected $wrapped : RendererInterface__construct(RendererInterface $wrappable)RenderInJsonrenderData()RenderInXmlrenderData()Webserviceprotected $data__construct($data)renderData() \ No newline at end of file +RendererInterfacerenderData()Decorator$wrapped : RendererInterface__construct(RendererInterface $wrappable)RenderInJsonrenderData()RenderInXmlrenderData()Webservice$data : mixed__construct($data)renderData() \ No newline at end of file diff --git a/Structural/Decorator/uml/uml.txt b/Structural/Decorator/uml/uml.txt index f0332ec..2561cf7 100644 --- a/Structural/Decorator/uml/uml.txt +++ b/Structural/Decorator/uml/uml.txt @@ -4,7 +4,7 @@ interface RendererInterface { } abstract class Decorator { - # protected $wrapped : RendererInterface + #$wrapped : RendererInterface +__construct(RendererInterface $wrappable) } @@ -17,7 +17,7 @@ class RenderInXml { } class Webservice { - protected $data + #$data : mixed +__construct($data) +renderData() } diff --git a/Structural/DependencyInjection/README.md b/Structural/DependencyInjection/README.md index 5c8b453..185a550 100644 --- a/Structural/DependencyInjection/README.md +++ b/Structural/DependencyInjection/README.md @@ -14,3 +14,7 @@ Notice we are following Inversion of control principle in `Connection` by asking * The Doctrine2 ORM uses dependency injection e.g. for configuration that is injected into a `Connection` object. For testing purposes, one can easily create a mock object of the configuration and inject that into the `Connection` object * Symfony and Zend Framework 2 already have containers for DI that create objects via a configuration array and inject them where needed (i.e. in Controllers) + +## UML Diagram + +![Alt DependencyInjection UML Diagram](uml/uml.png) \ No newline at end of file diff --git a/Structural/DependencyInjection/uml/uml.png b/Structural/DependencyInjection/uml/uml.png new file mode 100644 index 0000000..f38b80b Binary files /dev/null and b/Structural/DependencyInjection/uml/uml.png differ diff --git a/Structural/DependencyInjection/uml/uml.svg b/Structural/DependencyInjection/uml/uml.svg new file mode 100644 index 0000000..1014592 --- /dev/null +++ b/Structural/DependencyInjection/uml/uml.svg @@ -0,0 +1 @@ +AbstractConfig$storage__construct($storage)ArrayConfigget($key : string|int, $default = null)set($key : string|int, $value : mixed)Connection$configuration : Parameters$host__construct(Parameters $config)connect()getHost()Parametersget($key : string|int)set($key, $value : mixed) \ No newline at end of file diff --git a/Structural/DependencyInjection/uml/uml.txt b/Structural/DependencyInjection/uml/uml.txt new file mode 100644 index 0000000..b6765c5 --- /dev/null +++ b/Structural/DependencyInjection/uml/uml.txt @@ -0,0 +1,28 @@ +@startuml +abstract class AbstractConfig { + #$storage + +__construct($storage) +} + +class ArrayConfig { + +get($key : string|int, $default = null) + +set($key : string|int, $value : mixed) +} + +class Connection { + #$configuration : Parameters + #$host + +__construct(Parameters $config) + +connect() + +getHost() +} + +interface Parameters { + +get($key : string|int) + +set($key, $value : mixed) +} + +AbstractConfig <|.. ArrayConfig +Parameters <|.. ArrayConfig + +@enduml \ No newline at end of file