How joaopsoliveira03/estg-ed works
Project type and purpose
• This is a Java-based monolithic application that bundles:
• A custom “Java Data Structures” library (Collections, Graphs, Lists, Queues, Stacks, Trees, HashTables)
• A “Game” core API that uses those data structures to implement game logic (Entities, Utilities, Exceptions)
• A console-based management UI (“GameManagement” menus for players, locals, routes, shortest paths)
• A PlayerSimulator/demo module
• JSON-based persistence (gameData.json, players.json, etc.) loaded via json-simple
• A Maven build (pom.xml) with unit tests (GameTest.java)
File structure and infer layers
• src/main/java/Collections → custom data structures library
• src/main/java/Game → core game API and model (Entities, CustomCollections extension, Enumerations, Exceptions, Utilities)
• src/main/java/GameManagement → console UI layer (menus, commands, shortest-path computation)
• src/main/java/PlayerSimulator → sample client/demo that drives the Game API
• src/main/java/Main.java → application entry point that ties the GameManagement menus and PlayerSimulator
• src/main/resources → external dependencies (json-simple) and JSON files for persistence
1. Collections Library Module
– Packages: Collections/Graphs, …/Lists, …/Queues, …/Stacks, …/Trees, /HashTables, /Exceptions, SortSearch
– Provides ADTs and algorithms
2. Game Core Module
– Game/API: Game.java, GameImpl.java
– Game/Entities: domain objects (Player, Local, Portal, Connector, Team, associations)
– Game/CustomCollections: ExtendedNetwork
– Game/Utilities, Game/Exceptions
3. Persistence & Configuration
– JSON files (gameData.json, players.json, locals.json, routes.json, shortestPath.json)
– JSON-simple library (json-simple-1.1.1.jar)
4. Console UI / Application Layer
– GameManagement: MainMenu, PlayersManagementMenu, LocalsManagementMenu, RoutesManagementMenu, ShortestPaths
– Main.java entry point
5. Client / Simulator
– PlayerSimulator/PlayerDemo.java
6. Build & Test
– Maven (pom.xml)
– Unit tests (GameTest.java)
• Console UI → invokes → Game Core API
• PlayerSimulator → invokes → Game Core API
• Game Core → delegates to → Collections Library for data structures and graph algorithms
• Game Core ↔ Persistence Layer (loads/saves JSON via JSON-simple)
• GameManagement & PlayerSimulator ← configuration/read JSON files
• Main ← wires up UI menus and/or Simulator calls
Architectural patterns & principles
• Layered architecture:
• Data Structures layer (low-level, reusable)
• Domain / Core layer (business rules, Entities, Exceptions)
• Application / UI layer (console menus, user workflows)
• Infrastructure layer (JSON persistence, external lib)
• Separation of concerns: each module has a clear responsibility
• Dependency direction: higher layers depend on lower layers; no cyclic dependencies
Technology call-outs
• Java 8+
• Maven for build, dependency management (pom.xml)
• JSON-simple for parsing JSON configuration/persistence
• JUnit (or similar) for unit testing