111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, 1990. (Chapter 7)

Slides:



Advertisements
Similar presentations
11 Contracts CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 6)
Advertisements

Software Engineering Key design concepts Design heuristics Design practices.
Structured Design. 2 Design Quality – Simplicity “There are two ways of constructing a software design: One is to make it so simple that there are obviously.
1 Object-oriented design Part 2: OO tools & UML. 2 CRC cards Design tool & method for discovering classes, responsibilities, & relationships Record on.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
Documenting Information Systems
Ch 12: Object-Oriented Analysis
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
1 Classes. 2 Finding classes w Choosing classes is first step in defining essence of problem w If you can recognize an abstraction, you’ve found a candidate.
Chapter 12 ATM Case Study, Part 1: Object-Oriented Design with the UML
Interaction Diagrams Activity Diagram State Machine Diagram
Use-case Modeling.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
May-June 2001 ISISTAN Research Institute – Tandil, Argentina Software Design Methodologies: UML in Action Dr. Mohamed Fayad, J.D. Edwards Professor Department.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
© 2005 Prentice Hall3-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
Data Abstraction: The Walls
L6-1-S1Design Heuristics - 1 © M.E. Fayad SJSU -- CmpE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department,
Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.
Use Case Modeling. Use case diagram For each use case we develop  Object class diagram (with attributes only)  System sequence diagram (analysis) 
Chapter 7 Structuring System Process Requirements
System Analysis Overview Document functional requirements by creating models Two concepts help identify functional requirements in the traditional approach.
The Design Discipline.
1.  Modeling the context of a system  Modeling the requirements of a system 2.
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
Chapter 3 Systems Documentation Techniques Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 3-1.
CS212: Object Oriented Analysis and Design Lecture 4: Objects and Classes - I.
Faculty of Computer & Information Software Engineering Third year
UML basics UML distilled, a brief guide to the standard Modeling language, by Martin Fowler, 2000.
Chapter 9 Moving to Design
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Software Design Deriving a solution which satisfies software requirements.
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
CS Collaborations and Hierarchies CS 4311 Chapters 5 and 6 of Wirfs-Brock, R., Wilkerson, B., and Wiener, L., Designing Object- Oriented Software,
Software Design Process A solution to satisfy the requirements ◦ Design process and methods ◦ Design strategies including object-oriented design and functional.
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
1 Systems Analysis and Design in a Changing World, Thursday, January 18, 2007.
Systems Analysis and Design in a Changing World, 3rd Edition
GRASP: Designing Objects with Responsibilities
CS Overview of CRC CS 4311 B. Beck and W. Cunningham, A Laboratory for Teaching Object-Oriented Thinking, OOPSLA ’89, October 1-6, R. Wirfs-Brock,
© 2005 Prentice Hall9-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
CS Collaborations and Hierarchies CS 4311 Chapters 5 and 6 of Wirfs-Brock, R., Wilkerson, B., and Wiener, L., Designing Object- Oriented Software,
Lecture OO05 Object Scenarios Object Interaction Diagrams
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
1 Examining Execution Sequences Introducing Sequence Diagrams.
Lecture 18: Object-Oriented Design
Protocols Software Engineering II Wirfs Brock et al, Designing Object-Oriented Software, Prentice Hall, Mitchell, R., and McKim, Design by Contract,
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)
UML - Development Process 1 Software Development Process Using UML.
Use Case Diagrams. Introduction In the previous Lecture, you saw a brief review of the nine UML diagrams. Now that you have the clear, you'll start to.
© 2005 by Prentice Hall Chapter 7 Structuring System Process Requirements Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Chapter 7 Part II Structuring System Process Requirements MIS 215 System Analysis and Design.
Identification of Classes. Object Oriented Analysis (OOA) OOA is process by which we identify classes that play role in achieving system goals & requirements.
Appendix Object-Oriented Analysis and Design: Use Cases and Sequence Diagrams Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
1 Object-Oriented Static Modeling of the Banking System - III Lecture # 33.
Subsystems 02/ 09. Subsystem A component Encapsulates data Bundles operations with information.
Design Concepts ch-8
Dynamic Modeling of Banking System Case Study - I
Unified Modeling Language
Collaborations and Hierarchies
CRC: Classes, Responsibilities, and Collaborations
Chapter 11 Following the Trail; Examining Execution Sequences
Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract, Computer,
Software Development Process Using UML Recap
Implementation Plan system integration required for each iteration
Presentation transcript:

111 Subsystems CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 7)

222 Outline Subsystems: what and why? Subsystem documentation  Subsystems cards  Collaboration graphs Guidelines for defining subsystems

333 Steps for Producing Initial Designs Identify  Classes  Responsibilities  Collaborations Analyze  Class hierarchies  Contracts  Collaboration graphs

4 Motivation: Collaboration Graph Account 12 Balance Deposit Withdrawal Transfer Transaction 8 Display Device Input Device BCR Output Device ATM Form Menu User Message User Interaction 4 6 9

5 Problem Collaboration graphs get very complicated.  Too many lines (i.e., interactions or communications) Designs become incomprehensible. How to simply the design, esp. patterns of communications?

6 Solution Need an abstraction tool to provide macro views Collect classes together to form subsystems that  Behave like a class.  Support services to outside via contracts.

