Professional Documents
Culture Documents
GT2D Doc C2B Katigbak Salvacion
GT2D Doc C2B Katigbak Salvacion
2.0
U nle a shing Possibilit ie s
REQUIREMENTS:
1. Create the following for the DLSL Reservation System that is described below.
a. Use Case Diagram
b. Class Diagram
c. Program with Implementation of Abstraction, Encapsulation, and Inheritance
The clients can book a reservation through via online or through a phone call where in details of
the reservation are given such as personal information, date and time of the reservation,
facilities to be reserved, number of guests, and others. The reservation fee should be paid 24
hours after the transaction. All the reservation transactions are being monitored by the front
desk officer. For online reservations, he verifies the payment checking the status of the
reservation. Once verified, he updates the record and confirms the transaction. If the booking
was made through a phone call, the front desk officer waits for the bank confirmation before
updating the status of the reservation. The front desk officer then sends the details of the
reservation to the clients. The clients can cancel the reservation by accomplishing the Cancel
Reservation form that is accessible only in DLSL’s website. To approve the cancellation request,
the front desk officer needs the authorization of the hotel manager. The hotel manager is also in
charge in monitoring all matters related to reservation transactions. During check in, the
receptionist attends to the needs of the clients as well as during check out.
2.0
U nle a shing Possibilit ie s
2.0
U nle a shing Possibilit ie s
USE CASE
CI TE
2.0
U nle a shing Possibilit ie s
CLASS DIAGRAM
CI TE
2.0
U nle a shing Possibilit ie s
The classes inputValidator, reservationInfo, and roomReservation in this code are abstractions
of the different parts of a room reservation system. Every class concentrates on particular
features while keeping the specifics of its implementation hidden from the users of the class.
Each class abstracts certain functionalities, focusing on specific aspects of the reservation
system. For instance, inputValidator abstracts the validation logic, reservationInfo abstracts
user details, and roomReservation abstracts room-specific information.
Encapsulation occurs in this code when the required data and methods for validating inputs,
providing reserve information, and handling hotel reservations are encapsulated in the classes
inputValidator, reservationInfo, and roomReservation, respectively. The classes encapsulate
the data (fullName, address, contactNum, etc.) and methods (inputInitialInfo(),
inputRoomDetails(), to guarantee data integrity and to give external code a clear interface with
which to work.
The code utilizes inheritance through a hierarchical structure of classes: the base class
inputValidator provides methods for input validation, which are inherited by the
reservationInfo class. This class manages user details and incorporates the validation methods
for email, contact number, and reservation date. The roomReservation class further extends
from reservationInfo, handling room-specific information and reservation processes. It
includes methods for gathering room details, managing payments, cancellation, and re-
booking. This inheritance approach ensures code reusability, centralizing validation methods
and promoting an organized structure for the reservation system.