Getting started with Unity Framework
Last few months I have a thought about how to develop application with loosely coupled components. This is our primary objective when we goes for a scalable application development.
Unity container is one of the promising solution to develop any highly scalable solution. Let me explain it with a real life scenario. Such as, calculation of taxes or shipping charges in different country, states and zones. These are very common factors, which are become reasons to modify existing scripts/codes. Internal rules and methods of creating invoices partially depended on these rules of different type of charges.
Charges might be introduce by any governing body or as per the the new policy of any company, but it's take a long time to introduce and test the existing tested part of the solution again and again. Whereas, the dependency of components are minimized in any loosely coupled solution. It's just an approach like plug-&-play system. Few line of changes in any configuration file is good enough to integrate a new rule or logic into the system or couple of minutes to remove it from the system. Anyhow, the system can run without this additional part or work with it.
This kind of approach is not so new. We are familiar with Plug-ins, Add-on and Filters etc. Those are use to introduce scalability in any application or system. Any famous e-commerce or accounting system allow to download and install third-party components. However This one we can use to save our times, which we always spend for our boilerplate codes.
In addition, Unity container supports interception.
You can read more about this container from following links -
- patterns & practices - Unity
- Dependency Injection with Unity - Developer's Guide (new)
- A basic introduction to the Unity Application Block
- Oxite - uses of Unity for DI
- Hands-on labs (part of the Enterprise Library set)