uml library system

30
A LIBRARY SYSTEM DESIGN REQUIREMENT SPECIFICATION USING UML BY KWESIGA ABSOLOM REG.NO. BIS / 41102 / 91 / DU KAMPALA INTERNATIONAL UNIVERSITY COLLEGE OF APPLIED SCIENCES AND TECHNOLOGY 3 rd YEAR – 2 nd SEMESTER COURSE UNIT: SOFTWARE MODELING LECTURER : MS: NABBANJA TEDDY

Upload: wanjala-samuel

Post on 30-Oct-2014

151 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: UML Library System

A LIBRARY SYSTEM

DESIGN REQUIREMENT SPECIFICATION USING UML

BY

KWESIGA ABSOLOM

REG.NO. BIS / 41102 / 91 / DU

KAMPALA INTERNATIONAL UNIVERSITY

COLLEGE OF APPLIED SCIENCES AND TECHNOLOGY

3rd YEAR – 2nd SEMESTER

COURSE UNIT: SOFTWARE MODELING

LECTURER : MS: NABBANJA TEDDY

Page 2: UML Library System

List of Figures

Figure 1 showing Use Case diagram of Library System..................................................................8

Figure 2 showing Conceptual model.............................................................................................10

Figure 3 showing Class Diagram..................................................................................................10

Figure 4 showing Activity diagram of Library System.................................................................13

Figure 5 showing Sequence diagram.............................................................................................15

Figure 6 showing Collaboration diagram......................................................................................19

Page 3: UML Library System

Table of Contents

ContentsList of Figures...............................................................................................................................2

Table of Contents..........................................................................................................................3

Graphical Notion Used...................................................................................................................4

1.0 Introduction..............................................................................................................................5

1.1 Purpose.....................................................................................................................................5

1.2 Overview statement..................................................................................................................5

1.3 Goal..........................................................................................................................................6

1.3.1 Specific objectives.............................................................................................................6

1.4 Requirements............................................................................................................................6

2.0 Use case model.........................................................................................................................7

2.0.1 Course of event in Use Case diagram of the Library system..............................................9

2.0.2 Course of event in Activity diagram of the Library system..............................................13

2.0.3 Course of event in sequence diagram of the Library system............................................14

2.1 Operation Contracts for the Library system............................................................................16

2.1.1 Contract: Borrow a book..................................................................................................16

2.1.2 Contract: Return Book.....................................................................................................16

2.1.3 Contract Library system...................................................................................................17

2.1.4 Contract: Pay fine fee (amount).......................................................................................18

2.1.5 Contract: Renew lending..................................................................................................18

Glossary........................................................................................................................................20

References....................................................................................................................................22

Page 4: UML Library System

Graphical Notation Used

Notation of Use Case Diagram

Notation of Class Diagram

Notation of Sequence Diagram

Package

Page 5: UML Library System

1.0 Introduction

Borrowing books, returning books or viewing the available books within a Library is currently

done manually where members have to go to the Library and check the available books at the

Library. Members check the list of books available and borrow the books if the book is a borrow

book otherwise it is of waste for the member to come to the library to come to check for the

books if the member doesn’t get the book. Then the librarian checks the member id and allows

the member to check out the book and the librarian then updates the member database and also

the books database. This takes at least one to two hours if the member is available at the near by

place otherwise it may take more time.

This project illustrates the system requirements of a Library System. This system would be used

by members who may be students or professors and others to check the availability of the books

and borrow the books, and by the librarian to update the databases therefore, in this document

there will be need to illustrate and develop a mechanism to provide this flexibility and

customization. Using an iterative development strategy, this project will proceed through

requirements, object-oriented analysis, design, and implementation.

1.1 Purpose

This system manages all the happenings of the Library. Book transactions including Book

Registration, Students Registration, Book Issuing, Current Status of a particular books and many

others can be very easily handled by this module. Overall this system can be very helpful and it

can make things easier.

1.2 Overview statement

Project is related to library management which provides reading services to its members. Any

person can become a member of the library by filling a prescribed form. They can get the book

issued, so that they cab take home and return them.

Page 6: UML Library System

1.3 Goal

The general goal is to increase checkout automation, to support faster, better and effective library

services and business processes.

1.3.1 Specific objectives

Quick checkout for library members

Fast and accurate library business routines sales analysis

Automation of book transactions.

1.4 Requirements

