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.
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
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:
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.
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
Christof Marti wrote:
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.