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.


>
> Thanks
>
> --
> 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
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
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 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to