Class 14
Class 14
Language (UML)
1
UML as A Standard
⚫ Adopted by Object Management
Group (OMG) in 1997
⚫ OMG is an association of industries
⚫ Promotes consensus notations and
techniques
⚫ Used outside software development
− Example car manufacturing
2
Why are UML Models Required?
⚫ A model is an abstraction mechanism:
− Capture only important aspects and
ignores the rest.
− Differentmodels result when different
aspects are ignored.
− Aneffective mechanism to handle
complexity.
⚫ UML is a graphical modelling tool
Easy to understand and construct
3
⚫
UML Diagrams
⚫ Nine diagrams are used to capture
different views of a system.
⚫ Views:
− Providedifferent perspectives of a
software system.
⚫ Diagrams can be refined to get
the actual implementation of a
system.
4
UML Diagrams
Behavioural View
Structural View - Sequence Diagram
- Class Diagram - Collaboration Diagram
- Object Diagram - State-chart Diagram
- Activity Diagram
User’s View
-Use Case
Diagram
6
Use Case Model
⚫ Consists of set of “use cases” - Different
ways in which a system can be used by the
users
⚫ Corresponds to the high-level requirements
⚫ Represents transaction between the user and
the system
⚫ Defines external behavior without revealing
internal structure of system
7
Why Develop A
Use Case Diagram?
⚫ Serves as requirements specification
⚫ How are actor identifications useful
in software development:
− User identification helps in implementing
appropriate interfaces for different
categories of users
− Another use in preparing appropriate
documents (e.g. user’s manual).
8
Use Cases
⚫ Normally, use cases are independent of
each other
⚫ Implicit dependencies may exist
⚫ Example: In Library Automation System,
renew-book & reserve-book are
independent use cases.
− But in actual implementation of renew-book: a
check is made to see if any book has been
reserved using reserve-book.
9
Example Use Cases
− For library information system
⚫ issue-book
⚫ query-book
⚫ return-book
⚫ create-member
⚫ add-book, etc.
10
Representation of
Use Cases
− Represented by use case diagram
− A use case is represented by an ellipse
− System boundary is represented by a
rectangle
− Users are represented by stick person icons
(actor)
− Communication relationship between actor
and use case by a line
− External system by a stereotype
11
An Example Use Case Diagram
Play Move
Tic-tac-toe game
Player
12
Factoring Use Cases
⚫ Two main reasons for factoring:
− Complex use cases need to be
factored into simpler use cases
− To represent common behavior across
different use cases
⚫ Three ways of factoring:
− Generalization
− Includes
− Extends 13
Factoring Use Cases Using
Generalization
14
15
Factoring Use Cases Using
Includes
<<include>> Common
Base use case
use case
<<include>>
<<include>>
<<include>> <<include>>
16
17
Factoring Use Cases Using
Extends
18
19
Extension Point
20
Hierarchical Organization of
Use Cases
use case 1 use case 3
use case 2
21
Use Case Packaging
Accounts
Print
Query balance
Balance sheet
Receive Make
grant payments
22
23
Class Diagram
⚫ Describes static structure of a
system
⚫ Main constituents are classes and
their relationships:
− Generalization
− Aggregation
− Association
− Various kinds of dependencies
24
Class Diagram
⚫ Entities with common features, i.e.
attributes and operations
⚫ Classes are represented as solid outline
rectangle with compartments
⚫ Compartments for name, attributes, and
operations.
⚫ Attribute and operation compartments are
optional depending on the purpose of a
diagram.
25
Example Class Diagram
issueBook( );
findPendingBooks( );
findOverdueBooks( );
returnBook( );
findMembershipDetails( );
Mritunjay Mritunjay
B10028 B10028
C-108, Laksmikant Hall C-108, Laksmikant Hall
1119 1119
Mrituj@cse Mrituj@cse
25-02-04 25-02-04
25-03-06 25-03-06
NIL NIL
IssueBook( );
findPendingBooks( );
findOverdueBooks( );
returnBook( );
findMembershipDetails( );
28
Thank You
29