Presentation

Download Report

Transcript Presentation

Airline Reservation System
Dr.Paul Schragger
Distributed Systems
Presented By
Archana Annamaneni
INTRODUCTION
The software used to drive real-world airline reservations is complex.
It needs to respond to thousands of simultaneous users and interact
with constantly changing flight data.
The airline reservation software developed in this project, only models
a small number of transactions
Technology:JAVA RMI
PURPOSE
The primary purpose of doing this project is to learn the concepts of
distributed systems and to learn JAVA RMI technology.
Transferring data is basic computational operation. Java’s message-method
paradigm transfers data from a calling object to a called object within a single
Java virtual machine.
We can cross virtual machine boundaries using sockets, to transfer data from
one host to another .If we consider both paradigms- method calls and sockets –
achieves the same goal: the transfer of data.
If we consider the two methods, it’s easier to invoke a method than to send a
message over a socket. And RMI achieves to send data to a remote host as
easily as we invoke a method.
Architecture
Database
USE-CASES
Actor searches for a flight
Actor makes reservation
Actor searches for an active reservation
Activity Diagram
desired flight exists
Actor selects a flight
Actor makes
reservation
Actor searches for a flight
Actor leaves
Actor looks for
active reservation
Implementation
The following are the three transactions implemented in the project
Search Flights: returns each flight details stored in the database
Book Seat: It does a reservation for a specified passenger and a flight.
The transaction makes several simplifying assumptions like the
passenger and flight must already exist as entities; the transaction does
not create new passengers or flights. It informs if the flight does not
exist, and if it does not reserve a seat.
Show Reservation: returns the reservation information for a specific
passenger identified by passenger number. It informs if the passenger
does not exist
Class Diagram
Actor Searches For A Flight
Actor makes reservation
Actor looks for an active reservation
Issues Covered Related To DS
Scalability
Concurrency
Openness
int theReservationNo =
si.lockSeat(theConnection,flight_no ,passenger_no);
String query = "Delete From LockedSeat Where
ReservationNo ="+theReservationNo;
int n = st.executeUpdate(query);
Reservation res = new Reservation(theReservationNo , flight_no ,passenger_no);
int reser = res.dbWrite(theConnection);
Flight flight =Flight.getInstance(db,flight_no);
Int reservations=flight.getReservations();
Flight.serReservations(reservations-1);
Flight.dbWrite(db);
db.commit();
int seats = flight.getSeats();
int reservations = flight.getReservations();
if(reservations >=seats)throw new
FlightBookedException();
flight.setReservations(reservations+1);
flight.dbWrite(db);
query ="Insert Into
LockedSeat"+"(ReservationN,FlightNo
,PassengerNo,TimeStamp) Values
('"+theReservationNo+"','"+theFlightNo+"','"
+thePassengerNo+"','" +new Timestamp(new
date())+"')";
int up = st.executeUpdate(query);
db.commit();
Key Technology:RMI
RMI Registry
A naming service is an application that runs on a central server and functions
like a phone book
In RMI , the default naming service that ships with JDK is called the RMI
Registry
Server: serverInterface s = new serverImpl();
Naming.rebind(“rmi://localhost:1099/ARServer”,s);
Client: serverInterface theServer
=(serverInterface)Naming.lookup(“rmi://localhost/ARServer”)
Key Technology Continued……
theServer.searchFlights()
marshal parameters
send request
unmarshal parameters
invoke implementation
return Flight[]
impl
skel
stub
receive return(or exception)
marshal return(or exception)
send reply
unmarshal reply
return value(throw exception)
Conclusion
How Important Design and Analysis is?
Real time problems while developing a
distributed application
Ways to implement Synchronization