Docsity

Flight Reservation System: Travel Ticket and Connection Patterns, Study Guides, Projects, Research of Applications of Computer Sciences

Toggle sidebar
bg1
1
Composing analysis patterns to build complex models:
Flight reservation
Abstract
In previous work we developed the concept of Semantic Analysis Patterns (SAPs).
SAPs are mini-applications realizing a few use cases selected so as to make them as
generic as possible. One of the objectives of this approach is to make SAPs a
convenient way for inexperienced modelers to build complex object-oriented models.
In this paper we show the use of SAPs to build complex analysis patterns from the
combination of simpler patterns. We also claim that this approach provides models
that are also extensible and reusable. We present here a case study (a flight
reservation system) showing how SAPs can be composed to build complex models in
a convenient way. In developing our set of patterns we created one pattern and
specialized some existing patterns in the context of flight reservations. These patterns
provide a common structure, that has to be present in any flight reservation system,
but they also can be of independent value.
__________________________________________________
Keywords: Analysis patterns, Composite patterns, Flight reservation systems, Flight
routing. Object-oriented analysis and design
1. Introduction
When dealing with the specification, design, or implementation of a number of
similar applications, common parts can be found. These parts can be specified as
patterns that are independent from a particular specification, implementation details,
or implementation language. Sometimes such modules are not so simple: a general
module that can satisfy different purposes is not trivial. Moreover, the more
complicated modules often vary slightly from application to application. As the
number of applications increases, their management becomes increasingly difficult
and unwieldy. In previous work [Fer00a], we developed the concept of Semantic
Analysis Pattern (SAP), which emphasizes functional aspects of the application
model as opposed to improving flexibility as in most design and analysis patterns.
The main purpose of this type of pattern is to serve as a starting point when
translating requirements into a conceptual model. A SAP represents a minimum
application (a set of basic use cases) so that it can be applied to a variety of situations
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download Flight Reservation System: Travel Ticket and Connection Patterns and more Study Guides, Projects, Research Applications of Computer Sciences in PDF only on Docsity!

Composing analysis patterns to build complex models:

Flight reservation

Abstract

In previous work we developed the concept of Semantic Analysis Patterns (SAPs). SAPs are mini-applications realizing a few use cases selected so as to make them as generic as possible. One of the objectives of this approach is to make SAPs a convenient way for inexperienced modelers to build complex object-oriented models. In this paper we show the use of SAPs to build complex analysis patterns from the combination of simpler patterns. We also claim that this approach provides models that are also extensible and reusable. We present here a case study (a flight reservation system) showing how SAPs can be composed to build complex models in a convenient way. In developing our set of patterns we created one pattern and specialized some existing patterns in the context of flight reservations. These patterns provide a common structure, that has to be present in any flight reservation system, but they also can be of independent value.


Keywords : Analysis patterns, Composite patterns, Flight reservation systems, Flight routing. Object-oriented analysis and design

1. Introduction

When dealing with the specification, design, or implementation of a number of similar applications, common parts can be found. These parts can be specified as patterns that are independent from a particular specification, implementation details, or implementation language. Sometimes such modules are not so simple: a general module that can satisfy different purposes is not trivial. Moreover, the more complicated modules often vary slightly from application to application. As the number of applications increases, their management becomes increasingly difficult and unwieldy. In previous work [Fer00a], we developed the concept of Semantic Analysis Pattern (SAP), which emphasizes functional aspects of the application model as opposed to improving flexibility as in most design and analysis patterns. The main purpose of this type of pattern is to serve as a starting point when translating requirements into a conceptual model. A SAP represents a minimum application (a set of basic use cases) so that it can be applied to a variety of situations

and it can be combined with other related patterns to describe more complex applications.

A possible way to build complex analysis models using SAPs was described in [Fer00a]. However, regardless of the methodology used to build the models, having a complex pattern as a building block makes this work simpler. We show here how to build a complex analysis pattern using a travel application as example. In this example, the composite pattern is built from some existing patterns and one new pattern. The application requirements are described in a common context for all the patterns.

