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

Bug 256927

Summary: Support for determining incoming X-References efficiently
Product: [Modeling] EMF Reporter: Bernd Kolb <b.kolb>
Component: cdo.coreAssignee: Project Inbox <emf.cdo-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P4 CC: saulius.tvarijonas, smcduff, stepper
Version: 4.1Keywords: helpwanted
Target Milestone: ---Flags: stepper: galileo+
Hardware: PC   
OS: Windows Vista   
Whiteboard: Appealing to a Broader Community
Bug Depends on: 256931    
Bug Blocks:    

Description Bernd Kolb CLA 2008-11-28 13:18:07 EST
As discussed, CDO should have some support for X-References as they are necessary for metamodel extensions
Comment 1 Simon Mc Duff CLA 2008-11-28 13:43:19 EST
Hi Bernd,

You probably discussed this with Eike.

Can Eike or yourself define a use case on how it should behave or the problem you encounter ?

Thank you

Simon
Comment 2 Eike Stepper CLA 2008-11-29 04:02:25 EST
Simon, There is EcoreUtil.CrossReferencer which collects all incoming references of a set of target objects. We'd like to have a round trip-based mechanism that provides an iterator over the set of cross-referencing objects for CDO. I could imagine an API like this:

  public CloseableIterator<CDOObject> CDOView::queryCrossReferences(CDOObject... objects);

or this:

  public class CDOCrossReferencer implements CloseableIterator<CDOObject>
  {
    ...
  }

There are two arguments for the latter form:

1) Since the operation can be expensive even for a particular back-end we don't encourage users to use it so easly.

2) I'm foreseeing similar mechanisms to be added for example for getAllInstances(CDOClass c), thereby polluting the CDOView interface.

Btw. a third option would be to only provide such queries through a generic query language (in the terms of the query framework). I'll write a respective comment to bug #256931 too.
Comment 3 Bernd Kolb CLA 2008-11-29 04:42:20 EST
Some thoughts on this:

I find it specifically important to make the Feature a first class citizen in this query. Only rarely you need to know what is referencing an EObject in general rather than what is referencing an EObject in which context(feature)

Additionally, I am not sure if such a feature should be mapped to the query language discussed in #256931 My feeling is that it should be handled as low-level as possible and thus executed/answered by backend directly

API wise I'd be in favor for not mixing it with the CDOView. Just keep different things separate.

Just my 2 cents 
Comment 4 Eike Stepper CLA 2009-11-01 06:00:45 EST
Rebasing all unresolved enhancement requests to 3.0
Comment 5 Eike Stepper CLA 2010-06-29 04:51:37 EDT
Rebasing all outstanding enhancements requests to version 4.0
Comment 6 Eike Stepper CLA 2011-01-18 13:18:49 EST
I think we solved this in bug 300149.

*** This bug has been marked as a duplicate of bug 300149 ***
Comment 7 Eike Stepper CLA 2011-06-23 04:30:37 EDT
Moving all open enhancement requests to 4.1
Comment 8 Eike Stepper CLA 2012-09-21 07:19:01 EDT
Closing.