You are on page 1of 18

Hotel

Management
System
Object oriented approach to UML design
By,
Nijith Jacob (2007A7PS076G)
Karandikar Rajas Hemant (2007A7PS046G)

Submitted in partial fulfilment of


Object Oriented Analysis And Design course (SS G514)

Under the guidance of


J.V RAO

11/23/2010
1

Acknowledgements
In the outset, we want to thank Prof. J.V. Rao for giving us this opportunity to familiarize practically
with Object oriented system analysis and design through this project. His ample guidance and
suggestions were invaluable in the successful completion of this project. Also, we thank BITS Pilani
Goa Campus for giving us all the necessary resources and also including this course as an elective.
Also we extend our gratitude to anyone who has directly or indirectly helped in this project.
2

Contents
Acknowledgements 1

Contents 2

Overview 3

Use Case Diagram 4

Class Diagrams 5

Class Descriptions 7

Object Diagram 11

Sequence Diagrams 12

Remarks 16

References 17
3

Overview
This project is concerned with developing a flexible, open-ended design for hotel management
information system that incorporates well-known design patterns and a lucid design style using UML
diagrams. Our Hotel Management System consists of two users:

1. Customer
a. Individual Customer
b. Company Customer
2. Staff
a. Manager
b. Other Employees

Customers can avail various services provided by the hotel like room reservation, restaurant, sauna,
pool, casino etc. The system keeps a record of the customer details and previous visits of current and
past customers so that privileges and points can be awarded based on their history. To keep the
system history database to acceptable levels of data, excessive records are automatically purged at
regular intervals. A Custo er’s histor o sists of his/her pre ious isits, o l o e of hi h a e
active (not completed) at any point in time. If no visits are active, then a new visit instance need to
be created that can contain the various services that the customer need to avail during a new visit. If
a visit instance is active, then any services availed are considered as part of that visit. Each visit is a
composition of services that the customer uses. Any particular service usage consists of a single
resource (e.g. Room No 110) that belongs to a particular service (e.g. Room Service). When a
customer requests a resource, the system checks for that availability of the resource and adds that
resource to the list of availed services during that visit. At the end of the visit, when all the service
usages are finished, system automatically calculates the cost of the visit and also any points that
need to be awarded based on this visit is computed as well. The customer has provision to redeem
any in-house points that the customer has been awarded.

Manager(s) is (are) concerned with the overall functioning of the system. He/she has the provision
to add new services or resources for any particular service. The system keeps track of the
expenditure incurred by the various ser i es hi h a e ie ed the a ager. The a ager’s
de isio aki g a e assisted ased o the arious ser i e’s usage, total e pe diture, total
income etc., all of which the system automatically keep track of.
4

Use Case Diagram


5

Class Diagrams
6

Class Diagrams
7

Class Descriptions
Class Name Attribute/Method Description
Customer name Customer/Company Name
addr Customer/Company Address
cust_class Bit Vector to determine
whether a particular resource
can be assigned to this
customer
calc_history_pts() Abstract method for calculating
in-house points awarded based
on history. Part of interface
Awardable.
notify() Notifies the point object
contained in the customer to
update the history points. Part
of Observer interface
Individual_cust dob Date Of Birth of the customer
Company_cust manager Ma ager’s a e of the
company
Point redeemed_pts Total points that the customer
has used so far
history_pts Total points that the customer
has been awarded based on
history
awardee Awardable (Customer) object
that implements the
calc_history_pts() method part
of Awardable interface
redeem_pts(pts) Avail Points. Call with negative
argument to award points.
update_pts() Update the history points by
calling the calc_history_pts()
method implemented by the
awardee
History history_count Static attribute that determines
the number of persistent
records to be stored.
prune_interval Interval in which excessive
records are removed (greater
than history_count)
visits_no Total number of visits so far
prev_expenditure Total expenditure by the
customer for records that has
been removed so far
total_expenditure Total expenditure so far
latest_visit The latest visit object part of
the history
pruner Timer class object that removes
8

excessive record every


