| Home | Previous Lesson: Introduction Next Lesson: Linking or Embedding |
When an object is incorporated into a document, it maintains an association with the object application that created it. Linking and embedding are two different ways to associate objects in a compound document with their object applications. The differences between linking and embedding lie in how and where the actual source data that comprises the object is stored; this in turn affects the object's portability, its methods of activation, and the size of the compound document.
When an object is linked, the source data, or link source, continues to physically resides wherever it was initially created, either at another point within the document or within a different document altogether. Only a reference, or link, to the object and appropriate visual representation of the data is kept with the compound document.
Linking is efficient and keeps the size of the compound document small. Users may choose to link when the source object is owned or maintained by someone else because a single instance of the object's data can serve many documents. Changes made to the source object are automatically reflected in any compound documents that have a link to the object. From the user's point of view, a linked object appears to be wholly contained within the document.
One-Way Links start with a source document sharing its data with the destination document and when the data in the source document changes, the destination automatically changes. A One-Way Link can have multiple destination documents. For example, the company logo could be linked into a spreadsheet, the spreadsheet data linked into a word processor, the word processor data linked into a presentation. Any time the company logo changes, all points along the One-Way Link will get automatically updated.
Two-Way Links with a source document sharing its data with the destination document and the destination document sharing that data (object) back to another location within the source document. An example of this might be where data originates in the word processor. This data might be marketing forecast data, for example. This data is linked to a spreadsheet where a chart is created based on the linked data. The chart is then linked back into the source document right below the forecast data. Once this Two-Way Link is established, a what-if analysis can be performed on the original source data such that if the data changes in the source, it is updated in the spreadsheet. The chart is then updated and finally, the chart is updated in the source document. So the ability to share data in a destination document and receive linked data back into the source document is a Two-Way Link.
In addition to simple links, it is possible to get arbitrarily complex by nesting links and combining linked and embedded objects.
OLE provides the mechanism for objects to be linked in a variety of ways and have those links adapt to changing situations. An object may be linked to a complete or partial object, referred to as a pseudo object. An example of a pseudo object is a range of spreadsheet cells. The source of a link may reside inside either the same compound document as the linked object or in a separate compound document. Both the compound document containing the linked object and the link source may be stored in a standard disk file or in a file managed by the OLE storage system.
If the linked object is copied to a new location while the link source stays in place, the link remains intact and the linked object points correctly to the source. Similarly, if both the compound document containing the linked object and the link source are moved to a new location in the same relative path, the link remains intact.
With an embedded object, a copy of the original object is physically stored in the compound document as is all of the information needed to manage the object. As a result, the object becomes a physical part of the document. A compound document containing embedded objects will be larger than one containing the same objects as links. However, embedding offers several advantages that may outweigh the disadvantages of the extra storage overhead. For example, compound documents with embedded objects may be transferred to another computer and be edited there. The new user of the document need not know where the original data resides since a copy of the objects' source (native) data travels with the compound document.
Embedded objects can be edited in-place; that is, all maintenance to the object can be done without ever leaving the compound document. Since each user has a copy of the object's source data, changes made to an embedded object by one user will not effect other compound documents containing an embedding of the same original object. However, if there are links to this object, changes to it will be reflected in each document containing a link.
| Home | Previous Lesson: Introduction Next Lesson: Linking or Embedding |