Sie sind auf Seite 1von 20

Experiment 6

Object oriented analysis and design


Aim : To understand use case realization using sequence
diagram,activity diagram,state machine diagram and class diagram.
Theory :
Use-Case diagram :-

Use case diagrams are usually referred to as behaviour diagrams used to


describe a set of actions (use cases) that some system or systems
(subject) should or can perform in collaboration with one or more
external users of the system (actors). Each use case should provide
some observable and valuable result to the actors or other stakeholders
of the system.
Use case diagrams are in fact twofold - they are both behaviour
diagrams , because they describe behavior of the system, and they are
also structure diagrams s - as a special case of class diagrams where
classifiers are restricted to be either actors or use cases related to each
other with association.
Notation :-
UseCase
Draw use cases using ovals. Label the ovals with verbs that represent the
system's functions.

Actors
Actors are the users of a system. When one system is the actor of
another system, label the actor system with the actor stereotype.
Relationships
Illustrate relationships between an actor and a use case with a simple
line. For relationships among use cases, use arrows labeled either "uses"
or "extends." A "uses" relationship indicates that one use case is needed
by another in order to perform a task. An "extends" relationship
indicates alternative options under a certain use case.

Use Case Diagram:


Use Case Specifications
Use Case Name : Register
Actors Involved : Customer
Pre Condition : The Customer should not have account previously.
Flow of events : The customer registers on the site by providing his
details.
Post Condition : The customer should be registered successfully at the
website.

Use Case Name : Login


Actors Involved : Customer,Admin
Frequency : High
Flow of events : The user enters the password and username and is
logged in.
Alternate flow of events : The user enters the wrong username or
password and is requested to enter the credentials correctly.
Post Condition : The user should be logged in to the system.

Use Case Name : Generate policies


Actors Involved : Company official
Pre Condition : The Company official must be logged in.
Flow of events : The consumer clicks create new policy button a window
opens where he has to fill the details of the new policy such as
premium,emi etc.The system adds the policy into the database.
Alternate Flow of events : If product is already available “ policy exists”
message is displayed.
Post Condition : The new policy is added into policies list.

Use Case Name : Grant loans


Actors Involved : Company officials
Pre Condition : The Company official must be logged in and must have
the customer details on the screen.
Flow of events : The Company Official views the customer details and his
income.If the requirements are met then they are checked and the loan
is granted to customer on reviewing the policy he opts.
Post Condition : The product is removed from cart.
Use Case Name : Update information
Actors Involved : Customer,Admin
Pre Condition : The Admin and customer must be logged in the
system. Customer must have at least one change in his details
Flow of events : The consumer clicks on edit field to update his
information . The admin reviews the change in the details and updates
the information.
Alternate Flow of events : If update is unsuccessful “Update is
unsuccessful” is displayed and change is not made.
Post Condition : The Information is update successfully.

Use Case Name : Approve policies


Actors Involved : Admin
Pre Condition : The Admin must be logged in and policy details must be
available.
Flow of events : Admin approve policy button by checking all the
requirements of the policies.Then the system gives confirmation about
the invoice generated
Alternate Flow of events : If Admin disapproves the policy then a error
message is displayed
Post Condition : The policy is approved to customer

Use Case Name : View profile


Actors Involved : Customer
Pre Condition : The user must be logged in .
Flow of events : The customer clicks view profile button and system
asks admin to fetch customer details. The admin clicks submit
and details are displayed on the screen.
Alternate Flow of events : If user does not exist then error message is
displayed.
Post Condition : Profile is displayed on the screen.

Use Case Name : View Details


Actors Involved : Customer
Pre Condition : The user must be logged in .
Flow of events : The Customer clicks view policy button and system
asks admin to fetch policy details. The admin clicks submit and details
are displayed on the screen.
Alternate Flow of events : If policy does not exist then error message is
displayed.
Post Condition : Policy details are displayed on the screen.

Use Case Name : Post a query in discussion forum


Actors Involved : Customer
Pre Condition : The user must be logged in .
Flow of events : The customer presses a query button and it fills the
details of the query in the discussion forum. The admin generates a
query successful generation receipt.
Alternate Flow of events : If query does not exist then error message is
displayed.
Post Condition : Receipt is displayed on the screen.

Use Case Name : Pay premium


