0% found this document useful (0 votes)
2 views36 pages

LMS Lab File

The document outlines the Software Requirements Specification (SRS) for a Library Management System (LMS), detailing its purpose, scope, and functional and non-functional requirements. It describes the system's capabilities, including user management, book cataloging, issue/return processing, fine calculation, and report generation, as well as the roles of different user classes. Additionally, it includes use case diagrams and activity diagrams to illustrate system interactions and processes.

Uploaded by

manviyadav221
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views36 pages

LMS Lab File

The document outlines the Software Requirements Specification (SRS) for a Library Management System (LMS), detailing its purpose, scope, and functional and non-functional requirements. It describes the system's capabilities, including user management, book cataloging, issue/return processing, fine calculation, and report generation, as well as the roles of different user classes. Additionally, it includes use case diagrams and activity diagrams to illustrate system interactions and processes.

Uploaded by

manviyadav221
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

PRACTICAL 1

SOFTWARE REQUIREMENTS SPECIFICATION (SRS)


Standard: IEEE Std 830-1998 Recommended Practice for Software Requirements Specifications

1. Introduction
1.1 Purpose
The purpose of this document is to provide a detailed description of the requirements for the Library
Management System (LMS). This SRS describes the functional and non-functional requirements, constraints,
and interfaces of the proposed system. It is intended for software developers, project managers, and
stakeholders.
1.2 Scope
The Library Management System (LMS) is a software application designed to automate the day-to-day
operations of a library. The system handles management of books, members, issue/return of books, fine
calculation, and report generation.
The system will:
- Maintain a comprehensive catalog of books and other library resources.
- Manage member registrations and profiles.
- Handle issue and return of books with due date tracking.
- Automatically calculate fines for overdue books.
- Generate various reports for library administration.
- Support searching and browsing of the book catalog.
1.3 Definitions, Acronyms and Abbreviations

Term Definition

LMS Library Management System

SRS Software Requirements Specification

Member A registered user who can borrow books

Librarian Staff responsible for managing the library

Admin System administrator with full access

ISBN International Standard Book Number

GUI Graphical User Interface

DAO Data Access Object


1.4 References
- IEEE Std 830-1998: IEEE Recommended Practice for Software Requirements Specifications.
- IEEE Std 610.12-1990: IEEE Standard Glossary of Software Engineering Terminology.
1.5 Overview
Section 2 gives an overall description of the system. Section 3 provides specific functional requirements.
Section 4 describes non-functional requirements.

2. Overall Description
2.1 Product Perspective
The Library Management System is a standalone client-server application that replaces manual library
management. It interfaces with a relational database to store all library data and is accessible via a web
browser or desktop application.
2.2 Product Functions
1. User Authentication and Authorization
2. Book Catalog Management (Add, Update, Delete, Search)
3. Member Management (Registration, Updation, Deletion)
4. Book Issue and Return Processing
5. Fine Calculation and Management
6. Report Generation
7. Notification and Alerts
8. Book Reservation
2.3 User Classes and Characteristics

User Class Description Access Level

Administrator Manages system configuration and user accounts Full Access

Librarian Manages books, members, issues and returns High Access

Member Searches books, views account, requests books Limited Access

Guest Searches the catalog without login Read-only

2.4 Operating Environment


- Operating System: Windows 10/11, Linux, macOS
- Database: MySQL 8.0 or higher
- Programming Language: Java (JDK 11 or higher)
- Web Browser: Chrome, Firefox, Edge (latest versions)
- Minimum RAM: 4 GB | Minimum Storage: 20 GB
2.5 Design and Implementation Constraints
- The system must use a relational database management system.
- The system must follow object-oriented design principles.
- All passwords must be encrypted using SHA-256 or stronger algorithm.
- The system must support concurrent access by multiple users.
- Response time for any database query must not exceed 3 seconds.
2.6 Assumptions and Dependencies
- Users have basic knowledge of computer operation.
- Each book copy has a unique barcode/accession number.
- System clock is accurate for date-based fine calculations.
- A stable network connection is available for client-server operation.

3. Specific Requirements
3.1 Functional Requirements

FR-01: User Login


The system shall allow registered users to log in using username and password. The system shall validate
credentials and grant access based on user role.
FR-02: Book Management
The librarian shall add new books with ISBN, title, author, publisher, edition, year, and number of copies.
Librarian shall also update or delete book records.
FR-03: Member Management
The librarian shall register new members with name, ID, contact information, and membership type. Each
member shall have a unique member ID.
FR-04: Book Issue
The librarian shall issue a book to a member. System shall check availability and borrowing limit. Issue date
and due date shall be recorded automatically.
FR-05: Book Return
The system shall process book returns and automatically calculate fines for overdue books based on the
number of days past the due date.
FR-06: Search and Browse
All users shall search for books by title, author, ISBN, or subject. Search results shall show availability status.
FR-07: Fine Management
System shall calculate fine at Rs. 2 per day for overdue books. Librarian shall record fine payments.
FR-08: Report Generation
System shall generate reports: books issued, books overdue, fine collected, new additions, and member
activity reports.
FR-09: Book Reservation
Members shall reserve a book that is currently issued. The system shall notify the member when the book
becomes available.
3.2 External Interface Requirements
3.2.1 User Interfaces
- System shall provide a graphical user interface (GUI).
- Separate dashboards for Admin, Librarian, and Member.
- Forms shall have input validation with appropriate error messages.
3.2.2 Hardware Interfaces
- Barcode scanner for scanning book ISBN and member ID cards.
- Printer interface for printing reports and receipts.
3.2.3 Software Interfaces
- Database: MySQL connected via JDBC connector.
- Email: JavaMail API for sending notifications to members.

