Archive for 'Design Patterns'

ASP.NET MVC DI with Common Service Locator and NInject

I think everyone knows about Dependency Injection (DI) and how important it is when it comes to building low-coupled components. There are many IoC (Inversion of Control) containers. The most popular are

Each of them has its own pros and cons. I have been using NInject for years and I am really happy with it. Autofac is quite a new DI framework which shows really good results on benchmarks. You can find information for all DI frameworks on their websites or just google them for comparison. (more…)

Filled under ASP.NET, Design Patterns, Development Techniques. 1 Comment.

Test-Driven Development with ASP.NET MVC

ASP.NET MVC has become more and more popular. In my previous post I gave you my vision about it and what it introduced to ASP.NET developers. One of the advantages of the MVC pattern is the better testability. You can easily test every controller without dealing with the View itself.

Test-Driven Development (TDD)

Principles of TDD are really simple. The entire TDD process is described on the following scheme:

(more…)

Filled under ASP.NET, Design Patterns, Development Techniques, Testing. No Comments.

Why is ASP.NET MVC so Popular?

Classic ASP.NET

ASP.NET MVC has become more and more popular. Why? The ordinary ASP.NET allows developers to abstract from many details like request/response headers (by wrapping everything in nice API), manual HTML coding (by using server-side controls), etc. Everything is really cool – we develop a Web site for seconds. But what about the maintainability of this site later? Customers always want more and more. Even after years they may ask you to implement a new feature for them. And then developers start to sink into the depth of their own code ocean. If we add the lack of good documentation, the entire situation becomes really bad. (more…)

Filled under ASP.NET, Design Patterns. 1 Comment.

WPF MVVM and Showing Dialogs

Developing a WPF/Silverlight application using the MVVM (Model-View-ViewModel) pattern is a real challenge. But you know that using this pattern you write low-coupled and fully testable code (I hope). As MVVM says, the View can contain only XAML declarations. That is, no code-behind is present in your .xaml.cs file. (more…)

Filled under Design Patterns, WPF. 1 Comment.