GeoAPI specification should relax the rule against null collection when the enclosing type is an union

Description

When the type of a property is a Collection and that property has no value, we usually recommend to return an empty collection instead of null. However non-null collections may become tricky when two or more properties are mutually exclusive. We should probably said in the GeoAPI specification that this is only a recommendation and that implementors may relax this rule, especially on conditional properties.

To be more specific, ISO 19115 sometime defines conditions like "A can be defined only if B is not provided" and conversely. What to do if A and B are modifiable collections? If a user attempts to add an element in the collection A while collection B is non-empty, should the implementation accepts the condition violation, raise an exception or automatically clears the collection B? Some implementations may prefer to allow only one of A or B to be non-null in order to avoid the above question. GeoAPI should probably not mandate a particular strategy and let implementations document their choice.

Environment

None

Status

Assignee

Unassigned

Reporter

codehaus

Priority

Low
Configure