Section 2 describes the requirement for this system while Section 3 presents the atomic patterns that satisfy these requirements. To describe each pattern we follow loosely the templates of [Bus96]. Section 4 shows how we compose these patterns to develop a flight reservation system. The effectiveness and flexibility of the complete application; in effect, a new SAP, is shown by domain analysis using some examples. We end with some conclusions in Section 5.

2. Requirements as common context

A flight reservation system is a commonly used system. Typically a customer places an order for seats in a combination of connected flights from an origin to a destination airport. The customer and the system need to check the feasibility of flight connections and their schedule. Because of the complexity of this application, it is difficult to build it as one unit. We show here that by composing some simple patterns we can build this application as a SAP in a systematic way. The atomic or component patterns correspond to specific functions of the system and can be either new patterns or existing patterns, perhaps specialized for the application. Because of the way the whole application is built, the resulting model is also flexible and reusable. The final composite system could also be the basis for a framework.

It is possible to visualize the structure of a large system as a set of component units, where each one is based on a different set of functional aspects. The list of requirements for the reservation system is given below. These requirements can be expressed as a set of use cases, which we do not describe in detail for conciseness. The most important requirements for this system are:

 A flight is defined by a number and a date, and defines a route from an origin airport to a destination airport. A plane is assigned to a flight and it contains a set of numbered seats.

 Customers make reservations for specific seats in specific flights.

one span (a nonstop flight). The set of Flights 12, 14 is an airlink from A to B. Flights 13 and 14 are basic airlinks connecting Airports D and B. However, Flight 14 has another span to get to Airport E, while Flight 13 has only one span.

Figure 1. Definitions for the requirements.

From these requirements, we derive some atomic patterns that describe specific aspects. The Connection pattern appears to be new, while Flight Route, Seat Collection, Airport Role, Travel Ticket, and Seat Assignment are instantiations of known patterns in a specific context. For each functional aspect, we use a corresponding pattern to implement it and make some adjustments to satisfy the context constraints. Figure 2 describes these patterns as a pattern language for travel. A Travel Ticket describes an air trip as a series of tickets that correspond to connecting flights ( Connection pattern). For each specific flight, a seat assignment must be obtained ( Seat Assignment pattern). Seat availability is determined by using the Seat Collection pattern (a flight implies a collection of seats). The connecting flights may use information from the airports through the Airport Role pattern. The common contexts for all these patterns are passenger transportation systems, including airlines, railways, water navigation, or bus systems, although for concreteness we use the notation of air transportation. Figure 2 can be seen as a metamodel that describes how these patterns should be connected to define a complete model.

Patterns can be expressed at different levels of abstraction. For example, a pattern for general customer orders can be specialized to order tickets. The specialized version can still be considered a pattern (and not a specific model) because there are many situations that require ordering a series of tickets, airline reservations being one

Airport A

a span of^ Airport C Flight 12

Flight 12(one stop at C)

Airport D Flight

Flight 14

Flight 16

Flight 17

Routes

Routes from A to D

Airport B

Connecting Flights of Flight 12

Flight 14

Airport E

Flight 13

Flight 18

Flight 15 (nonstop)

of the most important and probably the most complex. In particular, the Travel Ticket pattern is a specialization of the Order pattern [Fer00], where each flight corresponds to an order line, and the Seat Assignment pattern is a special case of the Assignment pattern [Fer05]. Section 3 presents all the component patterns.

Figure 2. A pattern language for flight reservations

3. Component patterns

We present here all the patterns described in Section 2. These are the building blocks

for the complex pattern.

3.1 Travel Ticket

Intent

Airport Role

Connection

Seat Assignment

Seat Collection

Flight Reservation

Flight Route

Travel Ticket

Schedules

Seat Assignment Airport Information

Flight Connections

Seat Booking

Seat Availability

Plane Assignment

Connecting Flight Spans

Describes Flight Describes a Route Trip

Describes a Route

Figure 4: Sequence diagram to order a set of tickets

