|
From: Roland H. <Rol...@co...> - 2005-07-27 07:36:42
|
Hi, we are using multiple application modules, which we are wiring together during a bootstrap process. Each module has it's own container which is connected to its dependent module via a parent-child relationship (as described in http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/beans/factory/access/SingletonBeanFactoryLocator.html) However, the restriction to a strict treelike organization of ApplicationContext limits the usability of this pattern. E.g. imagine the following use case with four contexts: * bootstrap-ctx.xml for defining base beans used by any other container * dao-ctx.xml for defining DAOs. Depends on bootstrap-ctx.xml * security-ctx.xml depends also on bootstrap-ctx.xml but not on dao-ctx.xml * service-ctx.xml which depends on beans defined in security-ctx.xml and dao-ctx.xml. Using an hierarchical container setup something like a 'diamond' (graph) would be appropriate: bootstrap / \ / \ dao security \ / \ / service However, Spring doesn't allow multiple parent container, so we are left with the following linear setup: bootstrap | dao | security | service which has the undesired side-effect, that 'security' has access to 'dao'. Ok, this works for this simple setup, but one can easily imagine situations, where this 'linearity' restriction bites much harder. My question is, whether there are any plans for supporting ApplicationContext chaining in a more flexible way (i.e. with multiple parents) ? Or is there already another support for scoping beans coming from various application components ? For the moment, we switched to a single, big container which import various context snippets from the application modules and use bean-aliasing for scoping. ciao... -- ...roland huss consol.de |