
π Automotive Β· Class UML
An object model for a car rental service: branches, cars, customers, reservations, rentals and pricing.
Drawing diagramβ¦
Class diagram for car rental: Branch has many Cars; Car has a CarCategory (hatchback, sedan, SUV) and status; Customer with driving licence makes Reservations for a category at a branch; a Reservation becomes a Rental when a specific Car is assigned; Rental calculates the bill using a PricingPolicy and adds damage and fuel charges at return.
classDiagram
class Branch {
+String id
+String city
+availableCars(category) List~Car~
}
class Car {
+String regNo
+CarCategory category
+String status
}
class Customer {
+String id
+String name
+String licenceNo
}
class Reservation {
+String id
+DateTime pickupAt
+DateTime returnAt
+confirm()
+cancel()
}
class Rental {
+int startOdometer
+int endOdometer
+returnCar(fuelLevel, damages)
+bill() Decimal
}
class PricingPolicy {
+dailyRate(category) Decimal
+extraCharges(fuel, damages) Decimal
}
class CarCategory {
<<enumeration>>
HATCHBACK
SEDAN
SUV
}
Branch "1" --> "*" Car
Car --> CarCategory
Customer "1" --> "*" Reservation
Reservation "1" --> "0..1" Rental
Rental --> Car
Rental ..> PricingPolicy : usesEvery state of an electric vehicle charging session at a public charger, from plug-in to payment, including faults and idle fees.
A connected vehicle platform: the telematics unit in the car, the cloud services that collect data and send commands, and the owner's mobile app.
How a carmaker updates vehicle software over the air: campaign targeting, owner consent, download, safe installation and reporting.
A charge point operator's platform: chargers speaking OCPP, a central management system, driver app, payments and roaming.
Where each part of a fleet management system runs: GPS devices in trucks, cloud services for tracking and analytics, and apps for managers and drivers.
What happens when a rider books a cab: fare estimate, driver matching, pickup, the trip and payment.