eclipse-uml2 / uml2

An EMF-based implementation of the UML 2.x metamodel for the Eclipse platform.
Eclipse Public License 2.0
5 stars 4 forks source link

Allow to disable some constraints using preferences #90

Open eclipse-uml2-bot opened 1 week ago

eclipse-uml2-bot commented 1 week ago

| --- | --- | | Bugzilla Link | 529562 | | Status | NEW | | Importance | P3 enhancement | | Reported | Jan 09, 2018 03:41 EDT | | Modified | Jan 28, 2018 16:22 EDT | | Blocks | 505928 | | See also | 373643 | | Reporter | Benoit Maggi |

Description

Some profile-base DSML may chose to relax some UML constraints (Ex: SysML)

So it will be very useful to be able to "disable" some constraint when launching a validation.

eclipse-uml2-bot commented 1 week ago

By Benoit Maggi on Jan 09, 2018 03:45

The Bug 505928 give an example of constraint that is removed in SysML OMG profile. The result with the current SysML implementation is that the validation will always give a warning even for a valid SysML model (not UML valid).

It's probably a bad idea for a profile to "remove" some UML constraints but it exists so this feature would be really useful to provide a good tooling (without overriding the whole mechanism in SysML implementation)

eclipse-uml2-bot commented 1 week ago

By Benoit Maggi on Jan 09, 2018 03:45

The Bug 505928 give an example of constraint that is removed in SysML OMG profile. The result with the current SysML implementation is that the validation will always give a warning even for a valid SysML model (not UML valid).

It's probably a bad idea for a profile to "remove" some UML constraints but it exists so this feature would be really useful to provide a good tooling (without overriding the whole mechanism in SysML implementation)

eclipse-uml2-bot commented 1 week ago

By Ed Willink on Jan 09, 2018 05:24

IMHO a Constraint cannot be relaxed by a derived class, therefore any SysML requirement to do so is illegal until facilitated by a UML change. Such a change may adopt the NamedElement::isDistinguishableFrom idiom whereby a permitted semantic variation point is encapsulated by an override-able operation.

Again IMHO, in the interests of making progress 'today', once the necessary SysML semantic variation points have appeared as part of an OMG UML issue, the UML2 project might provide early support. Arguably this should be an URGENT OMG issue since it blocks implementation.


Alternatively/additionally a serious UI enhancement might allow a distinct ignore/info/warning/error severity for each individual / related-group of constraints. OCL has done this, since the new null-safety warnings may be unacceptable in legacy applications. But it is unpleasant since the only guaranteed argument to all validate() methods is a Map whose creation OCL cannot influence. Therefore discovery of the severity management requires tediously expensive Map accesses. For UML it might be possible to ensure that everything happens wrt to a UMLDiagnostician. Perhaps we can come up with an ExtensibleDiagnostician that supports the evolved needs of both UML and OCL.

eclipse-uml2-bot commented 1 week ago

By Benoit Maggi on Jan 09, 2018 06:56

(In reply to Ed Willink from comment #3)

IMHO a Constraint cannot be relaxed by a derived class, therefore any SysML requirement to do so is illegal until facilitated by a UML change. Such a change may adopt the NamedElement::isDistinguishableFrom idiom whereby a permitted semantic variation point is encapsulated by an override-able operation.

Yes IMHO "relaxing" UML should be illegal for a profile.

Again IMHO, in the interests of making progress 'today', once the necessary SysML semantic variation points have appeared as part of an OMG UML issue, the UML2 project might provide early support. Arguably this should be an URGENT OMG issue since it blocks implementation.

I'm not aware of the specific context in OMG, but SysML is providing version faster than UML so it may require some time to adapt.


Alternatively/additionally a serious UI enhancement might allow a distinct ignore/info/warning/error severity for each individual / related-group of constraints. OCL has done this, since the new null-safety warnings may be unacceptable in legacy applications. But it is unpleasant since the only guaranteed argument to all validate() methods is a Map whose creation OCL cannot influence. Therefore discovery of the severity management requires tediously expensive Map accesses. For UML it might be possible to ensure that everything happens wrt to a UMLDiagnostician. Perhaps we can come up with an ExtensibleDiagnostician that supports the evolved needs of both UML and OCL.

I use org.eclipse.emf.validation.constraintProviders extension point to provide constraints in SysML and it's working fine (Many time the preferences saved the day for a user that was annoyed by to verbose validation)

eclipse-uml2-bot commented 1 week ago

By Kenn Hussey on Jan 09, 2018 11:42

The org.eclipse.uml2.uml.validation bundle includes a delegating constraint provider, so shouldn't it already be possible to disable some of the provided constraints using the mechanisms in the EMF validation framework?