I would like to add one method to the Configuration object to help make
using it a bit easier--or at least DefaultConfiguration. It is the
addition of a branch() method. The purpose is to create a new branch
of the configuration tree with a new name.
The need came up with using a C++ version of the Config object, and I
have
a templating library that I am converting to a new format. I believe it
will become useful when we move to Java. The change is relatively
small,
and it does not have to alter the interface. It can be a function of
the
DefaulatConfiguration object.
Configuration newBranch = config.branch("new-name");
I have a legacy template library that only captures a little bit of the
overall print page. The printed strips have a header, and several
positions.
It needs to add in support for new strip types, and more controlled
placement
of elements. As a first step, I converted the loading scheme to create
a Configuration hierarchy.
After I create the legacy Strip template, I have to replicate all the
information
into new child configurations that are essentially the same--with the
exception
that the root name is different. Something along these lines:
Configuration family = processFamily(...);
Configuration strip = processStrip(...);
family.addChild(strip);
family.addChild(strip.branch("peg-strip"));
family.addChild(strip.branch("vert-peg-strip"));
This frees me from being forced to do a lot of otherwise complex logic
at this
level.
Do others think that this would be useful?
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>