Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367653 - [ComponentDiagram][ClassDiagram] instance slots - restrict instance values to feature classifiers
Summary: [ComponentDiagram][ClassDiagram] instance slots - restrict instance values to...
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.10.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-30 07:38 EST by Raphael Faudou CLA
Modified: 2017-09-08 09:44 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Faudou CLA 2011-12-30 07:38:56 EST
When defining a slot of an instance specification, a feature is chosen. If the feature has a type which is not primitive, the associated value is an instance value.
Currently we can choose any instance specification to fill this value which can lead to inconsistencies.
The choice of instance values should be limited to isntances specifications matching the feature classifiers.
Comment 1 Camille Letavernier CLA 2013-07-05 11:14:42 EDT
Attempts to provide a "correct by construction" editor often leads to restrictions.

The tool can assist the user, but must never restrict anything. Especially, we must never force the kind of elements for Default Values or slot values.

Using a LiteralString to define the value of an Enumerated slot is definitely a legal operation (This can be used to define Default Values of Enumerated properties in a Profile, as an alternative to Instance Values)

Pre-filling some fields is however a much more viable alternative, as it would improve usability without restricting the user.
Comment 2 Klaas Gadeyne CLA 2015-05-20 10:40:36 EDT
(In reply to Camille Letavernier from comment #1)
> Attempts to provide a "correct by construction" editor often leads to
> restrictions.
> 
> The tool can assist the user, but must never restrict anything. Especially,
> we must never force the kind of elements for Default Values or slot values.
> 
> Using a LiteralString to define the value of an Enumerated slot is
> definitely a legal operation (This can be used to define Default Values of
> Enumerated properties in a Profile, as an alternative to Instance Values)
> 
> Pre-filling some fields is however a much more viable alternative, as it
> would improve usability without restricting the user.

In bug #347941, I suggested the implementation of a _Wizard_ for "easy" instance creation (albeit in the specific context of SysML initial values).  (FWIW, this is also the way it's implemented in MagicDraw for instance).

This would allow the user to create 'correct-by-construction' models in a swift and user friendly way, yet allow the user to deviate from this in his models in case he wants to (and for instance set a string value for an enumerated slot).

BTW, the same remark holds for bug #367652, in which a Wizard that presents all possible slots of a classifier and allows the user to 'check' the ones he wants, could also significantly speed up instance creation and ensure 'compliant instance specifications'.
Comment 3 Klaas Gadeyne CLA 2015-05-20 10:42:34 EDT
[...]
> BTW, the same remark holds for bug #367652, in which a Wizard that presents
> all possible slots of a classifier and allows the user to 'check' the ones
> he wants, could also significantly speed up instance creation and ensure
> 'compliant instance specifications'.

Maybe the term (OCL) 'validatable' is more appropriate than compliant in the above sentence.
Comment 4 Klaas Gadeyne CLA 2015-11-27 11:56:09 EST
See Bug 333733 for a duplicate of this bug, including a solution which seems to be papyrus' best kept secret...

As put forward by Christian in Bug 457172 Comment 3, I also think that the UML form-based property view should support the user for building correct by construction models (if not: where are you going to draw the boundary?  Why not allow to drag activities in a Composite Structure Diagram?).

Hence: Please mark as a duplicate of Bug 333733.
Comment 5 Klaas Gadeyne CLA 2015-11-27 12:01:22 EST
(In reply to Klaas Gadeyne from comment #4)
> See Bug 333733 for a duplicate of this bug, including a solution which seems
> to be papyrus' best kept secret...
> 
> As put forward by Christian in Bug 457172 Comment 3, I also think that the
> UML form-based property view should support the user for building correct by
> construction models (if not: where are you going to draw the boundary?  Why
> not allow to drag activities in a Composite Structure Diagram?).
> 
> Hence: Please mark as a duplicate of Bug 333733.

My Bad: This bug is about the instance values, not about the definingFeature property of slots (See bug 367652 for the good reference).  So please ignore Comment 4