Re: [protobuf] Move nested message.

2014-10-27 Thread 'Shuo Zhou' via Protocol Buffers
Got it, thanks!

On Mon, Oct 27, 2014 at 3:43 PM, Ilia Mirkin  wrote:

> On Mon, Oct 27, 2014 at 6:33 PM, Shuo Zhou  wrote:
> > Hi,
> >
> > Suppose I got a message as follows:
> >
> > message Foo {
> >   message Bar {
> > optional string name = 1;
> >   }
> >   repeated Bar bar = 1;
> > 
> > }
> >
> > Then I find Bar is needed widely as a generic message, and want to move
> it
> > outside of Foo as follows:
> > message Bar {
> >   optional string name = 1;
> > }
> > message Foo {
> >   repeated Bar bar = 1;
> > ...
> > }
> >
> > Would this change cause serializing problem?
>
> Nope. As long as the field numbers don't change, there's no difference.
>
>   -ilia
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Move nested message.

2014-10-27 Thread Ilia Mirkin
On Mon, Oct 27, 2014 at 6:33 PM, Shuo Zhou  wrote:
> Hi,
>
> Suppose I got a message as follows:
>
> message Foo {
>   message Bar {
> optional string name = 1;
>   }
>   repeated Bar bar = 1;
> 
> }
>
> Then I find Bar is needed widely as a generic message, and want to move it
> outside of Foo as follows:
> message Bar {
>   optional string name = 1;
> }
> message Foo {
>   repeated Bar bar = 1;
> ...
> }
>
> Would this change cause serializing problem?

Nope. As long as the field numbers don't change, there's no difference.

  -ilia

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Move nested message.

2014-10-27 Thread Shuo Zhou
Hi,

Suppose I got a message as follows:

message Foo {
  message Bar {
optional string name = 1;
  }
  repeated Bar bar = 1;

}  

Then I find Bar is needed widely as a generic message, and want to move it 
outside of Foo as follows:
message Bar {
  optional string name = 1;
}
message Foo {
  repeated Bar bar = 1;
...
} 

Would this change cause serializing problem? 

Thanks,
Shuo

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.