Skip to content

MASEOKJAE/OODP_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š H-Library System

πŸ”Ή Handong Global University | Object-Oriented Design Patterns

πŸ”Ή June 2023

Team B

πŸ‘€ Dongheon Lee | 21600490 | Project Manager

πŸ‘€ Sooyeong Kim | 21800109 | Architecture Designer

πŸ‘€ Seokjae Ma | 21800239 | System Developer

πŸ‘€ Kihong Park | 21800264 | Document Manager


πŸš€ Project Overview

Libraries serve as essential hubs of knowledge for students, faculty, and staff. However, managing vast collections of books manually poses challenges, including:

  • πŸ“– Difficulty in tracking book loans and returns
  • πŸ” Time-consuming book searches due to limited space
  • ❌ Manual handling of overdue books and requests
  • πŸ› Complex book organization with frequent new arrivals

The H-Library System is designed to automate and optimize the process of book borrowing, returns, reservations, and administration through an efficient and user-friendly digital library system.


πŸ”‘ Key Features

πŸ› Core Library Functions

Feature Description Implementation
πŸ” Search Books Users can search for books by title, author, or publisher without logging in. βœ… Implemented (Refactored using Template Method Pattern)
πŸ“– Book Requests Users can request a book that does not exist in the library. βœ… Implemented (Singleton Pattern)
πŸ“š Loan Books Users can borrow books within their loan limit after login. βœ… Implemented
πŸ“ Book Reservations Users can reserve books currently on loan. βœ… Implemented (Repository Pattern)
πŸ“€ Return Books Users can return books without logging in. The system automatically updates their status. βœ… Implemented
πŸ”— External Library Access If a book is unavailable, users can borrow from an external library. βœ… Implemented (Adapter Pattern)
πŸ”‘ User Login Different access for students, professors, and librarians. βœ… Implemented (Singleton Pattern)
πŸ“© Receive Requests Librarians can review and approve book requests. βœ… Implemented (Observer Pattern)
πŸ“š Manage Books Librarians can add, edit, and remove books from the system. βœ… Implemented

πŸ“Œ System Architecture

πŸ— Applied Design Patterns

Pattern Application Implementation Area
Strategy β†’ Template Method Improved book search function for reusability and maintainability. BookSearcher.java
Singleton Ensures a single instance of user sessions. User.java, LoginDialog.java
Observer Notifies librarians of new book requests in real-time. RequestSearcher.java, RequestAdmin.java
State Implements Dark Mode for the admin page. AdminUI.java
MVC (Model-View-Controller) Enhances code organization and maintainability. LibrarySystem.java
Repository Efficient book reservation handling. BookRepository.java
Adapter Enables external library book access within the system. ExternalLibraryAdapter.java

πŸ›  Technologies Used

πŸ”Ή Programming Languages: Java

πŸ”Ή Frameworks & Libraries: Java Swing (GUI), Java Collections API

πŸ”Ή Database: CSV-based storage

πŸ”Ή Development Tools: IntelliJ IDEA, GitHub, Draw.io (Diagrams)


πŸ“‘ System Design

1️⃣ Use Case Diagrams

Use Case Diagram

Illustrating user interactions with the system, including scenarios for:

  • πŸ“š Requesting a Book: Users can enter book details such as name, author, and publisher on a dedicated request page.
  • πŸ“© Receiving Book Requests: Librarians receive and process book requests, updating their status within the system.
  • πŸ” Searching for a Book: Users can search for books by various criteria and view detailed information about availability and location.
  • πŸ“– Loaning and Returning Books: Includes sequences for loan approvals, book returns, and handling unavailable books.

2️⃣ Use Case Scenarios

The following table outlines detailed use case scenarios, including key participants, flow of events, and system quality requirements.

πŸ“Œ Request a Book

Aspect Details
Participating Actor πŸ“Œ User
Flow of Events 1. The user enters the book request page.
2. The system displays fields for book name, author, publisher, and published date.
3. The user fills in the details and submits the request.
Entry Condition The book requested is not available in the library.
Exit Condition The system successfully records and receives the book request.
Quality Requirements πŸ–₯️ Interface: The system must provide a responsive and user-friendly request page.
🎯 Accuracy: User input should be validated before submission.
πŸ”” Immediate Notification: The system should instantly notify the librarian of a new book request.

πŸ“Œ Receive a Book Request

Aspect Details
Participating Actor πŸ“Œ Librarian
Flow of Events 1. The librarian logs into the system and navigates to the book request section.
2. The system displays a list of requested books.
3. The librarian reviews and updates the book request status.
Entry Condition - The librarian is logged into the system.
- A book request has been submitted by a user.
Exit Condition The librarian successfully acknowledges and processes the request.
Quality Requirements ⏳ Prompt Response: The system must notify the librarian of new requests without delay.
πŸ’¬ User Communication: The librarian should be able to provide feedback to users regarding their requests.

