Results 1 to 2 of 2

Thread: Bean definition inheritance

  1. #1
    Join Date
    Mar 2008
    Posts
    23

    Default 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. #2
    Join Date
    Sep 2012
    Location
    Czech Republic
    Posts
    39

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •