mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eero Nevalainen <eero.nevalai...@indagon.com>
Subject Re: [jira] Commented: (DIRMINA-654) Google Protocol Buffers Codec
Date Fri, 09 Jan 2009 09:43:19 GMT
Tomasz Blachowicz wrote:
> On Wed, Jan 7, 2009 at 10:50 PM, Shawn Pearce <sop@google.com> wrote:
>> Applications that add two numbers together and return the result are fairly
>> common for an RPC sort of example.  The body of the implementation is
>> trivial, its the RPC framing that is interesting to show.
>>
>> What about just a simple add server?
>>
>>  message AddRequest { required int32 a = 1; optional int32 b = 2; }
>>  message AddResult    { required int32 r = 1; }
>>
>> ?
> 
> This is good idea I guess, I can provide the implementation for such a add
> server. Do you guys have any other ideas?

How about a stack calculator? You could demonstrate the extendability 
quite compactly with it:

First you have two messages defined
- a number
- the addition operator (+)

Then you can add a multiplication operator (*)

If I've understood protocol buffers correctly, an old client using just 
the addition should be able to operate just fine, even though a new 
message has been added to the protocol.

-- 

Eero


Mime
View raw message