Ayende @ Rahien

It's a girl

Northwind Starter Kit Review: Conclusion

This is a review of the Northwind Starter Kit project, this review revision 94815 from Dec 18 2011.

A while ago I said:

Seriously?!  22(!) projects to do a sample application using Northwind?

And people took me up to task about it. The criticism was mostly focused on two parts:

  • I didn’t get that the project wasn’t about Northwind, but about being a sample app for architectural design patterns.
  • I couldn’t actually decide that a project was bad simply by looking at the project structure and some minor code browsing.

I am sad to say that after taking a detailed look at the code, I am even more firmly back at my original conclusion.  I started to do a review of the UI code, but there really is no real need to do so.

The entire project, as I said in the beginning, is supposed to be a sample application for Northwind. Northwind is a CRUD application. Well, not exactly, it is supposed to be an example of an Online Store, which is something much bigger than just Northwind. But it isn’t.

Say what you will, the Northwind Starter Kit is a CRUD application. It does exactly that, and nothing else. It does so in an incredibly complicated fashion, mind, but that is what it does.

Well, it doesn’t do updates, or deletes, or creates. So it is just an R application (I certainly consider the codebase to be R rated, not for impressionable developers).

If you want to have a sample application to show off architectural ideas, make sure that the application can actually, you know, show them. The only thing that NSK does is loading stuff from the database, try as I might, I found no real piece of business logic, no any reason why it is so complicated.

So, to the guys who commented on that, it isn’t a good project. If you like it, I am happy for you, there are also people who loves this guy:

Personally, I would call pest control.

Comments

Guto
01/26/2012 10:18 AM by
Guto

Man, sometimes I imagine you like this guy: http://rafaoliveiralopes.files.wordpress.com/2011/01/trollface.jpg?w=300&h=273

Jacob
01/26/2012 10:50 AM by
Jacob

Am I the only onw who would like to se Ayende's version of NSK?

I agree with some of your criticism, but now iIt must be time to put up :)

dee
01/26/2012 10:56 AM by
dee

How does this poor dog relate to Northwind Starter Kit?

Simon
01/26/2012 11:11 AM by
Simon

Really enjoy your critiques but would love to see you produce something to show how it should be done.

rcardare
01/26/2012 12:16 PM by
rcardare

Good riddance, glad this series is over.

Daniel Lang
01/26/2012 12:17 PM by
Daniel Lang

@Jacob, @Simon, Sorry guys, but what do you mean with "it must be time to put up" or "would love to see you produce..." ?!?

It's perfectly ok not to agree with him and criticise his opinion, style or whatever, BUT you shouldn't ask for "how would you do it", because he has probably written more blog posts over the last years than any other .NET blogger. Also there is so much OSS available that has been written by him, so if you want to know how he would code things up, go and look at his code. I'm sure you find the link to his github on you're on, so don't be lazy.

Jacob
01/26/2012 12:47 PM by
Jacob

@Daniel Sorry, but if the conclusion to this series is a picture of a dog, and absoloutely nothing on how it could be done better, then what is the takeaway?

That NSK is bad? Ok, then. Thanks. I know how I would do it, and I know how Ayende wouldn't do it. It would be nice to know how he /would/ do it.

Obviously this is Ayende's blog, I'm just a reader with a suggestion that's all.

Oh, and by the way, what is the relevance of how many blog posts he has written? Does that mean he is so awesome that critique is not welome?

It was purely a suggestion.

Ayende Rahien
01/26/2012 12:57 PM by
Ayende Rahien

John, https://github.com/ayende/ravendb/blob/master/Raven.Client.Lightweight/Listeners/IDocumentQueryListener.cs

Rosso
01/26/2012 01:15 PM by
Rosso

This has been an incredibly useful series to me. There are lots of examples and books out there that seem to unnecessarily complicate what we need to do to accomplish simple things. It's great that an expert such as Ayende comes out and says so. Also, Ayende has included plenty of pointers during the series as to how he would do things differently. Do you really need to be spoonfed?

Dan
01/26/2012 02:24 PM by
Dan

Very funny ending to a series of posts that I really appreciated. I have a lot of painful experience dealing with code of other developers that was severely over architected and utilized every single design pattern that they could collect from the internet, so I believe that Ayende has taken the high road in battling the irresponsible dissemination of code without theory. He may come across as a bad guy in the eyes of many. But for those who have dealt with the madness of coders that utilize patterns and architectural concepts they don't understand, you are a hero.

Dan
01/26/2012 02:32 PM by
Dan

Just to elaborate on my point: at my company, and I'm sure at many companies, there have been so many instances in time when a developer has justified some very poor decision to managers and others by saying but look, this exact type of code appeared on some famous persons blog. That's why the effect of you as one of the most important .NET bloggers renouncing such mindless imitation is really helpful.

LeftyX
01/26/2012 02:34 PM by
LeftyX

I totally agree with Ayende. I had downloaded that project 1 year ago cause I was trying to learn something more about architecture. At the end I gave up cause I thought that was overly complicated and engineered. I think that approach is not even good for a complex application. Those guys just wanted to show off how cool they are putting together a bunch of concepts which are on everyone's mouth theses days.

Keep on writing about good software architecture Ayende. Simplicity is always the best way.

Harry Steinhilber
01/26/2012 03:32 PM by
Harry Steinhilber

@Jacob, The takeaway is that you should not do really simple tasks in a really complicated way. That you should not abstract things for the sake of abstraction.

As for how would Ayende do things, try looking around. Examples of how he works are all over this blog. Try his Github account or any one of the tags on this blog (especially Macto and OR/M tags).

Anyone who has read his blog for any length of time is well aware of how Ayende would implement a similar system.

Ed
01/26/2012 03:41 PM by
Ed

