A method in JADE is called an 'operation' in Rational Rose.
We will provide a borrower with a method that attempts to reserve a book.
The method takes the book as a parameter and returns
true if the book was reserved, false otherwise.
Instructions
- In the Browser, right-click the Book class and select
New Operation from the popup menu.
- Overtype reserve as the name for the operation.
- Double-click the reserve operation.
The Method Specification dialog is displayed.
- On the Method tab, select Boolean as the Return Type.
- On the Parameters tab, define a parameter named bk
of type Book and click the Add button.
- Click the OK button.
|
 |