Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

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

, 25 Jan 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
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)

Share

About the Author

Tom Janssens
Founder Core bvba
Belgium Belgium
Tom Janssens, owner of Core, a software and consultancy company.
Father of two sons named Quinten & Matisse, and married to a beautiful woman named Liesbeth.
 
Blog: http://tojans.me
Github: http://github.com/ToJans
Twitter: http://twitter.com/ToJans
LinkedIn: http://www.linkedin.com/in/tomjanssens

Comments and Discussions

 
QuestionHow to inject Membership Provider by Castle Windsor PinmemberSheri Solivan28-Jan-10 3:38 
AnswerRe: How to inject Membership Provider by Castle Windsor PinmemberTom Janssens30-Jan-10 5:44 
Your question is hard to answer since I am missing a lot of context here. Also, I am by no means an expert on castle. I would suggest you to
- read the documentation. It fully covers every aspect of castle.windsor
- just google it
- post to the relevant newsgroups/forums
 
I can not provide you any real links atm since i am posting from my mobile.
If you do have a a auestion specific to mvcextensions I'll be happy to answer.
 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411023.1 | Last Updated 25 Jan 2010
Article Copyright 2010 by Tom Janssens
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid