Ayende @ Rahien

Unnatural acts on source code

Infrastructure is king: The To Do app

I spent the last few days writing the NHibernate in Desktop Apps sample. Since I didn’t feel like doing something adventurous, I choose to use the age old ToDo app as the sample.

Now that I have finished it, I run some stats on it, and it is… interesting.

Here is the number of lines split into infrastructure and application code:

image

The funny part about this is that this is for an application that has three forms altogether and very little behavior.

The not so funny part is that I fully expect that extending the application would require very few modifications to infrastructure code, while the support of the infrastructure means that I can churning out new features without really having to think about anything but that specific feature.

Comments

pete w
08/03/2009 02:17 PM by
pete w

The desktop app presents a subtle but interesting challenge, being the "occaisionally connected" client.

I am assuming your infrastucture share of the code is large because you spent some time writing a server that communicates with thick clients in a "unit-of-work" fashion, such that the thick client doesnt deal with persistent objects.

I'd love to see your example when you are ready to share it :)

Johannes Rudolph
08/03/2009 03:42 PM by
Johannes Rudolph

1k LOC is very small, however i am wondering myself whether this is to be considered an "agile" development?

The domain is far less complex than client/server communication/syncing on the other side.

Ayende Rahien
08/03/2009 06:09 PM by
Ayende Rahien

Pete,

The sample app isn't an occasionally connected

Daniel Hölbling
08/03/2009 07:38 PM by
Daniel Hölbling

Will you post the code somewhere? I'd love to see how you approached Infrastructure in a so simple sample app.

anon
08/03/2009 09:11 PM by
anon

I'd love to see the code too!

Ayende Rahien
08/04/2009 06:10 AM by
Ayende Rahien

Yes,

I'll post it when the article is ready.

Jamie
08/04/2009 11:36 AM by
Jamie

Looking forward to seeing this.

Michael Hedgpeth
08/04/2009 12:14 PM by
Michael Hedgpeth

There is a great need for this; I'm looking forward to your article.

Dinesh Gajjar
08/04/2009 12:31 PM by
Dinesh Gajjar

I am awaiting for the code too :). It is interesting to see DDD in such simple app.

pete w
08/04/2009 01:01 PM by
pete w

I was challenged with writing an "occaisionally connected" client, and I leveraged NHib for persistence. iT turns out there was a scarcity of examples around using NHibernate in a thick client in this kind of manner.

The majority of examples you will find involve web-based stateless connections where sessions are much easier to manage.

Ayende Rahien
08/04/2009 02:46 PM by
Ayende Rahien

Dinesh,

This is anything but DDD

simsod
08/04/2009 04:01 PM by
simsod

Great Oren! It´ll be nice to see full desktop sample.

Arnis L.
08/05/2009 09:00 AM by
Arnis L.

Ayende, maybe i've missed some posts but can i ask - what's your attitude towards DDD? Your response to Dinesh was intriguing.

Ayende Rahien
08/05/2009 11:00 AM by
Ayende Rahien

Arnis,

I think it is over used in situations that it shouldn't be

Glenn F. Henriksen
08/27/2009 09:40 AM by
Glenn F. Henriksen

I'm really looking forward to this article. Do you know where it will be published?

Ayende Rahien
08/27/2009 09:45 AM by
Ayende Rahien

Glenn,

December, on MSDN Mag

Glenn F. Henriksen
08/27/2009 10:49 AM by
Glenn F. Henriksen

Aw, a long wait :D But worth it, I’m sure. Thanks for the reply!

Comments have been closed on this topic.