Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318907 - extended client contexts to not inherit constraints bound by default
Summary: extended client contexts to not inherit constraints bound by default
Status: CLOSED WONTFIX
Alias: None
Product: EMF Services
Classification: Modeling
Component: Validation (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major
Target Milestone: ---   Edit
Assignee: EMF Services Validation inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-05 11:10 EDT by Adam Neal CLA
Modified: 2022-05-26 15:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Neal CLA 2010-07-05 11:10:52 EDT
Build Identifier: IES 3.6, 20100611

If a parent client context, PCC, is set as 'default' and binds to namespace NS1, then it is expected that an extending client context, ECC, would inherit all constraints of the parent context.  This currently works, given the constraints bound to PCC are bound via XML.  Any constraints which are implicitly bound via the Nampespace at runtime, are not being inherited by the extending clients.

Expected behaviour is that an extending client context will inherit all constraints bound to the parent context, whether they were explicitly or implicitly bound.

Reproducible: Always

Steps to Reproduce:
1)create a plugin that defines a constraintBinding, and declares a clientContext which extends a base context declared as default.

    <extension point = "org.eclipse.emf.validation.constraintBindings">
        <clientContext
                default = "false"
                id      = "org.example.subClientContext">
            <selector class = "ExampleCientSelector"/>
        </clientContext>
        <binding
                category = "example"
                context  = "org.example.subClientContext">
            <extendClientContext ref = "com.ibm.xtools.modeler.validation.client"/>
    </extension>
2) make the selector class always return true...
3) create a validation project e.g.: File / New / Examples / RMP Plugins / Modeler Plugins / Model Validation
4) launch application
5) set a breakpoint in the JavaExample class
6) create a cyclic generalization and validate the model
Comment 1 Linda Damus CLA 2010-07-28 11:18:47 EDT
I infer from bug 249496, comment 11, point (2), and the response in comment 12, that this is working as designed.  In other words, clients should always bind their constraints to the context that they want to be part of.  The use of the default context is, according to its author, discouraged.

The documentation on the extendClientContext element in the constraintBindings extension point does not address what the expected behaviour should be with respect to inheriting constraints that are implicitly bound to a default context, one way or the other.

I propose that the extension point documentation be updated to make this clear, as follows:

"extendClientContext
Since 1.3. References a client-context that the bound context extends. Conceptually, this declares that objects matching the referenced context also match my bound context. In practice, this means that my bound context inherits all of the explicit constraint bindings from the referenced context.  

This will not include any implicit constraint bindings if the referenced context is a default context.  If my bound context wishes to include such implicit constraint bindings, it should itself be declared as a default context."
Comment 2 Pierre-Charles David CLA 2022-05-14 09:53:33 EDT
Eclipse EMF Validation is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/emf-validation.

If this issue is relevant to you and still present in the latest release:

* Create a new issue at https://github.com/eclipse/emf-validation/issues/.
  * Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  * In the GitHub description, start with a link to this bugzilla ticket
  * Optionally add new content to the description if it can helps towards resolution
* Update bugzilla ticket
  * Add to "See also" property (up right column) the link to the newly created GitHub issue
  * Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  * Set status as CLOSED MOVED

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for EMF Validation will be archived and made read-only.
Comment 3 Pierre-Charles David CLA 2022-05-26 15:30:03 EDT
EMF Validation is in maintenance mode and has very few resources available.
If you feel this issue is still relevant and important enough, and are willing to actively contribute yourself (or fund someone to work on it), please re-open on GitHub at https://github.com/eclipse/emf-validation/issues