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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2 <strong>Software</strong> design<br />

This chapter looks at software production <strong>in</strong> the large. In particular it looks at problems that occur <strong>in</strong> the<br />

development of large and not so large software systems. The notation used by UML (Unified Modell<strong>in</strong>g<br />

Language) is <strong>in</strong>troduced as a mechanism for document<strong>in</strong>g and describ<strong>in</strong>g a solution to a problem that is to<br />

be implemented on a computer system.<br />

2.1 The software crisis<br />

In the early days of comput<strong>in</strong>g, it was the hardware that was very expensive. The programs that ran on these<br />

computers were by today’s standards <strong>in</strong>credibly small. In those distant times computers only had a very limited<br />

amount of storage; both random access memory and disk storage.<br />

Then it all changed. Advances <strong>in</strong> technology enabled computers to be built cheaper, with a far greater capacity<br />

than previous mach<strong>in</strong>es. <strong>Software</strong> developers thought, “Great! We can build bigger and more comprehensive<br />

programs”. <strong>Software</strong> projects were started with an <strong>in</strong>crease <strong>in</strong> scope and great optimism.<br />

Soon, with projects runn<strong>in</strong>g over budget and not meet<strong>in</strong>g their client’s expectations, the truth dawned: large<br />

scale software construction is difficult. The early techniques that had been used <strong>in</strong> small scale software<br />

construction did not scale up successfully for large scale software production.<br />

This can be likened to us<strong>in</strong>g a bicycle to travel a short dis tance. Whilst this is adequate for the purpose, the use<br />

of a bicycle is <strong>in</strong>appropriate if a long distance has to be travelled <strong>in</strong> a short space of time. You cannot just peddle<br />

faster and faster.<br />

2.2 A problem, the model and the solution<br />

In implement<strong>in</strong>g any solution to a problem, we must first understand the problem that is to be solved. Then, when<br />

we understand the problem fully, a solution can be formulated.<br />

There are many different ways of achiev<strong>in</strong>g an understand<strong>in</strong>g of a problem and its solution. Usually, this<br />

<strong>in</strong>volves modell<strong>in</strong>g the problem and its solution us<strong>in</strong>g either a standard notation or a notation <strong>in</strong>vented by the<br />

programmer. The advantage of us<strong>in</strong>g a standard notation is that other people may <strong>in</strong>spect and modify the<br />

description of the problem and its proposed solution. For example, <strong>in</strong> build<strong>in</strong>g a house, an architect will draw up a<br />

plan of the various components that are to be built. The client can view the plans and give their approval or<br />

qualified approval subject to m<strong>in</strong>or modifications. The builders can then use the plan when they erect the house.<br />

Architect’s plan (model)<br />

F<strong>in</strong>ished house<br />

Writ<strong>in</strong>g a computer program <strong>in</strong>volves the same overall process. First, we need to understand the task that the<br />

computer program will perform. Then we need to implement a solution us<strong>in</strong>g the model that we have created.<br />

An easy pitfall at this po<strong>in</strong>t is to believe that the model used for the solution of a small problem can be scaled<br />

up to solve a large problem. For example, to cross a small stream we can put a log over the stream or if athletic we<br />

can even jump over the stream. This approach to cross<strong>in</strong>g a stream however, will not scale up to cross<strong>in</strong>g a large<br />

river. Likewise to build a 100-storey tower block, an architect would not simply take the plans for a 2-storey<br />

house and <strong>in</strong>struct the builders to build some extra floors.<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!