Consequences  This pattern describes only the ordered tickets, it must be complemented with other aspects e.g., seat and flight information (although this information may appear in them too).

 TicketSeries in this pattern may be any other product with multiple units.

 The customer who places an order may be a person or a corporation. Here we only focus on the passenger who will get the ticket(s) and use it (them). We could use a customer with two roles for this purpose.

 The requested tickets refer to a series of products. Their relationship and detail processing are discussed later in other patterns.

 Delivery, payment, and identification details are not included.

Known uses

In several situations we need to issue a set of related tickets, e.g. air travel (a ticket for

each flight), railway tickets ( a ticket for each lef), concerts (subscription to a series of

concerts).

Related patterns

This is a specialization of the Order pattern [Fer00].

3.2 Seat Assignment

:Passenger :TicketSeries :TicketRoute :Ticket-1 :Ticket-

request (^) check availability check availability confirmed (Ticket-1) check availability confirmed (Ticket-2)

show-price confirmed (Ticket-n) … book (^) book ticket (Ticket-1) confirm (Ticket-1)

book ticket (Ticket-n) confirm (Ticket-n)

confirm (TicketSeries)

Intent

A TicketUnit is assigned to a Seat, Flight, and Span.

Problem How to indicate the assignment of a seat to a span of a flight and correlate it to a ticket unit for as given passenger?

Forces  For each right to go from one place to another in a particular flight we need to have a description. A TicketUnit is a representation of that right.

 A TicketUnit defines a seat reservation for a flight corresponding to a particular span. The seat may not be defined when the ticket is issued.

 To produce the Ticket Unit the availability of a seat and the feasibility of a connecting span and its connecting flight must be confirmed.

Solution This is a special case of a general assignment pattern, which can be used to assign resources [Fer05]. Flight, span, and seat correspond to a ternary association and the ticket unit that describes the assignment is an association class. Figure 5 shows classes Seat , Span , and Flight and their assignment to a TicketUnit. Ticket units are collected in a TicketSeries, which collects all the ticket units for a trip.

Figure 5: Class diagram for the Seat Assignment pattern

Consequences

 TicketUnit can provide the right to go in a specific span of a flight.

TicketSeries (^) TicketUnit

Flight

Seat

Span

