Using Unity Container Hierarchies

July 26, 2008

Using Unity Container Hierarchies In today’s post I’m going to explain why and how to use the Unity container hierarchies. As the subject suggest Unity application block supports nested containers and allow you to build containers hierarchies. Why to Use Nested Containers  There are two reasons to use a nested containers: Control the scope of singleton object instances. Register different mapping for specific types. Controlling the Scope of Singleton Object Instances  Singleton objects lifetime is managed by the Unity container. They are kept in scope as long as the container isn’t disposed. In order to enable the existence of two separate sets of...

Working With Generic Types In Unity Configuration Section

July 25, 2008

Working With Generic Types In Unity Configuration Section In my previous post about Unity I  discussed about configuration files and how to configure Unity with them. I got a question in the subject of how to use generic types in the configuration files. This post will answer that question. The Scenario I have an interface of IValidator which receives a generic type T.     public interface IValidator<T>     {         #region Methods         void Validate<T>();         #endregion     } Also, I have a class Validator which receives a generic type T and implement the IValidator interface.     public class Validator<T> : IValidator<T>     {         #region IValidator<T> Members         public...

Mediator Pattern

July 24, 2008

Mediator Pattern Today’s pattern in the design patterns series will describe the mediator pattern. You can read my previous posts about design patterns here: Structural patterns Decorator pattern  Proxy pattern Facade pattern Adapter pattern Composite pattern Bridge pattern Flyweight pattern Creational patterns Singleton pattern Abstract...
no comments

Working With Configuration Files In Unity

Working With Configuration Files In Unity In the previous posts about Unity I discussed basic concepts and showed how to use Unity in ASP.NET web forms.  In this post I’m going to show how to use Unity with configuration files. The Unity Configuration Section In order to start working with configuration files with Unity the first thing to understand is the configuration section. Lets start with an example of ...

Guiding a New ASP.NET Group

July 15, 2008

Guiding a New ASP.NET Group Today I have started to guide a new ASP.NET group in SRL Group. As I written in early post, I have guided an ASP.NET group last year. All the trainees of the last group have succeeded to pass the 070-528 certification and this is one of the goals for this group as well. The main goal of the group is to help SRL employees to deeper learn the basics of ASP.NET. In the meetings I try...

Chain Of Responsibility Pattern

July 11, 2008

Chain Of Responsibility Pattern Today’s post will introduce the chain of responsibility pattern. You can read my previous posts about design patterns here: Structural patterns Decorator pattern  Proxy pattern Facade pattern Adapter pattern Composite pattern Bridge pattern Flyweight pattern Creational patterns Singleton pattern Abstract Factory pattern ...
one comment

ASP.NET Server Side State Management – Profile Properties

July 4, 2008

ASP.NET Server Side State Management – Profile Properties Today it is the last post in the ASP.NET state management series. In this post I’m going to describe the profile properties technique. You can read my previous posts in the state management subject in the following links: Client side state management introduction ViewState technique Hidden fields technique Query strings technique Cookies technique ...
no comments

How To Use Unity Container In ASP.NET

July 1, 2008

How To Use Unity Container In ASP.NET Today’s post will explain how to include Unity container  in ASP.NET web applications. The details I write here are based on David Hayden’s screen cast and therefore the credit is for David Hayden. Another good example of how to use Unity container through WCF service can be found in this post. Building The Container The first thing to do is to build the Unity container. We would like to have a persistent container that hold it’s state during the running of the application. The right place to put the  is as part of...