<beans>
<bean id=".." class="...">
...
</bean>
...
<beans>
So why does this tags are named <beans> and <bean>? This seems to be misleading.
In Spring one way of binding objects is using the beaness of java classes. But that is not that only way to bind them together, constructor can be used to bind objects. So if configuration file used tags as follows, it would be more meaningful.
<objects>
<object id=".." class="...">
...
</object>
...
<objects>
Seems it is used only to express that beaness can also be used in initialization. Would you agree? May be we are not seeing the exact reason. This is completely open for discussion.
Spring.NET uses object instead bean
ReplyDeleteYes, that's true. Spring.net uses "objects" and "object" while the other is using "beans" and "bean". Not sure why.
ReplyDeleteSeems your argument is correct.
ReplyDeleteI'm a little new to this but though your arguments do make some sense, I think the use of the and tags grew from the JavaBean convention in Java programming. This is possibly part of the reason why was used in Spring.NET as supposed to .
ReplyDeletehttp://en.wikipedia.org/wiki/JavaBean
Hi Myron, Yes I agree, JavaBeans spec must have an impact since Spring uses setters for injection. However the point is there's no requirement for our Java classes to be JavaBean spec complaint to be used inside a Spring config; even factory methods can be invoked using Spring config.
ReplyDeleteCheers.
Yes, I agree. I do believe the concept of Spring Beans grew from the JavaBeans concept. I think it was also a way to counter Enterprise Java Beans. If you all remember when Rod Johnson first introduced Spring it was suppose to be the anti-EJB. I think using the term bean was an attempt to reminded developers what EJB should have been (simple and straight forward) versus what it turned out to be (tedious and in many cases overkill). With that said I do think object is a better term than bean, but after 9 years of beans it may be tough (initially at least) to get developers to see it any other way.
ReplyDelete