Click here to Skip to main content
15,890,973 members
Articles / Web Development / HTML

Build ASP.NET MVC applications FAST with MVCExtensions v0.4

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
25 Jan 2010CPOL2 min read 13.6K   9   2
A very simple tasklist in order to show you on how to get started using this library.

Introduction

Today I finished v0.4 of my MVCExtensions library and I pushed the source code to github.

I also included a very simple tasklist in order to show you how to get started using this library. You can also see (slightly outdated) example code in this blog post...

You can see a demo of the tasklist app running here. (Try entering a task without a name, or with a name that has more than 256 chars to see the custom strings in action).

You can download the full source code here.

What is MvcExtensions ?

It is a library I wrote that takes out the burden of setting up a new MVC app each time. It was developed in order to be able to deliver apps faster to my customers...

In order to set it up, you need to create a class that defines where your domain model objects are, and register the module in global.asax. That's it !!!
The library auto-wires ASP.NET MVC with castle.windsor IOC, @jbogard's Automapper, @jagregory's FluentNHibernate ORM, @Loudej's Spark viewengine, @JeremySkinner's MvcContrib and some custom extensions. The idea is that the library takes all the hassle out of the setup of an ASP.NET MVC app and their dependencies...

It should also be pretty well structured using Services/Generic repository, Model-View-Viewmodels, ...
It also has a few predefined string classes with fixed length/null-& regex checkers for validation as well, controller action links that are defined in the controller instead of in the view, ...

This should allow you to write very clean controllers as well with custom automappers injected into the controller.

It also contains 3 spark extensions for the spark view engine in order to render actionlinks without much hassle.

Some Aubergine BDD as well

Next to this, it also contains a @tojans Aubergine BDD Coolproject with specs and a context.

This is the specs file:

Define a group of tasks
 using Tasks.Specs.TaskContext
  from Tasks.Specs.DLL
  
  
Story manipulate tasks
    Is about a group of tasks
    
    As a person
    I want to log my tasks
    So that I do not forget anything and get my priorities straight
    
    Given the following tasks exist
        +---------------------------+------------------------+--------+
        | name                      | description            | status |
        +---------------------------+------------------------+--------+
        | Do the dishes             | Be careful             | Todo   |
        | Update Aubergine project  | procrastination FTW !! | Todo   |
        | Order stamps              | 20 pieces              | Done   |
        +---------------------------+------------------------+--------+
    
    Scenario Add a new task
        When I add the following task
            +---------------------------+------------------------+--------+
            | name                      | description            | status |
            +---------------------------+------------------------+--------+
            | Feed the fishes           | Be careful             | Todo   |
            +---------------------------+------------------------+--------+
        Then the tasklist should contain the following tasks 
            +---------------------------+------------------------+--------+
            | name                      | description            | status |
            +---------------------------+------------------------+--------+
            | Do the dishes             | Be careful             | Todo   |
            | Update Aubergine project  | procrastination FTW !! | Todo   |
            | Order stamps              | 20 pieces              | Done   |
            | Feed the fishes           | Be carefull            | Todo   |
            +---------------------------+------------------------+--------+
            
   Scenario Switch the task status from "Todo"
        When I switch the status of the task "Do the dishes"
        Then the tasklist should contain the following tasks 
            +---------------------------+------------------------+--------+
            | name                      | description            | status |
            +---------------------------+------------------------+--------+
            | Do the dishes             | Be careful             | Done   |
            | Update Aubergine project  | procrastination FTW !! | Todo   |
            | Order stamps              | 20 pieces              | Done   |
            +---------------------------+------------------------+--------+
   
   Scenario Switch the task status from "Done"
        When I switch the status of the task "Order stamps"
        Then the tasklist should contain the following tasks 
            +---------------------------+------------------------+--------+
            | name                      | description            | status |
            +---------------------------+------------------------+--------+
            | Do the dishes             | Be careful             | Todo   |
            | Update Aubergine project  | procrastination FTW !! | Todo   |
            | Order stamps              | 20 pieces              | Todo   |
            +---------------------------+------------------------+--------+
        
   Scenario Delete a task
        When I delete the task "Update Aubergine project"
        Then the tasklist should contain the following tasks 
            +---------------------------+------------------------+--------+
            | name                      | description            | status |
            +---------------------------+------------------------+--------+
            | Do the dishes             | Be careful             | Todo   |
            | Order stamps              | 20 pieces              | Done   |
            +---------------------------+------------------------+--------+

The specs project generates and shows this report whenever it gets built (unless you introduce a bug).

What should I do with it ?

Well, I would suggest you check it out, and try to create a small demo app using the mvcextensions lib.

You can download all the required binaries from a single zip here.

I will probably create a walkthrough and/or screencast later on how to do this, unless somebody beats me to it... In case you would like me to show you a demo, do let me know what kind of app you would like to see.
Do not forget that it should be relatively limited on the functionality side in order to implement it in a short demo...

Opinions are appreciated !!

And as always: enjoy !!!

Bookmark and Share

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder Virtual Sales Lab
Belgium Belgium

Comments and Discussions

 
QuestionHow to inject Membership Provider by Castle Windsor Pin
Sheri Solivan28-Jan-10 2:38
Sheri Solivan28-Jan-10 2:38 
AnswerRe: How to inject Membership Provider by Castle Windsor Pin
Tom Janssens30-Jan-10 4:44
Tom Janssens30-Jan-10 4:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.