Interapplication Communication
Interapplication Communication
The interapplication communications architecture provides support for
automated copy and paste between applications
sending and receiving events between applications
reading and writing blocks of data between applications
The Edition Manager, Apple Event Manager, Event Manager, and
PPC Toolbox provide these features, and the Figure below shows their
relationships.
The managers constituting the interapplication communications architecture
The IAC architecture is built on communication and cooperation between
applications. Apple has defined important standards to help ensure that
communication between applications is effective. Using the Clipboard,
applications can share static data by allowing the user to copy and paste data
between documents. Using the Edition Manager, applications can support
dynamic data sharing and allow users to perform automatic copy and paste
between documents. Applications that support dynamic data sharing allow users
to copy data from one document to another and receive automatic updating of
the information when the data in the original document changes. The verbs
publish and subscribe describe this form of dynamic data sharing.
You can let users publish and subscribe among many documents by using the
Edition Manager and implementing the Create Publisher and
Subscribe To menu commands. This is a form of high-level communication
between applications; actually, the communication is in direct, as the
Edition Manager provides the interface that allows applications to share
dynamic data.
Your application can publish and subscribe with applications and documents
on a local disk or across a network. In general, anything that you allow the
user to copy or paste you should also allow the user to publish or subscribe to.
See Sharing Data Among Applications below for more information on
using the publish and subscribe features in your application.
Using the Apple Event Manager, applications can send Apple events to each
other to request services or information. These types of events are often the
result of a user request, or they can be specific events that your application
sends to another application. Apple events provide a standard way in which
your application can communicate with many other applications. Other
high-level events are for applications that choose to use a protocol other than
the Apple Event Interprocess Messaging Protocol (AEIMP). Applications can
use the Event Manager to send high-level events that follow their own
protocol.
The Program-to-Program Communications Toolbox(PPC Toolbox) is a set
of low-level routines that allow applications to communicate on the local
computer or over a network. Using the PPC Toolbox, applications can
exchange blocks of data with each other by reading and writing low-level
message blocks. The PPC Toolbox provides a method of communication
between applications that is more useful for applications that are closely
integrated, specifically designed to work together, or dependent on each other
for information. The PPC Toolbox is typically more useful for code that is
not event-based.
Your application can use the PPCBrowser function to allow the user to
choose another application to which to send high-level events or low-level
message blocks. The PPCBrowser function provides a standard user interface
for choosing an application to communicate with, much like the
Standard File Package provides a standard user interface for opening a
file.
All these forms of interapplication communication are based on the premise
that applications cooperate with each other. Both the application sending the
high-level event or low-level message block and the application receiving it
must agree on the protocol of communication.
The Figure below shows that your application can use the
Edition Manager to publish and subscribe to data. Your application can use
the Apple Event Manager to send and process Apple events and the
Event Manager to send and receive high-level events. Your application can
use the PPC Toolbox to read and write low-level message blocks. Your
application can use any of these methods to communicate with other
applications located on the same computer or across a network.
As the Figure below shows, managers in the IAC architecture can use the
services of other managers. For example, the Apple Event Manager uses the
communication services of the Event Manager. The Event Manager
in turn uses the PPC Toolbox on behalf of applications.
The Figure below shows how two different applications can use the
Edition Manager to publish and subscribe, and how they can use the
routines provided by the Apple Event Manager, the Event Manager, or
the PPC Toolbox to communicate with each other.
The next sections describe the three parts of the IAC architecture: the
Edition Manager, the Apple Event Manager and Event Manager, and
the PPC Toolbox.
Using interapplication communication
Applications using interapplication communication