18.10.2014 Views

Object-oriented Software in Ada 95

Object-oriented Software in Ada 95

Object-oriented Software in Ada 95

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Software</strong> design 19<br />

In software the same problems of scale exist; the techniques that we use to implement a small program cannot<br />

usually be successfully used on a large programm<strong>in</strong>g project. The computer literature is full of examples of<br />

software disasters that have occurred when a computer system has been started without a full understand<strong>in</strong>g of the<br />

problem that is to be solved.<br />

2.2.1 Responsibilities<br />

S<strong>in</strong>ce our earliest days we have all been told that we have responsibilities. Initially, these responsibilities are very<br />

simple, but as we grow older so they <strong>in</strong>crease. A responsibility is a charge, trust or duty of care to look after<br />

someth<strong>in</strong>g. At an early age this can be as simple as keep<strong>in</strong>g our room neat and tidy. In later life, the range and<br />

complexity of items that we have responsibility for, <strong>in</strong>creases dramatically.<br />

A student for example, has the responsibility to follow a course of study. The lecturer has the responsibility of<br />

deliver<strong>in</strong>g the course to the students <strong>in</strong> a clear and <strong>in</strong>telligible manner. The responsibilities of the student and<br />

lecturer are summarized <strong>in</strong> tabular form below:<br />

Responsibilities of a student<br />

Follow the course of study.<br />

Perform to the best of their ability<br />

<strong>in</strong> the exam/assessment for the<br />

course.<br />

Responsibilities of a lecturer<br />

Deliver the course.<br />

Set and mark the assessment for<br />

the course.<br />

Attend the exam board for the<br />

delivered course.<br />

<strong>Software</strong> too has responsibilities. For example, a text editor has the responsibility of enter<strong>in</strong>g the user’s typed<br />

text correctly <strong>in</strong>to a document. However, if the text that is entered <strong>in</strong>to the text editor is <strong>in</strong>correct or mean<strong>in</strong>gless,<br />

then the resultant document will also be <strong>in</strong>correct. It is not the role of the text editor to make overall decisions<br />

about the validity of the entered text.<br />

In early comput<strong>in</strong>g literature, a common say<strong>in</strong>g was “Garbage <strong>in</strong>, garbage out”. Even though the software<br />

package implements its responsibilities correctly, the results produced may be at least mean<strong>in</strong>gless, at worse<br />

damag<strong>in</strong>g if used.<br />

2.3 <strong>Object</strong>s<br />

The world we live <strong>in</strong> is composed of many different objects. For example, a person usually has access to at least<br />

some of the follow<strong>in</strong>g objects:<br />

• A telephone.<br />

• A computer.<br />

• A car.<br />

Each object has its own <strong>in</strong>dividual responsibilities. For example, some of the responsibilities associated with<br />

the above objects are:<br />

<strong>Object</strong><br />

Responsibilities<br />

Telephone • Establish contact with another phone po<strong>in</strong>t.<br />

• Convert sound to/from electrical signals.<br />

Computer • Execute programs.<br />

• Provide a tcp/ip connection to the <strong>in</strong>ternet.<br />

Car • Move<br />

• Go faster/slower<br />

• Turn left/right<br />

• Stop.<br />

A responsibility here, is a process that the object performs. For example, a car can move forwards or<br />

backwards. However, the car has to be <strong>in</strong>structed by the driver to perform this task. The object is passive, and only<br />

performs an action when <strong>in</strong>structed to do so.<br />

© M A Smith - May not be reproduced without permission

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!