Implement a simple library management system

Assignment Help Web Project
Reference no: EM13944761

Your task is to implement a simple "Library Management System (LMS)" outlined below. The solution should be developed following a supplied UML class diagram, and also adhere to a purposively built test harness. The class diagram itself will be outlined during our next two online chat sessions.

The system will consist of a collection of interacting classes/interfaces to store information about:

1. The library and its library collection;

2. The holdings contained in the library collection;

3. The member who can borrow/return available holdings;

4. The borrowing history of the library member.

The system will also include a unified "front end", through the provision of an LMSModel façade1 interface (located in the lms.model.facade package) that will offer a single point of entry for all high-level operations. This front end will support the testing of your program, independently of a graphical user interface, using the test harness.

1. LMS Scenario

The system will need to be modelled using a number of OO classes/interfaces. The main entities involved in the system, and their behaviours, are detailed below.

Library

The library should capture information about the library collection and the library member. Note that a typical library will contain multiple collections and members, but for simplicity reasons the decision was made to ‘restrict' the library to one library collection and one member only.

LibraryCollection

The library collection has a collection code (e.g. "LIB_IT"), a name (e.g. "Information Technology"), and a collection of holdings. The library collection is dynamic and unbounded i.e. you can add any number of holdings to a library collection.

Holding

Each holding has:

- a seven-digit numeric code (e.g. 1000001);
- a title (e.g. "Programming in Java");
- a predefined standard loan fee ($ value);
- a maximum loan period (defined in terms of the number of days)

Also, the system needs to cater for two distinct types of Holdings, Books and Videos:

• Books have a fixed (i.e. constant) standard loan fee of $10, and a fixed (maximum) loan period of 28 days.
• Videos have a variable standard loan fee of either $4 or $6, and a fixed (maximum) loan period of 7 days.
• The formula for calculating late penalty fee is different for both Holding types as follows:

- Books: late fee = number of late days x fixed daily rate of $2.

E.g. if a given book was returned 3 days late, the late fee will be $6 (3 days x $2).

- Videos: late fee = number of late days x 50% of the standard loan fee.

E.g. if a given video with a standard loan fee of $6 was returned 3 days late, the late fee will be $9 (3 days x 50% of $6).

Member

The member has:

- a member ID (e.g. "m00001");
- a full name (e.g. "Joe Bloggs");
- an initial (or maximum) borrowing credit ($ value), which is predefined according to the specific membership type, see below;
- a collection of currently borrowed holdings;
- a borrowing history comprised of the previous borrowing records.

Also, the system needs to cater for two distinct types of Members, Standard and Premium:

• Standard members have a fixed initial (or maximum) borrowing credit of $30, whereas Premium members have a fixed initial borrowing credit of $45. The holding's standard loan fee should be deducted from member's borrowing credit when he/she borrows this holding.

• Also, the holding return procedure, including the calculation of the late fee if applicable, will differ based on a specific member type as described in Section 3 of this document.

Borrowing History

Each borrowing record in the borrowing history should capture information about a previously returned holding and a corresponding fee payed for this holding (including late fees if applicable).

2. Base Functionality

The LMS system shall provide the following functionality. Check the provided LMSModel facade interface for a complete list of required functions:

• Create a new library, library collection, and library member
• Add/delete holding to/from a library collection
• Get a list (collection) of all the holdings in the library collection
• Count the number of holdings (books and videos) in the library collection
• Allow a member to borrow a holding
• Allow a member to return a holding
• Get a list (collection) of all currently borrowed holdings for the member
• Calculate the late fee for a holding (when applicable)
• Create and add a borrowing record to a borrowing history
• Get a specific borrowing record from a borrowing history
• Get a list of all the borrowing records (i.e. a complete borrowing history)
• Calculate the remaining credit ($ value) for a member
• Refresh member's credit (i.e. restore the credit to the initial maximum value)
• Calculate the total late fees ($ value) accumulated by a member for all the holdings stored in the borrowing history
• Check for borrowing eligibility (see Section 3 below)

3. Additional Implementation Details and Constraints

