dsto.dfc.databeans
Interface IDataObjectLink

All Known Implementing Classes:
DataBeanLink, DataBeanWeakRef, DataObjectLink, DataObjectWeakRef

public interface IDataObjectLink

Interface for classes that function as an indirect link to a data object.

A link may be either "hard" or "soft" as specified by isSoftLink(). A hard link behaves exactly the same as a normal reference to a data object: property events automatically propagate down the chain of parents. Soft links do not propagate events and are usually used to create cross-tree connections. Creating hard cross-tree connections at a minimum generates multiple different property change sets for each property change on the linked object (which may or may not be desirable), and opens the possibility of an infinite loop of property change events if a cycle of references is created (which is certainly not desirable :).

In general, when you need two references to a data object, nominate one as the primary (usually the logical "parent" of the object) and use soft links for the other references.

NOTE: events will only propagate from links that also implement the IDataObject interface regardless of soft or hard link status (it is a general requirement that all event sources are IDataObject's). The IDataObjectLink interface deliberately doesn't extend IDataObject to allow for simple implementations. However, the default implementations (DataObjectLink and DataBeanLink) do implement IDataObject and provide a complete facade for the object they link to, allowing events to transparently propagate. This facade feature allows many clients to ignore the fact that the object is a link at all.

Author:
Matthew Phillips

Method Summary
 IDataObject getLinkTarget()
          Get the data object that this link points to.
 boolean isSoftLink()
          True if this is a soft link.
 

Method Detail

getLinkTarget

IDataObject getLinkTarget()
Get the data object that this link points to.


isSoftLink

boolean isSoftLink()
True if this is a soft link. Soft links do not automatically propagate events from from the linked object.



Copyright © 2008 Commonwealth of Australia