Next: Interaction between objects Up: Software Architecture of Previous: Software Architecture of

Dynamic Object Associations

An object , if 's methods. Usually, in order to do this, must know the name (resp. address) of object . This is due to the method call syntax of many object-oriented programming languages. Therefore, names of associated objects are often constructor parameters, so that associations are established when objects are created. Associations of this kind are called physical associations.

Inside WebMap there are almost no physical associations between objects. Instead, a new dynamic type of object association - named logical association - is used. Newer object-oriented concepts which support dynamic object associations are based on so-called object request brokers. An extensive treatment of this technology can be found, for example, in the CORBA standard [2]. An object request broker can be thought of as a service broker for client objects. The client object tells the broker which service it needs, and the broker finds a suitable server object. Then the client may call a server object method which satisfies the client's needs. In this paradigm, client objects act and server objects react.

Example:
Suppose you (client) want to eat something in a restaurant and your hotel provides an information service (broker) for restaurants nearby. There, you explain what type of restaurant you are looking for, e.g., a good Chinese restaurant. After having received the address of the next suitable Chinese restaurant, you go there and tell the waiter (call a server method) what you want to eat.

The dynamic association concept used by WebMap works in a similar way. However, the behaviour of client and server is inverse: here server objects act and client objects react.

The broker is replaced by the so-called event dispatcher object (or distributor). Each (server) object which ``thinks'' that a special situation might be of interest to another object sends an event message to the dispatcher object (calls a dispatcher object method) before continuing its work.

Each (client) object which wants to be informed of a special situation registers with the dispatcher object. To receive events the class of the client object simply has to be derived from a predefined event receiver class, and must reimplement a special inherited method which maps events to method calls.

Example:
Look at a television news speaker (server). He works for a broadcasting company (event dispatcher), and every hour he reads the news (sends events to the event dispatcher). Suppose you (client) come back to your hotel room after eating in the Chinese restaurant. There you turn on your television (register with the event dispatcher). After this, you get information from the news speaker (your ``getInformation method'' is activated by the server's events).

Providing the possibility to establish logical associations between objects may be considered analogous to the introduction of meta-information in hypertexts: Using meta-information may create a relationship between documents which is not based on hyperlinks (see section 4). Compared to object associations a hyperlink corresponds to a physical object association and meta-information corresponds to a logical (event based) object association.



Next: Interaction between objects Up: Software Architecture of Previous: Software Architecture of


Peter Dömel (doemel@informatik.uni-frankfurt.de)