- Your primary goal is to implement the provided LMSModel interface in a class called LMSFacade in order to provide the behaviour specified as comments in the LMSModel.java source file and tested by the provided TestHarness.java. In Assignment 2 you will be asked to write a graphical user interface to more effectively utilise LMSModel.

- You have freedom in how you choose to implement your solution; however, you must implement it in such a way that the TestHarness is NOT modified. You should use inheritance, polymorphism, abstract classes and interfaces effectively, as taught in this course.

- Even though the LMSModel interface returns array types, you should use data structures from the Java collection API (e.g. Map, List etc.) in your implementation and convert them for return as necessary. You should choose structures that are appropriate to the task, for example if lookups are frequently performed a Map would be a suitable data structure.

- The provided source code includes DateUtil class which stores the -current- system date, and also allows you to get the total loan period (in number of days) for a holding i.e. returnDate - borrowDate. This can be useful when calculating late fees for a given holding. Specifically, the following calls should be used to find (1) the current date; and (2) the total loan period in number of days:

(1) String borrowDate = DateUtil.getInstance().getDate()); // call this when borrowing holdings

(2) int numOfDays = DateUtil.getInstance().getElapsedDays(borrowDate); // call this when returning holdings

Note that we need to artificially set the -current- date from within the TestHarness in order to test the borrow/return functions.

- You must provide appropriate constructors and methods as required by the TestHarness in order to ensure that your solution can be complied and tested without modifying the TestHarness.

Example 1. LibraryCollection class should implement the Holding[] getAllHoldings() method as used in the TestHarness tests.

Example 2. StandardMember and PremiumMember, which represent the concrete Member classes that you need to implement according to TestHarness, must have the following constructors:

public StandardMember (String memberId, String memberName);
public PremiumMember (String memberId, String memberName);

The rest of the requirements can be determined from the provided TestHarness.java source file.

Library Collection Rules:

The library collection is dynamic and unbounded. That is, you can have an unlimited number of holdings added to the collection. When calling addHolding(...) and removeHolding(...) methods to build up the library collection, the following rules must be maintained:

• Only one copy of a given holding can be added to the collection;
• You cannot remove a holding form the collection if it is currently on loan.

Boolean values should be used to indicate the successful completion of the add/removeHolding() functions based on the above rules.

Holding Borrow/Return Rules:

The member can borrow any number of holdings as long as the following rules are followed:

• The member must have a sufficient credit available to borrow a given holding.
• The member can borrow each holding only once.

The holding return procedure differs based on a specific member type:

• Standard members are not allowed to return a (late) holding if their current balance will become negative after paying the late penalty fee. In such cases, the current credit of a member needs to be restored to the initial maximum value first.

• Premium members can return a holding even if this will result in a negative current balance. However, they won't be able to borrow any new holdings until their current credit is restored to the initial maximum value.

Exceptions must be thrown when the holding borrow/return rules are violated. The exceptions must extend the provided LMSException class. Note: at the minimum you should provide and use three exception sub-classes:

InsufficientCreditException, MultipleBorrowingException, OverdrawnCreditException.

4. String Representations

Certain classes must provide specific string representations by overriding a public String toString() method which conforms to the format described below. This is required to enable correct operation of the TestHarness and is used as an alternative to data access methods, thereby allowing greater flexibility in how you implement your solution. Examine the TestHarness and the specification below to see how they are used.

Library Collection

collection_code:collection_name:holdingCodes
e.g. LIB_IT:Information Technology:1000001,2000002

Note:

(1) holdingCodes are optional since a library collection can be empty.

e.g. LIB_IT:Information Technology would indicate an empty collection.

(2) multiple holdingCodes should be separated with comas (no space in between).

Member

member_id:full_name:remaining_credit:type
e.g. m00001:JohnSmith:25:PREMIUM

Note: type must be either "STANDARD" or "PREMIUM".

Holding

holding_code:holding_title:standard_loan_fee:max_loan_period:holding_type
e.g. 0000001:Introduction to Java Programming:10:28:BOOK

Note: type must be either "BOOK" or "VIDEO".

History Record

