Component Design

Hotel Reservation System (HRS)

Version 1.0

Submitted in partial fulfillment of the requirements for the degree of Master of Software Engineering

Cem Oguzhan

CIS 895 – MSE Project

KansasStateUniversity

1.Introduction

The purpose of this document provides brief description and class diagrams of the application and classes for the Hotel Reservation System (HRS). A detail description of the methods and attributes is provided in the MSDN style documentation.

2.Hotel Reservation System

The Hotel Reservation System will provide service to on-line customers, travel agents, and an administrator. On-line customers and travel agents can make searches, reservations and cancel an existing reservation on the hotel reservation’s web site.Administrator can add/update the hotel and the room information approve/disapprove a new travel agent’s account application and generate a monthly occupancy rate report for each hotel.

2.1.Class Description and Diagrams

The class diagram below captures middle-tier, business specific layer, of the Hotel Reservation System. Business specific layer of the Hotel Reservation System consist of eleven classes, User, Customer, Travel Agent, Guest, Administrator, Mail, Database, Hotel, Room, Reservation and Error.

2.1.1.User

This class will handle user actions. User class is the super class of Customer and TravelAgent.

Attributes and methods:

  • m_userName : User’s user name
  • m_email : User’s e-mail address
  • m_password : User’s password
  • m_phone : User’s phone number
  • m_address : User’s address
  • m_city : City of the address
  • m_state : State of the address
  • m_zip : Zip code of the address
  • User() : Constructor
  • VerifyLogin() : It is responsible to authenticate and authorize the user to use secure sites
  • idValidUserName() : Checks the user name is unique or not when user creates an account
  • getUser() : Gets user information
  • The other methods are getters and setters for these variables

2.1.2.Customer

This class will handle customer actions. It inherits User class responsibilities.

Attributes and methods:

  • m_firstName : Customer’s first name
  • m_lastName : Customer’s last name
  • m_cardType : Customer’s credit card type
  • m_cardNumber : Customer’s credit card number
  • m_experationDate: Customer’s credit cards’ expiration date
  • Customer() : Constructor
  • createAccount() : It creates a customer account that the customer can be a member of the HRS
  • updateAccount() : It updates the customer account properties
  • The other methods are getters and setters for these variables

2.1.3.Travel Agent

This class will handle travel agent actions. It inherits User class responsibilities.

Attributes and methods:

  • m_companyName : Company name of travel agent
  • m_status : Travel agent’s account status (approved, disapproved, or waiting)
  • TravelAgent() : Constructor
  • requestAccount() : It handles travel agent’s account request
  • totalSales() : It calculates total sales of travel agent
  • salesCommussion() : It calculates sales commission of travel agent
  • The other methods are getters and setters for these variables

2.1.4.Guest

This class will handle guest information, when a travel agent makes a reservation.

It inherits from Customer.

Attributes and methods:

  • m_reservationNumber : Guest’s reservation confirmation number
  • Guest() : Constructor
  • reservationNumber() : It returns Guest’s reservation number
  • deleteGuest() : When the travel agent cancel the reservation, this method deletes Guest information of the reservation

2.1.5.Administrator

This class will handle administrator actions.

Attributes and methods:

  • m_userName : User name of Administrator
  • m_password : Password of Administrator
  • Administrator() : Constructor
  • VerifyLogin() : Responsible to authenticate administrator
  • getWaitingAgent() : Gets waiting travel agent’s account request
  • approveAccount() : Approves travel agent’s account request.
  • disApproveAccount() : Disapprove travel agent’s account request
  • occupancyReport() : Calculates occupancy rate for a hotel
  • The other methods are getters and setters for these variables

2.1.6.Mail

This class represents mail. It uses a virtual SMTP server. The Travel Agent and the Administrator class use the Mail class to send an e-mail.

Attributes and methods:

  • Mail() : Constructor
  • sendMail() : It sends an e-mail that Travel Agent’s account request is received
  • approveAccount() : it sends an e-mail that Travel Agent’s account request is approved
  • disApproveAccount() : It sends an e-mail that Travel Agent’s account request is disapproved

2.1.7.Error

Error class is responsible to write full stack trace to the Application Event Log, when an error occurs.

Attributes and methods:

  • EVENT_LOG_SOURCE: Source of error. (HRS)
  • Log() : Writes full stack trace to the Application Event Log

2.1.8.Database

All connection to the HRS’ database is provided by Database class. It will allow running queries against the HRS’ database.

2.1.9.Hotel

This class represents Hotel.

Attributes and methods:

  • m_hotelID : Hotel’s hotel id
  • m_name : Hotel’s name
  • m_street : Hotel’s address
  • m_city : City name of Hotel’s address
  • m_state : State name of Hotel’s address
  • m_zip : Zip code of Hotel’s address
  • m_phone : Hotel’s phone number
  • m_rating : Hotel’s star rating
  • Hotel() : Constructor method of Hotel class
  • isValidHotelID() : When the admin adds a new hotel into the database, this method checks that the hotel id is entered is unique or not
  • findHotel() : Finds hotel in particular city and state
  • getHotel() : Gets hotel information
  • newHotel() : Adds a new hotel into the database
  • updateHotel() : Updates hotel properties in the databes
  • numberofRoom() : Gets total number of room of the Hotel
  • occupancyRate() : Calculates occupancy rate of the Hotel
  • The other methods are getters and setters for these variables

2.1.10.Room

This class represents Room.

Attributes and methods:

  • m_roomNunber : Room number is a primary key that uniquely identify each room
  • m_price : Room’s price
  • m_bedType : Bed type of Room (Double, King)
  • m_smoking : Smoking type of Room
  • m_handicap_access : Accessible type of Room
  • m_roomLock : It is a time stamp that when was the last time is check out as an available room
  • Room() : Constructor method
  • isValidDoorNumber() : Checks the door number is unique or not entered by administrator when the admin adds a new room
  • getRoomAvl() : It has three overload methods. This method gets available rooms
  • getRoomAvlPrice() : It has two overload methods. This method gets available rooms by price
  • getRoom() : It has two overload methods. This method gets room by room number
  • getAllRoom() : Gets all rooms at the Hotel for editing
  • newRoom() : Adds a new room into the database
  • updateRoom() : Updates an existing room properties
  • The other methods are getters and setters for these variables

2.1.11.Reservation

This class is responsible for reservations.

Attributes and methods:

  • m_reservationNumber : Confirmation number for reservation
  • m_chekIn : Reservation’s check in date
  • m_checkOut : Reservation’s check out date
  • m_resvDate : The date of the reservation is made
  • m_price : Price of the room each day
  • m_totalCost : Total cost of the reservation
  • m_roomNumber : Reservation’s room number
  • m_userName : User name of the user, who makes the reservation
  • m_hotelID : Hotel’s hotel id of the reservation
  • Reservation() : Constructor method
  • makeReservation() : This method is called a make reservation on Customer site of the HRS
  • agentMakeReservation() : This method is called a make reservation on Travel Agent site of the HRS
  • getReservation() : Gets reservation by reservation number
  • cancelReservation() : Cancels valid reservation
  • calculateTotal() : Calculates total cost of the reservation before tax
  • calculateTax() : Calculates tax cost of the reservation
  • The other methods are getters and setters for these variables