Beruflich Dokumente
Kultur Dokumente
The web based “airline reservation system” project is an attempt to stimulate the
basic concepts of airline reservation system. The system enables the customer to do
the things such as search for airline flights for two travel cities on a specified date,
choose a flight based on the details, reservation of flight and cancellation of
reservation.
The system allows the airline passenger to search for flights that are available
between the two travel cities, namely the “Departure city” and “Arrival city” for a
particular departure and arrival dates. The system displays all the flight’s details
such as flight no, name, price and duration of journey etc.
After search the system display list of available flights and allows customer to
choose a particular flight. Then the system checks for the availability of seats on
the flight. If the seats are available then the system allows the passenger to book a
seat. Otherwise it asks the user to choose another flight.
To book a flight the system asks the customer to enter his details such as name,
address, city, state, credit card number and contact number. Then it checks the
validity of card and book the flight and update the airline database and user
database. The system also allows the customer to cancel his/her reservation, if any
problem occurs.
ANALYSIS
2.REQUIREMENTS ELICITATION:
SOFTWARE:
FORNT END :JAVA,HTML,SERVLETS
BACKEND : ORACLE 10i
OPERATING SYSTEM : WINDOWS XP
Use-case view
4. IDENTIFICATION OF ACTORS
Actors are not part of system.
Actors represent anyone or anything that interacts with (input to receive output
from) the system.
An actor is someone or something that:
Ø Interacts with or uses the system.
Ø Provides input tot and receives information from the system.
Ø Is external to the system and has no control over the use cases.
Actors are discovered by examining:
Ø Who directly uses the system?
Ø Who is responsible for maintaining the system?
Ø External hardware used by the system.
Ø Other systems that need to interact with the system.
The need of the actor are used to develop use cases. This insures that the system
will be what the user expected.
Graphical Depiction
An actor is a stereotype of a class and is depicted as “stickman” on a use-case
diagram.
Naming:
UML notation
UML notation:
2) Select Flight
After searching from the list of available flights the choose flight enables the
traveler to choose a flight. Then it checks the availability of seats on that flight. If
the scats are available then it allows the traveler to book a seat, otherwise it asks the
traveler to choose another flight. UML notation:
3) Book Flight
After choosing a flight, the traveler books the flight by using book flight
system. To book a seat the traveler first enters his details. The system then checks
the credit card and books the ticket and sends confirmation to user.
UML notation:
4) Cancel Flight
This use case is utilized by traveler. It enables the traveler to cancel his/her
reservation if any problem occurs.
UML notation:
USE-CASE DIAGRAM
Definition: A Use-case diagram graphically represents system behavior (use
cases). These diagrams present a high level view of how the system is used as
viewed from an outsider’s (actor’s) perspective. A use-case diagram may contain
all or some of the use cases of a system.
Association Relationship:
An association provides a pathway for communication. The communication
can be between use cases, actors, classes or interfaces. Associations are the most
general of all relationships and consequentially the most semantically weak. If two
objects are usually considered independently, the relationship is an association.
Associations are of two types
1) Uni-directional association.
2) Bi-directional association.
Graphical Depiction
An association relationship is an orthogonal or straight solid line with an
arrow at one end:
In An Association Relationship, we can provide Stereotype
COMMUNICATE also as shown below
Dependency Relationship:
A dependency is a relationship between two model elements in which a
change to one model element will affect the other model element. Use a
dependency relationship to connect model elements with the same level of
meaning. Typically, on class diagrams, a dependency relationship indicates that the
operations of the client invoke operations of the supplier.
We can provide here
1. Include Relationship.
2. Extend Relationship
1. Include Relationship
Multiple use cases may share pieces of the same functionality. This
functionality is placed in a separate use case rather than documenting it in every
use case that needs it
Include relationships are created between the new use case and any other use
case that “uses” its functionality.
An include relationship is a stereotyped relationship that connects a base use
case to an inclusion use case. An include relationship specifies how behavior in the
inclusion use case is used by the base use case.
2. Extend Relationship
An extend relationship is a stereotyped relationship that specifies how the
functionality of one use case can be inserted into the functionality of another use
case. Extend relationships between use cases are modeled as dependencies by
using the Extend stereotype. An extend relationship is used to show
Ø Optional behavior
Ø Behavior that is run only under certain conditions such as triggering an alarm
Ø Several different flows that may be run based on actor selection
Ø An extend relationship is drawn as a dependency relationship that points from the
extension to the base use case
The extend relationship sample demonstrates how you can use an extend
relationship to connect use cases. The sample illustrates two important aspects of
extend relationships:
Ø An extend relationship shows optional functionality or system behavior.
Ø A base use case does not need to acknowledge any specific extended use cases The
sample below shows a diagram containing an actor interacting with a web site. The
Customer has the option of buying merchandise online as shown through the
extend relationship.
Finally we can conclude
Ø Extend is used when you wish to show that a use case provides additional
functionality that may be required in another use case.
Ø Include applies when there is a sequence of behavior that is used frequently in a
number of use cases, and you want to avoid copying the same description of it into
each use case in which it is used.
7. FLOW OF EVENTS:
9. ACTIVITY DIAGRAM
An Activity diagram is a variation of a special case of a state machine, in
which the states are activities representing the performance of operations and the
transitions are triggered by the completion of the operations. The purpose of
Activity diagram is to provide a view of flows and what is going on inside a use
case or among several classes. We can also use activity diagrams to model code-
specific information such as a class operation. Activity diagrams are very similar to
a flowchart because you can model a workflow from activity to activity.
An activity diagram is basically a special case of a state machine in which
most of the states are activities and most of the transitions are implicitly triggered
by completion of the actions in the source activities.
Ø Activity diagrams represent the dynamics of the system.
Ø They are flow charts that are used to show the workflow of a system; that is, they
show the flow of control from activity to activity in the system, what activities can
be done in parallel, and any alternate paths through the flow.
Ø At this point in the life cycle, activity diagrams may be created to represent the
flow across use cases or they may be created to represent the flow within a
particular use case.
Ø Later in the life cycle, activity diagrams may be created to show the workflow for
an operation.
Activity diagrams contain activities, transitions between the activities,
decision points, and synchronization bars. In the UML, activities are represented as
rectangles with rounded edges, transitions are drawn as directed arrows, decision
points are shown as diamonds, and synchronization bars are drawn as thick
horizontal or vertical bars as shown in the following.
Activities:
An activity represents the performance of some behavior in the workflow.
Transitions:
Transitions are used to show the passing of the flow of control from activity
to activity. They are typically triggered by the completion of the behavior in the
originating activity.
Decision Points:
When modeling the workflow of a system it is often necessary to show
where the flow of control branches based on a decision point. The transitions from
a decision point contain a guard condition, which is used to determine which path
from the decision point is taken. Decisions along with their guard conditions allow
you to show alternate paths through a work flow.
Synchronization Bars
In a workflow there are typically some activities that may be done in
parallel. A synchronization bar allows you to specify what activities may be done
concurrently. Synchronization bars are also used to show joins in the workflow;
that is, what activities
must complete before processing may continue. Means, a synchronization bar may
have many incoming transitions and one outgoing transition, or one incoming
transition and many outgoing transitions.
Swim lanes
Swim lanes may be used to partition an activity diagram. This typically is
done to show what person or organization is responsible for the activities contained
in the swim lane.
Initial and Final Activities
There are special symbols that are used to show the starting and final
activities in a workflow. The starting activity is shown using a solid filled circle
and the final activities are shown using a bull’s eye. Typically, there is one starting
activity for the workflow and there may be more than one ending activity (one for
each alternate flow in the workflow).
Modeling a workflow in an activity diagram can be done several ways;
however, the following steps present just one logical process:
1. Identify a workflow objective. Ask, “What needs to take place or
happen by the end of the workflow? What needs to be accomplished?” For
example, if your activity diagram models the workflow of ordering a book
from an online bookstore, the goal of the entire workflow could be getting
the book to the customer.
2. Decide the pre and post-conditions of the workflow through a start
state and an end state. In most cases, activity diagrams have a flowchart
structure so start and end states are used to designate the beginning and
ending of the workflow. State and end states clarify the perimeter of the
workflow.
3. Define and recognize all activities and states that must take place to
meet your objective. Place and name them on the activity diagram in a
logical order.
4. Define and diagram any objects that are created or modified within
your activity diagram. Connect the objects and activities with object flows.
5. Decide who or what is responsible for performing the activities and
states through swim lanes. Name each swim lane and place the appropriate
activities and states within each swim lane.
6. Connect all elements on the diagram with transitions. Begin with the
“main” workflow.
7. Place decisions on the diagram where the workflow may split into an
alternate flow. For example, based on a Boolean expression, the workflow
could branch to a different workflow.
8. Evaluate your diagram and see if you have any concurrent workflows.
If so, use synchronizations to represent forking and joining.
9. Set all actions, triggers and guard conditions in the specifications of
each model element.
LOGICAL VIEW
Actor Action
1. None
3. The actor (Customer) selects a product.
5. Prepare for order
System Response
2. Displays list of Products.
4. Displays a list of all details for ordering a product.
6. Presents a message confirming that the order has been allotted.
Here objective is to find a set of classes that can interact to realize the use case. In
this case, we know from the use case diagram that the traveler is the actor for this
use case. The use case description tells us that traveler search for the flight by
giving arrival and departure city. The objective of the use case search flight is
allow the user to search for flights
First begin by picking out from the description all the important things or
concepts in the application domain. Our first list might include traveler, airline
database, and user database. But we are only interested in those about which the
system must store some information or knowledge in order to achieve its
objectives. The traveler will be modeled as an actor.
For the purposes of this particular use case, it is unlikely the system will
need to encapsulate any further knowledge about the actor.
Using the noun phrase strategy, candidate classes can be divided into three
categories: Relevant Classes, Fuzzy Area or Fuzzy classes (those classes that we
are not sure about), and irrelevant Classes.
It is safe to scrap the irrelevant classes, which either have no purpose or will
be unnecessary. Candidate classes then are selected from the other two categories.
Here identifying classes and developing a UML class diagram just like other
activities is an iterative process. Depending on whether such object modeling is for
the analysis or design phase of development, some classes may need to be added or
removed from the model .Analyst must be able to formulate a statement of purpose
for each candidate class; if not, simply eliminate it.
1 Identifying Tentative Classes:
The following are guidelines for selecting classes in an application:
Ø Look for nouns and noun phrases in the use cases.
Ø Some classes are implicit or taken from general knowledge.
Ø All classes must make sense in the application domain; avoid computer
implementation classes-defer them to the design stage.
Ø Carefully choose and define class names.
Identifying classes is an incremental and iterative process. This incremental
and iterative nature is evident in the development of such diverse software
technologies as graphical user interfaces, database standards, and even fourth-
generation languages.
2 Selecting Classes from the Relevant and Fuzzy Categories:
The following guidelines help in selecting candidate classes from the
relevant and fuzzy categories of classes in the problem domain.
A) Redundant classes.
Do not keep two classes that express the same information. If more than one
word is being used to describe the same idea, select the one that is the most
meaningful in the context of the system. This is part of building a common
vocabulary for the system as a whole. Choose your vocabulary carefully; use the
word that is being used by the user of the system.
E.g.: Traveler, Passenger
b) Adjectives classes.
“Be wary of the use of adjectives. Adjectives can be used in many ways. An
adjective can suggest a different kind of object, different use of the same object, or
it could be utterly irrelevant. Does the object represented by the noun behave
differently when the adjective is applied to it? If the use of the adjective signals
that the behavior of the object is different, and then makes a new class”.
For example : Single account holders behave differently than Joint account
holders, so the two should be classified as different classes.
c) Attribute classes: Tentative objects that are used only as values should be
defined or restated as attributes and not as a class
d) Irrelevant classes: Each class must have a purpose and every class should be
clearly defined and necessary. You must formulate a statement of purpose for each
candidate class. If you cannot come up with a statement of purpose, simply
eliminate the candidate class.
As this is an incremental process. Some classes will be missing; others will
be eliminated or refined later. Unless you are starting with a lot of domain
knowledge, you probably are missing more classes than you will eliminate.
Although some classes ultimately may become super classes, at this stage simply
identify them as individual, specific classes. Your design will go through many
stages on its way to completion, and you will have adequate opportunity to revise
it.
This refining cycle through the development process until you are satisfied
with the results. Remember that this process (of eliminating redundant classes,
classes containing adjectives, possible attributes, and irrelevant classes) is not
sequential. You can move back and forth among these steps as often analysts likes.
3. COMMON CLASS PATTERNS APPROACH
The second method for identifying classes is using common class patterns,
which is based on a knowledge base of the common classes. The following
patterns are used for finding the candidate class and object:
a) Concept class:
A concept is a particular idea or understanding that we have of our world.
The concept class encompasses principles that are not tangible but used to organize
or keep track of business activities or communications. E.g. Performance is an
example of concept class object.
b) Events class
Events classes are points in time that must be recorded. Things happen,
usually to something else at a given date and time or as a step in an ordered
sequence. Associated
with things remembered are attributes (after all, the things to remember are
objects) such as who, what, when, where, how, or why.
E.g.: Landing, interrupt, request, and order are possible events.
c) Organization class
An organization class is a collection of people, resources, facilities, or
groups to which the users belong; their capabilities have a defined mission, whose
existence is largely independent of the individuals. E.g.: An accounting department
might be considered a potential class.
d) People class (also known as person, roles, and roles played class)
The people class represents the different roles users play in interacting with
the application. E.g. Employee, client, teacher, and manager are examples of
people.
e) Places class
Places are physical locations that the system must keep information about.
E.g.: Buildings, stores, sites, and offices are examples of places.
persuade that object to accept the responsibility. For each responsibility that must
be allocated, one object is eventually persuaded by the weight of rational argument
to accept it. This process can help to highlight missing objects that are not
explicitly referred to by the use case description. When responsibilities can be
allocated in several different ways it is useful to role-play each allocation
separately to determine which is the most appropriate. The aim normally is to
minimize the number of messages that must be passed and their complexity, while
also producing class definitions that are cohesive and well focused.
Consider CRC exercise for the use case allotting buses to routes. This use case
involves instances of Bus, and Depot. The resulting CRC cards are shown in the
following figure.
Class Name : traveler
Responsibilities Collaborations
Provide traveling details
Search flight UI provide flights
available.
Steps:
1. An object is shown as a box at the top of a dashed vertical line. Object names
can be specific (e.g., Algebra 101, Section 1) or they can be general (e.g., a course
offering). Often, an anonymous object (class name may be used to represent any
object in the class.)
2. Each message is represented by an Arrow between the lifelines of two objects.
The order in which these messages occur is shown top to bottom on the page. Each
message is labeled with the message name.
Attributes
Attributes are part of the essential description of a class. They belong to the class,
unlike objects, which instantiate the class. Attributes are the common structure of
what a member of the class can 'know'. Each object will have its own, possibly
unique, value for each attribute.
Guidelines for identifying attributes of classes are as follows:
Ø Attributes usually correspond to nouns followed by prepositional phrases.
Attributes also may correspond to adjectives or adverbs.
Ø Keep the class simple; state only enough attributes to define the object state.
Ø Attributes are less likely to be fully described in the problem statement.
Ø Omit derived attributes.
Ø Do not carry discovery attributes to excess.
Some questions are there which help in identifying the responsibilities of classes
and deciding what data elements to keep track of:
· What information about an object should we keep track of?
· What services must a class provide?
NAMING RELATIONSHIPS:
An association may be named. Usually the name is an active verb or verb
phrase that communicates the meaning of the relationship. Since the verb phrase
typically implies a reading direction, it is desirable to name the association so it
reads correctly from left to right or top to bottom. The words may have to be
changed to read the association in the other direction. It is important to note that
the name of the association is optional.
ROLE NAMES:
The end of an association where it connects to a class is called an association
role. Role names can be used instead of association names.
A role name is a noun that denotes how one class associates with another.
The role name is placed on the association near the class that it modifies, and may
be placed on one or both ends of an association line.
Ø It is not necessary to have both a role name and an association name. >•
Ø Associations are named or role names are used only when the names are needed for
clarity.
MULTIPLICITY INDICATORS:
Although multiplicity is specified for classes, it defines the number of objects that
participate in a relationship. Multiplicity defines the number of objects that are
linked to one another. There are two multiplicity indicators for each association or
aggregation one at each end of the line. Some common multiplicity indicators are
1 Exactly one
0.. * Zero or more
1... * One or more
0 .. 1 Zero or one
5 .. 8 Specific range (5, 6, 7, or 8)
4 .. 7,9 Combination (4, 5, 6, 7, or 9)
REFLEXIVE RELATIONSHIPS:
Multiple objects belonging to the same class may have to communicate with one
another. This is shown on the class diagram as a reflexive association or
aggregation. Role names rather than asociation names typically are used for
reflexive relationships.
CLASS :
Stereotype:
Ø A new type of modeling element that extends the semantics of the metamodel.
Ø Stereotypes must be based on certain existing types or classes in the metamodel.
Ø Stereotypes may extend the semantics but not the structure of preexisting classes.
Ø Certain stereotypes are defined in the UML, others may be user defined.
UML is designed to be capable of extension; developers can add new stereotypes
depend on need. But this is only done when it is absolutely necessary. Three
analysis class stereotypes to the UML are:
Ø Boundary classes,
Ø Control classes
Ø Entity classes.
1. Boundary classes:
Boundary classes, it is a ‘model interaction between the system and its
actors’. Since they are part of the requirements model, boundary classes are
relatively abstract. They do not directly represent all the different sorts of interface
that will be used in the implementation language. The design model may well do
this later, but from an analysis perspective we are interested only in identifying the
main logical interfaces with users and other systems.
This may include interfaces with other software and also with physical devices
such as printers, motors and sensors. Stereotyping these as boundary classes
emphasizes that their main task is to manage the transfer of information across
system boundaries. It also helps to partition the system, so that any changes to the
interface or communication aspects of the system can be isolated from those parts
of the system that provide the information storage.
The class Search flight Ul is a typical boundary class. This style of writing
the name shows that the class is Search flight UI and it belongs to the User
Interface package when we write the package name in this way before the class
name, it means that this class is imported from a different package from the one
with which we are currently working. In this case, the current package is the Agate
application package, which contains the application requirements model, and thus
consists only of domain objects and classes. Alternative notations for Boundary
class stereotype can be represented as shown below
a) With stereotype
b) Symbol
2. Entity classes
The second analysis class stereotype is the entity class, which are given in
the class diagram of Allotting Buses to Routes by the two classes Bus and Route.
Entity classes are used to model ‘information and associated behavior of
some phenomenon or concept such as an individual, a real-life object, or a real-life
event’. As a general rule, entity classes represent something within the application
domain, but external to the software system, about which the system must store
some information. Instances of an entity class will often require persistent storage
of information about the things that they represent. This can sometimes help to
decide whether an entity class is the appropriate modeling construct.
For example, an actor is often not represented as an entity class. This is in
spite of the fact that all actors are within the application domain, external to the
software system and important to its operation. But most systems have no need to
store information about their users or to model their behavior. While there are
some obvious exceptions to this (consider a system that monitors user access for
security purposes), these are typically separate, specialist applications in their own
right. In such a context, an actor would be modeled appropriately as an entity class,
since the essential requirements for such a system would include storing
information about users, monitoring their access to computer systems and tracking
their actions while logged on to a network. But it is more commonly the case that
the software we develop does not need to know anything about the people that use
it, and so actors are not normally modeled as classes. The following are
representations for Entity classes.
3. Control classes
The third of the analysis class stereotypes is the control class, given by y the class
Searching system in Search flight.
On exit : What type of action that object has to perform after exiting from the state.
Do : The task to be performed when object is in this state, and must to continue
until it leaves the state.
On event: An on event action is similar to a state transition label with the following
syntax:
event(args)[condition] : the Action
STATE TRANSITION:
A state transition indicates that an object in the source state will perform
certain specified actions and enter the destination state when a specified event
occurs or when certain conditions are satisfied. A state transition is a relationship
between two states, two activities, or between an activity and a state.
We can show one or more state transitions from a state as long as each
transition is unique. Transitions originating from a state cannot have the same
event, unless there are conditions on the event. Graphical Representation
Provide a label for each state transition with the name of at least one event that
causes the state transition. You do not have to use unique labels for state transitions
because the same event can cause a transition to many different states or activities.
Transitions are labeled with the following syntax:
event (arguments) [condition] / action ^ target.sendEvent (arguments)
Only one event is allowed per transition, and one action per event.
STATE DETAILS:
Actions that accompany all state transitions into a state may be placed as an
entry action within the state. Likewise that accompany all state transitions out of a
state may be placed as exit actions within the state. Behavior that occurs within the
state is called an activity.
An activity starts when the state is entered and either completes or is
interrupted by an outgoing state transition. The behavior may be a simple action or
it may be an event sent to another object.
DESIGN
For example, in the above figure, the inheritance hierarchy exhibits low inheritance
coupling and is poorly designed. The subclass Land Vehicle needs neither the
attributes maximum Altitude and takeoff Speed nor the operations check Altitude
() and takeOff (). They have been inherited unnecessarily.
In this example it shows the base class, Vehicle, would be better named Flying
Vehicle and the inheritance relationship is somewhat suspect. A land vehicle is not
a kind of flying vehicle .However, many systems developers view designs with a
small degree of unnecessary inheritance as being acceptable if the hierarchy is
providing valuable reuse and is meaningful. However, a subclass with unnecessary
attributes or operations is more complex than it needs to be and objects of the
subclass may take more memory than they actually need. The real problems may
come when the system needs maintenance. The system’s maintainer may not
realize that some of the inherited attributes and operations are unused and may
modify the system incorrectly as a result. Alternatively the system’s maintainer
may use these unneeded features to provide a fix for a new user requirement,
making the system even more difficult to maintain in the future. For these reasons,
unnecessary inheritance should be kept as low as possible.
Operation Cohesion measures the degree to which an operation focuses on a single
functional requirement. Good design produces highly cohesive operations, each of
which deals with a single functional requirement. For example in the following
figure , the operation calculateRoomSpace () is highly cohesive.
The name is the attribute name, the type-expression is its data type, the
initial value is the value the attribute is set to when the object is first created and
the property-string describes a property of the attribute, such as constant or fixed.
The characters in single quotes are literals.
The following is a class Staff which is shown along with attribute data types
declared.
Attribute declarations can also include arrays also. For example, an Employee class
might include an attribute to hold a list of qualifications that would be declared
using the syntax:
Qualification [O ... 10]: String
Operations
Each operation also has to be specified in terms of the parameters that it
passes and returns. The syntax used for an operation is:
Operation name' ('parameter-list ') “: “return-type-expression
Object visibility
The following are the different kinds of visibilities, their symbols and their
meaning.
Visibility Visibility Meaning
symbol
+ Public The feature (an
operation or an attribute)
is directly accessible by
an instance of any class.
- Private The feature may only be
used by an instance of
the class that includes it.
# Protected The feature may be used
either by instances of the
class that includes it or
of a subclass or
descendant of that class.
~ Package The feature is directly
accessible only by
instances of a class in
the same package.
Interfaces
Generally a class may present more than one external interface to other classes or
the same interface may be required from more than one class. An interface in UML
is a group of externally visible (i.e. public) operations. The interface contains no
internal structure, it has no attributes, no associations and the implementation of
the operations is not defined. Formally, an interface is equivalent to an abstract
class that has no attributes, no associations and only abstract operations.
The following figure shows two alternative notations for an interface. The
simpler of the two UML interface notations is a circle. This is attached by a solid
line to the classes that support the interface. For example, in Figure the Advert
class supports two interfaces, Manageable and accessible, that is, it provides all of
the operations specified by the interface. The circle notation does not include a list
of the operations provided by the interface type, though they should be listed in the
repository. The dashed arrow from the Staff class to the Manageable interface
circle icon indicates that it uses or needs, at most, the operations provided by the
interface.
22.IMPLEMENTATION DIAGRAMS
22 (a).COMPONENT DIAGRAM