1
Vote

Return null if entity doesn't exist

description

If an entity doesn't exist an exception is returned, it would be better to return null.

comments

norgie wrote Oct 30, 2011 at 12:03 PM

Wouldn't it be better to use the NULL Object Pattern so that one doesn't have to litter ones code with if (entity != null)?

wrote Feb 13, 2013 at 8:42 PM