285 lines
7.4 KiB
Markdown
285 lines
7.4 KiB
Markdown
# Library Managemnet System
|
|
---
|
|
|
|
## Todo
|
|
- [X] Uml Diagrams
|
|
- [X] Redo UML Diagrams (possibly with mermaid)
|
|
- [ ] Set up database
|
|
- [X] decide how to do ui
|
|
----
|
|
|
|
## UML
|
|
###### Class
|
|
|
|
|
|
|
|
```mermaid
|
|
%%{ "theme": "default", "flowchart": { "curve": "linear" } }%%
|
|
classDiagram
|
|
direction TB
|
|
Library <-- Book
|
|
Library <-- GeneralUser
|
|
class Library{
|
|
+libraryName : String
|
|
+libraryAddress : String
|
|
+dailyLateFine : double
|
|
+maxLoans : int
|
|
+libraryBooks : ArrayList~Book~
|
|
+libraryUsers : ArrayList~User~
|
|
|
|
#highestUserID : long
|
|
#highestBookID : long
|
|
|
|
+Library()
|
|
+getLibraryName() String
|
|
+getLibraryAddress() String
|
|
+getDailyLateFine() double
|
|
+getHigestUserID() long
|
|
+getHigestBookID() long
|
|
+getLibraryBooks() String
|
|
+getLibraryUsers() String
|
|
|
|
#setLibraryName()
|
|
#setLibaryAddress()
|
|
#setDailyLateFine()
|
|
+updateBooksArray()
|
|
+updateUsersArray()
|
|
+updateBooksFile()
|
|
+updateUsersFile()
|
|
|
|
|
|
+verifyLogin() GeneralUser
|
|
+applyMambership() boolean
|
|
+searchLibrary() ArrayList~Book~
|
|
+findBook() Book
|
|
+borrowBook() String
|
|
+viewLoans() ArrayList~Book~
|
|
+returnBook() String
|
|
+addBook()
|
|
+retireBook()
|
|
+viewLogs()
|
|
+removeUser()
|
|
+backupDatabase()
|
|
}
|
|
class Book{
|
|
+title : String
|
|
+author : String
|
|
+publisher : String
|
|
+publisher : date
|
|
+year : int
|
|
+edition : int
|
|
+numCopies : int
|
|
+numCheckedCopies : int
|
|
-idnum : long
|
|
-price : double
|
|
-currentHolders : ArrayList~long~
|
|
|
|
+Book()
|
|
|
|
+getTitle() String
|
|
+getAuthor() String
|
|
+getYear() int
|
|
+getPublisher() String
|
|
+getEdition() int
|
|
+getIsbn() int
|
|
+getNumCopies() int
|
|
+getIdNum() long
|
|
+getPrice() double
|
|
+getPublisherDate() String
|
|
+getCurrentHolders() String
|
|
+getNumCheckedCopies() int
|
|
|
|
+loanBook(long userIdNum) void
|
|
+returnBook(long userIdNum) void
|
|
+equalsBook(String otherBook) boolean
|
|
|
|
+printBook() String
|
|
+printFullBook() String
|
|
+toString() String
|
|
}
|
|
class GeneralUser{
|
|
+username : String
|
|
#password : String
|
|
#userId : long
|
|
#userType : String
|
|
#currentLoans : ArrayList~Long~
|
|
-patronNames : String
|
|
-email : String
|
|
-phoneNumber long
|
|
-numLoans : int
|
|
|
|
|
|
+GeneralUser()
|
|
+getUsername() String
|
|
+getPassword() String
|
|
+getUserId() long
|
|
+getUserType() String
|
|
+getCurrentLoans() ArrayList~Long~
|
|
+getPatronName() String
|
|
+getEmail() String
|
|
+getPhoneNumber() long
|
|
+getNumLoans() int
|
|
|
|
+setUserName()
|
|
+setPassword()
|
|
+setCurrentLoans()
|
|
+setPatronName()
|
|
+setEmail()
|
|
+setPhoneNumber()
|
|
+setNumLoans()
|
|
+loanBook()
|
|
+returnBook()
|
|
+equals() boolean
|
|
+printUser() String
|
|
+printFullUser() String
|
|
+toString() String
|
|
}
|
|
```
|
|
###### Sequence
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant u as User
|
|
participant c as Client
|
|
participant s as Server
|
|
participant d as (Library) Database
|
|
note over u,d : basic client server proccess
|
|
u->>c: get command and data
|
|
c->>s:Establish Connection and send command
|
|
activate s
|
|
s-->d:Use database if neeeded
|
|
s->>c:Receive info and send response
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
note over u,d : Verify Login
|
|
u->>c:get user login info
|
|
c->>s:Send login info
|
|
activate s
|
|
s-->d:Use database to verify credentials
|
|
s->>c:Receive info and send response
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
|
|
note over u,d : Apply for membership
|
|
u->>c:get user data
|
|
c->>s:Send command and data to server
|
|
activate s
|
|
s-->d: add user to database
|
|
s->>c:Receive info and send response
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
|
|
note over u,d : Search Library
|
|
u->>c:get users book query
|
|
c->>s:Send command and book data
|
|
activate s
|
|
s-->d:Use database to attempt to find book
|
|
s->>c:Receive info and send response
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
|
|
note over u,d : Borrow Book
|
|
u->>c:get users book query
|
|
c->>s:Send command, user id, and book data
|
|
activate s
|
|
s-->d:Use database to attempt to find and borrow book
|
|
s->>c:Receive info and send response
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
|
|
note over u,d : View Loans
|
|
u->>c:get users command
|
|
c->>s:Send command and user id
|
|
activate s
|
|
s-->d:Use database to look up users loans
|
|
s->>c:Receive info and send response
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
|
|
note over u,d : Return Book
|
|
u->>c:get users book
|
|
c->>s:Send command, user id, and book data
|
|
activate s
|
|
s-->d:Use database to attempt to find and borrow book
|
|
s->>c:Receive info and send response
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
note over u,d : Add Book
|
|
u->>c:get book information
|
|
c->>s:Send command and book data
|
|
activate s
|
|
s-->d:Add book to database
|
|
s->>c:Send response upon creation
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
|
|
note over u,d : Retire Book
|
|
u->>c:get users book to remove
|
|
c->>s:Send command and book id
|
|
activate s
|
|
s-->d:Remove book from database
|
|
s->>c:Send response upon book removal
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
|
|
note over u,d : Backup Database
|
|
c->>s:Send command and location
|
|
activate s
|
|
s-->d:Create database backup
|
|
s->>c:Send response upon creation
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
|
|
|
|
note over u,d : Remove User
|
|
u->>c:get users id to remove
|
|
c->>s:Send command and user id for removal
|
|
activate s
|
|
s-->d:Delete User that matches id
|
|
s->>c:Send response upon users deletion
|
|
c->>s:close connection
|
|
deactivate s
|
|
c->>u:Display results
|
|
```
|
|
##### Use case
|
|
|
|
![Use Case](https://user-images.githubusercontent.com/74808546/164376684-c1cd8e5d-acba-45b6-8799-4de8109bb5bf.svg)
|
|
|
|
## Old Diagrams
|
|
1. Old UML Diagrams are in the drop-down to minimize the space they take up but are left to allow for review
|
|
<details>
|
|
<summary>Click to reveal</summary>
|
|
|
|
|
|
|
|
![LMS Class Diagram](https://user-images.githubusercontent.com/74808546/159811086-966a799e-94a7-4f6f-9969-3e6eb8679868.svg)
|
|
|
|
![LMS Case Diagram](https://user-images.githubusercontent.com/74808546/159811113-f2a9b001-bae1-4b5e-8688-8c8fa85b465c.svg)
|
|
|
|
![Guest](https://user-images.githubusercontent.com/74808546/159811184-8f13fdfc-9e27-4278-a399-2665ab852f2a.svg)
|
|
|
|
![Patron](https://user-images.githubusercontent.com/74808546/159811165-dc9ec0ec-36bb-4c0e-8ec0-e08f4be714d5.svg)
|
|
|
|
![Librarian](https://user-images.githubusercontent.com/74808546/159811039-c7d9512d-c9a7-4c7c-9278-a92536cccab7.svg)
|
|
|
|
![Admin](https://user-images.githubusercontent.com/74808546/159811206-483a2260-88a0-484a-a9e9-c19a4aa9b2eb.svg)
|
|
|
|
</details>
|