(Week 9 - OOP Exercise | Object-Oriented Programming Course | Software and Systems Engineering - LUT University)
This repository demonstrates a rally championship management system built with Java. It includes classes for drivers, cars, races, and a central manager to handle registrations and results.
https://drive.google.com/file/d/1Yxc5sg7h0ajB80NXP2dW3c97EAP1sccR/view?usp=sharing
com/main
package has the following .java
files:
Main.java
- Entry point for the Rally Championship Management System.ChampionshipManager.java
- Manages drivers, races, and championship statistics.ChampionshipStatistics.java
- Provides utility methods for calculating championship statistics.RallyRaceResult.java
- Represents the results of a single rally race.RaceResult.java
- Interface defining methods for race result management.RallyCar.java
- Abstract class representing a generic rally car.AsphaltCar.java
- Represents a car optimized for asphalt surfaces.GravelCar.java
- Represents a car optimized for gravel surfaces.Driver.java
- Represents a rally driver with attributes like name, country, and car.
- Compile the project.
- Run the
Main
class to see the championship workflow.
All required classes and interfaces are properly defined (e.g., Driver
, ChampionshipManager
) and used to handle driver registration, race simulation, and result management.
- Single Responsibility: Classes handle distinct responsibilities (e.g.,
Driver
manages driver details,RallyRaceResult
manages race data). - Open/Closed: Classes can be extended without altering existing code.
- Liskov Substitution: Subtypes like
GravelCar
andAsphaltCar
inherit fromRallyCar
and behave as expected. - Interface Segregation: Interfaces contain the necessary methods, promoting minimal dependencies.
- Dependency Inversion: Higher-level modules depend on abstractions (e.g., manager depends on interface-like structures).
The ChampionshipManager
uses relevant static methods or members where necessary to handle global state or instances.
ChampionshipManager
implements the Singleton pattern to ensure there is only one active manager for the entire application.