[xsd-users] Re: In-memory validation

Boris Kolpackov boris at codesynthesis.com
Fri Jan 23 09:09:31 EST 2009


Hi Jeroen,

Jeroen N. Witmond [Bahco] <jnw at xs4all.nl> writes:

> Just for my own amusement, I've been playing around with the idea of doing
> just that: Creating a data model that guarantees that its contents
> conforms to the schema. The current solution of serialisation and
> re-parsing, when done for every change, certainly is more inefficient than
> in-memory validation. And when it is delayed until a number of changes
> have accumulated, the data model may be left in an inconsistent state for
> some time. This can be a problem when the data model is shared, for
> instance between threads.

I think the most practical approach for such a situation is to 
have on-demand, in-memory validation support. In case of threads,
you would need to lock the data before a thread can modify it.
Then you can re-validate it just before unlocking after all the
modifications by this thread have been made.


> PS: You wouldn't happen to have a prerelease of XSD/e with support for
> validation during serialization[2] for me to play with? :)

Actually, I do:

http://www.codesynthesis.com/~boris/tmp/xsde-3.0.0.a1-i686-linux-gnu.tar.bz2

Take a look inside the examples/cxx/hybrid/ directory. There is not
manual yet for the new mapping but I will have the first draft ready
in the next couple of days.

Boris




More information about the xsd-users mailing list