On Wed, Sep 15, 2010 at 6:03 AM, users .... <moofis...@gmail.com> wrote:
> I am implementing PB to provide an external interface and API to a
> developing system. I know the interface will change and the extension/
> backwards compatibility is a major benefit. When designing the .proto
> files should I, for pure flexibility, make everything optional or
> repeated fields? If I do this I can then write separate Validate
> functions for each implementation revision. I can see an opportunity
> to automate the validate function creation with the code generating
> capabilities. This will remove the burden of "required is forever"
> but will it impact performance or have other negative effects that I
> can not see? Is this a good practice for flexible implementations or
> are there better patterns?
This is exactly what I usually recommend to people, and do in my own code.
There are no significant performance effects (if anything, performance will
be better because there are fewer checks to perform when parsing). But as
Jason says, opinions vary.
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at