[Design the new POJO MicroContainer] - Re: Moving microcontainer -> kernel
by adrian@jboss.org
"david.lloyd(a)jboss.com" wrote :
|
| | public static BeanMetaDataBuilder createBuilder(String name, String bean)
| |
|
| This just makes no sense. One of those parameters is the name of the bean associated with the BeanMetaData, the other is the name of the class. But which is which? I get it wrong about half the time.
|
This must be a bad example? The javadoc tells you which is which.
If you posted all the code;
| /**
|
| * Create builder from name and bean.
|
| *
|
| * @param name bean name
|
| * @param bean bean class name
|
| * @return new Builder
|
| */
|
| public static BeanMetaDataBuilder createBuilder(String name, String bean)
|
| {
|
| return BeanMetaDataBuilderFactory.createBuilder(name, bean);
|
| }
|
|
Parameter names have no meaning in java anyway - it being a positional language - so they could be called x and y. This is "Humpty dumpty" again.
"bean" is actually the name of the class on BeanMetaData because you can't have
a get/setClass() - it already means something else in java.lang.Object.
Anyway, "String bean" is kind of funny, even if it wasn't an intentional joke by Ales. :-)
http://en.wikipedia.org/wiki/Green_beans
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4234730#4234730
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4234730
15 years, 9 months
[Design the new POJO MicroContainer] - Re: Moving microcontainer -> kernel
by david.lloyd@jboss.com
"adrian(a)jboss.org" wrote : "david.lloyd(a)jboss.com" wrote : OK, I may not agree that this is "right" but it is what it is. I think there's one thing we can agree on though - the parameter ought to have a more accurate name, like "beanName" or "beanIdentifier" rather than just "bean", because "bean" implies an expectation that you're passing in the actual bean object in question rather than its identifier.
|
| You simply don't get it.
|
I get it - as I said, it is what it is. I'm just saying that at the least we ought to change the parameter name because it's misleading. For example, BeanMetaDataBuilder gives us:
| public static BeanMetaDataBuilder createBuilder(String name, String bean)
|
This just makes no sense. One of those parameters is the name of the bean associated with the BeanMetaData, the other is the name of the class. But which is which? I get it wrong about half the time.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4234726#4234726
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4234726
15 years, 9 months
[Design the new POJO MicroContainer] - Re: Moving microcontainer -> kernel
by adrian@jboss.org
"david.lloyd(a)jboss.com" wrote : OK, I may not agree that this is "right" but it is what it is. I think there's one thing we can agree on though - the parameter ought to have a more accurate name, like "beanName" or "beanIdentifier" rather than just "bean", because "bean" implies an expectation that you're passing in the actual bean object in question rather than its identifier.
You simply don't get it.
The controller context, dependencies, etc. has nothing to do with a "bean"
or the choices of any particular component model.
The POJO controller context is only one possible implementation that relates to beans
and that happens to use a String as the name.
Other component models don't have to use a String for the name.
Its up to each component model to keep things consistent.
If you want the longer version of this argument, at least as it relates to JMX, then use
search. I know I've been over the issue at least once before at some length in this forum.
There's even a JIRA (or at least a discussion) somewhere about using a "UUID"
as the real id with the publically visible "name" just being an alias.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4234706#4234706
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4234706
15 years, 9 months