πΉ 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
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.
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 |
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 |
πΉ Programming Languages: Java
πΉ Frameworks & Libraries: Java Swing (GUI), Java Collections API
πΉ Database: CSV-based storage
πΉ Development Tools: IntelliJ IDEA, GitHub, Draw.io (Diagrams)

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.
The following table outlines detailed use case scenarios, including key participants, flow of events, and system quality requirements.
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. |
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. |
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.). |
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. |
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 | π Up-to-Date Information: The system must reflect real-time loan status. |


π 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.

π 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.

π 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.
πΉ Before Refactoring: Code redundancy for different search types.
πΉ After Refactoring: Unified abstract BookSearcher
class, reducing duplicate code.
πΉ Before Refactoring: Multiple instances of the User
class.
πΉ After Refactoring: Implemented singleton instance, ensuring a single session per user.
πΉ Before Refactoring: No Dark Mode support.
πΉ After Refactoring: Implemented state switching between Light Mode and Dark Mode.
git clone https://github.com/MASEOKJAE/OODP_Project.git
cd OODP_Project
javac -d bin src/*.java
java -cp bin Main
- Username:
1234
- Password:
1234
We welcome contributions! π οΈ
- Fork this repository
- Create a feature branch (
git checkout -b feature-branch
) - Commit your changes (
git commit -m "Add new feature"
) - Push to the branch (
git push origin feature-branch
) - Submit a Pull Request
π© Email: [email protected]
π GitHub Repository: H-Library System