All Questions
2 questions
1
vote
1
answer
126
views
Should "magic" getter functions be used for dynamically calculated values or just existing properties?
For example, if I had a Customer class and wanted to get all orders by them. Would it be better to do:
class Customer{
public function getOrders(){
return results from db query
}
}
.....
5
votes
8
answers
2k
views
Rule of thumb for deciding which class a method belongs to
For example, imagine a website which stores results about a certain sport or game, which has a typical "season" structure, such that there's both a Player and a Season class. To retrieve a player's ...