This assignment is based around the development of a back-end Java package for a client who has already determined the functionality they require of the system, and have provided an interface to be...

This assignment is based around the development of a back-end Java package for a client who has already determined the functionality they require of the system, and have provided an interface to be used between the back-end you develop, and the front-end they have developed. They should be able to simply compile in the jar file of the package you develop, with the rest of their system, to result in a fully functioning solution. 2.1 The problem Erica and Thea run an independent bean bag store, specialising exclusively in artisanal bean bags. Within their shop they stock the bean bags they have for sale, which are periodically replenished as bean bags are sold and new bean bags are acquired. They want an electronic implementation of a stock system so that they can manage the bean bags they have in stock more effectively (and keep track of popularity, how soon 1 to restock a particular line of bean bags, etc). Erica and Thea already have a frontend developed — however they need the back-end of the system to be completed in a Java package. They do have an number of initial members of this package, which they have provided. In their current (paper based) stock system they keep track of a number of attributes for a bean bag: the manufacturer, the bean bag name, the price, an ID number (an eight character string holding a positive hexadecimal number)1 , the year of manufacture, the month of manufacture, and an optional free text component containing any additional information they think may be useful to their customers (e.g. on the free trade origin of the beans, or some quirky information regarding famous owners of that particular brand). Sometimes customers come in and browse the stock, find a bean bag they wish to purchase, but don’t have the money to buy it at that point. To help these customers, the back-end system should also permit reservations to be made. Reservations cannot be made on bean bags that are currently not in stock, as Erica and Thea cannot guarantee to find future stock of some items, and don’t like to disappoint their customers by promising something they may not be able to deliver. Once a stock item is reserved, it can only be sold to the customer with the matching reservation number (unless the reservation is cancelled). The shop uses the manufacturer provided ID to distinguish any stock in the system. Two bean bags with the same ID must match on name, manufacturer and free text component — and this needs be checked by the system against existing stock to flag up any data entry errors (which can lead to disappointed customers later). Bean bags with the same ID are therefore interchangeable from a stock viewpoint. Note however, it is possible for two bean bags with the same manufacturer, brand, and free text, to have different manufacturer IDs (as they may vary in e.g. colour, hence the assignment of a different ID by the manufacturer). Erica and Thea want the back-end of the new electronic system developed to be based on their existing paper system, as such they have already designed a Java interface for the new system, which their front-end application will use. You are to develop a class that implements this interface, and also develop with the necessary addistional supporting classes in the Java package called beanbags. The operational correctness of the back-end system will be tested through this provided interface on submission. Your task is to design and write the additional package members to complete the beanbags package. You will need to to design and write a class that implements the BeanBagStore interface (available on the ECM1410 study resources page, as well as at the end of this document). This implementor class must be a public class called Store. If it is not, then the front-end system will be unable to compile with your back-end solution, and the operational component of your mark will be 0. You will need to also write any other package members you deem appropriate to support this class and its functionality. All classes developed must reside in the beanbags package. Alongside the interface, I have provided in the package a set of exception classes which the interface requires, and also an ObjectArrayList class that allows you to maintain a list of items (including adding to a list, removing from a list and querying a list contents). You should find the ObjectArrayList class useful when maintaining lists of objects in your solution, especially given the package import restrictions of the assignment detailed later. Note that as the ObjectArrayList stores object references declared as the Object type, you will need to employ casting when using its contents. 2.2 Development considerations The following points should be noted: 1The various integer type wrapper classes offer overloaded ‘parse’ methods that convert Strings to the wrapped type. One of these has two arguments, with the second argument being the radix (base) used. You may find these methods useful. 2 • Your source code should include appropriate comments and assertions. • The stock of the store includes all products currently on the premises (those available for immediate sale and those reserved). • Erica and Thea live in a utopian city with no thieves, so stock reduction due to theft does not need to be modelled by your system. • If a bean bag is reserved, and prior to it being sold the price is changed, the lowest price the bean bag reaches should be used on selling (i.e. the buyer should be advantaged, not disadvantaged, by any price changes when stock is reserved). You will not need to submit an executable application (i.e. you do not need to submit a class with a public static void main method which uses the beanbags package). This notwithstanding, it is strongly advised that you do write an application to test that your package conforms to the requirements prior to submission. Apart from the classes you develop yourself, or that you have been given as part of the CA, you must only use those available in the java.lang and java.io packages. The use of any other packages will result in a penalty of 10 marks. Your should consult the BeanBagStore interface for a more detailed description of expected behaviour of a class which implements that interface (provided in the JavaDoc).
Mar 02, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here