AndrewJMarshall
Programmer
I know it seems like a goofy question, but ...
I'm writing a data layer class that provides methods to retrieve objects from a database by their ID. If no record exists for a specific ID, should the methods provided return null or throw an exception?
Please provide your reasoning as this is a mostly academic question. My suspicion is the that the "right" answer is "it depends". 8-(
Thanks,
Andrew
I'm writing a data layer class that provides methods to retrieve objects from a database by their ID. If no record exists for a specific ID, should the methods provided return null or throw an exception?
Please provide your reasoning as this is a mostly academic question. My suspicion is the that the "right" answer is "it depends". 8-(
Thanks,
Andrew