This is my solution for the third seminar for the course Object-Oriented Design (IV1350), at KTH The Royal Institute of Technology.
The design consists of one class diagram and five interaction diagrams.
The class diagram shows all packages, startup, view, controller, model and integration. Each package consists of propiate classes that should be in that package. Example integration has the classes that takes care of external calls like databases and other systems.
Initializes all the necessery classes to start the application. The catalog creator initializes the catalogs, the system creator initializes the extarnal systems. We the initialize the printer and add these to the Controller. The controller then initialized the cash register. We then add the controller to the view.
Initializes a new sale object which initializes a total object.
With the entered item identifier (a string), we check if it exists in our database. If it does we will add it to our sale, where we will add it to a list. If it exists in the list we will increase the quantity of that item. We will then update the running total. We will then return a string which consists of information about the entered item and the current running total.
With the entered customer identification we will get the discount from our database. If the customer doesn't exist we will return a discout of zero. We will the apply this discount to our sale object which will apply it to the total.
With the entered paid amount we will make a payment object, which consists of the total and the paid amount. With this payment we will add it to the cash register to update its balance. We will then send the sale information to the external systems. We will then make a receipt and send it to the printer. We will then return a string with the change.
There have been some changes that can be read here.