This project is a Java application where I practiced using listeners, Gson for JSON parsing, interfaces, and various Java concepts. The application manages a library of media items, including books, movies, audiobooks, and magazines. It demonstrates how to read JSON files, implement interfaces, and use the observer pattern for event handling.
- JSON Parsing: Uses Gson to parse JSON files containing information about books and movies.
- Interfaces: Defines a
Media
interface and implements it in classes likeBook
,Movie
,AudioBook
, andMagazine
. - Observer Pattern: Implements the observer pattern to notify observers about changes in the library.
- Library Management: Manages a collection of media items and allows updating their prices.
The workspace contains the following folders:
src
: Contains the source code and JSON files.lib
: Contains the Gson library dependency.bin
: Contains the compiled output files.
- Ensure you have Java installed on your system.
- Clone the repository and navigate to the project directory.
- Compile the Java files:
javac -d bin -cp lib/gson-2.11.0.jar src/Java/*.java
- Run the application:
java -cp bin;lib/gson-2.11.0.jar Java.App
- Gson: A Java library used to convert Java Objects into their JSON representation and vice versa.
You can customize the folder structure by updating the settings in .
For more details on managing dependencies in Visual Studio Code, refer to the VS Code Java Dependency Management documentation.