Login

Username

Password





Register   Reset password

Cuyahoga news

Progress report: Castle integration

There hasn't been much news about Cuyahoga lately. However, this doesn't mean that nothing is happening. I've been preparing the core of Cuyahoga to make the coming development efforts easier. One of those steps involved integrating the Castle Windsor IoC container. This container introduces the concept of Inversion of Control, which allows to develop components in a much more loosely coupled way. On top of that, Castle offers nice additional facilities like automatic transaction management and NHibernate integration.

And now I can hear you all thinking: "fine, but what do we gain with this stuff?". Well, in fact, a lot! Especially for module developers, things are getting much easier. A Cuyahoga module is now managed via the Castle container which automagically resolves all dependencies to external components. This can be services for data access, file access, authorization, search indexing, versioning, etc. Another new feature offered by Castle is automatic transaction management.
Imagine a scenario where you want to upload a file and manage some meta-data in a database. If something goes wrong, you'll end up with a record in the table for a non-existing file or a file without any meta-data. It takes quite a bit of code to handle this properly, but now, a simple .NET attribute is enough to make it safe. Don't believe it? Take a look at the Downloads module in SVN. Ok, it also involved creating a file service that can participate in transactions, but hey, as a module developer, you don't have to worry about that :).

4/2/2006 10:29:00 AM Published by Martijn Boland Category Cuyahoga Comments 4

Comments
  • That sounds very cool. I looked at the Castle docs a bit and find it intriguing. I am curious; with this integration, to what extent will one need to learn the Castle side of things to be able to write modules and take advantage of the integration you are doing?

    How stable is the current state of code? I am just starting in on a calendar module for Cuyahoga 1.0 and I wonder if I should be coding against the bleeding edge to take advantage of these new capibilities. Do you have an opinion on this?

    Matthew

    by Matthew Nichols - 4/3/2006 11:45:34 AM
  • To take full advantage you'll have to understand the concept of Inversion of Control and investigate which services Cuyahoga facilitates out of the box. It can save a nice amount of code and will make your module more testable (haven't mentioned the improved testability because Cuyahoga seriously lacks proper unit tests at the moment *ashamed*).

    The good thing with the current state of the code is that it doesn't force you in a specific way of coding. Every old module still works without modification, so if you're a little hesitant towards IoC etc., it's just fine to code everything the way you want even if that implies using plain ADO.NET and datasets.

    by Martijn Boland - 4/3/2006 3:12:40 PM
  • This sounds good Martijn. I know little about IoC at this point but this does sound like you've thought about it a great deal. The points you've outlined do make it sound compelling to stick it in cuyahoga.


    by Jason Finch - 4/4/2006 11:02:35 PM
  • Thank you for taking the time to write this blog post. Much appreciated, very valuable information.

    by Panerai Watches - 6/19/2010 9:44:59 AM

Back