As a team, fork this repository to an Organization and submit the URL of your fork via the Student Portal. Each teammate will submit the SAME URL.
Build a comprehensive Library Management System that demonstrates encapsulation, abstraction, inheritance, and polymorphism through a real-world application.
- To demonstrate the four pillars of OOP
- Master encapsulation through proper data hiding and access control
- Implement abstraction using abstract classes and interfaces
- Apply inheritance to create class hierarchies
- Demonstrate polymorphism through method overriding and dynamic binding
- Use JUnit to develop useful test modules
- Document components
- Comment code
Consider a system in which
Addresshas astreet,city,state, andzipCode.SearchableitemmatchesKeywordby searchinggetSearchableFieldsto if any contain a defined String.Reservableitem can bereserveorcancelReserveby aLibraryMember. depending on theirisReservedflag.LibraryItemisSearchable, and has anid,title,locationand availability based on itsisAvailableflag.LibraryItemcan becheckOutandcheckIn, which sets theirisAvailableflag.LibraryItemmust be able tocalculateLateFee,getMaxBorrowDaysandgetItemType.Bookis aLibraryItemthat hasauthor,isbn, number ofpagesandgenre. TheSearchableFieldsofBookaretitle,author,genreandisbn.BookisReservable, and has a late fee of $0.50 per day, can be borrowed for 14 days, and is typeBook.Periodicalis aLibraryItemthat haspublisher,issn,volume,issueNumberandpublicationDate.SearchableFieldsofPeriodicalaretitle,publisherandissn.Periodicalhas a late fee of $0.25 per day, can be borrowed for 7 days, and is typePeriodical.DVDis aLibraryItemthat hasdirector, minutes ofduration,rating, andgenre. TheSearchableFieldsofDVDaretitle,directorandgenre.DVDisReservable, and has a late fee of $1.00 per day, can be borrowed for 7 days, and is typeDVD.
Personhas aname,age,email, andphonenumber.Librarianis aPersonthat hasemployeeId,departmentandsalary. ALibrariancanaddItemToLibraryandremoveItemFromLibrary.LibraryMemberis aPersonthat hasmemberId,membershipDate,ListofborrowedItemswhich areLibraryItems,outstandingFees, andaddress.LibraryMembercanborrowItem, whichcheckOutitem and adds item toborrowedItems; canreturnItem, whichcheckInitem, removes item fromborrowedItems, andcalcuateLateFeebased on item anddaysLate; and canpayFees, which reducesoutstandingFeesbyamount.
Libraryhasname,address,itemsis aListofLibraryItem,membersis aListofLibraryMember,librariansis aListofLibrarian.LibrarycanaddItem,removeItem, which adds or removesLibraryItemto or fromitems;addMember, which addsLibraryMembertomembers;addLibrarian, which addsLibrariantolibrarians; andsearch, which searchesitemsfor a Stringkeyword;displayAllItemslists the item type, title and availability;generateLateFeeReportlists the member name, and their list ofborrowedItems, includingtitle,maxBorrowDaysandcalculateLateFee.
Hypatia, is theLibrarianofCentral Library, at123 Main St,Alexandra,DE12345. HeremployeeIdisL001, and she makes $45000a year. TheLibraryhas- 2
Book.B001isJava ProgrammingbyJohn Doe, 500 pages, located inA1,isbnis978-1234567890,genreisProgramming.B002isData StructuresbyJane Smith, 400 pages, located inA2,isbnis978-0987654321,genreisComputer Science.
- 2
Periodical.P001isBytepublished byMcGraw-Hill, Inc., vol6, issue8, located inP1,issnis0360-5280, published08/01/1981.P002isDr. Dobb's Journalpublished byM&T Publishing, Inc., vol10, issue6, located inP1,issnis0278-6508, published06/01/1985.
- 1
DVD.D001isThe Matrix, directed byWachowski Sisters,136minutes, ratedR, located inD1,genreisSci-Fi.
- 2
LibraryMember.M001isAlice Johnson,age25,emailalice@email.com,phoneNumber555-1234,addressis456 Oak St,Bookville,MD12347.M002isBob Wilson,age35,emailbob@email.com,phoneNumber555-4321,addressis654 Maple St,Media,PA12346.
- 2
- Create Base Classes with Proper Encapsulation (Afternoon)
- Create Test Class to Validate Base Classes (Evening)
- Encapsulaton Test Class
- Implement base classes with proper encapsulation
- Create a test class to demonstrate data hiding
- Write validation in setters to show controlled access
- Create Abstract Base Classes and Interfaces (Morning)
- Create Concrete Classes Using Inheritance (Afternoon)
- Create Test Class to Validate Inherited Classes (Evening)
- Inheritance Test Class
- Implement abstract class and interfaces
- Implement Book, DVD and Periodical classes
- Test inheritance relationships
- Test method overriding
- Design class hierarchy diagram
- Implement User Classes and Demonstrate Polymorphism (Morning)
- Create Main Library System
- Create Test Class to Validate Polymorphic Class Features
- Implement member and librarian classes
- Implement polymorphic search and reporting
- Test polymorphic method calls
- Complete Main Library System
- Meet with Data Engineering to discuss the pipeline feed (Morning)
- Develop a plan to read in the data file(s) (Afternoon)
- Create a specification for the data file(s)
- Create a plan to read in the data
- Implement a CLI for the application
- Create Test Class to Validate CLI
- Create a CLI
- Test CLI functionality
- Obtain the pipeline data from Data Engineering
- Read in the data file(s)
- Beta Test the Library Management System
- Complete the Library Management System
- System Test the Library Management System
- Create test cases that describe the
Library, itsitems,membersandlibrarians. - Generate a late fee report.
ask yourselves:
- What are
ListsandArrayLists? - How can they be used here?