Real World S#arp Architecture

With any framework, technology, tutorial, book, idea, <insert pedagogical sources here>, it's often difficult to figure how the technique should be used in the real world.  Sure, things sound great when the scope of your project deals cleanly with Customers, Orders and Order Items; and sure, auto-binding works great in a nicely controlled scenarios...but how should things work in the "real world."  No, not the Real World in which Brooke has a complete meltdown in season 18.  I'm talking about the real world in which many scenarios aren't clean cut in determining where the controller should end and the application services layer should take over; the world in which you're trying to bind from unique data collection mechanisms to appease odd requests from the client; the world in which even the GoF would retort with "heh, that's a tricky one."  Yes, we're faced with these kinds of dilemmas on a frequent basis.  What I find to be truly helpful is to look at full blown, real-world applications.  While a real-world application is never perfect, you can often find great gems for dealing with tricky situations and using patterns and complex scenarios.  Howard van Rooijen has released just such a real-world application demonstrating the use of S#arp ArchitectureAutoMapper, ELMAH, Spark View Engine, and other great tools.

In Howard's own words...  "A few months ago I wrote an email to the community about a site we had just launched – that used S#arp Architecture at its core along with a whole myriad of other Open Source Frameworks and Tools (Spark, AutoMapper, PostSharp, xVal...).

In the run up to the festive period, myself and two of the development team – Jonathan George & James Broome, decided that in the spirit of giving, we wanted to gift something back to the communities that gave so much to us throughout the year; so we decided to build a new sample web application to showcase the use of these various frameworks & tools called “Who Can Help Me?” which is based on the same architectural style as

Who Can Help Me? started out as a small web application I built a few years ago to solve a small and specific business problem within our consulting organisation (and to test out .NET 3.5, LINQ to SQL, ASP.NET WebForms & MS AJAX!). The problem was, that as the organisation grew and new members of staff started, they found it difficult to find the right people who could help them solve specific problems they’d encounter in their consulting gigs. As I have worked for the organisation for a long time (>9 years) I generally knew everyone, had worked with most of them and knew what their areas of expertise were, thus I’d get a few calls every day asking “Do you know anyone who knows about X that could help me?”. The solution was to create a searchable skills matrix that would allow people within an organisation find other people who had specific skills or expertise who could help them solve a particular problem.

So Jonathan, James & I decided to re-write the Who Can Help Me? from scratch, using the architecture style, frameworks and tools we used to build - it might seem like we've massively over-complicated the architecture for such a simple application - but we really wanted this to demonstrate some of the concepts & techniques we used to build a full scale, public facing enterprise web application. 

Who Can Help Me? utilises the following:

The project is currently hosted at Codeplex: and we’ve also released a live demo:  We’ve added some documentation on the Codeplex homepage and will continue to refine this and augment it with blog posts covering some topics in more depth – so if you’re interested – please keep an eye on the following blogs / twitter:

Thanks very much for this contribution Howard!  Besides myself, I'm sure others have found this project helpful and will continue to do so in the future.


Billy McCafferty

Posted 02-03-2010 2:04 PM by Billy McCafferty
Filed under:



Magesh wrote re: Real World S#arp Architecture
on 02-04-2010 12:26 AM

I was waiting for something like this.  Thank you so much.

Martin Aatmaa wrote re: Real World S#arp Architecture
on 02-04-2010 5:19 AM

WCHM is really very... sharp.

It's a great reference app, and takes S#arp Architecture to the next level.

Howard, James, and Jon are a great bunch, and I can't thank them enough for their contribution.

Hopefully they will be able to find more time to spend in the WCHM codeplex discussion boards ;)

uberVU - social comments wrote Social comments and analytics for this post
on 02-04-2010 6:44 AM

This post was mentioned on Twitter by suhinini: I'm sharing: Real World S#arp Architecture

sergiopereira wrote re: Real World S#arp Architecture
on 02-04-2010 9:43 AM

That's an excellent way of giving back. It will be very helpful. Thanks.

Cadred (dotNET) wrote .Net Pulse 2/4/2010
on 02-04-2010 11:37 AM

.Net Pulse 2/4/2010

DaRage wrote re: Real World S#arp Architecture
on 02-04-2010 3:00 PM

I'm amazed by the number of projects used for building this application. I mean MVC, NH, Windsor, ELMAH (what?) and a dozen others I never heard of.

