You might invert the encapsulation, so that each Fruit instance contains
a 'flavor' field that's a union of types like Apple and Orange?
Doug
On 05/31/2011 08:33 PM, Yang wrote:
I understand that avro does not have inheritance now, so I am wondering
what is the best way to achieve the
You can do this a few ways. The composition you list will work, the member
variable should be of type Fruit.
Or you can put the type object inside the fruit:
record Fruit {
int size;
string color;
int weight;
union { Apple, Orange } type;
}
record Orange {
string skin_thickness;
}
record