Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
In a real use case there were two different types of sensors that had
a common interface/info to be analyzed. It took a bit to figure out how to
deal with this. It certainly wasn't convenient.
Imagine the tuple type hierarchy:
class Base {};
class Derived1 extends Base {};
TStream<Derived1> sDerived1 = ...; // ingest
class Derived2 extends Base {};
TStream<Derived2> sDerived2 = ...; // ingest
TStream<Base> sBase = sDerived1.union( sDerived2 );
doAnalytics( sBase );
The union() gets a compilation error because TStream<Derived*> doesn't extend TStream<Base>. Std java generics stuff. A straightforward cast doesn't work; it requires a bit more convoluted casting.
[I'll capture the essence of a thread on the dev list for this below]