Publish-and-subscribe uses a transition file called the edition file. In program linking, the two programs talk directly to each other.
You probably would publish a report generated from a database, but not the cells of the database. For example, a word processor gets the top ten salespeople from a database.
Publish and subscribe, by which a change in one document effects a change in another document, has some of the flavor of program linking. However, it is important to note the differences, and corresponding strengths, of each feature.
The publish and subscribe feature is good for allowing programs (and their documents) to share data, while program linking using AppleEvents allows programs to communicate with each other--not only to send and receive data, but also to provide services to and request services from the other program.
Publish and subscribe are used when:
- you would otherwise copy and paste the same data;
- the data involved will probably not be changed by the users who subscribe to it;
- the data is likely to be widely distributed--as in a large writing project;
- one document needs data from several other documents.
Applications use AppleEvents to:
- get data from another program if the details of the request change slightly each time;
- get another program to manipulate and return a set of data;
- configure and control a variety of programs.