mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 01:32:22 +01:00
Added Decorator UML
This commit is contained in:
parent
729d093391
commit
3a7e38f91d
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 |
@ -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)
|
||||||
|
@ -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
|
||||||
|
|
||||||
|

|
||||||
|
BIN
Structural/Decorator/uml/uml.png
Normal file
BIN
Structural/Decorator/uml/uml.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
1
Structural/Decorator/uml/uml.svg
Normal file
1
Structural/Decorator/uml/uml.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 8.9 KiB |
29
Structural/Decorator/uml/uml.txt
Normal file
29
Structural/Decorator/uml/uml.txt
Normal 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
|
Loading…
x
Reference in New Issue
Block a user