Configuration hierarchy organization

Discussion in 'XML' started by Kenneth Porter, Dec 27, 2007.

  1. I'm trying to organize the XML for my system configuration.

    I have a System (top-level object) comprising a varying number of
    Components, each with its own configuration. I also have a number of
    classes representing stateful bundles of related methods. The latter
    classes need per-component configuration. Should that configuration be
    grouped with each Component's configuration, or should it be stored with
    the configuration for each bundle of stateful methods? What are the pros
    and cons of each?

    Here's a "picture" of the runtime organization:

    class System
    {
    Container<Component> components;
    StatefulMethodBundle1 group1;
    StatefulMethodBundle2 group2;
    };

    What are the relative advantages of storing a parameter in these ways?

    System.component[x].group1.y

    versus

    System.group1.component[x].y

    (x is the name (string) of a component, y is a component-specific parameter
    needed by group1.)
     
    Kenneth Porter, Dec 27, 2007
    #1
    1. Advertising

  2. Kenneth Porter

    Guest

    > System.component[x].group1.y
    > versus
    > System.group1.component[x].y


    Which solution to choose depends on what is changed together more
    often. You should organize the config so that typical changes will
    affect parts of configuration that are close to each other in the XML.
    I suppose typical changes more often affect many methods and a single
    component, so I think the first solution is better.

    Moreover, you seem to be using a language that was designed for text
    annotations, not for data. If your application is not text-oriented,
    but rather data-oriented better use Harpoon (http://
    harpoon.sourceforge.net) or Yaml (http://yaml.org), but not the XML.
     
    , Dec 27, 2007
    #2
    1. Advertising

  3. Uhm... As the example you show demonstrates, this isn't an XML question;
    it's a basic data structures question.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, Dec 27, 2007
    #3
  4. Joseph Kesselman <> wrote in news:4773eb20$1
    @kcnews01:

    > Uhm... As the example you show demonstrates, this isn't an XML question;
    > it's a basic data structures question.


    Pointers to better forums would be welcome.
     
    Kenneth Porter, Dec 28, 2007
    #4
  5. wrote in news:1c007e07-aee4-4d5e-a97e-d7e3f0619931
    @t1g2000pra.googlegroups.com:

    > Moreover, you seem to be using a language that was designed for text
    > annotations, not for data. If your application is not text-oriented,
    > but rather data-oriented better use Harpoon (http://
    > harpoon.sourceforge.net) or Yaml (http://yaml.org), but not the XML.


    I wasn't aware of those when I started to code. Thanks for the pointers.

    The app is implemented in C++, and uses the XML classes in the wxWidgets
    frame work to parse its config files.

    One thing I haven't seen in any of the data languages is a way of
    implementing "macros", a way to express a sequence that is used in several
    places. For example, my config file defines multiple types of systems
    (selected at runtime by the user) and many characteristics of these systems
    are common (eg. they may share similar collections of components). It would
    be desirable to specify a component configuration once and then refer to it
    in several places. I've seen hints of XML "pointers" that might serve the
    purpose, but haven't found any good examples illustrating their use.
     
    Kenneth Porter, Dec 28, 2007
    #5
  6. Kenneth Porter

    keshlam Guest

    On Dec 27, 10:18 pm, Kenneth Porter <>
    wrote:
    > One thing I haven't seen in any of the data languages is a way of
    > implementing "macros"


    If you're working with DTDs rather than schemas, Parsed Entities do
    the job. Unfortunately DTDs are incompatable with namespace-aware
    processing, and thus nearly unusable in modern XML applications.

    The XPointer and XInclude specs provide a more modern solution... but,
    alas, aren't as widely supported as one would like. The usual
    workaround is to preprocess the document through an XSLT stylesheet
    which implements the basic behavior of XInclude, or to implement your
    own include mechanism when designing your XML processing code.
     
    keshlam, Dec 28, 2007
    #6
  7. keshlam <> wrote in news:a2afc0e9-1be8-4252-91a4-
    :

    > The XPointer and XInclude specs provide a more modern solution... but,
    > alas, aren't as widely supported as one would like. The usual
    > workaround is to preprocess the document through an XSLT stylesheet
    > which implements the basic behavior of XInclude, or to implement your
    > own include mechanism when designing your XML processing code.


    I was thinking of taking the latter approach. Have any frameworks made
    progress in this direction? Or is there any reference code implementing
    XPointer or XInclude? I could then incorporate it into wxWidgets (the
    framework I'm using, which uses Expat under the hood).
     
    Kenneth Porter, Jan 2, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bryan Linton

    How to Deploy .NET across an organization

    Bryan Linton, Jan 21, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    402
    Phil Wilson
    Jan 21, 2005
  2. Mark
    Replies:
    0
    Views:
    832
  3. Kenneth Porter

    Configuration hierarchy organization

    Kenneth Porter, Dec 27, 2007, in forum: C++
    Replies:
    6
    Views:
    333
    Kenneth Porter
    Jan 2, 2008
  4. Guest

    Enums hierarchy and organization in C++

    Guest, May 30, 2008, in forum: C Programming
    Replies:
    3
    Views:
    914
    Stefan Naewe
    Jun 2, 2008
  5. kalensr
    Replies:
    0
    Views:
    92
    kalensr
    Mar 10, 2006
Loading...

Share This Page