Design of entity classes

The input of this step is the analyze entity class diagram. We need to process in the following steps:

  • Step 1: Add the id attribute for the classes which DO NOT inherit from other class: Hotel, Room, Client, Bill, Booking, BookedRoom, User, Service, UsedService.
  • Step 2: Add the type of each attribute in all classes
  • Step 3: Convert all association relationships to correspond aggregation/composition relationships:
    • Room + Booking -> BookedRoom is converted to: Room is a component of BookedRoom, BookedRoom is a component of Booking.
    • BookedRoom + Service -> UsedService is converted to: Service is a component of UsedService, UsedService is a component of BookedRoom.
  • Step 4: Add the object attributes which correspond to the aggregation/composition relationships:
    • Room is a component of Hotel, of type n-1 -> Hotel has a list of Room
    • Room is a component of BookedRoom, of type 1-n -> BookedRoom has a Room
    • BookedRoom is a component of Booking, of type n-1 -> Booking has a list of BookedRoom
    • Client is a component of Booking, of type 1-n -> Booking has a Client
    • User is a component of Booking, of type 1-n -> Booking has an User
    • User is a component of Bill, of type 1-n -> Bill has an User
    • Service is a component of UsedService, of type 1-n -> UsedService has a Service
    • UsedService is a component of BookedRoom, of type n-1 -> BookedRoom has a list of UsedService