Bean definition 

The metadata of a bean has its own properties with independent bean definitions. Some of these bean definitions are as follows:

  • Class: This will be used to create a bean, and it is mandatory to mention a class name for which we are supposed to create a bean.
  •  Name: If we want to define different aliases for the bean, then we use the name attribute, with the help of a separator, such as a comma (,) or semicolon (;). When we have XML-based configuration, we can use the name and/or id attribute as an identifier for a bean. A bean with an id attribute is preferred, because it is mapped with an actual XML ID element. 
  • Constructor-arg: A constructor argument is used to inject dependencies by passing a parameter as an argument ...

Get Java 9 Dependency Injection now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.