This example again demonstrates how utilizing an IoC container allows sophisticated wiring of components while not requiring either the client or the server to know about it.
The latest example has totally rewired the original concept of the application simply by coding a different set of blue prints, i.e. IoC configuration. It also demonstrates how things are more powerful and sophisticated when using the pure Python IoC configuration. We were able to mix in code as well as parameters, which is much smoother than writing XML files.
Our application started off as a simple client calling a service. By rewiring it to use IoC, it allowed us to easily reconfigure things to run multiple copies of our service on multiple nodes, without having to change the core logic.
Our round robin dispatcher is admittedly very simplistic. A real production solution would require:
Spring Python doesn't provide dispatchers, routers, and other types of components used to integrate systems together. Spring Integration (http://www.springsource.org/spring-integration) is a separate part of the Spring portfolio that brings these features to Java. Spring Python Remoting is a building block that in the future can be used to build a Spring Python Integration module.
We could spend countless hours refining our dispatcher. We can also focus on adding more features to our core business logic.
The important factor in all this as that we have demonstrated how Spring Python provides a non-invasive way to scale our original application far beyond what it was originally designed for.
In this chapter we have learned:
In the next chapter, we will use all of Spring Python's components to build a simple, scalable, and secure application with strong integrity.