in reply to Moose, the tree structure of XML and object-oriented inheritance hiearchies

“Nothing personal, but ...” my visceral reaction to this notion is like that of Baby Herman in Who Framed Roger Rabbit: “da whole thing stinks like yestahday’s diapahs!”

Remember ... nothing personal.   This is a frank comment, but not intended to sting, and strictly intended as purely an engineering critique.

Yes, it’s true:   an XML file is a nested, hierarchical data structure.   But that does not mean that you should, by any means whatever, construct a procedural software construction to match it!   I encourage you, instead, to view it as a database of sorts, and to use XPath expressions to traverse it ... to query it ... and, to focus precisely on those parts of it which concern you at a particular time.

I am extremely skeptical of strategies which attempt to make, shall we say, excessive use of “modifiers” and “augmentations,” and/or which simply become too-complex in the pursuit of brevity.   Above all other considerations, I always want to know precisely what a piece of source-code does, and, if I want to change it, I do not want that change to “ripple” ... most especially in ways that I cannot readily see.

Another thing that we can always say about files, especially XML files, is that they evolve.   When (not if ...) they do, what’s going to have to happen to your clever-but-delicate contrivance, and why?   Presumably you are still asking the same questions and still doing the same things, but how much does the source-code have to change, and how pervasive is that change?

Replies are listed 'Best First'.
Re^2: Moose, the tree structure of XML and object-oriented inheritance hiearchies
by metaperl (Curate) on Jun 27, 2011 at 14:30 UTC
    Another thing that we can always say about files, especially XML files, is that they evolve. When (not if ...) they do, what’s going to have to happen to your clever-but-delicate contrivance, and why? Presumably you are still asking the same questions and still doing the same things, but how much does the source-code have to change, and how pervasive is that change?
    whose contrivance? what module are you referring to? perigrin's? well, with XML::Toolkit there are a set of classes to generate XML and similar to how a ::Loader for database constructs classes for databases.

    So, your code itself would change very little because the classes are there to build the XML ... just re-run the loader.



    The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.

    -- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"