[
Lists Home |
Date Index |
Thread Index
]
On Mon, 14 Mar 2005 15:02:24 -0800, Bob Foster <bob@objfac.com> wrote:
> Generating instances from schemas usually just produces one of the
> infinite number of instances restricted by certain trivial parameters. I
> don't know of an example where meaningful instances are generated.
>
> If a generated document changes automatically depending on the schema it
> finds at the time of generation yet somehow contains the same
> "information", there must be a model of the document that is independent
> of the schema, e.g., something like an ER model. Then the model must be
> populated: this concrete entity has that relationship to these other
> concrete entities, etc. Then there must be a mapping from the abstract
> document model to the elements and attributes used in the schema. When
> the schema changes, the mapping must change in concert (and there must
> be a way to prevent changes to the schema that violate the abstract
> document model, e.g., changing an unbounded relationship to a bounded one).
>
> After that, piece of cake. ;-}
Instance traversal is something I didn't touch on but of course is the
real issue here: what's the data source? I had assumed the
application would be traversing some form of relational DB or similar
and that there was already some natural key structure and
relationship metadata/data around. Not necessarily a good
assumption...
If not, you need some source of control over the data source or
complete metadata. If the data is simple and you control it you can
just add id/idref pairs to it to get simple hierarchical descent
traversal. But if the data's that easy to walk then I'm not sure why
you're doing this.
Beyond that you can make some simplifying assumptions. The easiest is
something like assuming every element contains an attribute with the
same name plus something like "Id" appended and that every referring
element will include an identically named attribute. That will get you
lattice like graph traversal and many to many relationships. However,
unless this is also enforced on the data population side it sounds
rather fragile... Then again, we do know you have a Schema that can
be checked at data population time :-)
<snip/>
--
Peter Hunsberger
|