holding_code:payed_fee
e.g. 0000001:15

LibraryCollection, Member, Holding and HistoryRecord codes/ids and names/titles are assumed to be unique and case insensitive, and must not contain any colons (:) or commas (,) that would otherwise lead to invalidly formatted string representations.

single file for submission so you should compress your whole project (i.e. project folder in Eclipse) UML diagram next page.

Reference no: EM13944761

Questions Cloud

What are the attributes of this god : What indications are there in the poem that Akhenaton believed in 1 universal god? What are the attributes of this god?
What is chineasy : What is Chineasy? China is home to ancient traditions, breathtaking artwork, and what is currently one of the world's strongest economies.
What is the total amount : A company manufactures wooden swing sets which are sold partially assembled. The following costs were incurred related to the production of 1,400 swings: What is the total amount which should be included in manufacturing overhead for the month
Analysis examining cholesterol : Choose the appropriate statistical procedure: an analysis examining how cholesterol (mg/dL) varies with weight (lbs), annual income ($), and height (inches).
Implement a simple library management system : Your task is to implement a simple "Library Management System (LMS)" outlined below. The solution should be developed following a supplied UML class diagram.
Develop a detailed case proposal for description of network : For the equipment price list, make up the price list based on fair market value for each peice of equipment. Do the same for the labor costs.
What amount would be recorded as depreciation expense : A company purchased factory equipment on April 1, 2005, for $48,000. It is estimated that the equipment will have a $3,000 salvage value at the end of its 10-year useful life. what amount would be recorded as depreciation expense at December 31, 20..
What is the average temperature : What is the average temperature (in degrees Celsius) of the coffee during the first half hour?
How do the named pipes and tcp/ip sockets named libraries : What are the benefits and drawbacks of using ODBC to configure your client applications?

Reviews

Write a Review

Web Project Questions & Answers

  Describe the steps you have taken to maintain and redesign

Describe the steps you have taken to maintain and redesign your site(basic website beginner). How is the process that you followed similar to or different from how sites are maintained and redesigned in the professional environment

  Evaluate alternatives to the company self-hosting the site

Evaluate alternatives to the company self-hosting the site and Build a Gantt chart using Microsoft Project or equivalent software, showing all tasks associated with implementing the Website

  The websites of for-profit and non-profit organizations

Conduct a search to find a leader in health care. As an idea, you might explore the websites of for-profit and non-profit organizations and find the bios of their CEOs. Select a leader in health care to further examine.

  Increase the functionality of its online shopping cart

Use the concepts and scenario to help Fran's Virtual Fruit Stand increase the functionality of its online shopping cart. When a customer checks out, the shopping cart must store the required data pertaining to each item the customer is buying

  Explain designing and implementing a web application

This project aims to give students hands-on experience in designing and implementing a Web application on their own. In recent years, scientists have increasingly turned to the web for keeping up-to-date with the recent publications in their respec..

  Create flowchart for website

Use any program with which you are comfortable to create your own flowchart for your website. Libre Writer or Microsoft Word are good programs to create a flowchart, but there are others. Use the information provided within the Simulation as your ..

  Web development and design foundations

Web Development & Design Foundations with HTML 5, 7th ed. You have three attempts to complete the concepts exam and 60 minutes per attempt

  Describe the web-based information technologies

Describe the Web-based information technologies (protocols, policies, tools) behind electronic health care medical records. Analyze the security requirements needed to protect the Web-based medical records, especially the requirement to be able to ..

  Discuss what it will take to build a web architecture

Discuss what it will take to build a Web architecture, move an existing Website with minimal downtime, and provide a disaster recovery solution to ensure the site is always available.

  How ericsson benefitted from amazon web services

Assess how Ericsson benefitted from Amazon Web Services (AWS) in terms of cost reduction, automated software updates, remote access, and on-demand availability

  An explanation of why you created the specific goal

Create a goal in a Google Analytics account. An explanation of why you created the specific goal

  Implement an online educational website

The purpose of this project is to implement an online educational website with a similar goal of helping students to better grasp subject concepts that are taught within the classroom.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd