Announcement Announcement Module
Collapse
No announcement yet.
singleton, abstract/parent attributes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • singleton, abstract/parent attributes

    I don't think I've seen this documented anywhere: Is the "singleton" attribute inherited by child bean defs?

    I see this in the reference guide: "The remaining settings will always be taken from the child definition: depends on, autowire mode, dependency check, singleton, lazy init."

    So that means I must explicitly set singleton="false" on every bean that I wish it to be so and cannot have the setting inherit if set explicitly on the parent?

  • #2
    Originally posted by pfn
    So that means I must explicitly set singleton="false" on every bean that I wish it to be so and cannot have the setting inherit if set explicitly on the parent?
    As far as I know, yes. I guess the rationale is to prevent side-effects.
    In a large project you can have parent definitions in a separate context file. If you rely on all children being singletons and one changes the parent definition he will break things (probably being unaware of it).

    Regards,
    Andreas

    Comment

    Working...
    X