Issue 6330: Assigning ‘null’ to parameters should be avoided (sdo-pim-psm-ftf) Source: Fraunhofer FOKUS (Mr. Raju Nanda Vaidya, nobody) Nature: Enhancement Severity: Significant Summary: Assigning ‘null’ to parameters (specially for parameters related to sequence of some parameters, eg: NVList ) should be avoided. Operations should not return null but empty list or raise exception where appropriate. 1. Empty values must be consistently represented throughout the specification. At the moment, empty values are represented by ‘null’ values (see e.g. description of ServiceProfileList on p.2-8; OrganizationList, status on p. 2-9 etc.). For data structures which contain a list of some other data structure (ServiceProfileList) it should not be null but empty list. For data structures like ConfigurationProfile (2-8) or DeviceProfile (p2-9) the data structure cannot be declared as empty. Therefore it can be null but may be it is not necessary to specifically defined it? Only the important point in these case is that exception should be raised and null should not be returned when such data are requested. 2. What an operation should return in every possible condition must be clearly explained. The operations should avoid returning ‘null’. Instead it should raise appropriate exception or in case of a list is requested then an empty list should be returned. Resolution: Revised Text: Actions taken: October 15, 2003: received issue Discussion: End of Annotations:===== From: webmaster@omg.org Date: 15 Oct 2003 12:41:23 -0400 To: Subject: Issue/Bug Report -------------------------------------------------------------------------------- Name: Raju N. Vaidya Company: Fraunhofer FOKUS mailFrom: vaidya@hotmail.com Notification: Yes Specification: Platform Independent Model (PIM) and Platform Specific Model (PSM) for Super Distributed Objects (SDO) Specification Section: PIM, PSM FormalNumber: dtc/03-09-01 Version: 03-09-01 RevisionDate: 03-09-03 Page: PIM, PSM Nature: Enhancement Severity: Significant HTTP User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Description Assigning Þ±nullÞ² to parameters (specially for parameters related to sequence of some parameters, eg: NVList ) should be avoided. Operations should not return null but empty list or raise exception where appropriate. 1. Empty values must be consistently represented throughout the specification. At the moment, empty values are represented by Þ±nullÞ² values (see e.g. description of ServiceProfileList on p.2-8; OrganizationList, status on p. 2-9 etc.). For data structures which contain a list of some other data structure (ServiceProfileList) it should not be null but empty list. For data structures like ConfigurationProfile (2-8) or DeviceProfile (p2-9) the data structure cannot be declared as empty. Therefore it can be null but may be it is not necessary to specifically defined it? Only the important point in these case is that exception should be raised and null should not be returned when such data are requested. 2. What an operation should return in every possible condition must be clearly explained. The operations should avoid returning Þ±nullÞ². Instead it should raise appropriate exception or in case of a list is requested then an empty list should be returned.