Added Decorator UML

This commit is contained in:
John Webb 2014-07-29 10:18:51 -05:00
parent 729d093391
commit 3a7e38f91d
7 changed files with 36 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -13,6 +13,7 @@ class User {
} }
class UserMapper { class UserMapper {
# $user : User
protected $adapter protected $adapter
+__construct(DBAL $dbLayer) +__construct(DBAL $dbLayer)
+save(User $user) +save(User $user)

View File

@ -8,3 +8,7 @@ To dynamically add new functionality to class instances.
* Zend Framework: decorators for `Zend_Form_Element` instances * Zend Framework: decorators for `Zend_Form_Element` instances
* Web Service Layer: Decorators JSON and XML for a REST service (in this case, only one of these should be allowed of course) * Web Service Layer: Decorators JSON and XML for a REST service (in this case, only one of these should be allowed of course)
## UML Diagram
![Alt Decorator UML Diagram](uml/uml.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -0,0 +1,29 @@
@startuml
interface RendererInterface {
+renderData()
}
abstract class Decorator {
# protected $wrapped : RendererInterface
+__construct(RendererInterface $wrappable)
}
class RenderInJson {
+renderData()
}
class RenderInXml {
+renderData()
}
class Webservice {
protected $data
+__construct($data)
+renderData()
}
Decorator <|.. RenderInJson
Decorator <|.. RenderInXml
RendererInterface <|.. Decorator
RendererInterface <|.. Webservice
@enduml