Actors Involved : Customer
Pre Condition : The user must be logged in .
Flow of events : The customer presses a pay premium button and it fills
the details of the mode of the payment in window. The
admin generates a successful generation receipt on successful message
payment .
Alternate Flow of events : If payment was unsuccessful then error
message is displayed on the screen.
Post Condition : premium payment is displayed on the screen.

Sequence diagram :
To understand what a sequence diagram is, it's important to know the
role of UML. UML, or the Unified Modeling Language, is a modeling
toolkit that guides the creation and notation of many types of diagrams,
including behavior diagrams, interaction diagrams, and structure
diagrams. Sequence diagrams are a kind of interaction diagram, because
they describe how—and in what order—a group of objects works
together. These diagrams are used by software developers and business
people alike to understand requirements for a new system or to
document an existing process. Sequence diagrams are sometimes known
as event diagrams or event scenarios.

Sequence Diagram Applications


Sequence diagrams can be useful reference diagrams for businesses and
other organizations. Try drawing a sequence diagram to:

 Represent the details of a UML use case.


 Model the logic of a sophisticated procedure, function, or
operation.
 See how tasks are moved between objects or components
of a process.
 Plan and understand the detailed functionality of an existing
or future scenario.

Sequence Diagram:
Login -
View profile/pay premium /add disscussion forum query-
Generate new policies
Approve policies
Activity diagram :
An activity diagram visually presents a series of actions or flow of control
in a system similar to a flowchart or a data flow diagram. Activity
diagrams are often used in business process modeling. They can also
describe the steps in a use case diagram. Activities modeled can be
sequential and concurrent. In both cases an activity diagram will have a
beginning and an

Basic Activity Diagram Notations and Symbols

Initial State or Start Point


A small filled circle followed by an arrow represents the initial action
state or the start point for any activity diagram. For activity diagram
using swimlanes, make sure the start point is placed in the top left
corner of the first column.

Activity or Action State


An action state represents the non-interruptible action of objects. You
can draw an action state in SmartDraw using a rectangle with rounded
corners.

Action Flow
Action flows, also called edges and paths, illustrate the transitions from
one action state to another. They are usually drawn with an arrowed
line.

Object Flow
Object flow refers to the creation and modification of objects by
activities. An object flow arrow from an action to an object means that
the action creates or influences the object. An object flow arrow from an
object to an action indicates that the action state uses the object.

Decisions and Branching


A diamond represents a decision with alternate paths. When an activity
requires a decision prior to moving on to the next activity, add a
diamond between the two activities. The outgoing alternates should be
labeled with a condition or guard expression. You can also label one of
the paths "else."

Guards
In UML, guards are a statement written next to a decision diamond that
must be true before moving next to the next activity. These are not
essential, but are useful when a specific answer, such as "Yes, three
labels are printed," is needed before moving forward.

Activity Diagram :
Login-
View Details-
View profile/update profile -
Grant Loan
Pay Premium-
STATE MACHINE DIAGRAM
Class Diagram :
In software engineering, a class diagram in the Unified Modeling
Language (UML) is a type of static structure diagram that describes the
structure of a system by showing the system's classes, their attributes,
operations (or methods), and the relationships among objects.
The class diagram is the main building block of object-oriented modelling.
It is used for general conceptual modelling of the systematic of the
application, and for detailed modelling translating the models into
programming code. Class diagrams can also be used for data modeling.
The classes in a class diagram represent both the main elements,
interactions in the application, and the classes to be programmed.

 Inheritance - also known as generalization, this is the


process of a child or sub-class taking on the functionality of
a parent or superclass. It's symbolized by a straight
connected line with a closed arrowhead pointing towards
the superclass.
 Bidirectional association - the default relationship between
two classes; both classes are aware of each other and their
relationship with the other. This association is represented
by a straight line between two classes.
 Unidirectional association - a slightly less common
relationship between two classes; one class is aware of the
other and interacts with it. Unidirectional association is
modeled with a straight connecting line that points an
open arrowhead from the knowing class to the known
class.
 Aggregation - An association with an aggregation
relationship indicates that one class is a part of another
class. In an aggregation relationship, the child class
instance can outlive its parent class.
 Composite Aggregation - The composition aggregation
relationship is just another form of the aggregation
relationship, but the child class's instance lifecycle is
dependent on the parent class's instance lifecycle.
Class Diagram :

Conclusion: We have successfully understood use case realization using


sequence diagram,activity diagram,state machine diagram and class
diagram.

Das könnte Ihnen auch gefallen