plain-vanilla-games/schematics — pull request #11 by johannth (2013-04-26 20:36:48+00:00)
Title: Major rewrite of the core API by separating conversion and validation.

The original design enforced validation on model initialization. This
sounded great as it always meant that you had a perfectly valid model instance.
In practice, however, this resulted in abysmal performance with complex and embedded
models, as the same model was validated over and over again. Most of the time
we were also working with trusted data and validation didn't make any sense.

I therefore made things a little more explicit by separating the conversion and
the validation. Raw data is converted to richer Python constructs on initialization
and raises ``ConversionError`` if unable to do so. If you don't trust the raw data
you can then explicitly validate by calling ``validate`` which raises ``ModelValidationError``
that contains the error messages.

I think this separation allow Schematics to better serve is purpose as:

1. An powerful, type coercing, DSL for structuring and serializing objects.
2. A flexible, format agnostic (as in doesn't care whether you use HTML or JSON), validation library.