Announcement Announcement Module
Collapse
No announcement yet.
Bean definition inheritance Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bean definition inheritance

    Hi,

    If in container i use Bean definition inheritance feature and make one bean use other as parent, then can i also access the methods from parent class or only the properties...

  • #2
    Bean inheritance is a way to move common part of configuration to a parent bean. It has nothing to do with Java class inheritance. So there is no parent class, there is only a bean target class that can be configured either in a child bean or its parent bean definition. When you have bean A as parent and bean B as its child, when creating B, a merged definition of A and B is used (only one target class, properties elements are merged).
    >> can i also access the methods from parent class or only the properties...
    In a bean definition, you can access properties (like in any other bean definition). In a class instance, you can access all methods of the target bean class.

    Comment

    Working...
    X