Plugins | Justification |
---|---|
JavaFX 19 | A modern successor to Java's internal Swing API |
Shadow | Allows the creation of "fat" .jar files |
Ikonli | Provides access to the Bootstrap icon set |
Broadly, this project consists of two components.
The first is a fairly generic set of classes for handling dummy book and user data, and mainly exists to demonstrate common OOP principles (inheritance, abstraction, interfaces), as well as some more advanced concepts (nested objects, records, builders).
The second is the actual UI component, built using JavaFX. This is significantly larger than the "actual" project, but is also the more complicated and interesting part. It makes heavy use of the Observer pattern, and is designed to follow some general design principles:
- Large fonts and icons, for clarity;
- Consistent UI components, namely in the "TopBar;"
- Separation of concerns between administration and consumption.
Rather unintentionally, this separation of the project into a data model and UI component is essentially a rudimentary version of an MVC model (though I had not considered this when designing). In this case, the view and controller components were merged to form the UI component, which caused some headaches when making significant changes; in future I would probably adhere more strictly to an existing pattern, like real MVC. Admittedly, in future I would also probably not design a UI in Java, but that's a separate issue.
Gradle generates two files:
./gradlew
and./gradlew.bat
, to handle gradle tasks on systems that don't actually have Gradle installed. The commandgradle TASK
can be replaced with./gradlew TASK
(on unix systems) or.gradlew.bat TASK
(on Windows).
From the root directory of the project, run the following command:
# if you're on a unix system
./gradlew buildRelease
# if you're on Windows
./gradlew.bat buildRelease
This will generate a zip archive in ./build/distributions
containing
unix and Windows binaries for the app, and a self-contained .jar
(generated by Shadow), which can be run on any system with a compatible
Java version.
If you'd like the project as it was submitted, run the following command:
# if you're on a unix system
./gradlew buildSubmission
# if you're on Windows
./gradlew.bat buildSubmission
This command will do the same as buildRelease, while also adding in the source files and some Eclipse compatibility files. Those are just there to ensure that when run in the target context (in Eclipse on Windows 10), no additional configuration is required.