Oose Ass
Oose Ass
Elements:
Start: Represents the initiation point of the process.
Action (Diamond): Represents a decision point or a choice of
actions that can be taken. In this context, it signifies the
user's selection of an operation related to stock maintenance.
Use Cases (Rectangles): Each rectangle represents a specific
functionality or goal that the system enables. These are the
primary actions a user would perform to manage the library's
book stock.
o Add Book / Add New Book: Represents the process of adding
a new book to the library's inventory. The "Add Book"
label likely refers to the user's initial intention,
while "Add New Book" represents the actual system
function.
o Remove Book / Remove Old Book: Represents the process of
removing an existing book from the library's inventory.
Similar to adding, "Remove Book" is the user's intent,
and "Remove Old Book" is the system function.
o Check Stock / Check Stock Levels: Represents the process
of inquiring about the current stock levels of books in
the library. "Check Stock" is the user's intent, and
"Check Stock Levels" is the system function.
o Update Inventory: This use case appears to be a
consequence of adding or removing a book. It represents
the system's action of updating the underlying inventory
records based on these operations.
o Display Stock Levels: Represents the system's action of
showing the current stock levels to the user, likely as a
result of the "Check Stock" operation.
End: Represents the termination point of a particular use case
flow.
Arrows: Arrows indicate the flow of control or sequence of
actions. They show how the user's initial action leads to
specific system functionalities.
Classes:
Book:
o Attributes: title (String), author (String), ISBN
(String), isAvailable (boolean).
o Methods: addBook(), removeBook().
Staff:
o Attributes: staffId (String), name (String).
o Methods: manageInventory().
Member:
o Attributes: memberId (String), name (String), email
(String).
o Methods: borrowBook(), returnBook().
Library:
o Attributes: name (String), address (String), books (List
of Book objects).
o Methods: addBook(), removeBook(), checkStock().
Transaction:
o Attributes: transactionId (String), date (Date).
o Methods: borrowBook(), returnBook().
Relationships:
Library contains Book: This is represented by an arrow
pointing from Library to Book labeled "contains". It indicates
that the Library class has a collection of Book objects.
Staff manages Library: This is represented by an arrow
pointing from Staff to Library labeled "manages". It suggests
that a Staff object is responsible for managing the Library.
Member makes Transaction: This is represented by an arrow
pointing from Member to Transaction labeled "makes". It
indicates that a Member object initiates a Transaction.
Functionality:
The diagram suggests the following functionalities for the library
management system:
Adding, removing, and checking the availability of books.
Managing the library's inventory, likely by staff members.
Borrowing and returning books by library members.
Tracking transactions related to book borrowing and returning.
Sequence Diagram:
The sequence diagram shows the interactions between participants
over time. We'll illustrate the process of a member borrowing a
book, including the interactions between
the Member, Library, Transaction, and Book.
1. Participants:
o Member (M): The library member requesting to borrow a
book.
o Library (L): The system that handles the borrowing
process.
o Transaction (T): Represents the borrowing event created
by the library.
o Book (B): The entity representing the book being
borrowed.
2. Flow of Events:
o Request: The member sends a request to the library to
borrow a specific book (M->>L: Request to borrow Book).
o Check Availability: The library queries the book to check
if it is available (L->>B: Check availability).
o Response on Availability: The book responds back to the
library indicating whether it is available or not (B--
>>L: Is Available?).
3. Conditional Logic (alt blocks):
o Yes Condition: If the book is available, the following
occurs:
The library creates a new transaction to record the
borrowing action (L->>T: Create Transaction).
The transaction confirms back to the library that it
has been successfully created (T-->>L: Confirm
Transaction Created).
Finally, the library communicates back to the member
confirming that the book has been successfully
borrowed (L-->>M: Success: Book borrowed).
o No Condition: If the book is not available:
The library informs the member that borrowing is not
possible due to unavailability (L-->>M: Error: Book
not available).
Collaboration Diagram: