Re: Decouple SQL queries from class in OOP design



Mikito Harakiri a écrit :
(snip)

Cool. When I forget my badge and show up at the front door and give them my employee ID, it is sure nice not to have an EMP table and query it directly, but send a message to each and every DEPT instance to ask "does emp 1234 work for you?"

Is there any reason the OO code should do such a stupid thing (apart from having been designed by a stupid designer and coded by a stupid coder) ?


Anyway, I wouldn't let the guys at the front door have to manually issue SQL queries - I would provide them with a nicer user interface !-)
.