Re.Mark

My Life As A Blog

Anatomy of nspectre

leave a comment »

I’ve been meaning to blog about the anatomy of nspectre for a while now.  nspectre consists of 2 distinct parts:  configuration and a runtime.

The configuration has at its root the Settings class in the NSpectre.Core.Configuration namespace.  This namespace also contains a couple of implementations of IConfigurationReader that read XML into the configuration, which can be thought of as a (sort of) Domain Specific Language (DSL.) The DSL provides a means to model the conditions required for a type to be valid for a given action.  The reason I say sort of DSL is that the templates are, essentially, C#.  However, by leveraging CustomSpecifications, these templates can be abstracted.

The main class in the runtime is IValidator.  To create an instance of IValidator, you use IValidatorFactory – and to get an instance of IValidatorFactory you create an instance of Initialiser.  The implementation of IValidatorFactory compiles the Settings the first time an instance of IValidator is requested. 

Advertisements

Written by remark

May 16, 2006 at 10:20 pm

Posted in nspectre

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: