tags:

views:

37

answers:

1

The question is pretty simple actually. I have a module in my system containing classes that describe some measurement results. I also have a module containing classes used for a visualization. These two modules are not really related to each other and I prefer to not let them know each other.

Now I want to visualize the results using my visualization. I have to convert the results to a form that the visualization accepts. Where do I put this functionality? In the results module, in the visualization module or in a separate module?

I feel that making a separate module would force me to make a whole lot of separate modules for all combinations of things to visualize and visualizations. But I also don't like to link the two original modules together...

Is there some common practice for this?

Additional info: I use C#

PS: I found it difficult to search for an answer to this because I wouldn't know what the title would be. I also feel that someone who has the same problem will probably not find this question. So if any of you know a better title for this question, don't hesitate to change the title.

+2  A: 

A common set of data structures in a separate assembly (and used by various modules) is good practice.

Alternatively, if you really do not want that, you will have to ensure your input types for the visualisation part is a simple data structure, like an array of numbers, and maybe an additional argument which could be a name or something that describes them.

In most cases that won't suffice, so a common assembly is the best way forward IMO.

Wim Hollebrandse
I like your idea of an intermediate format, that way I can let every module worry about converting to and from this intermediate format. Bedankt.
Matthijs Wessels