Next: Class Diagram of Library
Up: 3rd example of object
Previous: 3rd example of object
Contents
Classes of `library' application
- base-object-class
This class is used in all three examples to handle unknown messages sent to an object.
- library
Instances of the class `library' keep track of all the books of the library and of all
its client, i.e. the readers. The library in this case study also has the function of a
publisher, buying books from an author. The possible transactions in our library can
be summarized as follows:
- books can be bought (from the author),
- books can be sold (to the reader),
- books can be lent (to the reader),
- books can be taken back (from the reader),
The library can be asked to provide a list of all the books and all the readers.
- book
An object of this class must have an author and a title and the state of
the object must include information about who is the owner of the book and who is
in its posession at any moment.
- person
This class is a base class for the derived classes author and reader.
It takes care of keeping track of names of persons and has an error-handling
functionality.
- author
Instances of this class have a list of all written books by the author and
a method to sell a new book to a publisher (library in our case).
- reader
All `reader' objects have a list of all books which are in their possession,
borrowed books and purchased books as well, and they have methods to buy,
to borrow and to return books.
Next: Class Diagram of Library
Up: 3rd example of object
Previous: 3rd example of object
Contents
Start
Georg P. Loczewski
2004-03-05