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

View File

@@ -8,3 +8,7 @@ To dynamically add new functionality to class 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)
## 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