Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.0
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
Since all the Guice stuff really saves me typing and allows me to write cleaner code (whethever this is a more or less a pure "IoC" approach), I decided to try adding annotations processing into pico as well as implicit binding. So far I implemented @Inject, @Singleton, @ImplementedBy.
public class Cat implements CatSoul {
@Inject
private Mouse mouse;
@Inject
private ExtendedPicoContainer container;
public Mouse getMouse()
{ return mouse; }public ExtendedPicoContainer getContainer()
{ return container; }}
@ImplementedBy(Cat.class)
public interface CatSoul {
public abstract Mouse getMouse();
}
and then you can write
ExtendedPicoContainer pico = new DefaultExtendedContainer();
CatSoul cat = pico.get(CatSoul.class);
assertNotNull(cat);
assertNotNull(cat.getMouse());
Activity

Field | Original Value | New Value |
---|---|---|
Key |
|
|
Project | PicoContainer Plugins [ 11080 ] | PicoContainer [ 10120 ] |

Attachment | picocontainer-src.patch [ 27179 ] |

Attachment | pom.xml.patch [ 27180 ] |

Assignee | Mauro Talevi [ maurotalevi ] |

Status | Open [ 1 ] | Closed [ 6 ] |
Fix Version/s | 3.0 [ 14410 ] | |
Resolution | Fixed [ 1 ] |
Added to sandbox: https://svn.codehaus.org/picocontainer/java/sandbox/picocontainer-annotations/
A few changes:
Comments on the actual implementation and annotations should be done on the mailing list.