vendredi 18 novembre 2016

which design to use for data and algorithm?

I'm designing a small C++ software to solve a certain kind of problem with more than one algorithm.

On one hand I like the idea of writing a class to handle the input and validation of the problem data. On the other hand I would like to use classes with a common base class to write the algorithms. Clearly, the two things do not excluding each other, but I can't figure out a clean way to give access to the problem data to the algorithm classes.

Is using class friendship a bad option?

Are there design patterns which can be used with my setting?

Thanks!

Aucun commentaire:

Enregistrer un commentaire