Books and Journals: The library contains both books and journals. It may have several copies of

the same book. Some of the books are for short term loans only. All other books may be

borrowed by any library member for a time frame of say 3 weeks. Only members of staff may

borrow journals. Members of the library can normally borrow up to 6 items at a time, but

members of staff may borrow up to 12 items at a time. New books and journals arrive regularly

and sometime disposed of; the catalogue needs to be updated. The current year’s journals are

sent away to be bound at the end of each year.

Borrowing: It is essential that the system keeps track of when books and journals are borrowed

and returned. The new system should produce reminders when a book is overdue. It may be

desirable to allow users to extend their loans if the book is not reserved. The system enforces the

rules for borrowing given above.

Browsing: The system should allow users to search for a book on a particular topic or by a

particular author etc. The user should then be able to check if the book is on loan and if so to

reserve the book. Other requirement artefacts for the intended project will include:

Use case model

Glossary (Data repository)

Conceptual model

System sequence, activity and collaboration diagrams.

Page 7: UML Library System

2.0 Use case model

This is a set of all written use cases; it is a model of the system's functionality and environment.

It may optionally include a UML use case diagram to show the names of use cases and actors,

and their relationships. This gives a nice context diagram of a system and its environment. To

improve the understanding of requirements, use cases are created to receive narrative

descriptions of the requested software system. To identify use cases, two approaches are

entangled:

Actor-based method:

Identify the actors related to a system or organization.

For each actor, identify the processes they initiate or participate in.

Event-based method:

Identify the external events that a system must respond to.

Relate the events to actors and use cases.

Applying the actor-based method for identifying the appropriate use cases in the Library system,

the following actors and use cases were found:

Members of staff

Members of the library

Users

Page 8: UML Library System

Figure 1 showing Use Case diagram of Library System

Page 9: UML Library System

2.0.1 Course of event in Use Case diagram of the Library system

1. When a member arrives to the library, the member gets to be checked by the library

guard.

2. The member goes to the reception for identification purposes or information inquiry.

3. The member goes for research by browsing for a particular book, topic or author to check

whether a copy of the book is available.

4. The member sometimes browses because the system keeps track of when books and

journals are borrowed and returned.

5. The member can borrow a copy of a book and return it in time to the librarian if not

returned in the due date; the fine has to be paid to the librarian.

Page 10: UML Library System

Figure 2 showing Conceptual model

Figure 3 showing Class Diagram

Page 11: UML Library System

Mapping of the classes within the Library System Class diagram in an Object Oriented

programming language.

Class Member

public class member

{

private string memberName;

private int memberID;

private string address;

public bool borrowBook

{

}

public bool returnBook

{

}

}

Class Librarian

public class Librarian

{

private int librarianID;

public bool returnBook

{

}

public bool checkFine

{

}

}

Page 12: UML Library System

Class Copy

public class Librarian

{

private int copyID;

private date dueDate;

public bool takeAcopy

{

}

}

Class Book

public class Book

{

private string bookID;

private string availability;

}

Class Status

public class Status

{

private string bookID;

private string bookTitle;

private int cat.No;

}

Page 13: UML Library System

2.0.2 Course of event in Activity diagram of the Library system

A starts when a member gets checked. In this situation, there’s need to show identification if

member has or register with the system. If user is a member, there’s access to browsing,

borrowing and returning library materials within the system then the member checks out and

goes in case of library transactions satisfaction. If user isn’t a member, there’s need for

registering in order to be approved membership thus access library transactions. If not with all,

the member quits the system.

Figure 4 showing Activity diagram of Library System

Page 14: UML Library System

2.0.3 Course of event in sequence diagram of the Library system

1) A member gets checked 2) Allows the member to enter

3) Inquires information or shows

identification or registers

4) Approved is a member and ready to research

(browse) for books

5) Borrows copy of book 6) Ok to borrow

8) Borrow 7) Records the book status and return date

9) Return copy of book 10) Check the return date

12) Pay fine 11) If not returned in due date, pay fine

13) Check out and go

Sequence diagram of a member borrowing a book in the Library System

Page 15: UML Library System

Figure 5 showing Sequence diagram

Page 16: UML Library System

2.1 Operation Contracts for the Library system

2.1.1 Contract: Borrow a book

Contract name Borrow a book

Actors Member, Librarian

Summary The Member borrows a book from the system

Precondition The Member has no old debts to the system

