[bind10-dev] cc message format description and routing daemon added to svn

Shane Kerr shane at isc.org
Wed Sep 23 09:42:39 UTC 2009


Michael,

On Tue, 2009-09-22 at 21:47 -0500, Michael Graff wrote:
> I really want to use a standard thing like
> 
>   std::string
>   stl::map
>   stl::list
> 
> or whatever which will allow strings, hashes, and ordered lists, to be
> used here whenever possible.  Perhaps it isn't as possible in C++ as it
> is on less strictly type-bound languages.
> 
> I could make an object who's only purpose is to wrap these (or just
> derive from those classes as well as one of my own) which adds rendering
> and parsing stuff.

You don't need to inherit from them, but rather to include them as
attributes in your objects.

The OO way to do this is to hide the specific logic in your classes. So,
using Jinmei's example:


class MessageComponent {
public:
    virtual void do_something() = 0;
};

class MessageComponentString : public MessageComponent {
private:
    string str;
public:
    virtual void do_something() { /* manipulate str here */ };
};


In OO, if you're checking types you're probably not doing the right
thing.

--
Shane




More information about the bind10-dev mailing list