I have a [ConfidentialInfo]
object that is sent as input over the wire for further processing.
ConfidentialInfo
{
confidentialInfo 1,
confidentialInfo 2,
confidentialInfo 3
}
I need to send back some derived values, after processing this input, as an object. Now, these values also bear close affinity to being part of the original input object.
ConfidentialInfo
{
outputNotSoConfidentialInfo 1,
outputNotSoConfidentialInfo 2
}
Should I model both the input and output together as one object - [ConfidentialInfo]
or end up modeling 2 different objects ---- [ConfidentialInfoInput]
and [ConfidentialInfoOutput]
?
[Update and Elaboration] : My dilemma is:
If they are modeled as one which makes absolute sense btw, there is a need to differentiate it. There is no immediate grasp of what is input and output.
If they are modeled separate...differentiation is explicit but cohesiveness is gone. And there are equality checks and other comparisons that come into place to ensure that output was indeed derived from given input.
What is the sensible way to proceed?
I think you should make ConfidentialInfo as abstract class, so the [ConfidentialInfoInput] and [ConfidentialInfoOutput] classes will inherit from it.