Announcement Announcement Module
Collapse
No announcement yet.
NewbieQ: Additive IoC? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NewbieQ: Additive IoC?

    Hello...
    I'm just getting introduced to Spring IoC. I see that an ApplicationContext can handle multiple config files...which is fantastic! The beans specified in app config file Foo.xml overriding/replacing bans defined in Bar.xml having the same label.

    Ok, fine... but is there a way I can define a bean, in my "global" app config file that has a property, say a Map, and have my child config files add values to the map...not replace the original bean?

    Thanks!
    Greg

  • #2
    You can use child bean definitions to do something similar to what you are describing. Read section 3.5 of the Spring reference docs for more info (http://www.springframework.org/docs/...an-definitions).

    However, as far as I know it's not possible to define half the elements of a map property in a abstract bean and the other half in a child bean.

    Erwin

    Comment

    Working...
    X