There are many things that need to be read from imported .proto files to
determine if the .proto is valid, or to produce correct code. e.g.:
- need to differentiate between enum and message imports
- when referencing a qualified type like foo.bar.Baz.Qux, you need to know
what components are package specifiers, and which are objects. This changes
the forward declaration scheme: if that was package foo.bar; message Bar {
message Qux { } }, the declaration is namespace foo { namespace bar { class
Bar_Qux; } }, whereas maybe Bar is just a namespace, so you should instead
produce namespace foo { namespace bar { namespace Bar { class Qux; } } }
- options like java_multiple_files affects the generated code
- when defining extensions, you need to know whether the extendee accepts
extensions, and what range of extension numbers the extendee allows

To use the .proto, you need to build the imported proto files anyway, so
even if you could capture all of this in a simple forward-declaration-type
scheme, I don't think you would save very much.

On Wed, Jan 19, 2011 at 9:02 AM, George <george.georg...@hotmail.com> wrote:

> Hi,
>
> It looks to me that the generated result of a single proto file
> doesn’t change significantly based on the content of the imported
> proto files, but mostly on the fact that it is imported.
>
> Did you have considered replacing the need of actual import with some
> kind of message forward declaration?
>
> In my opinion having a single proto file self-sufficient even in case
> it actually refers messages from other proto files could significantly
> simplify the build process.
>
> What the protobuf community thinks about this?
>
> Thanks,
> George
>
> --
> 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<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 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