πŸ“Œ Searching for a Book

Aspect Details
Participating Actor πŸ“Œ User
Flow of Events 1. The system presents a menu with options: search books, request books, rent books, reserve books, return books.
2. The user selects the search books option.
3. The system displays input fields for search criteria (book name, author, publisher, published date).
4. The user enters search criteria.
5. The system retrieves and displays matching books with details (title, author, publisher, year, loan availability).
6. The user notes the book number for future reference.
Entry Condition The user is logged into the system and wishes to check book availability.
Exit Condition The user successfully retrieves book information.
Quality Requirements πŸ“œ Informative: The system should clearly present book details.
πŸ” Efficient Search: Users should be able to filter by various parameters (title, author, publisher, etc.).

πŸ“Œ Loan a Book

Aspect Details
Participating Actor πŸ“Œ User
Flow of Events 1. The user selects search books.
2. The system prompts for search input.
3. The user enters the book number for the book they wish to borrow.
4. The system validates the request, updates the book's availability status, assigns the loan to the user, and displays a success message.
Entry Condition The user is logged in and has found an available book.
Exit Condition The user successfully borrows the book, and the system updates the loan record.
Quality Requirements βœ… Real-time Updates: The system must reflect loan status instantly.
πŸ”„ Accurate Tracking: User accounts should maintain a record of borrowed books.

πŸ“Œ Fail to Loan a Book

Aspect Details
Participating Actor πŸ“Œ User
Flow of Events 1. The user selects search books.
2. The system prompts for search input.
3. The user enters the book number.
4. If the book is already loaned, the system displays an error message: "The book is already loaned."
Entry Condition The user is logged in and attempts to borrow a book.
Exit Condition The user is informed that the book is unavailable.
Quality Requirements ⚠️ Clear Feedback: The system should display a precise message when a book is unavailable.
πŸ” Up-to-Date Information: The system must reflect real-time loan status.

3️⃣ Class Diagram

image image

πŸ“Œ Overview

The class diagram defines the structure of the system, showing key classes and their relationships.

  • Core entities such as User, Librarian, and Book are included, with inheritance, association, and dependency relationships clearly illustrated.
  • The first diagram focuses on users and book-related classes, while the second diagram covers loan and request processing classes.

4️⃣ Sequence Diagram

image

πŸ“Œ Overview

The sequence diagram illustrates the book loan and return process, depicting the flow of messages between system components.

  • When a user requests a book loan, the system verifies the book's availability and determines loan eligibility.
  • During the return process, the system updates the loan status and notifies any users with pending reservations.
  • The primary interaction follows the sequence: User β†’ Library System β†’ Book DB β†’ Librarian.

5️⃣ State Diagram

image

πŸ“Œ Overview

The state diagram represents the transitions of a book's status within the library system.

  • A book moves through the states: Available β†’ Reserved β†’ Loaned β†’ Returned.
  • Specific states trigger automatic notifications or system messages indicating book availability.
  • If a book is returned and a reservation exists, the system automatically assigns the book to the next user in line.

πŸ”„ Implementation Details

πŸ” Book Search (Template Method Pattern)

πŸ”Ή Before Refactoring: Code redundancy for different search types.

πŸ”Ή After Refactoring: Unified abstract BookSearcher class, reducing duplicate code.

πŸ“– Book Loan (Singleton Pattern)

πŸ”Ή Before Refactoring: Multiple instances of the User class.

πŸ”Ή After Refactoring: Implemented singleton instance, ensuring a single session per user.

πŸ›  Admin Page (State Pattern)

πŸ”Ή Before Refactoring: No Dark Mode support.

πŸ”Ή After Refactoring: Implemented state switching between Light Mode and Dark Mode.


πŸ–₯️ Installation & Setup

1️⃣ Clone Repository

git clone https://github.com/MASEOKJAE/OODP_Project.git
cd OODP_Project

2️⃣ Compile & Run

javac -d bin src/*.java
java -cp bin Main

3️⃣ Admin Login Credentials

  • Username: 1234
  • Password: 1234

πŸ“· Screenshots

πŸ”‘ Login Page

πŸ“– Book Search Page

πŸ“ Book Reservation Page

πŸ”— External Library Access


🀝 Contributing

We welcome contributions! πŸ› οΈ

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature-branch)
  3. Commit your changes (git commit -m "Add new feature")
  4. Push to the branch (git push origin feature-branch)
  5. Submit a Pull Request

πŸ“ž Contact

πŸ“© Email: [email protected]

πŸ“‚ GitHub Repository: H-Library System

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages