[jboss-dev-forums] [Design the new POJO MicroContainer] - Indirect dependency names
scott.stark@jboss.org
do-not-reply at jboss.com
Wed Apr 9 23:47:10 EDT 2008
One issue I have with creating the component factory notion pattern is that the factory wants to describe relationships between components with logical names that have to be transformed into unique names for the mc beans that are installed when the factory is asked to create the component beans.
For example, and ejb component factory would have BeanMetaData for the interceptors that included an
| AbstractInstallMetaData install = new AbstractInstallMetaData()
| install.setBean("BeanContext");
| install.setMethodName("addInterceptor");
| ...
|
The "BeanContext" name is the logical component name portion of the bean context. When its created as an mc bean instance by the component factory, this gets transformed into a unique name using an input base name and component id number. I'm going to have to extend all of the dependency related metadata and builders to override the depends name to allow for a transformed name.
I'm wondering if we should have consistent support for a dependency name abstraction that would allow for name transformation more easily. The existing String/Object based name methods would just call the generalized version taking a DependencyName with an IdentityDependencyName implementation:
| interface DependencyName
| {
| Object getName();
| }
| class IdentityDependencyName implements DependencyName
| {
| private Object name;
| IdentityDependencyName(Object name)...
| Object getName() { return name; }
| }
|
| class AbstractInstallMetaData
| {
| private DependencyName bean;
|
| public setBean(String bean)
| {
| setBean(new IdentityDependencyName(bean));
| }
| public setBean(DependencyName bean)
| {
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143035#4143035
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143035
More information about the jboss-dev-forums
mailing list