If you build modular app with Spring by importing children contexts into the parent ones, you face the limitations quite soon. The next step obviously, is approaching overweight OSGi. Isn't there something between these two extremes, which powerful enough and still light yet? Sure! Meet Banshun! Easy modularity for Spring.
Banshun allows to instantiate children contexts in a proper order considering declared references between singletons across the contexts.
3. Agenda - Features
●buildtime & runtime app customization
●developer friendliness
○references validation
○cycles resolution
○root cause logging
○fault-tolerance
○dependencies graph
●Spring AOP support
4. Is it your app?
:TheService
+ doBusiness(param) : Result
5. Is it your app?
:TheService
+ doBusiness(param) : Result
RDBMS
6. Is it your app?
:TheService
+ doBusiness(param) : Result
7. Is it your app?
<bean id="theService" class="com.foo.TheService">
... </bean>
<bean name="/web-service"
class="org.spring...HessianServiceExporter">
<property name="service" ref="theService"/> ....
</bean>
<bean id="/form" class="com....Controller"> </bean>
8. Don't you need to deploy it?
:TheService
+ doBusiness(param) : Result
9. Don't you need to deploy it?
:TheService
+ doBusiness(param) : Result
<<EAR>>
<<container>>
10. Don't you need to deploy it?
:TheService
+ doBusiness(param) : Result
<<WAR>>
<<container>>
11. The app becomes big
:FooService
:ZooService
:MooService
:FooService
:BarService
:BazService
<<WAR>>
12. The app becomes big
<<WAR>>
:FooService
:BarService
:BazService
:FooService
:BarService
:BazService
13. it have to be modular
:FooService
:BarService
:BazService
:MooService
:ZooService
<<component>>
:AService
:BService
:CService
:DService
:EService
<<component>>
22. are about multiple
classloaders
OSGi EJB
http://docs.jboss.
org/jbossas/docs/Server_Configuration_Guide/4/html/Inside_the_JBoss_Class_Loading_
rchitecture-The_Complete_Class_Loading_Model.html
23. OSGi, EJB
is about multiple
classloaders
Single classloader
is enough!
Banshun
resolves versions at build time
47. Build time Customization
<bean id="root" class="..banshun.ContextParentBean">
<property name="configLocation"
value=" -context.xml
..."/>
... </bean>
*
B A
48. Run time Customization
<bean id="root" class="..banshun.ContextParentBean">
...
<property name="runOnlyServices"
value="basketService
profileService">
..
... </bean>
BA BA