[kea-dev] Converting configuration back to JSON (unparsing)

Francis Dupont fdupont at isc.org
Thu Feb 23 19:36:02 UTC 2017


Thomas Markwalder writes:
> Yes, D2 has an object hierarchy constructed from Elements via
> SimpleParsers.  It is contained in D2CfgContext.

=> fine!

> The class is going to be named ToElement()?

=> CfgToElement but it is an abstract class so classes will derived
from it.

> Class names should be nouns, typically.

=> boost::noncopyable is a perfect counter-example.

> Having it be ToElement::toElement() seems a bit off.

=> the only place you should get it is in a doxygen comment
(and remember it is an instance method).

> What about something more like Configurable which defines toElement()
> method.

=> it is more Configured than Configurable but this does not catch
the fact the derived class must implement a toElement() method.
So ToElement seems a natural name.

I've just updated fdunparse private branch to these new names.
And BTW there is no ToElement::toElement found by grep (:-).

Thanks

Francis Dupont <fdupont at isc.org>

PS: for pretty print I believe a function is better (and less intrusive)
than to extend an existing method. I'll take the corresponding ticket
and change the code (and use it to not write whole configs for unit tests
twice :-).


More information about the kea-dev mailing list