SWE 621: Software Modeling and Architectural Design Lecture Notes On Software Design
SWE 621: Software Modeling and Architectural Design Lecture Notes On Software Design
SWE 621:
Software Modeling and Architectural Design
Hassan Gomaa
Dept of Computer Science
G
George M
Mason U University
i it
Fairfax, VA
Copyright © 2011 Hassan Gomaa
All rights reserved. No part of this document may be reproduced in any form or
by any means, without the prior written permission of the author.
This electronic course material may not be distributed by e-mail or posted on any
other World Wide Web site without the prior written permission of the author.
User
1
Requirements 2
Modeling
Analysis
Modeling
4 3 5
Design
Modeling 6
Throwaway Incremental
Prototyping Software
Construction 7
Incremental
Software
Integration 8
Customer
10
11 System
12 Incremental 9 Testing
13 Prototyping 14
15
2
1
6/7/2011
Lecture 4:
Object Structuring
Hassan Gomaa
2
6/7/2011
• Boundary objects
– User interaction object
– Device I/O object
– Proxy object
• Entity objects
– Longg livingg objects
j that store information
– Determined during static modeling
• Control objects
• Application Logic Objects
3
6/7/2011
4
6/7/2011
1: Operator 2: Sensor
Command Request
«user «entity»
interaction» :Sensor
:Operator Data
4: Display 3: Sensor
Data Interaction Repository
Data
: Operator
O
System boundary
Note: The dashed line for the system boundary is for illustrative purposes only and does not conform to the UML notation
10
5
6/7/2011
• Proxy object
– Interfaces to an external system
– Hides details of how to communicate with external
system
• E.g., Robot Proxy
• Interfaces to external (real-world) robot
11
System boundary
Note: The dashed line for the system boundary is for illustrative purposes only and does not conform to the UML notation
12
6
6/7/2011
13
1: Temperature
«external input Sensor Input
device» «input»
aReal-World aTemperature
Temperature SensorInterface
Sensor
Real-world
hhardware
d object
bj t Software object
Hardware/software boundary
Note: The dashed line for the hardware/software boundary is for illustrative purposes only and does not conform to the UML notation
14
7
6/7/2011
15
«software system»
BankingSystem
i
inputs to
«external I/O «input/output»
1 1
1 device» CardReader
CardReader outputs Interface
to 1
1 ATM
outputs to Operator
1 «external output «output» 1
1 1 1
1 device» ReceiptPrinter interacts
«user with
ReceiptPrinter Interface
ATM 1 interaction» 1 1 «external user»
Customer interacts Operator Operator
1 Interaction
with
«external user» «user interaction»
1 1
ATMCustomer Customer
KeypadDisplay Interaction
outputs to
1 «external output «output»
1 1
device» CashDispenser
CashDispenser Interface
16
8
6/7/2011
1: Operator 2: Sensor
Command Request
«user «entity»
interaction» :Sensor
:Operator Data
4: Display 3: Sensor
Data Interaction Repository
Data
: Operator
O
System boundary
Note: The dashed line for the system boundary is for illustrative purposes only and does not conform to the UML notation
18
9
6/7/2011
19
20
10
6/7/2011
«output»
3: Print Receipt
:ReceiptPrinter
Interface
«state dependent 4: Receipt Printed
control»
:ATM 1: Dispense Cash
Control
«output»
t t
2: Cash Dispensed, :CashDispenser
Interface
21
Timer object
• Activated periodically
1: Timer
« external Event «timer»
timer» : Report
: DigitalClock Timer
2: Prepare
«entity»
: Weekly Report
22
11
6/7/2011
23
24
12
6/7/2011
Algorithm Object
• Encapsulates algorithm
used in problem domain
• More usual in scientific,
engineering, real-time
domains
25
Service object
• Provides a service to other objects
• Responds to requests from client objects
26
13
6/7/2011
User
1
Requirements 2
Modeling
Analysis
Modeling
4 3 5
Design
Modeling 6
Throwaway Incremental
Prototyping Software
Construction 7
Incremental
Software
Integration 8
Customer
10
11 System
12 Incremental 9 Testing
13 Prototyping 14
15
27
14
6/7/2011
Withdraw «include»
Funds
Query «include»
Validate
Account PIN
«include»
Transfer
ATM Funds
Customer
Add Cash
Startup
Shutdown
ATM Operator
1
«external I/O
device» 1..*
CardReader Inputs To
1 Operator
1 Outputs
«external output To
1
device» 1..* 1 1
Outputs
ReceiptPrinter To
1 «software Interacts
system» 1 With 1..* «external user»
1 Interacts Banking
1
ATM «external user» With Operator
System
Customer 1..*
1
ATMCustomer
1 Outputs
To
«external output
device»
1..*
CashDispenser
30
15
6/7/2011
«software system»
BankingSystem
i
inputs to
«external I/O «input/output»
1 1
1 device» CardReader
CardReader outputs Interface
to 1
1 ATM
outputs to Operator
1 «external output «output» 1
1 1 1
1 device» ReceiptPrinter interacts
«user with
ReceiptPrinter Interface
ATM 1 interaction» 1 1 «external user»
Customer interacts Operator Operator
1 Interaction
with
«external user» «user interaction»
1 1
ATMCustomer Customer
KeypadDisplay Interaction
outputs to
1 «external output «output»
1 1
device» CashDispenser
CashDispenser Interface
31
User
1
Requirements 2
Modeling
Analysis
Modeling
4 3 5
Design
Modeling 6
Throwaway Incremental
Prototyping Software
Construction 7
Incremental
Software
Integration 8
Customer
10
11 System
12 Incremental 9 Testing
13 Prototyping 14
15
32
16