← Prev in month
← Prev in thread
Re: [xml-dev] RE: An inquiry into the nature of XML and how it orients our perception of information
On Mon, Nov 23, 2009 at 7:46 AM, Costello, Roger L. <> wrote: > 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. > Sorry but this is wrong. Bookstores do not *contain* a collection of 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
← Prev in month
← Prev in thread