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.

xv<br />

Preface<br />

The example programs shown <strong>in</strong> this book use the follow<strong>in</strong>g conventions:<br />

Item <strong>in</strong> program Example Convention used<br />

Attribute of an object<br />

or type<br />

Class<br />

Instance method:<br />

function or procedure<br />

Integer'Last<br />

package Class_cell is<br />

type Cell is<br />

private<br />

private<br />

end Class_cell;<br />

Display(The:<strong>in</strong> Cell)<br />

Starts with an upper-case letter.<br />

Is declared as a package prefixed<br />

with the name ‘Class_’. The class<br />

name is given to the private type<br />

that is then used to elaborate<br />

<strong>in</strong>stances of the class.<br />

The function or procedure is <strong>in</strong><br />

lowercase and the first parameter<br />

passed to it is an <strong>in</strong>stance of the<br />

class which is named the.<br />

Instance attribute:<br />

a data item conta<strong>in</strong>ed<br />

<strong>in</strong> an object.<br />

Class attribute:<br />

a global data item that<br />

is shared between all<br />

<strong>in</strong>stances of the class<br />

Constant or<br />

enumeration<br />

Balance: Float;<br />

The_Count: Integer;<br />

Max<br />

Starts with an upper-case letter <strong>in</strong><br />

the private part of the package.<br />

Starts with The_ and is declared <strong>in</strong><br />

the private part of the package.<br />

Starts with an upper-case letter.<br />

Function or procedure Deposit Starts with an upper-case letter..<br />

Package Pack_Account Starts with ‘Pack_’.<br />

Formal parameter Amount Starts with an upper-case letter.<br />

Protected type protected type PT_Ex<br />

is<br />

Starts with ‘PT_’<br />

entry Put(i:<strong>in</strong> T);<br />

entry get(i:out T);<br />

end PT_ex;<br />

Reserved word procedure Is <strong>in</strong> bold lower-case.<br />

Task type task type Task_Ex is Starts with ‘Task_’.<br />

entry Start;<br />

end Task_Ex;<br />

Type or subtype Colour Starts with an upper-case letter.<br />

Variable name<br />

M<strong>in</strong>e<br />

P_Ch<br />

1.1 Glossary of terms used<br />

Starts with an upper-case letter..<br />

An access value for an item will<br />

start with ‘P_’.<br />

Access type<br />

Access value<br />

A type used to elaborate an access value<br />

The address of an object.<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!