The Artima Developer Community
Sponsored Link

Java Buzz Forum
when spring prototype beans are not prototypes

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Marc Logemann

Posts: 594
Nickname: loge
Registered: Sep, 2002

Marc Logemann is founder of www.logentis.de a Java consultancy
when spring prototype beans are not prototypes Posted: May 22, 2007 3:51 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Marc Logemann.
Original Post: when spring prototype beans are not prototypes
Feed Title: Logemann Blog
Feed URL: http://feeds.feedburner.com/LogemannBlog
Feed Description: Marc Logemann's thoughts on java and other stuff
Latest Java Buzz Posts
Latest Java Buzz Posts by Marc Logemann
Latest Posts From Logemann Blog

Advertisement

One thing i really would like to see in spring is a more natural approach for declaring prototype beans when used by singleton beans. To be more detailed. When spring managed Bean A is a singleton and is using Bean B wich is a prototype (which is injected via setter injection), then its of course not enough to just tell spring that Bean B has scope “prototype”. Now everyone could argue that this is obvious and thus a no brainer because Bean A will always hold the same instance of Bean B due to the fact that the setter will be invoked only once throughout the entire lifetime. Even though its obvious for spring veterans, the forums speak a different story, just search for the word prototype and you will see plenty of questions in that area.

I am aware of Lookup-Method Injection which addresses exactly that problem, but even better would be a more automatic approach. I would like to use the same config semantics as with regular setter injection, spring should be doing the hard work for us. We already told spring what we want in form of describing how beans should be created and how they are wired together.

Read: when spring prototype beans are not prototypes

Topic: A FireFox Plugin for Eclipse Previous Topic   Next Topic Topic: Links for 2007-05-16 [del.icio.us]

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use