Do we really need all this to build a "good" application. Or better, is it considered good to use so much third party libraries..especially when a lot of those libraries are one-man-show that could disappear/discontinued anytime.

The question is: is this better for maintainability? I mean the whole idea behind using a "sharp" architecture is to achieve a better maintainability story, no?

Billy McCafferty wrote re: Real World S#arp Architecture
on 02-04-2010 3:17 PM

Use the right tools for the job DaRage, that's what it ALWAYS comes down to.  Using this combination on a small ecommerce shop would be way overkill.  But using it on a large enterprise app might not be.  Each project team needs to consider the balance of ease of development, maintainability, and complexity of tools involved with the specific needs of the project.  No tool, or suite of tools, is one size fit all.

9eFish wrote Real World S#arp Architecture - Billy McCafferty - - Just the Tasty Bits
on 02-04-2010 8:22 PM

9efish.感谢你的文章 - Trackback from 9eFish

Sanjeev Agarwal wrote Daily tech links for .net and related technologies - Feb 5-7, 2010
on 02-05-2010 4:38 AM

Daily tech links for .net and related technologies - Feb 5-7, 2010 Web Development Using FullCalendar

CurlyFro wrote re: Real World S#arp Architecture
on 02-05-2010 12:28 PM

i'm familiar with Sharp -- thanks Billy, but we've been using WCHM internally for a company app and we absolutely love it!

thanks for the contributions!

Howard van Rooijen wrote re: Real World S#arp Architecture
on 02-08-2010 4:51 AM

@DaRage - just because you haven't heard of these frameworks, doesn't mean they aren't worth using!

If you really want to become more productive - then one of the mindsets you need to tackle is the Not Invented Here syndrome that plagues so many people / teams.

One of the mantras we adopted when building was to deliver as much business value by making use of as many Open Source Frameworks & Tools so that we could concentrate our efforts on more useful facets - such as BDD / Testing / Automated Builds & Deployment, rather than creating yet another error logging framework.

None of the frameworks or tools listed above are "one-man-shows" - most, if not all have flourishing communities around them. There is very little risk involved - as if development on the project ceased - you still have access to the source code - so you are free to make any modification you require. It's a win-win situation.

Maintainability is quite simple - with projects like HornGet - rebuilding all the dependencies is a pretty straight-forward affair.

I think WCHM is a great demo - mainly because there is actually very little code in it - you harness the power of these frameworks and tools - you go with their flow and you can easily create powerful applications.


Nalin wrote re: Real World S#arp Architecture
on 02-12-2010 12:01 AM

Hi Billy,

If I am going to throw a custom exception, do I need to inherit from a specific base class?


Billy McCafferty wrote re: Real World S#arp Architecture
on 02-12-2010 8:42 AM

Nope.  Just write and use your custom exception as you would in any other .NET app.

David Rundle wrote re: Real World S#arp Architecture
on 02-12-2010 7:00 PM

Many thanks for the S#arp Archiecture and also thanks to all the developers invloded on the WCHM

I am enjoying to see how the decvelopment was done!



Marco wrote re: Real World S#arp Architecture
on 04-29-2010 8:44 AM


May be a little off topic, but in an MVC app, how have you deals with a site going in and out of SSL? I see the fancey dress site mentioned above does this and I am looking for an elegant solution.


Billy McCafferty wrote re: Real World S#arp Architecture
on 04-29-2010 10:30 AM

I'm not sure I understand the issue Marco.  I have a number of sites which go in and out of http/https without any problems.  Could you be more specific concerning the issue you're running into?

Marco wrote re: Real World S#arp Architecture
on 04-29-2010 3:49 PM

Sure.  Say the user goes from the home page (not ssl) to the purchase page (which is ssl). Then, if the user goes back to the home page (from a menu) the home page stays in ssl mode. does that help?

Billy McCafferty wrote re: Real World S#arp Architecture
on 04-29-2010 3:54 PM

Is there a drawback with it staying in SSL when they leave the cart?  I suppose JavaScript isn't cached; are there other reasons?

If you needed to, I suppose you could redirect the user to non SSL URLs via every controller that's not cart related, or make sure that every non-cart related anchor link has HTTPS replaced with HTTP.

Marco wrote re: Real World S#arp Architecture
on 04-29-2010 4:05 PM

I think mostly any links that are non-ssl from an ssl page you get that annoying browser warning about unsecured items on the page.

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)