• 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
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Spring Bean parent child scope relationship?

 
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.
 
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!