4. Non-Functional Requirements
4.1 Performance Requirements
- The system shall support at least 50 concurrent users.
- Search results shall be returned within 2 seconds.
- Issue/return transactions shall be processed within 3 seconds.
4.2 Security Requirements
- User passwords shall be stored in encrypted form.
- Account shall be locked after 5 consecutive failed login attempts.
- All user activities shall be logged with timestamps.
- Role-based access control shall be enforced throughout the system.
4.3 Reliability Requirements
- The system shall have 99% uptime during library working hours.
- Daily backups of database shall be performed automatically.
4.4 Maintainability Requirements
- The system shall be modular to allow easy updates.
- Code shall be well documented following Java coding standards.
4.5 Portability Requirements
- The system shall run on Windows and Linux platforms.
- System shall use platform-independent Java technology.
PRACTICAL 2

USE CASE DIAGRAM

Actors and Their Roles

Actor Role Description

Administrator Has full system control. Manages configuration, creates accounts for librarians, views
all reports, and maintains system health.

Librarian Manages day-to-day library operations: issues and returns books, manages members,
manages book catalog, calculates fines.

Member A registered library user. Can search books, view own account, renew books, and make
reservations.

Guest An unregistered visitor who can only browse and search the book catalog without
logging in.

Use Case Diagram (Text Representation)

+--------------------------------------------------+
| Library Management System |
| |
+-----------+ | [Login] [Search Books] | +---------+
| |---->| [Manage Books] [View Catalog] |<----| |
| Librarian |---->| [Issue Book] [Reserve Book] |<----| Member |
| |---->| [Return Book] [Renew Book] |<----| |
+-----------+ | [Manage Members] [View Account] | +---------+
| [Calculate Fine] [Pay Fine] |
+-----------+ | [Generate Report] [Browse Catalog] | +---------+
| |---->| [Manage Users] |<----| |
| Admin |---->| [System Configuration] | | Guest |
| | | [View All Reports] | | |
+-----------+ +--------------------------------------------------+ +---------+

Use Case Specifications

UC-01: Login
Attribute Description

Use Case Name Login

Actors Administrator, Librarian, Member

Precondition User must be registered in the system. System must be running and accessible.
Postcondition User is successfully authenticated and redirected to role-specific dashboard.

Main Flow 1. User opens the application. 2. User enters username and password. 3. System
validates credentials against database. 4. System grants access based on user role.
5. Role-specific dashboard is displayed.

Alternate Flow If credentials are invalid, system displays error message. After 5 failed attempts,
account is locked.

Function Authenticates users and grants role-based access to the system.

UC-02: Issue Book


Attribute Description

Use Case Name Issue Book

Actors Librarian

Precondition Librarian must be logged in. Book must be available. Member must have valid
membership and not exceeded borrowing limit.

Postcondition Book is marked as issued. Issue record is created with due date. Available copies
count is decremented.

Main Flow 1. Librarian selects Issue Book option. 2. Enters member ID. 3. Enters book ISBN
or accession number. 4. System checks availability and member eligibility. 5.
System records issue with issue date and due date. 6. Confirmation slip is
displayed.

Alternate Flow If book not available, system shows message and offers reservation. If member
exceeded limit, system shows alert and blocks issue.

Function Records the lending of a book to a member with appropriate date tracking.

UC-03: Return Book


Attribute Description

Use Case Name Return Book

Actors Librarian

Precondition Book must be currently issued to a member. Librarian must be logged in.

Postcondition Book is marked as returned. Fine is calculated if overdue. Book availability is


updated. Reserved copy assigned to next waiting member.

Main Flow 1. Librarian selects Return Book. 2. Scans or enters book accession number. 3.
System fetches issue record. 4. System calculates fine if overdue. 5. Librarian
collects fine if applicable. 6. Book status updated to Available.

Alternate Flow If book is overdue, system displays calculated fine. Payment must be recorded
before completing return.

Function Processes book return, calculates overdue fine, and updates availability status.
UC-04: Search Books
Attribute Description

Use Case Name Search Books

Actors Member, Librarian, Guest

Precondition System must be running. Database must be accessible.

Postcondition Search results are displayed with book details and availability status.

Main Flow 1. User enters search keyword (title, author, ISBN, or subject). 2. System queries
the database. 3. Matching results are displayed with availability status.

Alternate Flow If no results found, system displays 'No books found' message and suggests
similar titles.

Function Allows users to search and locate books in the library catalog.

UC-05: Manage Books


Attribute Description

Use Case Name Manage Books

Actors Librarian, Administrator

Precondition Actor must be logged in with appropriate privileges.

Postcondition Book catalog is updated with added, modified, or deleted records.

Main Flow 1. Librarian selects Manage Books. 2. Selects Add, Edit, or Delete operation. 3.
Enters or modifies book details. 4. System validates and saves the record.

Alternate Flow Duplicate ISBN not allowed on adding. Deletion blocked if copies are currently
issued.

Function Maintains the book catalog including addition, modification, and removal of
books.

UC-06: Manage Members


Attribute Description

Use Case Name Manage Members

Actors Librarian, Administrator

Precondition Actor must be logged in with administrative privileges.

Postcondition Member records are created, updated, or deactivated in the system.

