Java Fundamentals End Assignment - 2023
Java Fundamentals End Assignment - 2023
Introduction
In order to complete the course of Java Fundamentals students need to complete two tasks:
The document before you details the requirements for this end assignment.
General requirements:
• Unless otherwise specified, requirements are must-have for a passing grade.
• The application must be written in JavaFX.
• The application must be submitted as a zip (not .rar, .7z, or other formats) file containing the
following:
o /src – directory
o pom.xml
o Readme.md
• The name of your zip file must be: [your-name]-[your-student-number]-[end-assignment].zip,
e.g. wim-wiltenburg-123456-end-assignment.zip
• Code quality will be reviewed:
o Java coding conventions are followed.
o Code is written concisely and clear: methods are short (no 30+ line methods). Names
are chosen well and without spelling mistakes. Should someone other than you read
the code, they should be able to understand it easily.
o Object Oriented Principles are used: Encapsulation, inheritance and polymorphism
are used to hide class implementation details and prevent duplicate code. Static
variables/objects are not used.
o Code is robust: Input validation and exception handling are implemented wherever
needed to handle possible edge cases.
o All code is formatted properly and does not contain any profanity.
• Your application must be able to start up in the IDE of the reviewer.
• The screenshots in this document are indicative. Feel free to arrange and design it to your
own taste, as long as the required functionality is there.
• If you have specific usernames/password that are needed to log into the application, please
share them, e.g. in a README.md file in the root of the project.
• Before creating your zip file, do a code reformatting on all your files, and optimize your
imports!
1
Objectives
Your task is to build an application for a music store. The users of the application will be able sell
products. It will also be possible to manage the product stock, and to view the history of orders. The
application consists of:
• A login screen
• A main window with a menu that depends on the type of user
• Different views:
o A dashboard screen – accessible to sales and manager
o A screen for creating an order – accessible to sales
o A screen for inventory management – accessible to manager
o A screen viewing the order history – accessible to sales and manager
• The login screen should be a separate window. The other functionality should all be usable in
one main window.
• It is allowed to use separate (modal) dialogs for adding and editing the order and the product
collection. The choice to use separate dialogs or the main window is up to you.
• Do not use pop-up windows (message- or dialog boxes) to display error messages.
Database object
The data in the application is maintained by a database object (not a real database) and is initialized
at startup.
Important: For learning purposes, the data is not allowed to be static, and therefore the Singleton
Pattern must NOT be used. Populate the database object with initial data.
User experience
The example screen designs in this document are just an indication of what the UI could look like.
The screen design is up to you, as long as a similar (or better) level of usability is achieved.
2
Assignment part 1 - Login Screen
The login screen is a basic screen with username and password. You need to have a proper
mechanism in place to validate the input and grant the user access to the application.
First, make sure you have an in-memory database class that contains a collection of users. Initialize at
least 2 example users with different roles in the constructor of your database class.
Then develop a window that allows users to login using the usernames and passwords stored in the
collection. When the application starts, this window should be displayed.
• After clicking the ‘Login’ button with a correct username and password combination, the
login window should close and a new main window should open.
• The functionality in the main window will be developed in the next assignments.
• The user must get a clear and descriptive message if something goes wrong during the login
process. An example is to display: ‘Invalid username/password combination’ instead of ‘Login
failed’.
• Note that, as per the general requirements listed before, a pop-up dialog should not be used
to display the error message.
3
Assignment part 2 - Dashboard
Once the user is logged in, the main window is shown. The name and role of the logged in user are
visible. The dashboard should also display the current date and time.
4
Assignment part 3 – Sales
When the user opens the ‘Create order’ part of the application, a view should be displayed that
allows the user to enter customer information, and add products from the store inventory to the
order.
Clicking the ‘Add product’ button should display a pop-up window that allows selecting a product,
entering a quantity and then adding it to the order.
Clicking the ‘create order’ button should display a pop-up window that requests the user to confirm
the order. When the order is confirmed, the sold products should be removed from the product
stock.
5
Assignment part 4 – Inventory management
When the user opens the ‘Create order’ part of the application, a view should be displayed that
allows the user to manage the products that are available in the store.
This screen provides standard CRUD (Create, Read, Update, Delete) functionality for products. How
this is implemented, is up to you.
Ensure that when the product collection is modified, the changes are displayed immediately. The
user should not have to click buttons or restart the application to see the changes.
6
Assignment part 5 – Order history
When the user opens the ‘Order history’ part of the application, a view should be displayed that
shows all created orders.
When an order is clicked, the order details should be displayed. This includes a list of the ordered
products and their information.
7
Assignment part 6 - Serialization
When closing the application, the state of the database (the collection items and members) should
be serialized to a binary file.
When starting the application, the file should be deserialized. This ensures changes will persist
throughout application restarts. Make sure the application does not crash when the serialized file is
missing.