Title: Object Oriented Design with UML Continuation I
1Object Oriented Design with UML (Continuation I)
ECE 668 Fundamentals of Computer
Engineering Module II Software Engineering
Andrzej Rucinski Khrystyna Pysareva Spring 2004
2UMLs 12 Standard Diagram Types
- Structural Diagrams
- Class Diagram, Object Diagram, Component Diagram,
and Deployment Diagram - Behavior Diagrams
- Use Case Diagram, Sequence Diagram, Activity
Diagram, Collaboration Diagram, and Statechart
Diagram - Model Management Diagrams
- Packages, Subsystems, and Models
3OO system design guidelines
- Ask what the system is supposed to do
- Identify objects the system will need to do it
a). Identify operations to be performed b).
Identify information needed
3. Assign responsibility for the operations and
information to objects
a). Each object knows how to perform its own
operations b). Each object remembers its own
information
4Use Case Diagram
A use case diagram is a graph of actors, a set of
use cases, possibly some interfaces, and the
relationships between these elements. The
relationships are associations between the actors
and the use cases, generalizations between the
actors, and generalizations, extends, and
includes among the use cases. The use cases may
optionally be enclosed by a rectangle that
represents the boundary of the containing system
or classifier.
A technique for describing the system
requirements from the users point of view
5Use cases purpose
- System requirements clarification
- Communication with customers
- Communication with designers
- Communication with testers
- System documentation
6Definitions
- A scenario is a sequence of steps describing an
interaction between a user and a system - A use case is a set of scenarios tied together by
a common user goal
7Use case diagram components
- 1. Actors is a role that user (or external
system) plays with respect to the system - 2. Named use cases
- 3. Relationships
- Associations (actor to use case)
- Generalizations (use case to use case actor to
actor) - Extend (use case to use case)
- Include (use case to use case)
8Association
9Extend
10Generalization
11Generalization
12Include
13Use Case Example
- Web-based online store
- Buy a Product scenario
- The customer browses the catalog and adds desired
items to the shopping basket. When the customer
wishes to pay, the customer describes the
shipping and credit card information and confirms
the sale. The system checks the authorization on
the credit card and confirms the sale both
immediately and with a follow-up email. - ltAdopted from UML distilled by Fowler and Scott
2nd ed.gt
14Use Case Example (Cont.)
- Use Case Buy a Product
- Actors Customer, System
- Section Main
- Customer browses through catalog and selects
items to buy - Customer goes to checkout
- Customer fills in shipping information (address
next-day or 3-day delivery) - System presents full pricing information,
including shipping - Customer fills in credit card information
- System authorizes purchase
- System confirms sale immediately
- System sends confirming email to customer
15Use Case Example (Cont.)
- Alternative Courses
- Authorization Failure
- 6 System fails to authorize credit purchase.
Allow customer to re-enter credit card
information and retry - Regular Customer
- 3a. System displays current shipping information,
pricing information, and last four digits of
credit card information - 3b. Customer may accept or override these
defaults. Return to Main Course of Events at Line
6.
16Use Case Example (Cont.)
17Objects
- Basic Object Related Concepts
- Encapsulation
- Information Hiding
- Message Passing
- Polymorphism
- Classes and Instances
- Inheritance
18Objects
- An Object encapsulates both functions and data,
i.e. retains certain information, and knows how
to perform certain operations.
Information and Operations
Encapsulation
Information Hiding
19Message
- One object accesses another object by sending it
a message
message
Behavior of the object the set of messages to
which an object can respond An object can send
private messages to itself to implement publicly
accessible operations
20Method and Signature
- Method is an algorithm executed in response to
receiving a message whose name matches the name
of the method - Signature is the name of a method, the types of
its parameters, and the type of the object that
the method returns.
21Classes, Instances, and Polymorphism
- Objects which share the same behavior are said to
belong to the same class. A class is a generic
specification for an arbitrary number of similar
objects. - All objects are instances of some class.
- Polymorphism is the ability of two or more
classes of object to respond to the same message,
each in its own way.
22Homework
23Visio and UML
24Visio and UML