[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML Schemas: Best Practices
--- "Roger L. Costello" <costello@m...> 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|