Learned a lot from this review. I agree with Daniel above. However are there 'sample' apps you would point to that you would consider good examples to learn from? Your work is greatly appreciated!!

Apostol
01/26/2012 03:50 PM by
Apostol

I've surely seen my share of NSK-like apps in my experience and I'm happy that Aynede did those series. Maybe now more people will start thinking "is it necessary" before using a design pattern, and not use it just for the sake of it.

Battaile Fauber
01/26/2012 04:21 PM by
Battaile Fauber

Laughing at the "put up or shut up" comments. Check out his github or prior blog posts.

Further, these posts serve a purpose. Code like what is being reviewed ends up being taken as prescriptive, much to the detriment of many code-bases.

Deke
01/26/2012 05:24 PM by
Deke

@Jacob, I'm glad glad you pointed out that that picture was of a dog. It was beginning to haunt me. Just like trying to to follow an over-complicated example exclaiming "Best Practices" would have haunted me had I followed it. It's good to see experienced programmers denouncing complication and giving reasons why. Simple is definitively better. Much easier to maintain. Why re-abstract the abstract.

Shashi Penumarthy
01/26/2012 05:38 PM by
Shashi Penumarthy

As developers we suffer from the need to play with cool toys. We need to start paying more attention to our requirements and less attention to our personal desire to work with the latest and greatest. Thanks for an illuminating series!

The Dog
01/26/2012 06:20 PM by
The Dog

I'm the dog in the picture. I'm really angry to be compared with NSK uglyness. Futhermore, since I'm a living been, I'm a complex organism, per contary NSK is a "complicated" one. You Ayende explained, thanks to me, the difference between the two concepts of complexity and complication.

Alek Davis
01/26/2012 06:50 PM by
Alek Davis

Good job, Ayende Rahien. Having to deal with over-engineered apps on a daily basis, I totally see where you're coming from. I'm puzzled, why people seem to have attachments to complicated designs, when a simple one would do suffice. I guess, our brains work differently (can't think of a better explanation).

Zim
01/26/2012 07:11 PM by
Zim

Regarding the "put up" comments I felt the post on the 6th did some of that rather well:

http://ayende.com/blog/153153/northwind-starter-kit-review-refactoring-to-an-actual-read-model

I second Deke's sentiments.

tobi
01/26/2012 08:23 PM by
tobi

This is kind of refreshing. Having just worked on such code I was ready to shoot myself. It is such a depressing code base.

It is not like the NW sample was chaos. It is not. It is like sorting every single item in your home in alphabetical order. It is too much order and it is just not helpful.

Bunter
01/27/2012 12:23 AM by
Bunter

All which brings back the age-old question: why are good application examples so rare (or should I say almost non-existent), especially among Microsoft stack? Too much greenfield with no real delivery date pounding against one's head unleashes the architecture astronaut?

thisguyliker
01/27/2012 01:22 AM by
thisguyliker

I like this guy: http://farm4.static.flickr.com/3291/3044802775_864fcae4e7.jpg

Steve
01/26/2012 11:55 PM by
Steve

The more of your blog I read, the more.I realize you're just a giant dick.

Instead of looking down on everyone else, try teaching how things could be done better.

But I'm guessing you suck at that. Most high ego developers are awful teachers.

Harry Steinhilber
01/27/2012 04:48 PM by
Harry Steinhilber

@Bunter A large part of the problem is that in order to create a good application example, you need a complex enough domain to warrant the architecture. Most examples don't do this because the developer must then learn the domain as well as the architecture. Unfortunately, this will always be the case as the architecture of an application is entirely dependent on the requirements of the domain.

Instead most sample application take basic CRUD requirements and slap a heavy overly complicated (not complex) architecture on top of it. This is when you get things like NSK that don't actually teach what they are intended to.

Mark
01/27/2012 06:22 PM by
Mark

If anything the take away I got was don't make things too complicated. I believe Ayende has made a good argument here, and proof of how he'd go about accomplishing it isn't necessary. A CRUD application is simple. In my mind I'd go with something like ASP.NET Web Pages to accomplish the task with SQL and WebMatrix Data namespace. For more complex applications, with more business logic, then consider jumping to something like S#arp Architecture which serves as a good foundation for MVC and the NHibernate ORM...a more complex application needs more abstraction and using bigger frameworks to help makes a lot of sense. Smaller simple applications will be easier to understand without so much abstraction of repository details.

SPATEN
01/28/2012 03:20 AM by
SPATEN

F the dog, what's up with that chair?

Thanks again for another refreshing series.

Stephen

Roland
01/28/2012 08:40 AM by
Roland

Though the review was "harsh", there are plenty of good lessons to learn from. I have changed my mind about repository -- more accurately, what to abstract away in which circumstances.

David Robbins
01/30/2012 07:06 PM by
David Robbins

This was a good series, as it revealed what emotion goes into architecture and development. We dev's are a passionate lot, clearly. That's a good thing.

I've harped on this theme in other comments: The create\or of the NSK wrote a book about architecture, yet has produced an amazingly complex example of enterprise architecture. What does this tell us? What choices should be made? If it's 3 am and I'm knee deep in architecture that is confusing, have I done the right thing for my clients?

adante
01/31/2012 06:02 AM by
adante

For those of us who are impressionable developers, could you recommend a project which would be useful as a pedagogical example (i.e. one that is not monstrous in complexity, but has all the good practice juju to learn from)

Bunter
02/04/2012 01:45 AM by
Bunter

@Harry - you're kind of rephrasing my question - sure, picking a wrong problem as a basis for the solutions ends up both problem and solution being wrong but my question was more targeted why on earth everybody tries to produce the sample targeting usually DDD-ish kind of architecture which probably pays off only in the most tiniest fraction percent of the cases.

Comments have been closed on this topic.