On Thu, Mar 17, 2011 at 3:42 PM, ctapobep
<[email protected]> wrote:
> Inheritance has a lot of usages in our day-to-day work, and thus
> including it into a feature list is a must from my perspective. I have
> two use cases in hand right now:
> 1. Historically we were using another lib that supported inheritance
> and a lot of classes were written that leverage this feature. I don't
> like that lib, but I can't move to protobuf simply because it doesn't
> support inheritance.

You can still fake out inheritance with composition. Whatever your
library is that you've wrapped around, you can do this.

> 2. I need to have a grid structure, that may contain any type: String,
> int, double, etc. To do so I'd like to have a List<BasicType> as a raw
> in a grid, where BasicType is an ancestor for IntType, DoubleType,
> StringType, etc. I can't imagine implementing this elegantly without
> inheritance.

That's basically a union.
(http://code.google.com/apis/protocolbuffers/docs/techniques.html#union)

-a
-- 
Austin Ziegler • [email protected][email protected]
http://www.halostatue.ca/http://twitter.com/halostatue

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to