Unity 2.0 design pattern in simple words:
- Unity 2.0 is a type of design pattern that can be used to implement composite application library.
- Unity 2.0 design pattern lets us to view different modules of our composite application to appear as signal entity.
- It allows objects belonging to different modules to implement dependency on each other.
"Unity 2.0 design pattern is used to implement dependency injection"
How to implement Unity 2.0 design pattern?
Step 1: Download Unity 2.0 library. This can be found here.
Step 2: Create composite application using Composite Application Guidance. You can find the details about this here.
Step 3: Override the boot strapping class in composite application to use Unity bootstrapper.
Step 4: Identify classes in your composite application that are dependent.
Step 5: Create a dependency injection (DI) container using the Unity 2.0 library.
Step 6: Implement dependency injection using one of the following techniques:
- Using build up to wire up objects not created by the container
- Using injection attributes