prune_interval interval
update_expenditure() Updates the total_expenditure
based on all the visits so far
attach(visit) Append the visit to the visit list
detach(visit) Remove the visit object from
the list
notify() Notifies the customer object to
update the points. Part of
Observer interface
action_performed() The method implemented as
part of Action_Listener
interface. This method is
executed every prune_interval
interval and removes excessive
records
Payable start_date Start Date for the billing period
end_date End Date for the billing period
cost Total cost for the period
addition_cost Any additional cost charged
irrespective of the billing period
completion_status Indicate whether the
visit/service is finished
calc_cost() Abstract method that calculates
the cost incurred
notify() Abstract method that notifies
any dependent object when
status is set to completed. Part
of Observer interface
update_status() Abstract method that checks
whether the status can be
updated and updates the status
if necessary
add_cost(cost) Sums up the argument to
additional_costs
Visit no_services Total number of services
availed during this visit
calc_date_interval(service) Calculate the start and end
dates for the visit based on the
new service that was most
recently added (passed as
argument).
update_date_interval() Calculate the start and end
date based on start and end
dates for all the services availed
during the visit
calc_cost() Total cost incurred in the visit
notify() Notifies the history object to
update its expenditure and
notify the customer object if all
the services have been
9

completed
update_status() Sets the completion_status if all
the services have been
completed
attach_usage(usage) Attaches a new service usage to
the list
detach_usage(usage,penalty) Removes a service usage if it
has not been yet completed
and adds the penalty for
cancellation
Service_Usage usage_resource The resource been used
update_status() Sets the completion status,
updates the cost and call the
notify() method
notify() Notifies the visit object to
update its expenditure and
carry on the notification to
upper levels. The resource been
used is then freed.
calc_cost() Calculate the total cost incurred
for using the resource
find_resource(subtype,value = Find a free resource for the
NONE) customer. Subtype argement
represent a particular type of
resource that customer want.
Value argument is used when a
specific resource is required by
the customer
resource_cleanup() Free the reource
Service name Name of the service. It matches
the service name of all the
resources contained in the
service
run_cost_calc_interval The interval in which the run
cost is calculated by calling the
action_performed() method
part of Action_Listener
interface
total_run_cost Total run cost for the service so
far
expense_keeper Timer class for keeping the
expense
find_resource(class,subtype, Finds a free resource that can
value,start date,end date) be assigned to the customer
belonging to a particular class
matching the subtype and value
(if any) that does not interfere
with the required start and end
dates for usage.
free_resource(resource) Removes the resource from
usage_list
10

add_resource(resource) Adds a new resource.


remove_resource(id) Remove a resouce
Resource id Unique ID
service_name Name of the service that this
resource Is part of
value Specific value/name
subtype The general category to which
this reource belong
cust_class The Class of customer to which
this resource can be assigned
calc_cost(duration) Abstract method to calculate
the cost for the resource based
on duration
clean_up() Resets any resource specific
attributes. Called when a
resource is freed after usage
resource_idle_cost(duration) Expense incurred by the hotel
when resource Is idle for a
duration of time
resource_run_cost(duration) Expense incurred by the hotel
when resource Is used for a
duration of time
Service_Manager add_service(service) Adds a new service
rem_service(service) Remove an existing service
find_service(name) Finds a service based on name
calc_service_cur_usage(name) Calculate the percentage
current usage for a particular
service
calc_total_run_cost() Total run cost incurred by all
the services in the system
11

Object Diagram
12

Sequence Diagrams
13

Sequence Diagrams
14

Sequence Diagrams
15

Sequence Diagrams
16

Remarks
1. The project design can be considered more than a hotel management system design. The
design can be extended as a design pattern for a general scenario where customers interact
with a system for resources and the system keep track of customer history in the form of
persistent storage and award points/privileges based on that history.

For e.g. A Muti-user operating system environment where resources can be in the form of
shared resources like printer, storage, CPU time etc. and users are awarded points for their
greater use of the system.

2. The system is flexible in the sense that resources or services can be added / removed easily. The
system can easily adapt to any future advancements easily.

3. Observer Pattern and Composite Pattern are two design patterns that were incorporated into
the design
17

References
[1] Kim Hamilton and Russell Miles, Learning UML 2.0, O’Reill , April 2006

[2] Dan Pilone and Neil Pit a , UML 2.0 I a Nutshell, O’Reill , Ju e 2005

You might also like