Operations
A class is defined in terms of its attributes and
its operations. An operation is some action an object of the class performs – the
behaviour of an object is made up of the particular operations it executes.
Staying with the example of the class LibraryItem,
operations that might be defined for an object of the class include:
- setting the loan status attribute to the value ‘on loan’ or
‘on shelves’
- tell us the ‘loan fee’ value (i.e. the object tells another
object/part of the system the value of one of its attributes)
- set the ‘due date’ (e.g. to be the first working day after
the current date plus the ‘loan duration’)
Operations are implemented as methods in programming
languages such as Java.
Back
to top

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg
|