Exploring ASP.NET MVC application architecture

I am planning on exploring how to architect a good MVC application. During this exploration I found some interesting web-resources. I might be using this post in possible future blog posts as a reference.

Sample apps

I really think that looking at other peoples code can give you great ideas about what to do and what not. So here are some sample apps to look at. You could look at SharpArchitecture also as a sample app but I thought that one deserved a paragraph of it’s own.

  • I don’t know Rob Connery personally but you gotta love what he does. StoreFront, is his sample app. And you can find a lot about it here.
  • Read the separate Oxite paragraph for more details before downloading ! Oxite got a lot of bad credits but combined with the critics you can find it still has value in learning how to architect an MVC app or how not to architect an MVC app.
  • NerdDinner is rather basic but still is a nice starter with a free chapter of the “Proffesional ASP.NET MVC 1.0” book coming with it.
  • Codecamp server is on my list to explore, haven’t seen it yet. Is is part of the “ASP.NET MVC in Action” book.

SharpArchitecture

SharpArchitecture already has an architecture and while exploring it you can get very inspired. As far as I can tell there went a lot of thought in this architecture and for now I see it as a starting and reference point for my explorations.

You can find it here.

Oxite

When Oxite got out it got a lot of criticism, but also a lot of love to make it better. There is a lot to find in the comments about Oxite about what people expect from an MVC app.

  • This tweet from Simone Chiaretta is what most people thought about Oxite when it got out.
  • This post is my all-time Oxite favourite. Rob Connery gives explanations and solutions.
  • Chad Myers is a good second with also constructive comments
  • Although I don’t like the tone, this post still has some great comments.
  • A collection of Oxite tweets

Screen casts

Most screen casts are not on an architecture level, but I do believe that the more details you know, the better you can architect the application. Also you need to be aware that these screen casts might be about different versions of the MVC framework.

Books

  • This post by David Hayden says enough about some books, take your pick.
  • This is a nice Stackoverflow answer about some books.

Miscellaneous

I just had to mention these posts, but did not have a real category for it.

Other posts like this one

You wouldn’t have guessed it, but other people have collected resources too.

I hope everybody has just as much fun as I have exploring this. If anybody has something to add, please do so in  the comments.

Gathering requirements like a Woodcutter

There once was a woodcutter working hard cutting down a tree. Suddenly a leprechaun appeared and started yelling stop stop.

The woodcutter looked at the leprechaun and started smiling : “Are you going to offer me a pot of gold if I quit cutting down your house ?”. The leprechaun frowned and replied “off course not silly, leprechauns don’t live in trees ! I live in a beach house in Miami, but I do want to make you an offer.”

The leprechaun made the following offer:

If you promise you will give half of your winnings to charity, I will let you win twenty million.

The woodcutters first thought was that he was not going to give away ten million. But thinking a bit harder he came to the conclusion that he just was offered ten million and he should accept the offer as fast as he could. So he started picturing what his wife would say when they would have won the ten million. Humm wait a minute, I won’t be able to convince my wife to give away ten million. So he asked the leprechaun if he was allowed to tell his wife about the deal. The leprechaun agreed.

If you and your wife will give half of your winnings to charity, I will let you win twenty million.

So the woodcutter started picturing again how he and his wife would celebrate the ten million tomorrow or the day after. Hummm the leprechaun did not say anything about a date. So leprechaun when is this going to happen ?. Oh sorry said the leprechaun I cannot commit to a date, it will be in your lifetime. The woodcutter thought hard and did not find this very acceptable, suppose he was already going to win twenty million, was the leprechaun going to cheat him out of ten million ? The woodcutter strongly suggested that the leprechaun would give a date, the leprechaun finally agreed.

If you and your wife will give half of your winnings to charity, I will let you win twenty million before the end of this year.

The woodcutter started imaging again about spending all those euro’s. Hummmm the leprechaun did not say anything about euro’s. So leprechaun what will the currency be ? Oh the leprechaun could not really tell, it was a matter of what lottery he could manipulate and negotiations with other leprechauns. The leprechaun and the woodcutter discussed this a bit and came to a new agreement.

If you and your wife give half of your winnings to charity, I will let you win about twenty million euro’s, remaining after being converted form the original currency, before the end of this year.

Learning from the discussion so far the woodcutter did not start imaging anything but he started analyzing the agreement and the word ‘about’ started to feel a bit funny. What would happen if it was nineteen million nine hundred thousand, would he still be required to give half ? And what charity ? He could start his own foundation for the needy woodcutter. After three days of negotiating they came to an agreement.

If you and your wife give exactly half (rounded down) of your winnings to a charity of the leprechauns choice. The leprechaun will let the woodcutter win at least twenty million euro’s, remaining after being converted from the original currency, before the thirty first of December this year at midnight. The wife will not get her own amount but she shares with the woodcutter and if anything significant changes in the made agreement the woodcutter and the leprechaun will renegotiate the agreement.

The woodcutter went home a happy man. When he got home, his wife was mad for him being late three days. After some explaining she did not like the deal, she wanted half of the ten million. The wife left the woodcutter and the woodcutter went back to the forest to renegotiate.

The wife lived happily ever after.

When making agreements consider your organization, time, cultural differences, measurability of requirements, changes in the environment, personal viewpoints and as much as you can think of. Make the choices flexible enough to last and make them fast enough so you won’t be caught by design creep. Don’t exclude any major stakeholders.