I agree, when a constructor's required input is any invalid value (including null), it makes perfect sense that an exception is thrown.
But I realize the correct technical answer for one set of classes does not take into account the existing project standards or practices. Extra work is required because these classes behaves differently from the other data classes used by the project. The extra work may be a little, add the try and catch code just for these classes. The extra work may be large, review and changes of the projects architecture so all data classes throw an exception on bad data. Your project team must decide. I have found that a pragmatic approach that strikes a fair balance between the technically best way and the business goal of getting it done is the best answer. The perfectionist in each of us must be kept in check or you can never get anything done. Jim Dohrenwend -----Original Message----- From: Repine, Burt [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 03, 2002 11:15 AM To: JDJList Subject: [jdjlist] Exception thrown from the constructor of a class A developer on our team just introduced a new set of classes the project that throw an exception from the constructor. The classes follow the Value Object pattern so they're just data containers. The exception is thrown if a null value is passed in. This seems like a really bad idea to me with no inherent benefit but the developer is holding fast to his implementation. Are there any philosophies out there on this subject? Thanks! ____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________ ____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________
