[ 
https://issues.apache.org/jira/browse/THRIFT-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641165#action_12641165
 ] 

David Reiss commented on THRIFT-167:
------------------------------------

My gut instinct is that this will actually create more work than it saves.  We 
will have to retool all of the generators to to use this style.  With a 
stateful protocol, you can just store the TField in an instance variable and 
then just check that when you get the value (and reset the TField to null).

> Improve the TProtocol interface to facilitate more complex protocols
> --------------------------------------------------------------------
>
>                 Key: THRIFT-167
>                 URL: https://issues.apache.org/jira/browse/THRIFT-167
>             Project: Thrift
>          Issue Type: Improvement
>            Reporter: Bryan Duxbury
>         Attachments: thrift-167.patch
>
>
> In doing some exploratory coding on THRIFT-110, it's clear that some 
> improvements to the TProtocol interface would make things much easier. 
> What I'm thinking is that we should add a new set of methods that take the 
> TField and value simultaneously. For instance, we'd have writeString(str) and 
> writeStringField(field, str). This way, the protocol would know explicitly 
> that it can write the field id, type header, and value all at once. The 
> exsiting overload (writeString(str)) would still be used when writing 
> containers' contents. 
> Existing protocols can implement this behavior very simply as a call to 
> writeField then writeString, so we wouldn't have to do a ton of work to 
> recode them completely. Code generators would have to change to take full 
> advantage of this new interface, but existing generated code would still 
> work, since we'd retain all the original methods. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to