ch07lect1_UD - Using UML Patterns and Java Object-Oriented...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 6 System Design: Addressing Design Goals
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 2 System Design 2. Subsystem Decomposition Layers vs Partitions Coherence/Coupling 4. Hardware/ Software Mapping Special Purpose Buy vs Build Allocation of Resources Connectivity 5. Data Management Persistent Objects File system vs Database Access Control List vs Capabilities Security 6. Global Resource Handlung 8. Boundary Conditions Initialization Termination Failure 3. Concurrency Identification of Threads 7. Software Control Monolithic Event-Driven Conc. Processes 1. Design Goals Definition Trade-offs
Background image of page 2
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3 Concurrency Nonfunctional Requirements to be addressed: Performance, Response time, latency, availability. Two objects are inherently concurrent if they can receive events at the same time without interacting Source for identification: Objects in a sequence diagram that can simultaneously receive events Unrelated events, instances of the same event Inherently concurrent objects can be assigned to different threads of control Objects with mutual exclusive activity could be folded into a single thread of control
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 4 Thread of Control A thread of control is a path through a set of state diagrams on which a single object is active at a time A thread remains within a state diagram until an object sends an event to different object and waits for another event Thread splitting: Object does a non-blocking send of an event to another object. Concurrent threads can lead to race conditions. A race condition (also race hazard) is a design flaw where the output of a process is depends on the specific sequence of other events. The name originated in digital circuit design: Two signals racing each other to influence the output.
Background image of page 4
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 5 Example: Problem with threads :BankAccount c1:Customer c2:Customer :WithdrawCtrl :WithdrawCtrl getBalance() 200 withdraw(50) setBalance(150) getBalance() 200 withdraw(50) setBalance(150) computeNewBalance(200,50) computeNewBalance(200,50) Assume: Initial balance = 200 Final balance = 150 ??! Thread 1 Thread 2 Should BankAccount be another Thread ?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Object-Oriented Software Engineering: Using UML, Patterns, and Java 6 Solution: Synchronization of Threads c1:Customer c2:Customer :BankAccount :WithdrawCtrl getBalance() 200 withdraw(50) setBalance(150) computeNewBalance(200,50) Initial balance = 200 withdraw(50) Single WithdrawCtrl Instance Synchronized method End balance = 100
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/22/2011 for the course CS 101 taught by Professor Dat during the Spring '11 term at Bilkent University.

Page1 / 41

ch07lect1_UD - Using UML Patterns and Java Object-Oriented...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online