Main Flow 1. Librarian selects Manage Members. 2. Selects Register, Update, or Delete. 3.
Fills in member details. 4. System validates and saves.
Alternate Flow Deletion blocked if member has books currently issued. System shows pending
returns.

Function Manages library membership including registration, updation, and deactivation.

UC-07: Calculate Fine


Attribute Description

Use Case Name Calculate Fine

Actors Librarian (System auto-calculates)

Precondition Book must be returned after the due date.

Postcondition Fine amount is calculated, displayed, and recorded after payment.

Main Flow 1. System detects overdue on book return. 2. Calculates fine = Days Overdue x
Rs. 2. 3. Displays fine to librarian. 4. Librarian collects fine. 5. System records
payment.

Alternate Flow If member disputes fine, librarian can apply waiver with admin approval.

Function Automatically calculates late return fine and records payment.

UC-08: Reserve Book


Attribute Description

Use Case Name Reserve Book

Actors Member

Precondition Member must be logged in. Book must be currently issued (unavailable).

Postcondition Reservation is recorded. Member is notified when book becomes available.

Main Flow 1. Member searches for a book and sees it is issued. 2. Clicks Reserve. 3. System
records reservation with date and priority number.

Alternate Flow Duplicate reservation for same book by same member is blocked.

Function Allows members to reserve unavailable books and get notified on availability.

UC-09: Generate Report


Attribute Description

Use Case Name Generate Report

Actors Administrator, Librarian

Precondition Actor must be logged in. Data must be available in database.

Postcondition Report is generated and available for printing or export.


Main Flow 1. Actor selects Generate Report. 2. Selects report type and date range. 3. System
retrieves data and generates report. 4. Report displayed with print and export
options.

Alternate Flow If no data available for selected period, system shows appropriate message.

Function Generates statistical and operational reports for library administration.


PRACTICAL 3

ACTIVITY DIAGRAM

Activity Diagram 1: Book Issue Process

[START]
|
v
+------------------------+
| Librarian Logs In |
+------------------------+
|
v
+------------------------+
| Select 'Issue Book' |
+------------------------+
|
v
+-------------------------------+
| Enter Member ID |
| Enter Book ISBN/Accession No.|
+-------------------------------+
|
v
+-------------------------------+
| System Checks Member Status |
+-------------------------------+
| |
[Invalid] [Valid Member]
| |
v v
+--------+ +---------------------------+
| Show | | Check Book Availability |
| Error | +---------------------------+
+--------+ | |
[Not Available] [Available]
| |
v v
+----------+ +------------------+
| Offer | | Check Issue |
| Reserve | | Limit of Member |
+----------+ +------------------+
| |
[Exceeded] [OK]
| |
v v
+--------+ +---------------------+
| Show | | Record Issue Entry |
| Alert | | Set Due Date |
+--------+ +---------------------+
|
v
+--------------------+
| Print Issue Slip |
+--------------------+
|
v
[END]

Activity Diagram 2: Book Return and Fine Calculation

[START]
|
v
+----------------------------+
| Librarian Selects |
| 'Return Book' |
+----------------------------+
|
v
+----------------------------+
| Scan/Enter Accession No. |
+----------------------------+
|
v
+----------------------------+
| Fetch Issue Record |
| from Database |
+----------------------------+
|
v
+----------------------------+
| Compare Return Date |
| with Due Date |
+----------------------------+
| |
[On Time] [Overdue]
| |
v v
+----------+ +------------------------+
| No Fine | | Calculate Fine |
+----------+ | (Days Overdue x Rs. 2) |
| +------------------------+
| |
| v
| +------------------------+
| | Display Fine Amount |
| | Collect Payment |
| +------------------------+
| |
+---------+-------+
|
v
+--------------------------+
| Update Book Status |
| to 'Available' |
+--------------------------+
|
v
+--------------------------+
| Check for Reservations |
+--------------------------+
| |
[Reserved] [Not Reserved]
| |
v v
+------------------+ +------+
| Notify Reserved | | Done |
| Member | +------+
+------------------+
|
v
[END]

Activity Diagram 3: Member Registration

[START]
|
v
+----------------------------+
| Librarian Selects |
| 'Register New Member' |
+----------------------------+
|
v
+----------------------------+
| Enter Member Details |
| (Name, ID, Contact, Type) |
+----------------------------+
|
v
+----------------------------+
| System Validates Input |
+----------------------------+
| |
[Invalid] [Valid]
| |
v v
+-----------+ +------------------------+
| Highlight | | Check for Duplicate ID |
| Errors | +------------------------+
+-----------+ | |
[Duplicate] [Unique]
| |
v v
+---------+ +--------------------+
| Error | | Save Member Record |
| Message | | Generate Member ID |
+---------+ +--------------------+
|
v
+--------------------+
| Create Login |
| Credentials |
+--------------------+
|
v
+--------------------+
| Send Member Card |
| Details to Member |
+--------------------+
|
v
[END]
PRACTICAL 4

CLASS IDENTIFICATION AND CLASS DIAGRAM

4.1 Strong Classes (Independent Existence)

Class Name Description

Book Represents a book title in the library catalog with all bibliographic details.

BookCopy Represents a physical copy of a book with unique accession number.

Member Represents a registered library member with personal and membership details.

Librarian Represents library staff who manage day-to-day library operations.

Administrator Represents the system administrator who has full control over system.

4.2 Weak Classes (Depend on Strong Classes)

Class Name Depends On Description

IssueRecord Book, Member Represents a lending transaction. Cannot exist without


