OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: XML Schemas: Best Practices

[ Lists Home | Date Index | Thread Index ]
  • From: Toivo Lainevool <tlainevool@yahoo.com>
  • To: "Roger L. Costello" <costello@mitre.org>, xml-dev@lists.xml.org
  • Date: Wed, 18 Oct 2000 10:16:42 -0700 (PDT)

--- "Roger L. Costello" <costello@mitre.org> wrote:
> Issue: When should an element or type be declared global versus when
> should it be declared local?
<snip>
> (1) What name do we give to (what I have been calling) First Design?
> (2) What name do we give to (what I have been calling) Second Design?
> (3) What are the other characteristics of the two design approaches?
> (4) What do you see as the main tradeoffs in the two design approaches?

One possibilty for naming these two ideas would be borrow terms from modeling
relationships in object oriented analysis. Aggregation is the term used to
describe a whole-part relationship. Composition is "a form of aggregation with
strong ownership and coincident lifetime as part of the whole" [From UML 1.0].
Composition has parts that have only one owner, for example a hand and fingers
have this relationship.

The first design would be "Composition". The subelement exist only if the
parent exists.

The second design would be "Shared Aggregation". Adding the "shared" would
stress that the different parts were meant to have multiple parents.

As far as a rule of thumb of when to use one over the other, I would tend to
start with "Composition" (boxes within boxes), which is the simpler approach.
The model should only be made more complex with "Shared Aggregation" (separate
boxes) if there is a need to do so.

I agree with Rick's observation that these best practices would make good
patterns. As soon as I get some time, I will try to convert some of Roger's
ideas into patterns and see how it works out. If anyone else wants to give this
a shot I will gladly host the results at xmlpatterns.com

Toivo Lainevool


__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS