toad
Fall 2014
School of Computer Science School of Computer Science
Principles of Software Construction: Objects, Design, and - - PowerPoint PPT Presentation
Principles of Software Construction: Objects, Design, and Concurrency Design: From Systems to Objects toad Fall 2014 Jonathan Aldrich Charlie Garrod School of School of Computer Science Computer Science Administrivia Homework 1 due
School of Computer Science School of Computer Science
2
3
4
5
Requirements Elicitation (see 15-313)
(Object-Oriented) Requirements Analysis
System Specification
Architectural Design (mostly in 15-313) Responsibility Assignment
Method specifications / code contracts
6
7
Requirements Elicitation (see 15-313)
(Object-Oriented) Requirements Analysis
System Specification
Architectural Design (mostly in 15-313) Responsibility Assignment
Method specifications / code contracts
8
What are the operations on the system, performed by the user?
In what order do they occur?
Under what conditions can each interaction take place?
What is the result of the interaction?
9
10
11
12
13
Preconditions Postconditions
Like a pre-/post-condition
Often written in natural
Focused on system interfaces
14
SalesLineItem quantity Sale dateTime total Register id ProductDesc itemID description price * 1 0..1 1 1 1..* Contained-in Captured-on Described-by
15
Operation name, parameters Requirement or use case this
Preconditions Postconditions
Operations that are complex or subtle Operations that not everyone understands Simple/obvious operations are often not given contracts in practice
Written in past tense (a post-condition) Describe changes to domain model
Operation: makeNewSale() Preconditions: There is not currently a sale in progress Postconditions:
created
Register
16
SalesLineItem quantity Sale dateTime total Register id ProductDesc itemID description price * 1 0..1 1 1 1..* Contained-in Captured-on Described-by
17
SalesLineItem quantity Sale dateTime total Register id ProductDesc itemID description price * 1 0..1 1 1 1..* Contained-in Captured-on Described-by
18
Requirements Elicitation (see 15-313)
(Object-Oriented) Requirements Analysis
System Specification
Architectural Design (mostly in 15-313) Responsibility Assignment
Method specifications / code contracts
19
knowing doing
doing something itself, such as creating an object or doing a
initiating action in other objects controlling and coordinating activities in other objects
knowing about private encapsulated data knowing about related objects knowing about things it can derive or calculate
20
Found in System Sequence Diagrams and Behavioral Contracts
Knowing, doing, etc.
Knowing
Doing
Two objects may have the same class merge responsibilities A class may have a superclass divide responsibilities
Drive by quality attributes General Responsibility Assignment Software Patterns provide
21
22
SalesLineItem quantity Sale dateTime total Register id ProductDesc itemID description price * 1 0..1 1 1 1..* Contained-in Captured-on Described-by
23
SalesLineItem quantity Sale dateTime total Register id ProductDesc itemID description price * 1 0..1 1 1 1..* Contained-in Captured-on Described-by
24
25
System sequence diagrams for each scenario (use case) Behavioral contracts for each operation
Object interaction diagrams Object model (a class diagram)
Methods are added New classes, fields, associations are added for implementations Fields and associations are further specified New inheritance relations are added for reuse
Coming soon!