Team1-Proj2-Sp22-main/readme.md

7.4 KiB

Library Managemnet System


Todo

  • Uml Diagrams
  • Redo UML Diagrams (possibly with mermaid)
  • Set up database
  • decide how to do ui

UML

Class
%%{ "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
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

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
Click to reveal

LMS Class Diagram

LMS Case Diagram

Guest

Patron

Librarian

Admin