Book and Member.

Fine IssueRecord Represents a fine for overdue. Depends entirely on


IssueRecord.

Reservation Book, Member Represents a reservation request. Cannot exist without


Book and Member.

Notification Member Represents a notification sent to a member. Depends on


Member.

Report Various Represents generated reports. Depends on multiple entity


classes.

4.3 Class Descriptions

1. Book (Strong Class)


+------------------------------------------+
| Book |
+------------------------------------------+
| - isbn : String |
| - title : String |
| - author : String |
| - publisher : String |
| - edition : String |
| - year : int |
| - subject : String |
| - totalCopies : int |
| - availableCopies : int |
+------------------------------------------+
| + addBook() : void |
| + updateBook() : void |
| + deleteBook() : void |
| + searchBook() : Book |
| + checkAvailability() : boolean |
| + getDetails() : String |
+------------------------------------------+

2. Member (Strong Class)


+------------------------------------------+
| Member |
+------------------------------------------+
| - memberId : String |
| - name : String |
| - email : String |
| - phone : String |
| - address : String |
| - membershipType : String |
| - membershipDate : Date |
| - expiryDate : Date |
| - booksIssued : int |
| - maxBooksAllowed : int |
+------------------------------------------+
| + register() : void |
| + updateDetails() : void |
| + deactivate() : void |
| + viewAccount() : void |
| + canBorrow() : boolean |
+------------------------------------------+

3. IssueRecord (Weak Class)


+------------------------------------------+
| IssueRecord |
+------------------------------------------+
| - issueId : int |
| - memberId : String [FK] |
| - accessionNo : String [FK] |
| - issueDate : Date |
| - dueDate : Date |
| - returnDate : Date |
| - status : String |
+------------------------------------------+
| + issueBook() : void |
| + returnBook() : void |
| + calculateFine() : double |
| + getIssueHistory() : List |
+------------------------------------------+

4. Fine (Weak Class)


+------------------------------------------+
| Fine |
+------------------------------------------+
| - fineId : int |
| - issueId : int [FK] |
| - amount : double |
| - daysOverdue : int |
| - paidStatus : boolean |
| - paidDate : Date |
+------------------------------------------+
| + calculateFine() : double |
| + recordPayment() : void |
| + waiveFine() : void |
| + getFineDetails() : String |
+------------------------------------------+

5. Reservation (Weak Class)


+------------------------------------------+
| Reservation |
+------------------------------------------+
| - reservationId : int |
| - memberId : String [FK] |
| - isbn : String [FK] |
| - reservationDate : Date |
| - status : String |
| - priority : int |
+------------------------------------------+
| + makeReservation() : void |
| + cancelReservation() : void |
| + notifyMember() : void |
| + fulfillReservation(): void |
+------------------------------------------+

4.4 Class Diagram (Relationships)

+--------------+
| Librarian |
+--------------+
manages | | manages
+-----------+ +-----------+
| |
v v
+------------+ +-----------+
| Book | | Member |
| (Strong) | | (Strong) |
+------------+ +-----------+
| isbn | | memberId |
| title | | name |
| author | | email |
| ... | | ... |
+------------+ +-----------+
1 | 1 |
has | places |
* | * |
+-----------+ +------------+
| BookCopy | |Reservation |
| (Strong) | | (Weak) |
+-----------+ +------------+
1 |
| issued as
* |
+------------+<------ 1 Member
| IssueRecord|
| (Weak) |
+------------+
1 |
| generates
0..1 |
+------------+
| Fine |
| (Weak) |
+------------+

4.5 Relationship Summary

Relationship Type Multiplicity Description

Book - BookCopy Composition 1 to Many A book title has one or more physical
copies

Member - IssueRecord Association 1 to Many A member can have multiple issue


records

BookCopy - Association 1 to Many A copy can be issued multiple times


IssueRecord (historical)

IssueRecord - Fine Composition 1 to 0..1 An issue record may generate at most


one fine

Member - Reservation Association 1 to Many A member can make multiple


reservations

Book - Reservation Association 1 to Many A book can have multiple reservations


queued

Librarian - Book Association 1 to Many A librarian manages multiple books

Librarian - Member Association 1 to Many A librarian manages multiple


members
PRACTICAL 5

SEQUENCE DIAGRAM

Sequence diagrams show the time-ordered interaction between objects for a specific scenario.

Scenario 1: Book Issue Process

Librarian :UI :IssueController :MemberDAO :BookDAO :IssueDAO


| | | | | |
|--login--->| | | | |
| |---validate()---->| | | |
| |<--success--------| | | |
| | | | | |
|--selectIssueBook()---------->| | | |
|--enterMemberID(id)---------->| | | |
| | |--getMember()-->| | |
| | |<--memberObj----| | |
| | |--checkLimit() | | |
| | |<--limitOK------| | |
| | | | | |
|--enterBookISBN(isbn)-------->| | | |
| | | |--getBook()->| |
| | | |<--bookObj---| |
| | |--checkAvail()-------------->| |
| | |<-----------available---------| |
| | | | | |
| | |--createIssueRecord()------------------------->|
| | |<----------------------------------issueId-----|
| | |--updateAvailableCopies()---->| |
| | |--incrementBooksIssued()-->| | |
| | | | | |
|<----------showConfirmation---| | | |
| | | | | |

Scenario 2: Book Return with Fine Calculation

Librarian :UI :ReturnController :IssueDAO :FineCalculator :FineDAO


