We can begin the refinement now by adding some attributes and operations. Our most important classes appear to be Member, Author, Employee, Book, Journal, and Sample.
The Member
In nouns list some of the nouns are appropriate to be used as member's attributes. And from vers list we can chose some of the possible operations for the member. These two lists are given in the following table:
List of attributes | List of operations |
name | newMember() |
lastname | |
address | search() |
date of birdth | |
place of living | lend() |
PersonalRegistrationNumber | |
telephone | reserve() |
memberID |
The member class now will look as:
The Member class |
The Author
Lists of attributes and operations for the author will be:
List of attributes | List of operations |
name | createAuthor() |
lastname | bookReference() |
date of birdth |
The Author class |
The Employee
Lender and the DataEntry clerk are childern of the abstract class Employee. First we'll assign attributes to the Employee class and the children classes will inherits them. Also we must bear in mind that every employee has a member record. This will guide us that in the Employee class list of member's attributes may appear, plus an attribute to differs employees from members. Also DataEntry clerk class will have new attribute which determines the type of data entry performing that clerk. List of attributes and operations (for Lender and DataEntry clerk) are given in fillowing table:
List of attributes for the Employee class | List of operations for the Lender class | List of operations for the DataEntryClerk class |
name |
makeLending() | newMember() |
lastname | ||
address | newBook() | |
date of birdth | returnLending() | |
place of living | newJournal() | |
PersonalRegistrationNumber | ||
telephone | sendReport() | newSample() |
memberID | newMultimedia() | |
employee |
The structure of the Employee class with its subclasses is given on the following picture:
The Employee class and its children |
Try
finding out an attributes and operations for the Book class. This class will be very
simmilar with next - the Journal class.
The Journal
List of attributes and operations for the Journal class are following:
List of attributes | List of operations |
title | freeSamples() |
volume | |
area | newJournal() |
publishing year | |
publishing house | makeLending() |
ISBN | |
status | makeReservation() |
numberOfSamples |
The "status" attribute indicates the type of the journal: electronic or paper. The Journal class will be:
The Journal class |
The Sample
The lending process may produce lended book or journal only if a free sample of that book or journal is present in the library. For that purpose a Sample class must be present. The sample class will have only two attributes (in this moment) - signature and status (lended or free), and one operation newSample(). The Sample class is present on next picture:
The Sample class |
When
you're putting together interview results, business processes, and domain analyses, keep a
model dictionary. This is a glosary of all the terminology in the model. It will help you
maintain consistency and avoid ambiguity.
Also it's not a good idea to have every detail of your class model in one hude diagram.
You'll need a master diagram that shows all the connections, associations and
generalizations, but it's the best to elide attributes and operations from this picture.
You can turn the spotlight on selected classes by putting them in separate diagrams.