7 What Are Subsystems? Groups of classes that collaborate among themselves to support a set of contracts Goal: To simplify patterns of communications

8 What Are Subsystems? (Cont.) Subsystems are not super classes. Subsystems are not “just a bunch of classes.” Subsystems should provide a good abstraction. Subsystems should provide a clearly defined interface, called subsystem contracts.

9 Subsystem Contracts All contracts supported  by things inside a subsystem  for things outside the subsystem. Delegation of contracts Printing Subsystem Print Server Printer Laser Printer InkJet Printer 1 1 2

10 Subsystem Cards for Documenting Subsystems Write the subsystem name at the top List all classes in the subsystem Include ref. to the subsystem’s position in the collaborations graphs Describe the purpose of the subsystem List contracts for which it is a server For each contract, identify the class or subsystem to which the contract is delegated

11 Subsystem Cards (Cont.) Subsystem: Drawing Subsystem Classes: Control Point, Drawing, Drawing Element, … Collaborations Graphs: see Figure 4-6 Description: Responsible for displaying and maintaining the contents of the drawing… Contracts 1. Display itself Server: Drawing 2. Access and modify the contents of a drawing Server: Drawing 3. Modify the attributes of a Drawing Element Server: Control Point

12 How to Identify Subsystems? Bottom-up and top-down approaches Bottom up  Start with classes and responsibilities  Identify collaborations  Partition the classes based on patterns of collaborations  This approach is useful when managing the complexity as a system grows.

13 Subsystem Identification Draw collaboration graph (use white board). Look for strongly coupled classes. Look for ways to simplify your description of the system. Look for clean separations. Look for good abstractions.

14 How to Identify Subsystems? Top down  Look at high level functions of system  Look at data sources and uses  Look at supporting technologies  Partition to manage complexity and reduce coupling  This approach may be useful when managing the complexity imposed by initial specification.

15 Guidelines for Simplifying Interactions Minimize number of collaborations a class has with other classes or subsystems. Minimize number of classes and subsystems to which a subsystem delegates. Minimize number of contracts supported by a class or subsystem.

16 G-1: Minimize Number of Collaborations Class should collaborate with as few other classes and subsystems as possible. (Why?) Heuristic: Centralize communications

17 Example Printing Subsystem Print Server Printer Laser Printer Color Printer File 3 Printing Subsystem Print Server Printer Laser Printer Color Printer File 3

18 G-2: Minimize Delegations of Subsystem Contracts Keep the number of classes inside the subsystem that support subsystem contracts to a minimum Again, centralize communications into and out of the subsystem

19 G-3: Minimize Number of Contracts Too many contracts in one place indicate too much intelligence concentrated in one place: split the functionality between two or more classes. Re-examine the collaboration patterns

20 Example Cash Register Warehouse Inventory Item Transaction Log Accounting Subsystem 213

21 Example Cash Register Warehouse Inventory Item Transaction Log Accounting Subsystem 213

22 Example Refined Cash Register Warehouse Inventory Item Transaction Log Accounting Subsystem Inventory Subsystem

23 Inventory Manager Example Refined Again Cash Register Warehouse Inventory Item Transaction Log Accounting Subsystem Inventory Subsystem 4646

24 Inventory Manager Example Refined Further Cash Register Warehouse Inventory Item Transaction Log Accounting Subsystem Inventory Subsystem

25 If You Have to Redesign... Redraw the graphs Re-examine the collaboration patterns Walk through scenarios (all of them) Verify that things are simpler, have improved cohesion and reduced coupling

26 ATM Example: Contracts 1. Account: access and modify balance 2. Account: commit result to database 3. Display: display information 4. Form: get numeric value from user 5. Input Device: accept user input 6. Menu: get user selection 7. Output Device: output to the user 8. Transaction: execute financial transaction 9. User Message: display message and wait

27 Collaboration Graph Account 12 Balance Deposit Withdrawal Transfer Transaction 8 Display Device Input Device BCR Output Device ATM Form Menu User Message User Interaction 4 6 9

28 Refining Account 12 Balance Deposit Withdrawal Transfer Transaction 8 Display Device Input Device BCR Output Device ATM Form Menu User Message User Interaction 4 6 9

Simplified Graph 1 Financial Subsystem 8 Display Device Input Device BCR Output Device ATM Form Menu User Message User Interaction 4

Refining Financial Subsystem 8 Display Device Input Device BCR Output Device ATM Form Menu User Message User Interaction 4

Simplified Graph 2 Financial Subsystem ATM 4 I/O Subsystem User Interaction Subsystem

32 ATM Even More Simplified Graph Financial Subsystem User Interface Subsystem

33 ATM Even More Simplified Graph Financial Subsystem User Interface Subsystem Any critique?

34 Rework Rework your design. If it isn’t changing, you’re not working. Do not change just to change, but change based on recognition of better design. Take pride in your work.

35 Group Work and Assignment Group work (see handout) Subsystems for the project  Due: Mar. ?, 2015  Leader: Architect  Contents Class diagram showing all classes and their relationships (inheritance and associations) Contracts by refining your CRC cards Subsystems by grouping classes and identifying subsystem contracts (subsystem cards) Collaboration graphs