It's all about the answers!

Ask a question

Difference between IReference, ILink and IEndPointDescriptor


Swathi Rao (5112) | asked Feb 12 '08, 6:06 a.m.
JAZZ DEVELOPER
Hi,

Could someone please explain the difference between IReference, ILink and IEndPointDescriptor? I have read the Java docs for these, but I am still not clear about their usage.

I also had another doubt related to IReference. The Java doc on IReference states that a reference can be created to any arbitrary entity using URIs. But when I searhed for its usage in the Jazz source code, I noticed that in most cases the URI was created by calling the Location.toRelativeUri or Location.toAbsoluteUri method, wherein the Location object itself was created using an IItemHandle or URI or another Location object. So does this mean that creation of references is restricted to Jazz items only?

Regards,
Swathi.

3 answers



permanent link
Christof Marti (681) | answered Feb 12 '08, 6:48 a.m.
Hi Swathi,

an ILink has a source and a target IReference connecting two entities. These entities can be Jazz or external artifacts. We usually reference Jazz artifacts using an item reference (see IReference.isItemReference() and IItemReference) instead of an URI.

Each link has a ILinkType describing links of that type in terms of two IEndPointDescriptors, this information is statically defined in plug-in extensions (see ILinkTypeRegistry).

Hope that helps,

Christof
Jazz Work Item team


swathi.rao wrote:
Hi,

Could someone please explain the difference between IReference, ILink
and IEndPointDescriptor? I have read the Java docs for these, but I
am still not clear about their usage.

I also had another doubt related to IReference. The Java doc on
IReference states that a reference can be created to any arbitrary
entity using URIs. But when I searhed for its usage in the Jazz
source code, I noticed that in most cases the URI was created by
calling the Location.toRelativeUri or Location.toAbsoluteUri method,
wherein the Location object itself was created using an IItemHandle
or URI or another Location object. So does this mean that creation of
references is restricted to Jazz items only?

Regards,
Swathi.

permanent link
Christof Marti (681) | answered Feb 13 '08, 9:48 a.m.
Links are a generic, extensible way of storing relations between artifacts, if you don't need the extensibility modeled references are the preferred way of storage since these are easier to use programmatically and more efficient.

The Javadoc you mention refers to cloning of IReferences, not EMF references. The issue there is that since an IReference is contained in an ILink and EMF automatically updates a contained object's container field, a single IReference instance can only be used with a single ILink.

Regards,

Christof
Jazz Work Item team



Thanks for your input. I looked up for the ILinkTypeRegistry extension point as well and got a better understanding.

Just one more clarification. When does one choose to create a Link as opposed to having a reference in the EMF Model? The java doc mentions that -
The links component often clones references under the covers, to address the EMF issue that an EObject can be "contained" in only one other EObject at a time

So is this the only reason why we use Links?


Christof Marti wrote:
Hi Swathi,

an ILink has a source and a target IReference connecting two entities.
These entities can be Jazz or external artifacts. We usually reference
Jazz artifacts using an item reference (see IReference.isItemReference()
and IItemReference) instead of an URI.

Each link has a ILinkType describing links of that type in terms of two
IEndPointDescriptors, this information is statically defined in plug-in
extensions (see ILinkTypeRegistry).

Hope that helps,

Christof
Jazz Work Item team


swathi.rao wrote:
Hi,

Could someone please explain the difference between IReference, ILink
and IEndPointDescriptor? I have read the Java docs for these, but I
am still not clear about their usage.

I also had another doubt related to IReference. The Java doc on
IReference states that a reference can be created to any arbitrary
entity using URIs. But when I searhed for its usage in the Jazz
source code, I noticed that in most cases the URI was created by
calling the Location.toRelativeUri or Location.toAbsoluteUri method,
wherein the Location object itself was created using an IItemHandle
or URI or another Location object. So does this mean that creation of
references is restricted to Jazz items only?

Regards,
Swathi.

permanent link
Swathi Rao (5112) | answered Feb 15 '08, 3:42 a.m.
JAZZ DEVELOPER
Thanks for the clarification Christof.

Regards,
Swathi Rao.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.