According to tell dont ask, push is better – or more OO. You don’t want to query object for data so you can do something, you want object to do it, because he’s the one who knows his data.
Related article about evil getters
According to tell dont ask, push is better – or more OO. You don’t want to query object for data so you can do something, you want object to do it, because he’s the one who knows his data.
Related article about evil getters