[picocontainer-scm] [jira] Updated: (PICO-293) Annotation extension for picocontainer
"Mauro Talevi (JIRA)" <jira-yCVjj/[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.cvs |
|---|---|
| Message-ID | <8300873.9679.1257974335251.JavaMail.haus-jira@codehaus01.managed.contegix.com> |
[ http://jira.codehaus.org/browse/PICO-293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mauro Talevi updated PICO-293:
------------------------------
Assignee: (was: Mauro Talevi)
> Annotation extension for picocontainer
> --------------------------------------
>
> Key: PICO-293
> URL: http://jira.codehaus.org/browse/PICO-293
> Project: PicoContainer
> Issue Type: New Feature
> Reporter: Erik Putrycz
> Attachments: annotations-project.zip, picocontainer-src.patch, pom.xml.patch
>
>
> 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());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
<a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>