Você está na página 1de 3

Some examples of computer-based systems describe a number of computer applications show how each can be regarded as consisting of objects

and an outside world where the system executes via the process of message passing first example: o A simple system for keeping track of the planes in the airspace surrounding an airport (Air Traffic Control) o simple; not so much details; just the basics

BA123 LH199 BA111

LO998

AF125

The Outside World

very simple view of an air traffic control system a snapshot taken at a particular time during execution shows 5 planes are currently under the control of the human air traffic controllers who supervise the traffic to and from the airport each plan is an example of an object (an entity represented in the store of the computer on which the application runs) each object will consist of a unique identifier and some stored data associated with it; in this case the flight numbers the stored data is the state of the object 4 Items of data associated with each object The planes x coordinate position The planes y coordinate position The planes z coordinate position Type of the plane

1st 3 for knowing where the planes are last is for assigning a runway; a number of runways for different types of planes shaded part represents the air traffic control system (the object world) unshaded part represents the outside world (world of real aircraft, human controllers, and concrete airports) events occur in this outside world which affect the object world

Events that can affect the object world: A plane appears in the air space controlled by the system; results in a new plane object being created and given values for its state. A plane disappears from the airspace. Occurs for a number of reasons: the plane may have left the air space during its onward journey, it could have landed, or may have crashed. This results in the disappearance of the plane object. The plane moves its position in the sky. This is monitored by radar equipment and it results in the x, y and z coordinates of the plane being updated. Data about a planes position is sent to a controller on the ground. The object world remains the same; the only thing that happens is that the x, y and z coordinated of a plane are sent to the outside world. The way in which an object world within the shaded area is altered and accessed is achieved via a mechanism known as a message. Example of a message being sent to airplane AF125: AF125.newPos(12,444,22); The line consists of 2 components: 1st component: receiver object (airplane AF125) 2nd component is the message (which made up of 4 components) selector (identifies the message to be sent; newPos) arguments (12, 444, 22; the x, y and z position of the plane) Above message may correspond to a plane moving to a new position as detected by a radar. Messages either update objects, update objects and return with some values, or just return with some value without updating any objects.

More examples: 1. newRadar.update( ); 2. oldRadar.writedown(12,newPos)

3. 4. 5. 6.

planLH.land(runway12) LH199.getxpos( ) BA123.removePlane( ) BA111.landPlane( )

Você também pode gostar