« Responding to Online Criticism | Main | Cool Project: Timelines.com »
Wednesday
May132009

Zetetic.Chain - Some love for .NET


Today we released Zetetic.Chain on github as open source under a BSD-style license. The inspiration for Zetetic.Chain is Apache Chain, but Zetetic.Chain also takes advantage of some of the things .NET does really well without lots of dependencies, like reflection attributes (well, reflection in general), XML serialization, Remoting, indexer properties, and so on.

The Chain concept lets you work with commands, and stacks of commands, with a simple model—just say the name of the command you want to run, pass it an object in which to get and set state / results, and the Zetetic.Chain library takes care of the rest, keeping your implementation nice and clean. You configure the details of each command in a lean n’ mean XML file. Example:


<catalog>
<chain name="TellStory">
<command name="first" typeName="Storybook.WalkInTheWoods">
<add key="BoysName" value="Hansel" />
<add key="GirlsName" value="Gretel" />
</command>
<command name="also" typeName="Storybook.BirdsEatTheBreadcrumbs" />
<command name="ohno" typeName="Storybook.WitchInCandyHouse" />
</chain>
</catalog>

Your code can fire off the chain of events simply by calling:


ICatalog catalog = CatalogFactory.GetFactory().GetCatalog("storybook.xml");
IContext context = new ContextBase();
catalog["TellStory"].Execute(context);

So check it out, let us know what you think! Personally I know this library is going to become part of most of my ongoing projects on the .NET platform.


Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>