I have 12 objects. They have different but very similar actions to perform, and I may easily group them in one array. Because they also have to be returned to main() by the factory classes specialising them, I could write fewer lines of code by using arrays or vectors instead of 12 individual objects.
But, I'm wondering: because they have different meanings in the whole picture, I would somehow depersonalise them by arranging them in arrays. Also, I don't exclude that in the longer term they may differentiate their behaviour more.
As a rule of thumb, when is right, by good design, to move to arrays? Hope not a too philosophical question...
Aucun commentaire:
Enregistrer un commentaire