I have an abstract class "A", which has a property of the enumeration type "OutputType", and an abstract method () method, which should perform a certin calculation and output the result in double [] ** according to the value of OutputType.
I also have classes defined as D1, D2, D3 ... D20 derived from A, where each class Di implements the A () () method differently.
The problem is that not all OutputType values (output types of calculations) are supported in every Di
For instance:
If the values of the OutputType enumeration are "Scaled", "NonScaled" and "ConstantLength",
Di certificate can support "Scaled" and "NonScaled", but does not support "ConstantLength", and another Di can support all types of operations,
My question is:
What is the right design pattern to implement this behavior?
Please avoid the obvious "Throw if the OutputType property gets the value of an unsupported operation."
Edit
Expanding the question:
Is there a way to notify the user with intellisense of all supported operations, so the user should not use trial and error? (besides proper documentation)
source
share