• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Spring Bean parent child scope relationship?  RSS feed

 
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!