• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Does Autowire feature like extending a class?

 
Ranch Hand
Posts: 282
2
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think my doubt is related to this post and it's rolling in my mind for a long. Does Autowire feature provide all the features as like if extend a class ?  

To elaborate, if we Autowire a class in another class using @Autowired annotation then creation of object as a bean will be taken care by Spring container. And we can reuse all of its fields and attributes ? Is there any limitation to Autowire and extends Keyword  ? Then does Autowire came into scene as a reusable feature? It's known that Autowiring is not to encourage tightly coupled  beans. Is my Question logic ? Why my brain thinks Autowire as an Reusability feature ? Please help me with your comments. Thanks
 
Enthuware Software Support
Posts: 4667
51
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mohammed Sardar. wrote:I think my doubt is related to this post and it's rolling in my mind for a long. Does Autowire feature provide all the features as like if extend a class ?  

To elaborate, if we Autowire a class in another class using @Autowired annotation then creation of object as a bean will be taken care by Spring container. And we can reuse all of its fields and attributes ? Is there any limitation to Autowire and extends Keyword  ? Then does Autowire came into scene as a reusable feature? It's known that Autowiring is not to encourage tightly coupled  beans. Is my Question logic ? Why my brain thinks Autowire as an Reusability feature ? Please help me with your comments. Thanks


No, autowiring is not like extends. Autowiring is about "has-a" and extends is about "is-a", the concepts that you studied while preparing for OCAJP
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic