Another nugget of design to consider over tea time.

I have an potential concern about VectorWritable. It is now subclassed
by MultiLabelVectorWritable and WeightedVectorWritable. That's OK, if
the output of these Writables is never intended for consumption by a
job that more generically expects Vectors.

The way Writables work, the way to implement that behavior would not
be subclassing. VectorWritable is a factory class for Vector
subclasses, in essence, and so is not subclassed itself.

Even if there is no such interoperability intended, I think the design
here should be adjusted. This is a case for composition rather than
inheritance, since subclassing VectorWritable suggests it can be
substituted for VectorWritable, and it cannot. The structure has also
caused, for example, a private field to become protected and things
like that.

Reply via email to