Details
-
Type: Improvement
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 1.0-beta-5, 1.1, 2.0
-
Fix Version/s: 1-1-beta-2
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Environment:all
-
Number of attachments :
Description
There is a cyclic dependency between the ComponentAdapter and PicoContainer interfaces, which is not very nice at all. Worse, ComponentAdapter even depends on MutablePicoContainer.
This is bad design (cyclic == bad), and it creates headaches when writing a custom PicoContainer implementation.
The dependency from ComponentAdapter on MutablePicoContainer and on PicoContainer should be removed. A way to do that is to use some kind of context/resolver/dependency provider interface, have the PicoContainer feed that to the ComponentAdapter, and remove the resonsibility on ComponentAdapters to register themselves with the PicoContainer (which can be seen as subversion of control, in fact).
A design similar to this existed previously (ComponentRegistry).
This has come up several times now. Recent mailing list thread is at:
http://lists.codehaus.org/pipermail/picocontainer-dev/2003-December/001913.html
Activity
Field | Original Value | New Value |
---|---|---|
Affects Version/s | 2.0 [ 10411 ] | |
Affects Version/s | 1.0.1 [ 10307 ] | |
Assignee | Jon Tirsen [ tirsen ] | |
Fix Version/s | 2.0 [ 10411 ] |
Fix Version/s | 2.0 [ 10411 ] | |
Fix Version/s | 1.0 [ 10145 ] |
Fix Version/s | 1.0-beta-4 [ 10412 ] | |
Fix Version/s | 1.0 [ 10145 ] |
Priority | Major [ 3 ] | Blocker [ 1 ] |
Priority | Blocker [ 1 ] | Minor [ 4 ] |
Fix Version/s | 1.0-beta-4 [ 10412 ] | |
Fix Version/s | 1.0 [ 10145 ] |
Fix Version/s | 1.0-beta-5 [ 10145 ] | |
Fix Version/s | 1.0-RC-1 [ 10461 ] |
Fix Version/s | 1.0.1 [ 10307 ] | |
Fix Version/s | 1.0-RC-1 [ 10461 ] |
Fix Version/s | 1-1-beta-2 [ 11243 ] | |
Resolution | Fixed [ 1 ] | |
Assignee | Jon Tirsen [ tirsen ] | Joerg Schaible [ joehni ] |
Fix Version/s | 1.1 [ 10307 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
The cyclic dependency between ComponentAdapter and (Mutable)PicoContainer is on the method parameter level, and not on the instance level. This is not the worst kind of mutual dependency in the world, and we can live with it for now.
However, I agree that this should be fixed. We can certainly make PicoContainer more IoC by introducing some kind of ComponentLookup interface.
I am positive about this. But I think it should be postponed until after the release of PicoContainer 1.0, preferrably on a 2.0 branch as this will break BWC.