I really like using protobuf but I cannot find a way to make this one case 
work.

I need to define a base, lets call it Transaction. Each message could be 
implemented differently so my original implementation was

message Transaction{
    oneof type {
        NTx n = 1;
        TTx tx = 2;
    }
}

message NTx {
    required string something_else;
}

message TTx {
    required string soemthing;
}

Now I need people outside of the project to extend Transaction.
I realised that oneof can't be extended so I moved to doing

message Transaction {
    enum /* ... */
    
}

This is starting to get chaotic. So I moved to 

message Transaction {
    required int32 tx_type = 1;
    extensions 100 to max;
}

message NTx {
    extend Transaction {
        optional int32 tx_type = 101;
    }
    optional string something = 1;
}


This also is horrible to work with due to how extensions work in Java.



I really need some help.

I need a way of a generic transaction envelope. Then I need end users to define 
their own transaction types with arbitrary data in it.

And it could be two or three client modules combined together. If anyone could 
help me I would be grateful. 



-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to