• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring Bean parent child scope relationship?

 
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Lets see,

Parent Bean A has singleton Bean --> Child class will be by default if not defined.

Parent class is Prototype --> Then child class is singleton --> will this work.

So what is the rules of the scope of inheritance in spring if parent bean has differnt bean and then child is by default?

rgds,
ranjan
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am answering-
If parent bean has scope singleton then child bean should always be singleton even if we write the scope of child bean to prototype in context.xml file.

Child inherits and overridden the properties of parent in spring.
reply
    Bookmark Topic Watch Topic
  • New Topic