Contract-first Design - DevWeek 07 Sample Code
For those who just attended my talk on Contract-first Design and microkernel usage at DevWeek 2007 in London here´s the sample code.
It implements a very simple scenario, where a user can select from a list of calculation routines a function to generate a list of numbers. But the point was not to implement sophisticated functionality; rather I wanted to show, how a solution can be split up into true components which can be developed and tested in isolation. Here´s a sketch of the application´s architecture:
All components are treated as black boxes who don´t reveal any internals to their clients. The clients just know the exported contracts of their service components, the components they are depending on.
Which contract implementation actually services a client is not hard coded in the client as usual via static references. Rather clients are either told which implementation to use by injecting it into them - or they use a microkernel/servicelocator to discover it. That way productivity and testability are much increased. And I think it´s the only way to come to a higher level of industrialization and systematic software development.
PS: This was my first time at DevWeek. And I have to say I like the conference. The delegates are quite experienced .NET developers so the general level of discussion and technical presentations is high. And the organizers are dedicated to deliver a professional event. The number of delegates speaks for itself: more than 600 attendees, the conference was sold out. Great Job, Nick!