[odb-users] Re: Can one use ODB with Classes generated by XSD?

Boris Kolpackov boris at codesynthesis.com
Mon May 14 13:39:19 EDT 2012


Hi Brian,

B Hart <bhartsb at gmail.com> writes:
 
> I understand it might be be difficult to auto-generate an acceptable DB
> Schema in the majority of instances, but would even a poor DB Schema and
> mapping (automatically generated) be a better starting point than none at
> all (especially when there are going to be many tables)?

It might seem so, but in the long run, I don't think it will (generally,
we try to avoid designing tools that have short-term benefits with long-
term problems, even if it is very tempting sometimes).

You mentioned above that the "DB Schema auto-generated by XMLSpy is
definitely not perfect, but with a little minor cleanup should be 3N
form." The problem with this approach is that you will have to keep
manually "fixing-up" the schema (plus the generated C++ code, if we
were to support this in XSD) every time the XML schema changes. This
is the example of the "short-term benefits with long-term problems"
approach I am talking about.

The approach that I have in mind would require you to providing
initial mapping (e.g., which classes are objects, which ones are
values, which attributes/elements are object ids, etc). This might
require some upfront time investment. However, down the road,
provided the future schema changes are not too radical, this
mapping shouldn't take much effort to maintain. It should definitely
be easier than fixing-up generated database and C++ code.

Boris



More information about the odb-users mailing list