classDiagram
class Publication {
-title: String
-year: int
-author: String
-statusPublication: enum
}
class Borrow {
+fromDate
+toDate
+borrowStatus
}
class Issue {
+publishDate
+unpublishDate
+manageDate
-issueStatus
}
class Member {
-idMember: String
+checkOutPublication()
+returnPublication()
+holdOnPublication()
}
class Librarian {
-idLibrarian
+addPublication()
+removePublication()
+holdPublication
}
class Person {
-name: String
-surname: String
-address: String
-age:int
+getPublications()
}
Person --> Member
Person --> Librarian
Member --> Borrow
Borrow --> Publication
Librarian --> Issue
Issue --> Publication
Lab#SE00-3: Library Model
Java SE Lab 00
📘 Linux Lab#SE00-3: Library Model
Create two new feature for a library management system:
- to track the library’s inventory of periodicals such as newspapers, newsletters, and magazines.
- that allows the librarian to add, remove, and update the periodicals in the inventory, and also show all the periodicals in the inventory.
Create five new classes:
Periodical,Newspaper,Newsletter,Magazine, andEdition.- In the
Periodicalclass, define fields such as title, publisher, publicationDate and methods such as getTitle(), getPublisher(), getPublicationDate() - In the
Newspaperclass, define fields such as edition, section and methods such as getEdition(), getSection() and also inherit fields and methods from the Periodical class. - In the
Newsletterclass, define fields such as frequency and methods such as getFrequency() and also inherit fields and methods from the Periodical class. - In the
Magazineclass, define fields such as category and methods such as getCategory() and also inherit fields and methods from the Periodical class. - In the
Editionclass, define fields such as issueNumber, volume and methods such as getIssueNumber(), getVolume()
- In the
Define the relationships between the classes, such as
inheritance,composition, anduse.- The
Newspaper,Newsletter, andMagazineclasses inherit fields and methods from thePeriodicalclass. ThePeriodicalclass**uses**theEditionclass.
- The
1 Basic UML
This Mermaid class diagram describes the classes and their relationships in a library management system.
It shows the classes involved in the process of a library member checking out a book and a librarian helping him.
- The
Memberclass has a method checkOutPublication() which represents the action of a library member checking out a book.- The
Borrowclass is associated with the Member class, it has fields such as fromDate, toDate and borrowStatus which describes the borrowing time and the borrow status.
- The
- The
Librarianclass has a method addPublication(), removePublication(), holdPublication() which represents the action of a librarian adding, removing and holding a publication.- The
Issueclass is associated with the Librarian class, it has fields such as publishDate, unpublishDate and manageDate and issueStatus which describes the publishing and unpublishing of the publication.
- The
The Publication class is the superclass for all types of publications, it has fields such as title, year, author, statusPublication which represents the properties of the book.
In summary in this class diagram:
- the
Memberclass is checking out a book: the Borrow class helps to the member class,** it keeps track of the borrowing time and the borrow status.** - the
Librarianclass is helping the member by adding, removing and holding a publication: the Issue class is associated with the librarian class, it keeps track of the publishing and unpublishing of the publication - the
Publicationclass is the superclass for all types of publications, it has properties such astitle,year,author,statusPublication.
2 Large UML
This mermaid UML is a class diagram that describes the classes and their relationships in a library management system.
The Interface class represents the user interface that allows the user to manage the library, search for publications, check out and check in publications, add, remove and update publications.
The
Publicationclass is the superclass for all types of publications, which includes:Book,Journal,Magazine,ReferenceBook,HandBook, andMovie.Bookclass has a methodgetAuthor()andgetISBN(),Journalclass hasgetISSN()andgetAuthors(),Magazineclass hasgetIssue()andgetAuthors(),ReferenceBookclass hasgetEdition()andgetAuthors(),HandBookclass hasgetSubject()andgetAuthors(),Movieclass hasgetDirector(),getReleaseDate()andgetAuthors().
The
Borrowclass has properties fromDate, toDate and borrowStatus which describes the borrowing time and the borrow status.The
Issueclass has methods publish, unpublish and manage which describes the management of the publications.The
Personclass is the superclass for Author, Member, and Librarian.- The
Authorclass has getBooks() method, Memberclass has getBorrowings() method,Librarianclass has add(), remove(), and getPublications() method.- The
Studentclass has getID() method, Teacherclass has getDepartment() method,Facultyclass has getPosition() method.
- The
Person.java
classDiagram
class Interface {
+manage()
+search()
+checkOut()
+checkIn()
+add()
+remove()
+update()
}
class Publication {
+getTitle()
+getPublisher()
+getPublicationDate()
}
class Book {
+getAuthor()
+getISBN()
}
class Journal {
+getISSN()
+getAuthors()
}
class Magazine {
+getIssue()
+getAuthors()
}
class ReferenceBook {
+getEdition()
+getAuthors()
}
class HandBook {
+getSubject()
+getAuthors()
}
class Movie {
+getDirector()
+getReleaseDate()
+getAuthors()
}
class Borrow {
+fromDate
+toDate
+borrowStatus
}
class Issue {
+publish
+unpublish
+manage
}
class Person {
+getName()
}
class Author {
+getBooks()
}
class Member {
+getBorrowings()
}
class Librarian {
+add()
+remove()
+getPublications()
}
class Student {
+getID()
}
class Teacher {
+getDepartment()
}
class Faculty {
+getPosition()
}
class Catalog {
}
Catalog --> Publication
Publication --> Book
Publication --> Journal
Publication --> Magazine
Publication --> ReferenceBook
Publication --> HandBook
Publication --> Movie
Person --> Author
Person --> Member
Person --> Librarian
Member --> Student
Member --> Teacher
Member --> Faculty
Publication --> Author
Member --> Borrow
Borrow --> Publication
Librarian --> Issue
Issue --> Publication