24.05.2014 Views

pdf: 600KB - Potsdam Institute for Climate Impact Research

pdf: 600KB - Potsdam Institute for Climate Impact Research

pdf: 600KB - Potsdam Institute for Climate Impact Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

22<br />

UML design from code. In certain cases, the whole program can be generated from a complete<br />

UML description.<br />

The UML story illustrates a marked trend in software evolution, from programmers writing<br />

procedural code to programmers writing declarative program specifications, which are then<br />

'understood' by a suitable generic processor and turned into procedural code.<br />

Topic Declarative bit Processor Non-declarative<br />

approach<br />

Datahandling<br />

using a<br />

program<br />

The file<br />

containing the<br />

data<br />

The program<br />

written to process<br />

the data<br />

Mapping The map The human brain<br />

(able to find a<br />

path from A to B,<br />

<strong>for</strong> example)<br />

Electronic<br />

circuits<br />

Spreadsheet<br />

A computer-based<br />

representation of<br />

the circuit<br />

(resistor R1<br />

connected to<br />

capacitor C3, etc)<br />

The spreadsheet<br />

itself (i.e. the<br />

spreadsheet it is<br />

when saved to<br />

file: the .xls file).<br />

Logic The logic<br />

programming 'program' (facts<br />

and rules) (see<br />

Appendix A2.3)<br />

Software tools<br />

able to:<br />

- simulate the<br />

behaviour of the<br />

circuit;<br />

- prepare a circuit<br />

layout <strong>for</strong> a<br />

printed circuit<br />

board;<br />

- calculate the cost<br />

of the circuit;<br />

- calculate the<br />

heat budget of the<br />

circuit.<br />

The spreadsheet<br />

software, e.g.<br />

Microsoft Excel.<br />

The logic<br />

programming<br />

interpreter, e.g.<br />

Prolog.<br />

Write a program<br />

which contains<br />

the data in the<br />

program itself.<br />

Give<br />

instructions<br />

about how to get<br />

from A to B.<br />

Write a program<br />

<strong>for</strong> each circuit<br />

<strong>for</strong> each task.<br />

E.g. one<br />

program would<br />

be needed to<br />

simulate the<br />

behaviour of a<br />

specific circuit.<br />

Write a program<br />

to do the<br />

calculations.<br />

Difficult to<br />

conceive doing<br />

using<br />

conventional<br />

programming..<br />

Advantages of a<br />

declarative approach<br />

Separate data from<br />

program. There<strong>for</strong>e<br />

same data can be<br />

analysed by different<br />

programs; same<br />

program can be used to<br />

analyse different<br />

datasets.<br />

Map can be used to get<br />

from many points to<br />

many other points.<br />

User constructs a<br />

circuit in intuitive<br />

terms (resistors,<br />

capacitors, etc, and<br />

their connections).<br />

The one design can be<br />

processed by multiple<br />

tools.<br />

Each tool can be used<br />

<strong>for</strong> all possible circuits,<br />

there<strong>for</strong>e huge savings<br />

in ef<strong>for</strong>t.<br />

Greater ease of use.<br />

Support tools (e.g.<br />

graphics; immediate<br />

update of values).<br />

Only feasible way of<br />

tackling problems<br />

involving logic-based<br />

reasoning.<br />

Table 5.2 Summary comparison of declarative and procedural software architectures

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

Saved successfully!

Ooh no, something went wrong!