OOAD-LAB-VI-SEM

Exercise 06

Drawing Class Diagram and Use Case Diagram for Hotel Management System

Aim

To draw the Class Diagram and Use Case Diagram for a Hotel Management System.

Theory

Procedure/Program

  1. Class Diagram:
    • Identify the main components of the Hotel Management System:
      • Customer: Attributes like customerID, name, email, phoneNumber, address.
      • Room: Attributes like roomNumber, roomType, roomStatus, pricePerNight, bedType.
      • Reservation: Attributes like reservationID, checkInDate, checkOutDate, status, room, customer.
      • Payment: Attributes like paymentID, paymentDate, amount, paymentMethod.
      • Staff: Attributes like staffID, name, role, salary, contactDetails.
      • Hotel: Attributes like hotelName, location, totalRooms, rating.
    • Define relationships:
      • Association between Customer and Reservation (a customer can have multiple reservations).
      • Association between Room and Reservation (a room can be reserved multiple times).
      • Association between Payment and Reservation (payment is linked to a reservation).
      • Association between Staff and Hotel (staff is associated with a hotel).
      • Aggregation between Hotel and Room (a hotel has many rooms).
    • Specify operations (methods):
      • Customer: Methods like bookRoom(), cancelReservation(), viewReservationHistory(), checkIn(), checkOut().
      • Room: Methods like checkAvailability(), updateRoomStatus(), viewRoomDetails().
      • Reservation: Methods like createReservation(), cancelReservation(), viewReservationDetails().
      • Payment: Methods like processPayment(), generateInvoice(), viewPaymentHistory().
      • Staff: Methods like manageReservations(), assignRoom(), viewStaffSchedule().
      • Hotel: Methods like addRoom(), updateRoomDetails(), viewAvailableRooms().
  2. Use Case Diagram:
    • Identify actors in the system:
      • Customer: The user who books rooms, checks in, makes payments, and views their reservations.
      • Hotel Staff: The user who manages reservations, assigns rooms, and processes check-ins.
      • Admin: The user who manages the overall hotel operations, such as adding rooms and staff.
    • Identify use cases:
      • For Customer: Book Room, Cancel Reservation, Check In, Check Out, Make Payment, View Reservation.
      • For Hotel Staff: Assign Room, Manage Reservations, Check In, Check Out, Process Payment.
      • For Admin: Add Room, Add Staff, Update Room Details, View Reservations.
    • Draw the system boundary:
      • Draw a rectangle representing the system’s boundary and place the use cases inside it.
      • Connect the actors (Customer, Hotel Staff, Admin) to the use cases they interact with.
      • Use relationships such as include or extend for actions that depend on others. For example, Book Room may include Check Availability before allowing a booking.

Output/Explanation

alt text

alt text

Explanation: