Ticket #778 (new enhancement)
Inversion of Control and Dependency Injection
| Reported by: | laurentj | Owned by: | |
|---|---|---|---|
| Priority: | highest | Milestone: | Jelix 1.2 |
| Component: | jelix:utils | Version: | 1.0RC1 |
| Severity: | normal | Keywords: | |
| Cc: | Php version: | ||
| Review: | Hosting Provider: | ||
| Blocked By: | Documentation needed: | no | |
| Blocking: |
Description
Christophe's patch #523 brings a kind of dependency injection / Inversion of Control, but it is not enough. We should provide a real framework for IOC/DI.
First, we should have DI on constructors. We could have too DI throw setters.
I think we could remove methods added by Christophe on jClasses, and then get/create methods could do IOC/DI transparently. For example, this methods could check if there is a mapping for the given selector. If yes, it use jClassBinding etc, and if not, it tries to load the class as usual.
To indicate the dependencies, I don't know yet if we should use an xml file or a simple ini file. We'll see.
Change History
Note: See
TracTickets for help on using
tickets.
