it only has to be unique to the particular message - not unique globally.
The "why" is simply: because that is what it uses on the wire to identify
different members.

If they weren't unique, clearly it wouldn't work. If they weren't explicit
(but were, say, assumed positionally) then it would not be possible to
version the contracts easily, and extension members wouldn't make much
sense.

Or another way of considering it: ask the same question, but in the context
of a regular programming language: replace "id" with "member name". Same
thing - just less text on the wire.

(if I've missed the point of your question, let me know)

Marc

On 4 June 2012 11:03, charfeddine.ahmed <charfeddine.ah...@gmail.com> wrote:

> Why do we need to put a unique id to each member in a .proto file ?
> It is annoying when we need to make changes (add, remove members).
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@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.
>
>


-- 
Regards,

Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@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