On Mon, Nov 23, 2009 at 7:46 AM, Costello, Roger L. <costello@mitre.org> wrote:Sorry but this is wrong. Bookstores do not *contain* a collection of
> The OO form frames ones thoughts in this way:
>
> Book stores contain a collection of Book objects
> and Magazine objects. The Book and Magazine types
> inherit from an abstract Publication type.
>
Book objects. It seems you have now spent so much time with XML, that
XML has colored your thinking to the point where you try to fit
everything into an XML model. What you describe is an XML description.
Don't worry. It happens to everyone. It's just that I'm used to seeing
people try to force XML to fit the OO or relational models instead of
the other way around. :-)
The OO description is that a bookstore contains a *pointer* to a
collection of Book objects. Very rarely would a bookstore object
actually contain the books. The distinction is subtle, but critical
most especially when attempting to serialize object graphs into XML
trees or relational tables. Two different bookstore objects can have
pointers to the same books. However, two different bookstore elements
can't contain the same books. Trees are a restricted subset of graphs,
and this is why naive approaches to serialization are doomed to fail.
(Sophisticated approaches to serialization are also doomed to fail,
but for more complex reasons.)
--
Elliotte Rusty Harold
elharo@ibiblio.org
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php