Uploaded by Asma Pervaiz

Trip Booking System Class Diagram

advertisement
a) Classes:

User

Trip

Transport

Accommodation

Entertainment

Promotion

Ad
b) Associations – verb phrases:

User books Trip

Trip includes Transport

Trip includes Accommodation

Trip includes Entertainment

Promotion applies to Trip

Ad targets User
c) Associations - multiplicities:

User books 1 or more Trips (1 to *)

Trip includes 1 or more Transports (1 to *)

Trip includes 1 or more Accommodations (1 to *)

Trip includes 1 or more Entertainments (1 to *)

Promotion applies to 1 or more Trips (1 to *)

Ad targets 1 or more Users (1 to *)
d) Attributes:

User: name, email, password, payment_info

Trip: start_date, end_date, budget

Transport: type, departure_location, arrival_location, departure_time,
arrival_time, cost

Accommodation: name, location, room_type , check_in_time, check_out_time,
cost

Entertainment: name, location, age_range, opening_hours, cost

Promotion: discount_rate, start_date, end_date

Ad: content, image, link, start_date, end_date
e) Methods:

User: login(), logout(), register(), update_profil e(), book_trip(),
view_booked_trips(), flag_content()

Trip: add_transport(), add_accommodation(), add_entertainment(),
update_budget(), view_itinerary()

Transport: view_details(), book()

Accommodation: view_details(), book(), request_early_check_in(),
request_late_check_out()

Entertainment: view_details(), book()

Promotion: apply_discount()

Ad: view_details()
f) Complex features - generalisation and/or associative classes:
Generalization relationship exists between the User class and two subclasses
Customer and Employee. This relationship indicates that Customer and Employee
inherit all the attributes and methods of the User class.
g) (1 mark) a 2-3 paragraph description of the association chosen, including expansion of the
association details such as verb phrases and multiplicities, and justification for why this association
is one of the most important and interesting associations
One of the most important and interesting associations in this class diagram is the "User
books Trip" association between the U ser and Trip classes. This association represents
the action of a user booking a trip, which is the primary goal of this system. The
multiplicity of this association is one -to-many, which means that a user can book one
or more trips, while a trip can only be booked by one user.
The "User books Trip" association is also interesting because it involves other
associations such as "Trip includes Transport," "Trip includes Accommodation," and
"Trip includes Entertainment." These associations represent the compon ents of a trip,
and the "User books Trip" association brings them all together to create a complete
itinerary.
Furthermore, this association is important because it connects the user to the core
functionality of the system - booking trips. It also highlights the importance of user
authentication and security, as only authorized users should be able to book a trip.
Additionally, this association plays a crucial role in the financial aspect of the system,
as it involves the processing of payments and the mana gement of bookings.
Class Diagram:
User
Transport
-name
-email
-password
-payment_info
-login()
-update_profile()
-book_trip()
Trip
1
-start_date
-end_date
-budget
add_transport()
update_budget()
*
*
1
1
1
*
*
-type
-departure_location
view_details()
book()
1
Customer
Employee
-name
view_booked_trips()
*
-name
view_booked_trips()
*
Entertainment *
-opening_hours
-cost
view_details()
book()
1
1
Promotion
Ad
content
end_date
start_date
view_details()
*
discount_rate
start_date
apply_discount()
1
Accommodation
-location
-room_type
-check_in_time
request_early_check_in()
request_late_check_out()
Download