As Spring 3.0 support annotation to configure beans using @configuration and @bean there is no need of declare beans in the xml file right? so i guess in future the class XmlBeanFactory will be deprecated? Any comments on which way is more efficient?
This is a general trend with more than just Spring and comes under the general heading of "zero configuration". You can see similar stuff in Java EE, for example.
However, annotations by themselves have problems, since if they were left unattended, they'd require hard-wiring of component relationships and configuration parameters. That would remove a lot of Spring's flexibility to allow reusable code, plugin components, and special wiring for test frameworks.
So the actual process (in Spring and elsewhere) is that if an XML file exists, it will override the annotations. That way you can take a "management by exception" approach, code the information in the Java files (where appropriate), but still be able to customize it by external directives in the XML file.
So XML is not obsolete, just no longer the only way to do things.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
posted 10 years ago
Thankx Tim for the reply...by the way what you mean by "if they were left unattended"?