Professional Documents
Culture Documents
Lecture 10: Object-Oriented Analysis (System Sequence Diagrams, Conceptual Model)
Lecture 10: Object-Oriented Analysis (System Sequence Diagrams, Conceptual Model)
high-level/expanded, essential/real
System Sequence Diagram - What are the system events and operations ?
Interaction Diagram - Sequence Diagram Contract Specs.
Sample UP Artifacts
Business Modeling
Domain Model
Use-Case Model
:System
Requirements
text use cases system events & data
foo( x ) bar( y )
...
Design Model
Design
Project Management
Test Plan
Development Case
Test
Environment
Cases Model
sequence diagrams
system events and operations Derived from Use Cases Typical course of events Identify system functionality (operations) to be designed System boundary is critical
box. Identify each actor that directly operates on the system. Draw a line for each such actor. From expanded use case identify system events that each actor generates. Ilustrate them. Optionally include use case text on left.
ECE 452 - Introduction to Software Engineering
:System
enterItem(UPC, quantity)
endSale() Text which clarifies control, logic, iteration, etc. May be taken from the use case. system event it triggers a system operation
makePayment(amount)
System events
System Event
An external input event generated by an actor to a system the system is seen as a black box
System operation
the method invoked in response to a system event
Use the same names for system event and system operation System events may have arguments
:System
3. Cashier enters item identifier. 4. System records sale line item and presents item description, price, and running total.
Cashier repeats steps 3-4 until indicates done. 5. System presents total with taxes calculated. 6. Cashier tells Customer the total, and asks for payment. 7. Customer pays and System handles payment. ...
help define system behavior Contracts are defined in part by preconditions and postconditions Examples in this chapter document system operations such as
enterItem endSale makePayment However, contracts also apply to low-level methods
ECE 452 - Introduction to Software Engineering
Model
illustrates meaningful concepts most important artifact in OO analysis need use cases as input
Question:
Domain Analysis
Object
level Objective: Create a library of reusable components for a particular domain Ongoing activity of the software process (not tied to a specific project) Domain analysis model specifies objects and classes that characterize the domain
ECE 452 - Introduction to Software Engineering
Domain Analysis
Define
domain to be investigated Categorize the items extracted from the domain Collect a representative sample of applications in the domain Analyze each application in the sample Develop an analysis model for the objects Define reuse guidelines
ECE 452 - Introduction to Software Engineering
Conceptual Models
Conceptual
Model
created for the use cases of the current cycle in the language of the problem domain
Must
identify
is part of, contains, manages, is-a, ... instance variables needed to hold state
ECE 452 - Introduction to Software Engineering
attributes of concepts
Conceptual Modeling...
Conceptual
information
software artifacts, methods, etc.
Better
concepts
Conceptual Modeling
Associations
less important than identifying concepts show only need-to-know association (avoid redundant or derivable associations) name, multiplicity, navigability multiple associations
Conceptual Model
Attributes
keep attributes simple if in doubt define it as a concept no attributes as foreign keys (use associations)
Figure 9.1
More
Concept
Records-sale-of 1
Item
*
Stocked-in
Association
Contained-in 1 Sale Store address name 1 Houses Paid-by 1 Payment amount ECE 452 - Introduction to Software Engineering POST 1 1.. * Captured-on 4 1
Attributes
date time 1
We're shooting for something like this for your final project
Conceptual Model
Concepts
help with domain vocabulary Conceptual models are not models of software designs
dont be thinking windows and files here no responsibilities yet, do this in design
Concept:
symbol: a word or image representing a concept definition extension: set of examples to which the concept applies
ECE 452 - Introduction to Software Engineering
Example Concept
POST
Sale
date time
Sale
concept's symbol
"A sale represents the event of a purchase transaction. It has a date and time."
concept's definition
sale-1 sale-2
sale-3
concept's extension
sale-4
Example Concept
POKER
Card
concept's symbol
concept's definition
Ace
King 5
concept's extension
Object-Oriented
Partition
Identifying Concepts
One
Look for the concepts in the problem specification and in your uses cases
read the final project specification specifying too many concepts is good is is better too have too many than too few concepts may have no attributes
Try
Concept Category
Physical
or tangible things
POST ProductDescription
Transactions
and Policies
POST RefundPolicy
Organizations
POST SalesDepartment
For more, see pages 91-93
Concepts?
page 96-97
Use vocabulary of the users Users are not usually present for college programming projects However, Poker has users
the users are you this isn't a Library with Patrons and Librarians
Do
Finding Concepts
Make
Common Mistake
Do not mistake an attribute for a concept All others things are likely a concept
if in doubt, make it a concept
Example: Payment in the POST problem could be thought of as the amount of a Sale
a primitive attribute like 9.75 But a payment could be made by check, cash, credit card, could be in various currencies of the world, could require change This outgrows being a simple attribute
things correctly is
similar concepts with different names
Register 1 Records6
*
Sale
ECE 452 - Introduction to Software Engineering
*
Sale
Abstract Concepts
Poker
Encoding images with some compression scheme or encrypting messages for privacy
Concepts in the problem domain exist even if they do not seem to be part of the real world
POST Concepts
Accounts Receivable Drivers License
Cash Payment
Credit Payment
Check Payment
Credit Card
Check
POST
Item
Store
Sale
Product Catalog
Sales LineItem
Cashier
Customer
Manager
Product Specification
unreal things
The Software class diagram will look a lot like the conceptual model You will see associations, boxes, multiplicity... Larman uses concept to refer to real world things and Classes refer to software specifications and implementations. UML defines class as
a description of a set of a objects that share the same attributes, relationships, and semantics
the three Amigos: Grady Booch, Ivar Jacobsen, Jim Rumbaugh
Adding Associations
Next
a relationship between concepts that indicates some meaningful and interesting connection
Name the association with a hyphen connected verb phrase which reads well between concepts
association
POST
Records-current 1 1
Sale
Associations
Associations
imply
our knowledge of the relationship must be preserved for some time (1 ms to forever)
Association:
a line between two concepts and a name zero or more; they are bi-directional T * "many" can have a multiplicity 1.. * one or more T exist in conceptual models and 1..40 one to forty T class diagrams
Multiplicity adornments
5 T exactly five
3, 5, 8
Possible Associations
A is a physical part of B Drawer - POST A is a logical part of B SalesLineItem - Sale A is physically contained in B POST-Store A is logically contained in B ItemDescription-Catalog A is recorded in B Sale - POST A uses or manages B Cashier - POST A communicates with B Customer - Cashier A is related to a transaction B Customer - Payment Draw some poker associations now
Associations
Some
useful associations
Association Guidelines
Concepts
many
Multiplicity
Multiplicity
defines how many instances of type A can be associated with one instance of type B at some point can differ
Game 1 1..6 Player
Mother
1 performs-in *
1+
Child
Actor is associated with 0 to many films. A film is associated with 0 to many actors
Actor
Film
Depends on Context
Are
Wheel Wheel
Car
Wheel
Association Names
Upcase / hyphenate
Type-VerbPhrase-Type
Captures 1 1.. *
Sale
Paid-by 1 1
Payment
Not yet worrying about messages, instance variables, data flow, or software objects Just show some concepts are connected
ECE 452 - Introduction to Software Engineering
No Implementation Yet
The
Some
Conceptual Model for the POST associations are not all need to know Records-sale-of
Described-by 1 Product Specification Contains 1 1 1.. *
Product Catalog
*
Store 1 1.. * Logscompleted 6 1
Used-by
Describes
*
Stocks 1 Item
Contained-in 1 Sale
Houses
*
Captured-on 1 1 1
Started-by 1 1
Paid-by 1 Payment
Initiated-by 1 Customer
3 Records-sales-on 1
Initiated-by 1
Cashier
Product Catalog
*
Store 1 1.. * Logscompleted 6 1
Used-by
Describes
*
Stocks 1 Item
Contained-in 1 Sale
Houses
1.. * POST
*
Captured-on 1 1 1
Paid-by 1 Payment
Initiated-by 1 Customer
3 Records-sales-on 1
Initiated-by 1
Cashier
Product Catalog
*
Store 1 1.. * Logscompleted 6 1
Used-by
Describes
*
Item 1
Contained-in 1 Sale
Houses
1.. * POST
*
Captured-on 1 1 1
Paid-by 1 Payment
Initiated-by 1 Customer
3 Records-sales-on 1
Initiated-by 1
Cashier
bounded by current requirements only but it may not convey a full understanding the conceptual model may not communicate key ideas and relationships has need to know requirements what the system must do clearly communicates important concepts
By eliminating concepts and associations that are not currently required need to know Make your conceptual model so it
could have View as a concept
Summary
Doubting
keep it
Doubting
drop it
Do
model satisfy all need to know associations and still present a clear complete picture?
ECE 452 - Introduction to Software Engineering
Identifying Attributes
The
final piece to the conceptual model is to add the attributes needed to support use cases Attribute: a logical data value of an object
not necessarily in the final design, though some attributes will end up in the code
Example:
not use complex ideas as attributes UML puts attributes in 2nd row of concept box
Sale date startTime : Time attributes
Attribute or Association?
Easy
Worse
Better name
Cashier
Uses
1 number
POST
Attribute or Association?
Attributes
Better
Flight
Flies-to
Airport