So we know the 'why' now, but that still leaves me with the issue.
Should containsBean() be modified to check the parent for the bean? I think it should. What's the point in having a parent otherwise? (Forgive me for maybe not knowing all ColdSpring features yet...)
The other option would be modifiying findBeanNameByType() so it handles extended component types correctly.
Any other options? Besides not extending services...

Regards,
Ruud


Kurt Wiersma schreef:
The idea of having a hierarchical bean factory was mine. The idea is that if you have an application whose services rely on a set of shared, enterprise wide, services this application could take the enterprise services in as a parent bean factory to its factory and any dependencies that the application's services have on the enterprise services would be resolved by CS since they would live in the same bean factory. The hierarchical AppContexts, on the other hand, are setup to allow you setup a series of separate bean factories for an application which do not resolve dependencies between the different factories. (example: would be large application with different modules)
I probably need to publish a good example of how I use the hierarchical bean factories for this to make more sense. Currently I don't have a use for the hierarchical AppContexts but I could see how in a really large application they might be useful. I should note too that inspiration for both of these ideas came directory from Java's Spring framework.

--Kurt

On 5/5/06, Dave Ross <[EMAIL PROTECTED]> wrote:
It was always that way according to FishEye:
 
 
containsBean() was checked in with that code commented out. I think there was some internal debate whether to leave AppContext and BeanFactory separate (e.g. AppContext *is* a BeanFactory with hierarchical features) or just throw the hierarchical stuff right into the default BeanFactory. Leaving them separate won out.
 
-Dave
 
On 5/5/06, Sean Corfield <[EMAIL PROTECTED] > wrote:
On 5/5/06, Ruud Hermans < [EMAIL PROTECTED]> wrote:
>  As for the second issue: I'm using the bleeding edge and I traced the cause
> of the issue.
>  The problem only occurs in subapps that use a bean which is defined in a
> parent services.xml.
>  Since the method 'containsBean' in DefaultXmlBeanFactory doesn't check its
> parent anymore (The code that does, is commented out. Another earlier
> discussion I missed? :) ), coldspringPlugin.cfc will call findBeanNameByType
> (line 162). And here is where things go wrong, since obviously the extended
> component type differs from the original component type.

I was confused to see that containsBean() *did* check its parent
because it seemed to me that was the whole point of the
ApplicationContext (which has hierarchical factories). I couldn't
understand why the regular factory did this. So, I'm not surprised
this has changed now. Um, did anyone follow that logic? :)

However, it would be nice to know *why* it was the way it was and why
it has recently changed.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



Reply via email to