Archive for October, 2012


Unity Framework

Unity is a lightweight, extensible dependency injection container. It facilitates building loosely coupled applications and provides developers with the following advantages: • Simplified object creation, especially for hierarchical object structures and dependencies • Abstraction of requirements; this allows developers to specify dependencies at run time or in configuration and simplify management of crosscutting concerns • Increased flexibility by deferring component configuration to the container • Service location capability, which allows clients to store or cache the container • Instance and type interception Unity is a general-purpose container for use in any type of Microsoft® .NET Framework-based application. It provides all of the features commonly found in dependency injection mechanisms, including methods to register type mappings and object instances, resolve objects, manage object lifetimes, and inject dependent objects into the parameters of constructors and methods and as the value of properties of objects it resolves. In addition, Unity is extensible. You can write container extensions that change the behavior of the container, or add new capabilities. For example, the interception feature provided by Unity, which you can use to capture calls to objects and add additional functionality and policies to the target objects, is implemented as a container extension.

MVVM

The Model View ViewModel (MVVM) is an architectural pattern used in software  engineering that originated from Microsoft which is specialized in the  Presentation Model design pattern. It is based on the Model-view-controller  pattern (MVC), and is targeted at modern UI development platforms (WPF and  Silverlight) in which there is a UX developer who has different requirements  than a more “traditional” developer. MVVM is a way of creating client  applications that leverages core features of the WPF platform, allows for simple  unit testing of application functionality, and helps developers and designers  work together with less technical difficulties.

VIEW: A View is defined in XAML and should not have any logic in the  code-behind. It binds to the view-model by only using data binding.

MODEL: AModel is responsible for exposing data in a way that is easily consumable  by WPF. It must implement INotifyPropertyChanged and/or INotifyCollectionChanged  as appropriate.

VIEWMODEL: A ViewModel is a model for a view in the application or we can say as  abstraction of the view. It exposes data relevant to the view and exposes the  behaviors for the views, usually with Commands.

MVC 3

I choose to develop my application with the Asp.Net MvC framework because it enables me to develop high quality web applications. The framework utilizes successful design patterns (Model View Controller) and is build using important object oriented principles and best-practices like separation of concerns, loose coupling and testability. While it may take some getting used to for those coming from Asp.Net Web Forms, the initial learning investment will prove worth while.

The Asp.Net MvC framework recently had it’s third major release, while many new features have been added, there are two new features that got me really exited. First is the Razor view engine, which offers cleaner and “easy on the eyes” syntax for the views. Razor comes with full Intellisense support. The second feature is the NuGet package manager which enables developers to easily manage third party libraries and their dependencies from within Visual Studio. NuGet makes installing and updating off all third party libraries a breeze. We will be working with both these new features during this article series. After discussing the framework let’s talk about the application we are going to build.