E
Efi
Hello,
I have the following two classes:
class Chunk<T,V1> {
V1 value;
T data;
}
class Feature<T,V2>{
V2 value;
T data}
I am writing a class that in essence transforms a Chunk into a
Feature.
class Transform<T,V1,V2> ...
public Feature<T,V2> transform (Chunk<T,V2> foo)...
Chunk and Feature has a common typed parameter(T) which I'm enforcing
when I'm declaring the Transform class.
I think that the transform class is just too confusing when I'm using
it with 3 typed parameters, I would like to reduce the number of typed
parameters and still have the same functionality.
At the beginning I thought using constraints i.e.
class Transform<U,V> where T : Chunk V : Feature
however in order to use it I need to add type to Chunk and Feature
i.e.
where T : Chunk<T,V1>
so it didn't help me.
What do you think, how can I do it?
Thank you,
Efi
I have the following two classes:
class Chunk<T,V1> {
V1 value;
T data;
}
class Feature<T,V2>{
V2 value;
T data}
I am writing a class that in essence transforms a Chunk into a
Feature.
class Transform<T,V1,V2> ...
public Feature<T,V2> transform (Chunk<T,V2> foo)...
Chunk and Feature has a common typed parameter(T) which I'm enforcing
when I'm declaring the Transform class.
I think that the transform class is just too confusing when I'm using
it with 3 typed parameters, I would like to reduce the number of typed
parameters and still have the same functionality.
At the beginning I thought using constraints i.e.
class Transform<U,V> where T : Chunk V : Feature
however in order to use it I need to add type to Chunk and Feature
i.e.
where T : Chunk<T,V1>
so it didn't help me.
What do you think, how can I do it?
Thank you,
Efi