Added DependencyInjection UML

This commit is contained in:
John Webb
2014-07-29 10:58:40 -05:00
parent 3a7e38f91d
commit aef2f34993
16 changed files with 59 additions and 27 deletions

View File

@@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@@ -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