{available seat#}

ticketseries#: String bookdate: String

origin: String destination: String

ticket#: String

flight#: String schedule: List<departure time, arrival time, stop> seat#: String

{connecting flights haveconnecting schedule}

1..*

{available series tickets}

{connected spans}

Assignment Pattern

association as classdependence of constraints

 Constraints defined on Seat help to confirm the available seats of a plane which is assigned to a flight.

Known uses Airplanes, trains, theatres, stadiums, have collections of seats, usually numbered.

Related patterns

This is a special case of the Whole-Part pattern of [Bus96]. The Whole-Part pattern describes

the aggregation of components that together define a semantic unit.

Figure 6: Class diagram for Collection pattern (Seat and Plane)

3.4 Self-Connection pattern

Intent

Describe relationships between objects in the same class.

Problem

Objects in a set may have relationships to some others of the same set. An airport is connected with another by an airlink. A span is connected to another if the destination

1..*

Flight flight#: String schedule: List<departure time, arrival time, stop>

Seat Seat#: String

Plane type: String no#: String seatCapacity: InfoList o classInfo: InfoList

1

assigned_to

a plane has a fixed number of seats in a class

of the preceding span is also the origin of the succeeding one. A span is also connected to another if the destination of the preceding span is connected with the origin of the succeeding one by other means of transportation. If there is another kind of connection between these two airports we use other-link (see Figure 7). A flight is connected to another if and only if airports between two connected spans have a connecting schedule such that the arrival time of a flight is before the departure time of the other flight. We need a convenient way to describe these connections.

Figure 7: Class diagrams for three instances of the Connection pattern

Forces

 An object may be connected to another object of the same type by a semantic relationship.

 The two ends of the relationship have different meanings, e.g., origin and destination of a flight.

Solution

The Connection Pattern describes self-associations in a class and satisfies these

forces. Figure 7 shows three instances of this pattern for connecting flights,

connecting spans, and connecting airports.

Consequences

 A connecting association is used to describe the connection between two related objects of the same type.

Airport

Flight (^) Span origin: String destination: String

flight#: String schedule: List<departure time, arrival time, stop>

name: String city: String

{connecting condition}

1..*

1

1..*

1

a_connected_by other_link

a_connecting

1..*

1

f_connecting

{connecting flights have connecting schedule} {connection betweendifferent spans} s_connecting

Connection Pattern Connection Pattern

Connection Pattern

A specialization of the Path Pattern [Sch91] satisfies the forces. The class model for that pattern is shown in Figure 8(a) and its application in our reservation system is shown in Figure 8(b). Figure 8b shows a flight including one route, which in turn, includes a subset of basic airlinks. This subset is described in association class Span.

Figure 8: Class diagram for Path pattern and its application in the reservation system

Consequences

 A span is a part of route of a flight, and the choice of a span is based on the available connected airlinks in a flight route. For the convenience of customers, we should list the airlinks of all the airlines. The customer's request would be satisfied if there is any available connecting span, even when it belongs to a different airline.

 Based on the pattern, connected basic airlinks in a route of a flight provide a set of available spans. A passenger may select a subset of airlinks in a route to form a span from its origin to destination. The trip can be extended by other connecting spans from the destination of the preceding span. With all the connected spans in different flight routes, a passenger may fulfill a series of trips from source to destination.

 Constraints defined on connecting flights and connecting spans require that class Airlink provide connections for different airlinks. The constraints on

Airlink

Route

Flight

Span

dependence of constraint

origin: String destination: String

flight#: String schedule: List<departure time, arrival time, stop>

airline_link#: String

origin: String destination: String

{connection between basic airlinks in a route}

{connection of airlinks between different routes}

1..* 1..*

(^1) subset 1 basic

1..* 1

{connecting flights must have connecting schedule}

{connection between different spans}

Airlink

Path

airline_link#: String

origin: String destination: String

1..* 1..*

1 1 basic subset

(a) (b)

connecting flights are based on the connection between two airlinks in different routes. The constraints on connecting spans are based on the connection between different spans. The dependence of constraints is shown explicitly in Figure 6(b).

Known uses

Routing of electric networks, transportation systems, water distribution systems.

Related patterns

[Sch91] describes pipes to fill vats with juice.

3.6 Airport Role pattern

Intent

To support the descriptions for different airlinks, the airports are classified as Origin, Intermediate, and Destination. An airport usually plays several roles.

Problem

How to model role aspects of an object as separate role objects that are dynamically attached to and removed from that object ( core object).

Forces

 An airport may have different roles for routes and spans at the same time. In a route, an airport and its connected airlinks indicate the available connections for a flight. In a span, an airport and its connected airlinks indicate the selection of reservations by the passenger.

 An airport may change its roles dynamically.

 Relationships between an airport and its roles are independent from each other so that changes to a role do not affect airlinks that are not involved in that role.

Solution

A specialization of the Role Object pattern [Bau00] can be used here. A core object

usually plays several roles and the same role is likely to be played by different core

objects. When a core object is currently playing the requested role, it is in a role

for him and his family (wife and daughter) to Dallas (from HK). Now B wants to

change his reservation and make a reservation for the friend and his family so that he

can stay with his friend at Dallas for two days.

Context

Section 2 shows the context for this pattern.

Forces

 The requested tickets and the relationships between them must be captured in a precise way. Requests may be individual or group requests.

 A customer‟s reservations may change over time and it should be easy to make these changes.

 The pattern must describe a fundamental semantic connection. This means the pattern must be simple enough to apply to a variety of related situations.

Figure 10: Some examples using the reservation system

Solution

Figure 11 combines all the patterns seen earlier and includes all their requirements. A Passenger books a Ticket Series consisting of some Ticket Units. The series defines some TicketRoutes , where each route is described by a Ticket Unit. A TicketRoute consists of one or more Flights. Each flight has Route defined by one or more Airlinks. A flight is assigned to a Plane, which has a set of seats to be used by

shanghai

Tokyo

Hongkong

Los Angeles (LAX) Dallas (DAL)

Miami (MIA)

New York (NY)

Customer A booked in Dallas, on 8/29/00. : round-trip, Dallas  Los Angeles 9/4/00. Customer B booked in Shanghai, on 7/8/00. : one New York-way, Shanghai  Los Angeles 9/11/00.  Miami 9/6/00,

Customer B changed his reservation. : one-way, Shanghai  Dallas 9/6/00. Customer B booked for his friend. : one-way, Hongkong  Dallas 9/4/00.

858 <W11:00am, W7:00pm>

368 <W4:30pm, W12:30pm>

898 <M9:00am, M9:00am>

804 <F9:00pm, S6:30am>

803 <M8:00pm, M11:30pm> <F6:00am, F2:30pm>

passengers. In each Span of a flight, some seats are available for use. A quaternary association relates ticket units to flights, spans, and seats. Airlinks connect Airports , which can have the roles of Origin, Intermediate , or Destination for a given airlink.

Example resolved

Using such a system, customer A can select an available flight among all those

passing through the span from DAL to LAX, i.e., 803 < M 8: 00pm, M 11: 30pm;

F 6: 00am, F 2: 30pm >, and select another to come back, i.e., 368 < W 4: 30pm, W

12: 30pm >. Although the route of flight 803 covers the span from LAX to DAL and

Figure 9: Class diagram for the reservation system

Figure 11. Class diagram for complete flight reservation system.

he may select flight 803 for his ticket, he does not use such a flight because he does

not want to wait until Friday. He removes the relationship of the ticket for the back

trip and resets it to an earlier flight (flight 368). He will get a series of tickets with

AirportRole

Airlink

Airport

Route

Plane

Passenger book TicketSeries

TicketRoute

TicketUnit

Flight Seat

Span

assigned_to

association as class implied relationship or dependence

{available seat#}

Origin Intermediate Destination

id(/account#): String creditInfo: String

ticketseries#: String bookdate: String

(^1) *

type: {one-way, round-trip} trip_source: String trip_destination: String (^) origin: String destination: String

ticket#: String

flight#: String schedule: List<departure time, arrival time, stop>

seat#: String

type: String no#: String seatCapacity: InfoList classInfo: InfoList

{a plane has a fixed number of seats in a class

name: String city: String

departure_time: Date parking_lot: Integer

arrival_time: Date departure_time: Date hotels: String

arrival_time: Date nearby_hotel: String

roleType: {route_t, span_t}

airline_link#: String

origin: String destination: String

0..*

core

roles

{connecting condition}

1..*

1

1..*

1

other_link

a_connected_by

a_connecting

{two connecting airlinks?}

{connection between basic airlinks in a route}

{connection of airlinks between different routes}

1..* 1..*

1 subset 1 basic

1..* 1

1..* 1

1..*

1

f_connecting 1..*

{connecting flights have connecting schedule}

1..

1..*

1..* {available series tickets}

{connection between different spans}

s_connecting

Figure 12: Domain analysis of a reservation system for customer A (round-trip)

After a request from his friend in Hong Kong, customer B wants to change his

reservation so that he can stay at Dallas with his friend for two days. He selects the

simplest span for him to go to DAL. Instead of using the connecting spans of flight

858 and flight 368, he selects the span directly to DAL from the basic airlinks in the

route of flight 858. After two days, he continues his trip to MIA using a connecting

span of connecting flight 804. It is advantageous here to keep most of the feasible

parts of the trip and change to a more convenient plan dynamically and easily. In

Figure 14, the customer only changes the connecting spans at DAL and chooses the

simplest span to reach DAL. The related connecting flights and the connecting spans

based on the basic airlinks of the routes which are already available in the system

provide an easy change (see Figure 14).

For the friend and his family, customer B selects flight 898 and makes a reservation

for three seats in the same trip. As shown in Figure 15, there is a series of one-way

tickets for the friend. Each ticket unit is assigned to the flight 898 (from HK to DAL),

a seat of the plane, and the span based on the route of such a flight. Except for the

seat, all the ticket units share the same information of this trip. Duplicate copies of the

information for airports and flights are avoided in such a system. This simplifies the

process of finding the feasible spans and available seats for all in the family. It also

facilitates the management of the information for airports and flights.