Skip to content

FlorinaMt/Vinyl-Lending-Library_Robot-Simulated

Repository files navigation

Use

 A Vinyl has at least a title, artist, year, and a lending state. The Vinyl can be in different states depending on availability, reservation, borrowing or a combined borrowing and reservation.

 You can borrow a Vinyl either if it is not reserved by someone else, is not already borrowed or if it is reserved by you (reserved).

 You cannot reserve a Vinyl if it already contains a reservation (there is no reservation list, only one person at the time can reserve the Vinyl). However, you are allowed to reserve

 A Vinyl if it is available (no reservation and not borrowed) or if it is borrowed and does not have another reservation.

 A Vinyl can be removed from the library if it has no reservation and is not borrowed (available). If the Vinyl is borrowed, reserved or both, then the removal sets a flag such that the Vinyl cannot be reserved any longer.

 The Vinyl is not fully removed until it has been returned and does not have a reservation (the person who may have reserved the Vinyl will still be able to borrow it, before it is finally removed)

 A GUI with two windows displays a list of Vinyls including their states. Select one Vinyl and Reserve, Borrow or Return it. Remove a Vinyl (mark it to be removed until its state allows it to be fully removed). Information that a Vinyl is about to be removed (before it is fully removed) is displayed. Two threads simulate “Bob” and “Wendy” reserving, borrowing and returning a Vinyl.

Requirements

  • MVVM with at least two windows;
  • the Observer design pattern;
  • the State design pattern for the different states of a Vinyl;
  • threads for the simulation and still be able to manually use the system (in the GUI)

Class Diagram

image

State Machine Diagram

image

The application:

image image image