Since protocol messages are value objects, it's generally not necessary to
mock them.  The problem with interfaces is that they cannot make any
guarantee of immutability.
On Mon, Sep 21, 2009 at 3:24 AM, Brice Figureau
> wrote:

> On Fri, 2009-09-18 at 15:15 -0700, wrote:
> ... snipped...
> > It would have hard to impossible to implement some of the stuff
> > without the completely different class structure it uses.
> What I like with this class structure (not using it, just read the blog
> post) is that it creates a java interface for the protobuf object.
> This should greatly help mock the objects in unit tests.
> With the current protobuf implementation which creates final classes it
> is impossible to mock a protobuf object. Of course there are usually
> alternatives, but sometimes it is useful to verify mock interactions in
> client code.
> That's currently a feature I'd appreciate in the Google Protocol
> Buffers. Even more than lazy parsing...
> --
> Brice Figureau
> Follow the latest Puppet Community evolutions on!
> >

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to