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
Periodical
class, define fields such as title, publisher, publicationDate and methods such as getTitle(), getPublisher(), getPublicationDate() - In the
Newspaper
class, define fields such as edition, section and methods such as getEdition(), getSection() and also inherit fields and methods from the Periodical class. - In the
Newsletter
class, define fields such as frequency and methods such as getFrequency() and also inherit fields and methods from the Periodical class. - In the
Magazine
class, define fields such as category and methods such as getCategory() and also inherit fields and methods from the Periodical class. - In the
Edition
class, 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
, andMagazine
classes inherit fields and methods from thePeriodical
class. ThePeriodical
class**uses**
theEdition
class.
- 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
Member
class has a method checkOutPublication() which represents the action of a library member checking out a book.- The
Borrow
class 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
Librarian
class has a method addPublication(), removePublication(), holdPublication() which represents the action of a librarian adding, removing and holding a publication.- The
Issue
class 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
Member
class 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
Librarian
class 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
Publication
class 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
Publication
class is the superclass for all types of publications, which includes:Book
,Journal
,Magazine
,ReferenceBook
,HandBook
, andMovie
.Book
class has a methodgetAuthor()
andgetISBN()
,Journal
class hasgetISSN()
andgetAuthors()
,Magazine
class hasgetIssue()
andgetAuthors()
,ReferenceBook
class hasgetEdition()
andgetAuthors()
,HandBook
class hasgetSubject()
andgetAuthors()
,Movie
class hasgetDirector()
,getReleaseDate()
andgetAuthors()
.
The
Borrow
class has properties fromDate, toDate and borrowStatus which describes the borrowing time and the borrow status.The
Issue
class has methods publish, unpublish and manage which describes the management of the publications.The
Person
class is the superclass for Author, Member, and Librarian.- The
Author
class has getBooks() method, Member
class has getBorrowings() method,Librarian
class has add(), remove(), and getPublications() method.- The
Student
class has getID() method, Teacher
class has getDepartment() method,Faculty
class 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