use case diagram : library system books and journals the library contains books and journals. it may...

17
Use Case Diagram Use Case Diagram : Library System : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books are for short term loans only. All other books may be borrowed by any library member for three weeks. Members of the library can normally borrow up to six items at a time, but members of staff may borrow up to 12 items at one time. Only members of staff may borrow journals. Borrowing The system must keep track of when books and journals are borrowed and returned, enforcing the rules described above. Browsing The system should allow users to search for a book on a particular topic, by a particular author etc., to check whether a copy of book is available for loan and, if not, to reserve the book. Anybody can browse in the library.

Upload: norma-stephens

Post on 23-Dec-2015

259 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Use Case Diagram Use Case Diagram : Library System: Library System

Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books are for short term loans only. All other books may be borrowed by any library member for three weeks. Members of the library can normally borrow up to six items at a time, but members of staff may borrow up to 12 items at one time. Only members of staff may borrow journals.

Borrowing The system must keep track of when books and journals are borrowed and returned, enforcing the rules described above.

Browsing The system should allow users to search for a book on a particular topic, by a particular author etc., to check whether a copy of book is available for loan and, if not, to reserve the book. Anybody can browse in the library.

Page 2: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Use Case Diagram : Library Use Case Diagram : Library Systems : Systems : ActorActor

BookBorrower Browser

JournalBorrower Librarian

Page 3: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Use Case Diagram : Library Use Case Diagram : Library Systems : Systems : Use CaseUse Case

Borrow copy ofbook

Extend loan

Reserve book

Browse

Borrow journal

Update catalog

Page 4: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Use Case Diagram : Library Use Case Diagram : Library Systems : Systems : Use Case DiagramUse Case Diagram

BookBorrower

Borrow copy ofbook

Extend loan

Reserve book

Return copy ofbook

BrowserBrowse

JournalBorrower

Borrow journal

Return journal

Librarian

Update catalog

Page 5: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Use Case Diagram : Library Use Case Diagram : Library Systems : Systems : <<include>><<include>>

BookBorrower

Borrow copy ofbook

Extend loan

Check for resevation<<include>>

<<include>>

Page 6: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Use Case Diagram : Library Use Case Diagram : Library Systems : Systems : <<extend>><<extend>>

BookBorrower

Borrow copy ofbook

Refuse loan«extends»

Page 7: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

BookBorrower

Borrow copy ofbook

___________________status validation: after confirming identity

Refuse loantoo many books on loan

«extends»

Use Case Diagram : Library Use Case Diagram : Library Systems : Systems : <<extend>> with <<extend>> with extension pointextension point

Page 8: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Use Case Diagram : Library Use Case Diagram : Library Systems : Systems : GeneralizationGeneralization

BookBorrower

JournalBorrower

Every human JournalBorrower is a BookBorrower

Page 9: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Use Case DiagramUse Case Diagram: : Library SystemLibrary System

BookBorrower

Borrow copy ofbook

Extend loan

Check for resevation

Reserve book

Return copy ofbook

BrowserBrowse

JournalBorrower

Borrow journal

Return journal

Librarian

Update catalog

Refuse loan«extends»

Page 10: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Class Diagram Class Diagram : Library System: : Library System: Identifying Identifying ClassesClasses

Take a list of candidates classes by underlining the nouns and noun phrases.

Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books are for short term loans only. All other books may be borrowed by any library member for three weeks. Members of the library can normally borrow up to six items at a time, but members of staff may borrow up to 12 items at one time. Only members of staff may borrow journals.

Borrowing The system must keep track of when books and journals are borrowed and returned, enforcing the rules described above.

Page 11: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Class Diagram Class Diagram : Library System: : Library System: Identifying Identifying ClassesClasses

From the list of candidates classes, the following are discarded as they are obviously not good candidate class.

• library, because it is outside the scope of the system;• short term loan, because a loan is really an event, the lending of a book to a user, which so far as we know is not useful object in this system; • member of the library, redundant with library member;• week, it is a measure of time, not a thing;• item, it means book or journal;• time, it is outside the scope of the system;• system, it is part of meta-language of requirements description, not part of the domain;• rule, for the same reason.

Page 12: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Class Diagram Class Diagram : Library System: : Library System: Identifying Identifying ClassesClasses

Possible classes:

LibraryMember Copy

Book

MemberOfStaff

Journal

Page 13: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Class diagram : Class diagram : Library SystemLibrary System

LibraryMember Copy

Book

-is a copy of1..*

1

-borrows/returns

0..1 0..*

MemberOfStaff Journal-borrows/returns

0..1 0..*

Page 14: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Sequence diagram : Sequence diagram : Library SystemLibrary System

BookBorrower

theLibraryMember:LibraryMember

borrow()

theCopy:Copy theBook:Book

okToBorrow()

borrow()

borrowed()

Page 15: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

Collaboration diagram: Collaboration diagram: Library SystemLibrary System

BookBorrower

borrow()

2:borrow()

1:okToBorrow()

2.1: borrowed()

:LibraryMember theCopy:Copy

:Book

Page 16: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

State diagram : State diagram : Library SystemLibrary System

on loan on the shelf

return()

borrow()

Class Copy

on loan on the shelf

return()/book.returned(self)

borrow()/book.borrowed(self)

Class Copy with action

Page 17: Use Case Diagram : Library System Books and journals The library contains books and journals. It may have several copies of a given book. Some of the books

State diagram : State diagram : Library SystemLibrary System

Class Book

not borrowable borrowable

borrowed()[not last copy]

borrowed()[last copy]

returned()