2 ms·
One obvious problem with that comparison - it is a toy example. It is really not about anthropomorphizing objects, it is about where the state is kept and who
by danbruc 12y ago
One obvious problem with that comparison - it is a toy example.
It is really not about anthropomorphizing objects, it is about where the state is kept and who can modify it how. And the right or at least the best choice heavily depends on the problem you are modeling. If you are primarily tracking the whereabouts of students it is probably a good choice that students keep track of that information and provide an interface to update it. If you are primarily interested in rooms and who is inside, it may be better to make the rooms responsible and provide an interface like classroom.enter(student).