Skip to content

Domain Model Iterations

gtjarvis edited this page Feb 23, 2021 · 47 revisions

Note: For the Umple code I put Java syntax highlighting in markdown since it's close enough and umple wasn't recognized.

1. Version 1.0 (final version):

Untitled-Diagram-2.png


Brief rationale for Domain Model:

Classes

  • RepairSystem: The object which contains the general information about the repair shop
  • Person: The superclass containing the shared attributes between the Mechanic, AdministrativeAssistant and Customer class.
  • Administrative Assistant: Class providing the administrative assistant has exclusive power in maintaining and creating the schedule and the available spots, a class for the administrator was required. The object also contains the personal information and credentials of the administrator.
  • Customer: Object that contains the credit card and/or debit card information in order to make transactions when booking appointments.
  • Mechanic: Object that contains the personal information, expertise and all past and upcoming appointments of an employee of the repair shop.
  • Car: Object that contains the general information of a car. This can range from the type of car or if the car has its winter tires installed.
  • TimeSlot Object that contains temporal information.
  • Appointment: Object that contains all relevant information ( includes the images of the car provided by the client, time of appointment, service required, mechanic required ) for the booked meeting.
  • Service: Object that contains the cost for the service, the require service for the desired appointment, the mechanic required to provide desired service and the appointment.

    Design Decisions

  • Person class is the superclass to the Mechanic, AdministrativeAssistant and Customer class since multiple attributes and methods are shared among the different actors.
  • Car class was necessary to store information about the car ( history, number of kilometers, if it has winter tires etc.). The price for a service depends on the type of the car.
  • Image class was created because it will provide additional information for a mechanic (ie, it will allow customers to attach multiple images to their appointment).
  • TimeSlot class: The mechanics provide their availabilities to the administrator. Based on their expertise, service offered and availabilities, the system will provide a list of times ( i.e. time slot) which represents the working hours for a particular mechanic. Since an appointment requires a mechanic, the availability and the length of the appointment will depend on the working hours of a mechanic. It is necessary to have a time slot class to build the mechanic's and repair shop schedule.
  • Customer class: has a Date lastActive attribute which represents the day they were last active. After 5 years of inactivity, the system will remove the account from the database. This will ensure a better management of the memory space in the database.
  • Appointment class: has a AppointmentStatus status which represents an enumeration (CarReceived, inProgress, Completed). Once the status is changed to completed, the customer will receive a notification. Having this attribute will allow customers to keep track of the progress of their appointment and will allow them to do other things during their appointments.
class RepairSystem
{
  1 <@>- * Person;
  1 <@>- * Service;
  1 <@>- * Appointment;
  1 <@>- * TimeSlot;
  String shopName;
  String address;
  int spaceAvailable;
  int numOfEmployees;
}

class Person
{
  String name;
  int id;
  String password;
  int phone;
  String email;
}

class Customer
{
  isA Person;
  String creditHash;
  String debitHash;
  String address;
  Calendar lastActive;
}

class Mechanic
{
  isA Person;
  * -- * TimeSlot workHours;
  * -- 1..* Service capabilities;
}

class AdministrativeAssistant
{
  isA Person;
}


class Appointment
{
  * -- 1 TimeSlot appointmentTime;
  * -- 1..* Mechanic m;
  * -- 1 Customer c;
  * -- 1..* Service requireServices;
  1 <@>- * Image;
  String note;
  int appointmentId;
  enum AppointmentStatus {CarReceived, InRepair, Completed};
    AppointmentStatus status;
}

class TimeSlot
{
  Time startTime;
  Time endTime;
  int timeId;
  Date date;
 
}

class Service
{
  enum ServiceType {CarRepair, OilChange, RegularCheckup, CarWash, TireChange, RoadsideAssistance, Towing, CarInspection, Other};
  ServiceType type;
  int price;
}

class Image
{
  int imageId;
  String url;
}


class Car
{
  * -- 1 Customer;
  1 -- * Appointment;
  enum CarType {Sedan, Coupe, Sports, Hatchback, MiniVan, StationWagon, Convertible, Truck, SUV, Other};
    CarType type;
  boolean winterTires;
  int carId;
  int numOfKilometers;
}

2. Preliminary Version

Version 0.5

  • By subteam 1 (Norman and Thomas):
    • Diagram:
* Code:
class User
{
    String name;
    int id;
    String password;
}

class Customer
{
    isA User;
    String creditHash;
    String address;
}

class Mechanic
{
    isA User;
    * -- * TimeSlot workHours;
    * -- 1..* Service capabilities;
}

class AdministrativeAssistant
{
  isA User;
}

class Appointment
{
    * -- 1 TimeSlot appointmentTime;
    * -- 1..* Mechanic;
    * -- 1 Customer;
    * -- 1..* Service requiredServices;
  
    String note;
    Image image;
    1 -- * Image;
}

class TimeSlot
{
    Time startTime;
    Time endTime;
}

class Service
{
    enum TypeOfService {CarRepair, OilChange, RegularCheckup, CarWash, TireChange, RoadsideAssistance, Towing, CarInspection, Other};
    TypeOfService type;
}


class Image
{
}
  • By subteam 2 (Catherine, Sia and Annabelle):

    • Diagram:

Version 1.0:

  • Diagram:

  • Code:

class RepairSystem
{
    1 <@>- * User;
    1 <@>- * Service;
    1 <@>- * Appointment;
    1 <@>- * TimeSlot;
    String shopName;
    String address;
    int spaceAvailable;
    int numOfEmployees;
}

class User
{
    String name;
    int id;
    String password;
    int phone;
    String email;
}

class Customer
{
    isA User;
    String creditHash;
    String debitHash;
    String address;
}

class Mechanic
{
    isA User;
    * -- * TimeSlot workHours;
    * -- 1..* Service capabilities;
}

class AdministrativeAssistant
{
    isA User;
}

class Appointment
{
    * -- 1 TimeSlot appointmentTime;
    * -- 1..* Mechanic;
    * -- 1 Customer;
    * -- 1..* Service requireServices;
    1 <@>- * Image;
    String note;
  
    enum AppointmentStatus {CarReceived, InRepair, Completed};
    AppointmentStatus status;
}

class TimeSlot
{
    Time startTime;
    Time endTime;
}

class Service
{
    enum ServiceType {CarRepair, OilChange, RegularCheckup, CarWash, TireChange, RoadsideAssistance, Towing, CarInspection, Other};
    ServiceType type;
    int price;
}

class Image
{
}

class Car
{
    * -- 1 Customer;
    1 -- * Appointment;
    enum CarType {Sedan, Coupe, Sports, Hatchback, MiniVan, StationWagon, Convertible, Truck, SUV, Other};
    CarType type;
    boolean winterTires;
    int numOfKilometers;
}