Team LiB
Previous Section Next Section

Events Drive Object Collaboration

At its simplest, the process of object-oriented software development involves

Think of an anthill: at first glance, you may see no apparent activity taking place. But if you drop an ice cream cone nearby, a flurry of activity suddenly begins as ants rush around to gather up the "goodies," as well as to repair any damage that may have been caused if you dropped the ice cream cone too close to the anthill!

Within an OO application (the "anthill"), the objects ("ants") may be set in motion by an external event such as

As soon as such a triggering event has been noted by an OO system, the appropriate objects react, performing services themselves or requesting services of other objects in chain-reaction fashion, until some overall system goal has been accomplished. For example, the request to register for a course as made by a student user via the SRS application's GUI may involve the collaboration of many different objects (see also Figure 4-1):

Click To expand
Figure 4-1: SRS objects must collaborate to accomplish the overall SRS mission.

Meanwhile, the user of the SRS is blissfully ignorant of all the objects that are "scurrying around" behind the scenes to accomplish the student's goal; the student merely fills in a few fields and clicks a button on the SRS GUI, and a few moments later sees a message that either confirms or rejects the student's registration request.

Once the ultimate goal of an event chain has been achieved (for example, registering a student for a course), an application's objects may effectively become idle, and may remain so until the next such triggering event occurs. An object-oriented application is in some ways similar to a game of billiards: hit the cue ball with your cue stick, and it (hopefully!) hits another ball, which might collide with three other balls, and so on. Eventually, however, all balls will come to a standstill until the cue ball is hit again.


Team LiB
Previous Section Next Section