Professional Documents
Culture Documents
Review-1
Overview
Database
Database design
Activity Diagram
Authenticate Interface
Variable username, password, email Boolean Authenticate (String username, String password);
This method checks if the user name and password input is a valid input. If true, it will return true; otherwise, return false.
This method is used to register a new user. If the register is successful, return true; otherwise, return false. This method checks to see if the user is still active when it doesnt reponse in a certain amount of time.
Flight Interface
Search Interface
This class has only one method Search. Maybe can be combined with the Flight class. Flight Search_oneway (String from_city, String to_city, Date dept_time, Date arr_time, int num_of_Seat) Flight Search_round (String from_city, String to_city, Date dept_time, Date return_time, int num_of_Seat) Given the search criteria, searches the database looking for flights that match the criteria.
Creditcard Interface
User_id Card_number Type Year Month Boolean IsValid() String GetNumber() String GetType() Number GetYear() Number GetMonth()
Methods
Reservation Info
A class about the reservation information. Variables
ReserveAndPurchase Method
Methods
Boolean Reserve(String Reservation_id, String User_id, Flight flightobj, Creditcard cc, Date Reservation_date, Integer Num_of_seats, String [] Passenger_name) Boolean CancelReservation () Reservation ReadReservation() Boolean Purchase() If the action is successful, return True; otherwise, return False.
Possible Solution: two phase commit procotol can be used. Or make full use of the COMMIT, ROLLBACK command in the database. Implement an IsAlive function which ping the client or server to make sure that it is still active.
Synchronization
Use monitor method in the Reserve method to make sure there is no client reserving the same ticket at the same time
Data replication
Use data replication techniques to improve the reliability of the system. Use primary copy method to enhance the consistency of the data.