Hi,

This is an oldish message, but unless I have a mail delivery issue, it
hasn't received any answer or follow-up, so here it is.

On Tue, Jun 19, 2012 at 2:30 AM, Michael MacFadden
<[email protected]> wrote:
> Wavers,
>
> We have run in to some code that we would like to get some guidance from the 
> community on.  We have been diving in to the protocol buffers implementation 
> and ran in to the Protocol String Template mechanism.  It seems like the 
> steps are the follow:
>
> 1) Use protoc to compile .proto file in to .java files.
> 2) Use javac to compile the .java file in to class files.
> 3) Use the PST tool to evaluate the Protobufs to generate additional java 
> files.
> 4) Use javac to compile the PST generated code.
>
> So a couple questions:
>
> 1) Can some one talk a little about what the PST stuff is, how it extends the 
> protoc compilation?
> 2) How the build process works?
> 3) How is the code build by the PST used?

The goal was to generate GWT-compatible protobuf implementations.
There would have been basically 3 approaches:
 - parse the .proto files, i.e. duplicate protoc functionnality
 - plug into protoc (this was probably not possible at the time, and
plugging Java extensions seems a little fragile)
 - post-process the implementation generated by the stock protoc,
using protobuf's own reflection APIs.

The last approach is what's used here. So PST takes as input the
output of "protoc" (compiled as classes, so reflection can be used),
and produces different implementations of the same messages.

Note this is all from memory, from when I looked at it *last year* !
(or even earlier)

-- 
Thomas Broyer
/tɔ.ma.bʁwa.je/

Reply via email to