in reply to OO design question
The better way is to define one output function for each type, with a parameter (a constant) of the method of output that you are generating; it's up to the individual type if it needs to heed that type, with a default output of "plain text". This way, adding a new output type won't break anything to start, and you can then work back to update those types of objects that will work with that data type to do so; those that are unaffected like scalars need no additional updating.
|
|---|