In this context with views in a tree, which class should perform the task?
- by Jhonny 8
Imagine that I have this context:
A main view containing a table containing some cells. Each one of them with their own controller and view files.
In the main view, I have an object "Person", with 3 different IDs. Depending on certain conditions (let say, time of the day), I have to choose one of them and display it in the cell.
My question is, should the main view pass the whole object to the table, and this one to the cell, and the cell will calculate the ID that it will be shown?
or,
The main view calculates this parameter, and send the result to the table and this to the cell?
Is a question focused on OO design, which one of this approaches is more suitable in an OO design and why?