An extension of spring framework developed by Grid Dynamics which helps monolith apps became more modular but still staying the monolith at the same time.
3. What we have?
● Highload backend for eCommerce site
○ Many many modules
● Deployed to a cluster as a single Web App
○ Servlet container
○ Spring MVC
● Builds with Maven
4. What is the problem?
● When your application becomes bigger it have to be
modular
○ Modules are crafted by isolated teams
○ During application build module dependencies have
to be validated
○ Once application is built it have to be easy deployable
○ Communication between modules have to be fast
5. How about osgi and ejb?
● Additional build steps
○ Deployment descriptors
● Problems
○ Ejb requires Ejb container
○ Just google for "Osgi pain"
○ Hot partial redeploy is evil at production
● Long learning curve
6. Spring is not modular!
● bean name clashes
● conflicting aspects, default scope, etc
● run or fail entirely
7. Spring Nested
● Lets make spring modular!
○ Root context loads children contexts
○ Children contexts are isolated
■ no bean clashes
■ no problems with AOP
■ etc
○ Children contexts export and import shared
beans explicitly
8. How does it work?
2. Children context exports shared bean
3. Other children context imports shared bean
1. Root context loads children contexts
9. Features!
● Build time features
○ validation
■ wrong interface/name
■ import with no exports
■ export with no imports
■ cyclic references detection (prohibit)
● Runtime features
○ run only specified modules
○ fault-tolerance mode - skip failed modules
10. Pros and cons
● Pros
○ It's just a jar!
○ It's just a spring!
○ It's simple and robust!
● Cons
○ Sometimes you still need hammer-like EJB
and OSGI
11. Hey! Give me some links!
http://blog.griddynamics.com/search/label/Spring
https://github.com/griddynamics/banshun