| | | | | |
|--selectReturnBook()------>| | | |
|--enterAccessionNo()------>| | | |
| | |--getIssueRec()-> | |
| | |<--issueRecord--| | |
| | | | | |
| | |--calculateFine()------------>| |
| | | (dueDate, returnDate) | |
| | |<-----------fineAmount---------| |
| | | | | |
|<----------displayFine-----| | | |
| | | | | |
|--confirmReturn()--------->| | | |
| | |--updateStatus(Returned)------>| |
| | | | | |
| | |--saveFineRecord()--------------------------------->|
| | |<-----------------------------------------ok------|
| | | | | |
| | |--checkReservation()---------->| |
| | | | | |
|<----------showSuccess-----| | | |
| | | | | |

Note: '-->' denotes a method call or message. '<--' denotes a return message or response. ':ClassName'
indicates an object instance of that class.
PRACTICAL 6

COLLABORATION DIAGRAM

A collaboration diagram (Communication Diagram in UML 2.x) shows structural relationships among objects
and the messages exchanged between them. Numbers on messages indicate the sequence of execution.

Collaboration Diagram 1: Book Issue Process

1: enterMemberID(id)
:Librarian -----------------------------------------> :IssueController
| |
| 2: enterBookISBN(isbn) |
|-----------------------------------------> |
|
3: getMember(id) |
:MemberDAO <--------------------------------------|
| |
| 3.1: return memberObject |
|-----------------------------------------> |
|
4: checkBorrowLimit() |
:MemberDAO <--------------------------------------|
| |
| 4.1: return limitStatus |
|-----------------------------------------> |
|
5: getBook(isbn) |
:BookDAO <------------------------------------|
| |
| 5.1: return bookObject |
|-----------------------------------------> |
|
6: checkAvailability() |
:BookDAO <----------------------------------|
| |
| 6.1: return availabilityStatus |
|-----------------------------------------> |
|
7: createIssueRecord() |
:IssueDAO <----------------------------------|
| |
| 7.1: return issueID |
|-----------------------------------------> |
|
:Librarian <----- 8: showConfirmation() ---------------|

Collaboration Diagram 2: Member Login

1: enterCredentials(username, password)
:Member -------------------------------------------------> :LoginController
|
2: authenticate(username, password) |
:AuthDAO <----------------------------------------|
| |
| 2.1: return userRecord |
|------------------------------------------------->|
|
3: validatePassword(password, hash) |
:Encryptor <----------------------------------------|
| |
| 3.1: return isValid (true/false) |
|------------------------------------------------->|
|
4: getUserRole(userId) |
:AuthDAO <----------------------------------------|
| |
| 4.1: return role |
|------------------------------------------------->|
|
:Member <----------- 5: redirectToDashboard(role) ---------------|

Collaboration Diagram 3: Book Search

1: enterSearchKeyword(keyword)
:User -----------------------------------------> :SearchController
|
2: searchBooks(keyword) |
:BookDAO <-------------------------------------|
| |
| 2.1: return bookList |
|--------------------------------------------> |
|
3: getAvailability(bookList) |
:BookCopyDAO <-------------------------------|
| |
| 3.1: return availabilityMap |
|-------------------------------------------> |
|
:User <----------- 4: displayResults() ---------------|

Note: Numbers on arrows indicate sequence of messages. Decimal numbers (e.g. 2.1, 3.1) indicate return
messages or nested calls. ':' before class name indicates an object instance.
PRACTICAL 7

STATE CHART DIAGRAM

State chart diagrams show the states an object passes through during its lifetime and the events/conditions that
trigger transitions between those states.

State Chart 1: Book Copy States

[START]
|
[Book added to library]
|
v
+------------------+
| AVAILABLE |<--------------------------+
| entry/ shelve | |
| exit/ update DB | |
+------------------+ |
/ | \ |
[Reserved] [Issued] [Reported Damaged] [Returned]
/ | \ |
v v v |
+--------------+ +----------+ +-----------+ |
| RESERVED | | ISSUED | | DAMAGED | |
| entry/ hold | | entry/ | | entry/ | |
| exit/ notify | | set due | | flag book | |
+--------------+ | date | +-----------+ |
| +----------+ | |
[Fulfilled] | [Repaired] |
| [Return] | |
| (on time or overdue) | |
v v v |
+---------------+-----------------+--------------------+
|
[Beyond Repair from DAMAGED state]
|
v
+------------------+
| DISCARDED |
| (Removed from |
| System) |
+------------------+
|
v
[END]

State Chart 2: Issue Record States