Description The Member chooses a book that is not already lent and that s/he does not own. The Librarian assigns the Member as the borrower of that book and also states a deadline for returning the book.

Postcondition The Member has successfully borrowed the book

Exceptions 1. If the Member has a due to pay, the Member canpay it (see Pay the fine usecase) and try again.2. The Member owns the book.3. The book is already lent.

Used use cases Pay fine fee

2.1.2 Contract: Return Book

Contract name Return Book

Responsibility Update return book

Type System

Cross reference R 3.5

Note A book should be in good state when returned.

Exception If the return date gets expired, extra charges

Output Increase in book numberDeduction of borrowers card

Pre-condition Less books and journal available

Post-condition Books increased in the bank

Page 17: UML Library System

2.1.3 Contract Library system

Contract name Library system

Responsibility 1. Borrowing books

2. Return books

3. Pay fine fee

4. Receive payment

5. Renew membership

Type System

Cross reference System functions

Usecase Lend book

Exceptions the book not returned in time the fine is paid and if the library fine is not paid, don’t lend book

Output Reference book borrowed

Pre-condition 1. pay library fine to access library2. register to borrow book.

Post-condition -borrow book

-use library

Page 18: UML Library System

2.1.4 Contract: Pay fine fee (amount)

Contract name Pay fine fee(amount)

Responsibility The Member pays a certain amount of his/her debts

to the System

Type System

Crossreference R1.3

Note Library fine fee is paid when the return date expires.

Exceptions The member has no debts to pay

If the library card expires, no access

If the library card valid, payment allowed

Output Issuing receipts’

Precondition Registered member

post condition Payment created

Payment associates with library use duration

2.1.5 Contract: Renew lending

Contract name Renew lending

Responsibility Updating system by extending date

Type system

CrossReference R 3.4

Note Renewing is allowed only twice

Exception If the book is renewed twice, no renew again.

Output Retain the book

Pre-condition User has the book

Post-condition Return date changed

User and bookbank state remains the same.

Collaboration diagram of a member borrowing a book in the Library System

Page 19: UML Library System

Figure 6 showing Collaboration diagram

Page 20: UML Library System

Glossary

Term Definition and Information

Activity diagram A diagram that describes procedural logic, business process or

work flow. An activity diagram contains a number of Activities

and connected by Control Flows and Object Flows.

Activity Carrying out behavior in a State machine diagram.

Actor A role that a user takes when invoking a use case. Also see actor

modeling.

Artifact Items that model physical pieces of information in your system,

such as a user's manual, training material, or password file.

Attribute A significant piece of data owned by a Class, often containing

values describing each instance of the class. Besides the attribute

name and a slot for the attribute value, an attribute may have

specified Visibility, Type, Multiplicity, Default value, and

Property-string.

Class The primary declarative construct of Object-Oriented

Programming; a cohesive unit of Attributes and Operations; a

compile-time template for an Object.

Class diagram A type of static structure diagram that describes the structure of a

system by showing the system's classes, their attributes and the

relationships between the classes.

Constraint Natural language, programming language or Object Constraint

Page 21: UML Library System

Language Boolean condition which may not be false if a Class is

to be considered valid.

Event When it occurs on an Object it may cause a Transition in a State

machine diagram.

Operation The signature of a Method of a Class; consists of the Operation

Name, Visibility, Parameter list, Return Type, and Property-

string.

Operation contract Identifies system state changes when an operation happens.

Use case A technique for capturing functional requirements of systems.

Page 22: UML Library System

References

Books:

1. Component-based product line engineering with UML by Colin Atkinson

2. Enterprise modeling and computing with UML by Peter Rittgen

3. Using UML: software engineering with objects and components by Perdita Stevens, R. J. Pooley

4. UML and the Unified Process by Liliana Favre

Internet:

1. http://www.blissit.org/library.htm

2. http://www.rfidguardian.org/index.php/RFID_Guardian_Use-Cases_Library

3. http://www.ksl.stanford.edu/people/pp/papers/PinheirodaSilva_IMKB_2000.pdf

4. http://julius88.weebly.com/uploads/3/2/8/9/3289949/a_library_system.doc

5. http://www.comp.dit.ie/rlawlor/Soft_Eng/UML_and_Rose/Using%20UML%20library%20handout%20diagrams.pdf

6. http://en.wikipedia.org/wiki/Glossary_of_Unified_Modeling_Language_terms