Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Difference between IReference, ILink and IEndPointDescriptor

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.

0 votes



3 answers

Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
Thanks for the clarification Christof.

Regards,
Swathi Rao.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,926

Question asked: Feb 12 '08, 6:06 a.m.

Question was seen: 7,767 times

Last updated: Feb 12 '08, 6:06 a.m.

Confirmation Cancel Confirm