-
1. Re: MC facade / fancy handles
adrian.brock Apr 10, 2008 1:27 PM (in response to alesj)You're talking about old IOC style programming
i.e. registry.getBean(name);
I don't like this form of IOC since it means you are tied to the container api
and therefore not portable across IOC containers.
It should be discourged. The best way to get the bean is to inject it. :-)
But if you are going to do it, then you're better off using something like the locator
pattern examples I did in the initial user guide.
Either:
* Use the MC to build up a singleton hashtable name->object
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontainer/trunk/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/HashtableLocator.java?revision=66902&view=markup
* Use the MC directly as the implementation detail of the locator
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontainer/trunk/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/ControllerLocator.java?revision=66902&view=markup -
2. Re: MC facade / fancy handles
alesj Apr 10, 2008 5:04 PM (in response to alesj)"adrian@jboss.org" wrote:
* Use the MC directly as the implementation detail of the locator
It's this one that needs to be pimped even more. :-)
But the question was more 'where' to put this than what/how.
And /dev/null or /dev/random is not appripriate. ;-)