ASP MVC ToolBox – MvcContrib library

Recently, I have been developing quite a big website using ASP.Net MVC Preview 2 framework. Itself it has several nice features but to build a high testable, loosely coupled application we need something more than we get. MvcContrib is a good source of a few nice ideas which can help you in testing, designing and developing your application.

TDD in ASP.MVC is the main reason why I’ve chosen it

ASP.Net with their code behind for views was always a bit too messy for me. For sure there are several ways to use pure ASP.Net with good test coverage but I was looking for something cleaner. Then, ASP.Net MVC appeared on the horizon. (Earlier I was using Castle Monorail Framework which is very similar to ASP.MVC). A clear division between View, Controllers and Model makes it all much easier to test. At least, this framework makes it much easier. However, without proper architecture built on ASP.Net MVC Framework we can still have many issues testing it right. That is why IoC was invented in my opinion, and thanks to MvcContrib you can find there IoC implementations for well known Containers (StructureMap, Windsor, Spring.Net etc.). To be clear, MvcContrib does not provide the IoC container implementation, but it shows how to populate the IoC in ASP.MVC for their Controllers Factory.

MvcContrib offers testing library for HTTPContext mockups

Thanks to Test Helper (I’ve used it recently in my projects) I can test controller and mock HttpContext. Test Helper offers very simple approach to create new controller instances, testing abilities for view generations, routing rules.

Portable areas is an approach to develop one-in-assembly plugins

MvcContrib implements a nice approach for implementing fully separated, loosely coupled plugins. Each Portable area is a separate control with its own assembly. The communication between such a portable area and a host application is made in a messaging way. More about portable areas you can read here. The big advantage of using portable areas is the fact that a developer is aiming at reusability of the component. This means that library is built and can be directly used in other project as well.

FluentHtml is shipping compile time checking to your views

ASP.MVC views are endpoint were developers can make several huge mistakes by coding there some business logic or by writing some magic strings to make view more customizable. With FluentHtml you can do it all but in pure C# code so when you refactor one of your classes it will automatically be caught in your views.

RESTful routing

Nothing more to say. Nice library that enables you to provide your controller methods to be accessible on Restful basis.

Other nice improvements are also worth mentioning

MvcContrib is very young but already a pretty nice set of libraries that can speed up your development process and improve quality of your code today.

Aspire Blog Team

Aspire Systems is a global technology services firm serving as a trusted technology partner for our customers. We work with some of the world's most innovative enterprises and independent software vendors, helping them leverage technology and outsourcing in our specific areas of expertise. Our services include Product Engineering, Enterprise Solutions, Independent Testing Services and IT Infrastructure Support services. Our core philosophy of "Attention. Always." communicates our belief in lavishing care and attention on our customers and employees.

2 comments

  1. Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum! http://less-accurate.com/

Comments are closed.