Ticket #778 (confirmed enhancement)
Inversion of Control and Dependency Injection
|Reported by:||laurentj||Owned by:|
|Hosting Provider:||Blocked By:|
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.