[bind10-dev] proposal: separate ModuleCCSession and ConfigData

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Tue Apr 3 18:25:04 UTC 2012


At Mon, 2 Apr 2012 12:35:28 +0200,
Michal 'vorner' Vaner <michal.vaner at nic.cz> wrote:
> 
> >     // Adds the module name to the internal subscription list with the
> >     // callback, and if not yet, subscribe to new messages for the module.
> >     void setCommandCallback(const std::string& module_name,
> >                             CallbackType callback);
> 
> I'd actually prefer to have something like „Add callback for a command of this
> name“, not a one-callback-fits-all. This way it would be more modular and we
> could avoid handling things like parameter validation and unknown command
> handling.

Hmm, you are probably right.  We can then also (possibly) avoid
separating config updates and other commands.

> Also, I don't think we should distinguish the „our config data“ from „foreign
> config data“ too much.

Right, that's one other points I'd like to clarify.  My gut feeling is
that as we revisit/clarify the API and refactor the code we'll
probably find we can unify the cases for local (ours) and remote
(foreign).

> If we would have the ConfigData class, I think the
> ModuleCCSession should inherit from it, because handling own config data should
> contain all the things as handling any config data (merging the configurations,
> etc). It would just need some more code for validation, etc.

Hmm, I'm afraid I don't follow this logic.  BTW, there is indeed a
ConfigData class right now, and ModuleCCSession inherits from it.  I
actually thought that relationship was one reason why ModuleCCSession
had now so many responsibilities and was much complicated, and I
proposed to stop doing the inheritance for clearer separation of
responsibilities.

---
JINMEI, Tatuya
Internet Systems Consortium, Inc.


More information about the bind10-dev mailing list