On Thu, May 8, 2008 at 11:25 AM, Peter Gummer < peter.gummer at oceaninformatics.com> wrote:
> Tim Cook wrote: > > >> > First of all; an ontology instance cannot (should not) exist outside > of > >> > an archetype instance. Therefore it is obvious which archetype it > >> > belongs with. > >> > >> I don't understand how it would be obvious, Tim. You would have to > search > >> through all of the archetypes somehow in order to find the one to which > >> the > >> ontology belongs. > > > > Ahhhh, but I think that this has more to do with your implementation > > decisions than with the object model. ???? > > > > How could your ontology instance lose it's reference to its parent > > archetype instance while in memory? My guess is that it doesn't. I'll > > venture that it happens based on how you choose to persist your objects. > > Correct? > > No, I didn't say anything about an ontology instance losing its reference. > We're talking about whether the in-memory ontology instance should refer > to > its archetype via (a) a direct object reference of type ARCHETYPE, or (b) > an > indirect reference of type ARCHETYPE_ID. > > My point was that with (a) you have the owning archetype immediately, > whereas with (b) you would have to do some kind of look-up or search. > > (Note that I don't know whether this actually was the motivation for > choosing ARCHETYPE rather than ARCHETYPE_ID.) In the Java implementation, the reference to parent is not used so far, both in the case of ARCHETYPE/ARCHETYPE_ONTOLOGY and C_OBJECT/C_ATTRIBUTE. I think the explanation could be the navigation between child and parent is nearly always from parent to child (top down traverse of the object tree), e.g. serializing AOM to ADL and use AOM as a template to create RM instances. The only exception is during parsing when the object tree is built from bottom up. This is where these circular references are getting in the way. If these references are not very useful in other implementations, I would like to suggest to leave them out. Cheers, Rong that the reference of the parent is still in the context if needed. I only found it getting in the way of implementing immutable object pattern. > > > - Peter > > > _______________________________________________ > openEHR-technical mailing list > openEHR-technical at openehr.org > http://lists.chime.ucl.ac.uk/mailman/listinfo/openehr-technical > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.openehr.org/mailman/private/openehr-technical_lists.openehr.org/attachments/20080508/f518bd28/attachment.html>