[START]
|
[Book Issued to Member]
|
v
+------------------+
| ACTIVE |
| entry/ set due |
| date |
+------------------+
/ | \
[Renewed] [Overdue] [Returned on time]
/ | \
v v v
+--------+ +----------+ +----------+
|RENEWED | | OVERDUE | | RETURNED |
|entry/ | | entry/ | | (On Time)|
|extend | | generate | +----------+
|due date| | fine | |
+--------+ +----------+ [Closed]
| | |
[Returned] [Returned+Fine Paid]|
| | |
v v |
+--------+ +--------+ |
|RETURNED| | FINE | |
|(Renewed)| | PAID | |
+--------+ +--------+ |
| | |
+-----+-------+------------+
|
v
+----------+
| CLOSED |
| (Archived|
+----------+
|
v
[END]

State Chart 3: Member Account States

[START]
|
[Member Applies for Registration]
|
v
+------------------+
| PENDING |
| (Awaiting |
| Verification) |
+------------------+
|
[Verification Approved]
|
v
+------------------+ [Suspended due to overdue/fine]
| ACTIVE |-------------------------------------+
| (Can Borrow | |
| Books) |<---------+ v
+------------------+ [Restored/ +------------------+
| Fine Paid] | SUSPENDED |
[Membership Expires] | (Cannot Borrow) |
| +------------------+
v
+------------------+
| EXPIRED |
| (Membership |
| Lapsed) |
+------------------+
/ \
[Renews] [Does Not Renew]
/ \
v v
ACTIVE +------------------+
| DEACTIVATED |
| (Account Closed) |
+------------------+
|
v
[END]
PRACTICAL 8

COMPONENT DIAGRAM

A component diagram shows the organization and dependencies among software components. It illustrates
the modular structure of the system and how components communicate via interfaces.

Components Identified

Component Type Description

Presentation Layer UI Component Contains all user interface screens and forms for
Admin, Librarian, and Member.

Authentication Module Service Component Handles user login, logout, session management,
and password encryption.

Book Management Module Service Component Manages all book-related operations: add, update,
delete, search.

Member Management Module Service Component Manages member registration, updation, and
deactivation.

Issue & Return Module Service Component Handles book issue, return, and renewal
transactions.

Fine Management Module Service Component Calculates and manages fines for overdue books.

Reservation Module Service Component Manages book reservations and waiting queues.

Report Module Service Component Generates and exports various library reports.

Notification Module Service Component Sends email/SMS notifications to members.

Database Access Layer Data Component Provides abstracted database access using DAO
pattern.

Database Data Store MySQL database storing all persistent library data.

Component Diagram

+------------------------------------------------------------------------+
| Library Management System |
| |
| +----------------------+ +------------------------------+ |
| | <<component>> | | <<component>> | |
| | Presentation Layer |---------->| Authentication Module | |
| | - LoginUI | | - LoginController | |
| | - DashboardUI | | - SessionManager | |
| | - BookUI | | - PasswordEncryptor | |
| | - MemberUI | +------------------------------+ |
| | - ReportUI | | |
| +----------------------+ | |
| | | |
| v v |
| +---------------------+ +--------------------------+ |
| | <<component>> | | <<component>> | |
| | Book Management | | Member Management | |
| | - BookController | | - MemberController | |
| | - BookDAO | | - MemberDAO | |
| | - BookCopyDAO | +--------------------------+ |
| +---------------------+ | |
| | | |
| v v |
| +---------------------+ +--------------------------+ |
| | <<component>> | | <<component>> | |
| | Issue & Return |<------>| Fine Management | |
| | - IssueController | | - FineCalculator | |
| | - IssueDAO | | - FineDAO | |
| | - ReturnController | +--------------------------+ |
| +---------------------+ | |
| | | |
| +---------------------+ +--------------------------+ |
| | <<component>> | | <<component>> | |
| | Reservation Module | | Notification Module | |
| | - ReservationCtrl |------->| - EmailService | |
| | - ReservationDAO | | - SMSService | |
| +---------------------+ +--------------------------+ |
| | |
| v |
| +-------------------------------------------------------+ |
| | <<component>> | |
| | Database Access Layer (DAO) | |
| | - ConnectionManager | |
| | - QueryExecutor | |
| +-------------------------------------------------------+ |
| | |
| v |
| +-------------------------------------------------------+ |
| | <<database>> | |
| | MySQL Database (library_db) | |
| | - books, members, issue_records, | |
| | fines, reservations, users | |
| +-------------------------------------------------------+ |
+------------------------------------------------------------------------+

Component Interfaces

Interface Provided By Required By

IBookService Book Management Module Presentation Layer, Issue Module

IMemberService Member Management Module Presentation Layer, Issue Module

IIssueService Issue & Return Module Presentation Layer, Fine Module

IFineService Fine Management Module Issue Module, Presentation Layer

IAuthService Authentication Module Presentation Layer


IReservationService Reservation Module Presentation Layer, Issue Module

INotificationService Notification Module Reservation Module, Issue Module

IReportService Report Module Presentation Layer


PRACTICAL 9

FORWARD ENGINEERING (MODEL TO CODE CONVERSION)

Forward engineering is the process of converting a design model (class diagram) into executable source code.
The Java classes below are generated from the LMS class diagram.

9.1 [Link]
// [Link]
package lms;

public class Book {


private String isbn;
private String title;
private String author;
private String publisher;
private String edition;
private int year;
private String subject;
private int totalCopies;
private int availableCopies;

public Book(String isbn, String title, String author,


String publisher, int year, int totalCopies) {
[Link] = isbn;
[Link] = title;
[Link] = author;
[Link] = publisher;
[Link] = year;
[Link] = totalCopies;
[Link] = totalCopies;
}

public boolean checkAvailability() {


return availableCopies > 0;
}

public void updateBook(String title, String author,


String publisher, int year) {
[Link] = title;
[Link] = author;
[Link] = publisher;
[Link] = year;
}

public String getDetails() {


return "ISBN: " + isbn + ", Title: " + title
+ ", Author: " + author
+ ", Available: " + availableCopies
+ "/" + totalCopies;
}

public String getIsbn() { return isbn; }


public String getTitle() { return title; }
public String getAuthor() { return author; }
public int getAvailableCopies() { return availableCopies; }
public void setAvailableCopies(int n) {
[Link] = n;
}
}

9.2 [Link]
// [Link]
package lms;

import [Link];

public class Member {


private String memberId;
private String name;
private String email;
private String phone;
private String membershipType;
private Date membershipDate;
private int booksIssued;
private int maxBooksAllowed;

public Member(String memberId, String name, String email,


String phone, String membershipType) {
[Link] = memberId;
[Link] = name;
[Link] = email;
[Link] = phone;
[Link] = membershipType;
[Link] = new Date();
[Link] = 0;
[Link] = 5;
}

public boolean canBorrow() {


return booksIssued < maxBooksAllowed;
}

public void incrementBooksIssued() {


booksIssued++;
}

public void decrementBooksIssued() {


if (booksIssued > 0) booksIssued--;
}

public String getMemberId() { return memberId; }


public String getName() { return name; }
public String getEmail() { return email; }
public int getBooksIssued() { return booksIssued; }
}

9.3 [Link]
// [Link]
package lms;
import [Link];
import [Link];

public class IssueRecord {


private int issueId;
private String memberId;
private String accessionNo;
private Date issueDate;
private Date dueDate;
private Date returnDate;
private String status;
private static final double FINE_PER_DAY = 2.0;
private static final int LOAN_PERIOD = 14;

public IssueRecord(int issueId, String memberId,


String accessionNo) {
[Link] = issueId;
[Link] = memberId;
[Link] = accessionNo;
[Link] = new Date();
[Link] = new Date([Link]()
+ [Link](LOAN_PERIOD));
[Link] = "Issued";
}

public double calculateFine() {


Date now = new Date();
if ([Link](dueDate)) {
long diff = [Link]() - [Link]();
long days = [Link](
diff, [Link]);
return days * FINE_PER_DAY;
}
return 0.0;
}

public void returnBook() {


[Link] = new Date();
[Link] = "Returned";
}

public int getIssueId() { return issueId; }


public String getMemberId() { return memberId; }
public String getStatus() { return status; }
public Date getDueDate() { return dueDate; }
}

9.4 [Link]
// [Link]
package lms;

import [Link];

public class Fine {


private int fineId;
private int issueId;
private double amount;
private int daysOverdue;
private boolean paidStatus;
private Date paidDate;

public Fine(int fineId, int issueId,


double amount, int daysOverdue) {
[Link] = fineId;
[Link] = issueId;
[Link] = amount;
[Link] = daysOverdue;
[Link] = false;
}

public void recordPayment() {


[Link] = true;
[Link] = new Date();
[Link]("Fine of Rs. " + amount
+ " paid successfully.");
}

public void waiveFine() {


[Link] = 0;
[Link] = true;
[Link]("Fine waived off.");
}

public String getFineDetails() {


return "Fine ID: " + fineId
+ ", Amount: Rs." + amount
+ ", Days Overdue: " + daysOverdue
+ ", Paid: " + paidStatus;
}

public double getAmount() { return amount; }


public boolean isPaid() { return paidStatus; }
}

9.5 [Link] (Main Class)


// [Link]
package lms;

import [Link];
import [Link];

public class LibrarySystem {


private List<Book> books = new ArrayList<>();
private List<Member> members = new ArrayList<>();
private List<IssueRecord> issueRecords
= new ArrayList<>();
private int issueCounter = 1;

public void addBook(Book book) {


[Link](book);
[Link]("Book added: "
+ [Link]());
}

public void registerMember(Member m) {


[Link](m);
[Link]("Member registered: "
+ [Link]());
}

public boolean issueBook(String memberId,


String isbn) {
Member member = findMember(memberId);
Book book = findBook(isbn);
if (member == null || book == null)
return false;
if (![Link]()
|| ![Link]())
return false;
IssueRecord rec = new IssueRecord(
issueCounter++, memberId, isbn);
[Link](rec);
[Link](
[Link]() - 1);
[Link]();
[Link]("Book issued.");
return true;
}

private Member findMember(String id) {


for (Member m : members)
if ([Link]().equals(id))
return m;
return null;
}

private Book findBook(String isbn) {


for (Book b : books)
if ([Link]().equals(isbn))
return b;
return null;
}

public static void main(String[] args) {


LibrarySystem lms = new LibrarySystem();
Book b1 = new Book("978-0136083238",
"Clean Code", "Robert C. Martin",
"Prentice Hall", 2008, 3);
[Link](b1);
Member m1 = new Member("M001",
"Amit Kumar", "amit@[Link]",
"9876543210", "Student");
[Link](m1);
[Link]("M001", "978-0136083238");
[Link]([Link]());
}
}
PRACTICAL 10

REVERSE ENGINEERING (CODE TO MODEL CONVERSION)

Reverse engineering is the process of extracting a design model (class diagram, relationships) from existing
source code. The given Java code is analyzed to derive class structure and associations.

10.1 Given Java Code


// [Link]
package lms;

import [Link];

public class Reservation {


private int reservationId;
private String memberId;
private String isbn;
private Date reservationDate;
private String status;
private int priority;

public Reservation(int reservationId,


String memberId,
String isbn) {
[Link] = reservationId;
[Link] = memberId;
[Link] = isbn;
[Link] = new Date();
[Link] = "Active";
[Link] = 1;
}

public void cancelReservation() {


[Link] = "Cancelled";
[Link]("Reservation " +
reservationId + " cancelled.");
}

public void fulfillReservation() {


[Link] = "Fulfilled";
[Link]("Book available: "
+ memberId);
}

public void notifyMember(String msg) {


[Link]("Notify " +
memberId + ": " + msg);
}

public int getReservationId() {


return reservationId;
}
public String getMemberId() {
return memberId;
}
public String getIsbn() { return isbn; }
public String getStatus() { return status; }
public int getPriority() { return priority; }
public void setPriority(int p) {
[Link] = p;
}
}

10.2 Extracted Class Diagram

+-------------------------------------------+
| Reservation |
+-------------------------------------------+
| - reservationId : int |
| - memberId : String |
| - isbn : String |
| - reservationDate : Date |
| - status : String |
| - priority : int |
+-------------------------------------------+
| + Reservation(int, String, String) |
| + cancelReservation() : void |
| + fulfillReservation() : void |
| + notifyMember(String) : void |
| + getReservationId() : int |
| + getMemberId() : String |
| + getIsbn() : String |
| + getStatus() : String |
| + getPriority() : int |
| + setPriority(int) : void |
+-------------------------------------------+

10.3 Reverse Engineering Analysis

Code Element Model Element Description

class Reservation Class Maps to a class named 'Reservation' in the class


diagram

private int reservationId Attribute (private) Integer attribute with private visibility

private String memberId Attribute + Foreign key implying association with Member class
Association

private String isbn Attribute + Foreign key implying association with Book class
Association

private Date reservationDate Attribute (private) Date type attribute for reservation timestamp

private String status Attribute (private) String with implicit enum: Active, Cancelled,
Fulfilled

private int priority Attribute (private) Integer representing queue priority

public Reservation(...) Constructor Maps to object creation in class diagram


cancelReservation() Operation (public) Public method maps to operation in class diagram

fulfillReservation() Operation (public) Public method maps to operation in class diagram

notifyMember(String) Operation (public) Implies dependency with notification component

getters and setters Operations Accessor/mutator operations in the class diagram

10.4 Inferred Relationships

- Reservation has an Association with Member class (via memberId field). Multiplicity: Many
Reservations to One Member.
- Reservation has an Association with Book class (via isbn field). Multiplicity: Many Reservations to
One Book.
- Reservation is a Weak class - it depends on existence of both Member and Book objects.
- The notifyMember() method implies a Dependency relationship with a Notification or Messaging
service component.

10.5 Inferred Relationship Diagram

+---------+ +-------------+ +------+


| Member | 1 * | Reservation | * 1 | Book |
+---------+<----------+-------------+---------->+------+
| memberId| places | reservationId| for | isbn |
| name | | memberId [FK]| | title |
| ... | | isbn [FK] | | ... |
+---------+ | status | +------+
| priority |
+-------------+
|
notifyMember() dependency
|
v
+------------------+
| <<dependency>> |
| NotificationSvc |
+------------------+
PRACTICAL 11

DEPLOYMENT DIAGRAM

A deployment diagram shows the physical architecture of the system. It represents how software artifacts are
deployed onto hardware nodes and how these nodes communicate.

Nodes in the System

Node Type Description

Client Workstation Hardware Node Desktop or laptop used by Librarian and Admin to access
the system.

Member Device Hardware Node PC, laptop, or smartphone used by library members to
access the portal.

Application Server Hardware Node Server running the LMS application (Spring Boot / Java
EE).

Database Server Hardware Node Dedicated server running MySQL database for all library
data.

Email Server Hardware Node SMTP server for sending notification emails to members.

Deployment Diagram

+----------------------------+ +------------------------------+
| <<device>> | | <<device>> |
| Client Workstation | | Member Device (PC/Mobile) |
| (Librarian / Admin) | | |
|----------------------------| |------------------------------|
| <<artifact>> | | <<artifact>> |
| Web Browser | | Web Browser / Mobile App |
+----------------------------+ +------------------------------+
| |
| HTTPS (Port 443) | HTTPS (Port 443)
| |
+-----------------+--------------------+
|
v
+------------------------------------------+
| <<device>> |
| Application Server |
| (Ubuntu Server 22.04 LTS) |
|------------------------------------------|
| <<artifact>> |
| LMS Web Application (Spring Boot JAR) |
| - Embedded Tomcat (Port 8080) |
| - REST API Controllers |
| - Service Layer (Business Logic) |
| - DAO Layer (JDBC / Hibernate) |
+------------------------------------------+
| |
| JDBC (Port 3306) | SMTP (Port 587)
v v
+---------------------+ +---------------------+
| <<device>> | | <<device>> |
| Database Server | | Email Server |
|---------------------| |---------------------|
| <<artifact>> | | <<artifact>> |
| MySQL 8.0 | | SMTP Service |
| database: library_db| | (Postfix / Gmail) |
| - books | +---------------------+
| - members |
| - issue_records |
| - fines |
| - reservations |
| - users |
+---------------------+

Communication Protocols

Source Destination Protocol Port

Client Browser Application Server HTTPS 443

Mobile App Application Server HTTPS / REST API 443

Application Server Database Server JDBC / TCP 3306

Application Server Email Server SMTP / TLS 587

Deployment Specifications

Node Hardware Specs Software

Application Server 4-core CPU, 8GB RAM, 100GB Ubuntu 22.04, JDK 17, Spring Boot
SSD 3.x, Tomcat

Database Server 4-core CPU, 16GB RAM, 500GB Ubuntu 22.04, MySQL 8.0
SSD

Email Server 2-core CPU, 4GB RAM Ubuntu 22.04, Postfix SMTP

Client Workstation Dual-core CPU, 4GB RAM Windows 10/11 or Linux, Modern
Web Browser

You might also like