Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329000

Summary: lowerBound defaults differ from UML 2.3
Product: [Modeling] EMF Reporter: Ed Willink <ed>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 2.6.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2010-10-29 02:22:34 EDT
Almost certainly a WONTFIX, but I think the discussion is worth having Bugzilla'd.

The default lowerBound for UML is 1, so a default feature in UML is not nullable, i.e. cannot be null and also be well-formed.

Ecore tooling consistently provides a zero default, so that in the Sample Ecore Editor a 1 bound must be entered explicitly and a corresponding 1 annotation appears in the icon.

UML2 tooling provides a one default, and suppresses the multiplicity annotation
in the UML2 model editor when it would be [1].

The MDT/OCL Examples OCLinEcore editor currently follows Ecore, so entry of

    name : String

round-trips to show

    name : String[?]

explicitly.

Resolving this surprise and aligning with UML suggests that OCLinUML should
default to a 1 lowerBound, requiring the [?] to be entered explicitly to get a 0 lower bound.

Should the Ecore behaviour be regarded as an unfortunate tradition that new tooling should rectify, or an important behaviour that new tooling should preserve?
Comment 1 Ed Merks CLA 2010-10-29 04:09:57 EDT
It's clearly not something we'd change.  In the Ecore tree view we show multiplicities a certain way (with 0..1 being implicit as it's the default).  I don't consider it an unfortunate mistake.  What does EMOF say about it?
Comment 2 Ed Merks CLA 2010-10-29 04:10:16 EDT
There's nothing to fix in Ecore.
Comment 3 Ed Willink CLA 2010-10-29 05:04:33 EDT
MOF 2.0 is the UML way, so this is a MOF/Ecore semantic difference.
Comment 4 Ed Willink CLA 2010-10-29 05:37:22 EDT
There are actually 3 different defaults.

The Ecore.ecore default clearly must not change to avoid breaking already serialized meta-models.

The Sample Ecore Editor icon default could acquire a 0..1 decoration to avoid any confusion for users unaware of the distinct MOF/Ecore behaviour.

Tools such as the Sample Ecore Editor could apply a 1 rather than 0 lower bound default on new user input, so that a newly created EAttribute is 1..1 rather than 0..1. This would make new entry MOF-compatible without affecting serialization. 

It was interest in any strong opinion for/against the analoguous change in the OCLinEcore editor that prompted this discussion.
Comment 5 Ed Merks CLA 2010-10-29 08:36:37 EDT
I doubt any users have any EMOF expectations because there don't appear to be any other tools that support it.  I'm not interested in changing long established behavior either.  Probably an OCL editor ought to decorate in a way consistent with the Ecore editors...