Polymorpism and Domain Models
Polymorpism and Domain Models
Session 2024
Topics: polymorphism and domain models
Case study # 1
You have to implement a Vehicle Rental System. The vehicle can be a Car, Bike, or Truck. Each vehicle has a
unique number, brand, model, and rental price. A customer can rent any vehicle based on availability.
Each vehicle type has different rental calculation rules. Cars and Bikes are charged per day. Trucks are charged
per day plus an extra load fee. You can deposit and return vehicles.
The system manages Customer information. Customers have unique IDs, names, driving license details, and
contact information
Case study #2
You have to implement a Notification System for a mobile productivity app. Notifications can be sent through
multiple channels: Email, SMS, and Push Notifications.
Each notification type has a unique sending process. Emails are sent using SMTP, SMS via an SMS gateway,
and Push Notifications.
The system should allow each type to send messages using a common interface. The behavior of sending varies
with the channel.
The system manages User profiles. Each user has a unique ID, name, email, phone number, and preferences for
how they want to receive notifications.