Sitting in on Dave Ross's Inversion of Control (ColdSpring) presentation right now. Dave's laying the groundwork for the "what & why" of ColdSpring. For background, it's a framework, but not one like ModelGlue, Fusebox, Mach-II, etc. It's more like a container for your application's model. It doesn't handle HTTP requests. It's based off of the Java Spring framework, but it's not a one-for-one port. It attempts to solve the same problems, though.
ColdSpring implements a flexible model, where components use each other (one component depends on another to do work), as opposed to one component creating and configuring another. This is called a dependency, with the two components being collaborators. As an IoC container, ColdSpring injects one component into another. Components don't have to create and configure each other - they just use each other. This also makes the actual implementation unimportant as you are now programming to an interface.
Polymorphism - you can swap out one implementation of a component for another and collaborators don't know the difference.
ColdSpring works like this:
How does ColdSpring get used in a real app:
BeanFactory can also do auto-wiring. Lets ColdSpring automatically figure out which components should be injected where by looking at the method signatures of the defined components and matching with bean definitions. There are pros and cons to auto-wiring. Pros are less typing and less xml. Cons are having to keep better track of what's going on.
ColdSpring AOP (aspect oriented programming). It allows you to apply a piece of code across the rest of your codebase in logical places - such as before or after a method call or when an exception is thrown. AOP is often used in logging and security, but it isn't limited to that. It also works well for managing transactions and workflow. ColdSpring AOP can also be used to expose functionality to services such as Flash Remoting without having to create a facade. Chris Scott programmed the AOP piece of ColdSpring.
ModelGlue 2.0 uses ColdSpring as the default IoC container. It's used by the framework itself and is also exposed so you can use it.
There are no comments for this entry.
[Add Comment]