1 Chapter 11 Component-Level Design. 2 What is a Component? OMG Unified Modeling Language Specification [OMG01] defines a component as “… a modular, deployable,

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

Chapter 11 Component-Level Design
Chapter 13 Design Concepts and Principles
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
CS /32 Illinois Institute of Technology CS487 Software Engineering Component Level Design & Design Documentation Instructor: David A. Lash.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Component-Level Design
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
1 Chapter 16 Component-Level Design. 2 Component-Level Design  the closest design activity to coding  the approach:  review the design description.
Component-Level Design
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Chapter 11 Component-Level Design
Architectural Design.
Chapter 10 Architectural Design
Design Concepts "You can use an eraser on the drafting table or a sledge hammer on the construction site." Frank Lloyd Wright.
Ch:10 Component Level Design Unit 4. What is Component? A component is a modular building block for computer software Because components reside within.
 2004 by SEC Chapter 4 Software Design. 2  2004 by SEC Chapter 4 Software Design 4.1 Design Fundamentals 4.2 Design Method 4.3 Architecture Design
SOFTWARE DESIGN.
Chapter :11 Component-Level Design
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 11 Slide 1 Design.
Chapter 13 Design Concepts and Principles Software Engineering: A Practitioner's Approach, 5/e.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Programming Techniques Lecture 10 Component-Level Design Based on: Software Engineering, A Practitioner’s Approach, 6/e, R.S. Pressman Software Engineering.
CS 8532: Adv. Software Eng. – Spring 2009 Dr. Hisham Haddad Chapter 11 CS 8532: Advanced Software Engineering Dr. Hisham Haddad Class will start momentarily.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Design Methods Instructor: Dr. Jerry Gao. Software Design Methods Design --> as a multistep process in which we design: a) data structureb) program structure.
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
1 Chapter 16 Component-Level Design. 2 Component-Level Design  the closest design activity to coding  the approach: review the design description for.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Chapter 14 컴포넌트-수준 설계 Component-Level Design
Architectural Design Introduction Design has been described as a multistep process in which representations of data and program structure,
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
Component Design Elaborating the Design Model. Component Design Translation of the architectural design into a detailed (class-based or module- based)
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Component-Level Design and User Interface Design Departemen Ilmu Komputer IPB 2009.
February 19, February 19, 2016February 19, 2016February 19, 2016 Azusa, CA Sheldon X. Liang Ph. D. Software Engineering in CS at APU Azusa Pacific.
Basic Characteristics of Object-Oriented Systems
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11b: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 7/e (McGraw-Hill, 2009). Slides copyright 2009 by Roger Pressman.1.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Design Concepts ch-8
Analysis Classes Unit 5.
Chapter 14 Component-Level Design
Component-Level Design
Software Engineering: A Practitioner’s Approach, 6/e Chapter 11 Component-Level Design copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc.
Software Quality Engineering
CIS 375 Bruce R. Maxim UM-Dearborn
Chapter 10 Component-Level Design
Component-Level Design
Component-Level Design
Component-Level Design
Chapter 16 Component-Level Design
Component-Level Design
Object-Oriented Design
Software Design CMSC 345, Version 1/11.
DESIGN CONCEPTS AND PRINCIPLES
COSC 4406 Software Engineering
Chapter 10 – Component-Level Design
Presentation transcript:

1 Chapter 11 Component-Level Design

2 What is a Component? OMG Unified Modeling Language Specification [OMG01] defines a component as “… a modular, deployable, and replaceable part of a system that encapsulates implementation and exposes a set of interfaces.”

3 OO view of Component Design A component contains a set of collaborating classes, Basic design concept Begin with the analysis model Elaborate Analysis classes Infrastructure classes Example Print shop

4 OO Component PrintJob computeJob initiateJob i i l i ii i l passJobto Production() design component numberOfPages numberOfSides paperType magnification productionFeatures PrintJob computeJobCost() passJobtoPrinter() analysis class

5 Conventional view of Component Design Component from conventional view processing logic the internal data structures implementing processing logic an interface that enables the component to be invoked and data to be passed to it Basic design concept Begin with the analysis model, usually DFD Transform DFD into structure chart Elaborate each module in structure chart Control component Problem domain component Example Print Shop

6 Structure Chart

7 Conventional Component

8 Basic OO-Design Principles The Open-Closed Principle (OCP). “A module [component] should be open for extension but closed for modification. Example: Detector class for the SafeHome security function

9 Basic OO-Design Principles (cont.) The Liskov Substitution Principle (LSP). “Subclasses should be substitutable for their base classes. Dependency Inversion Principle (DIP). “Depend on abstractions. Do not depend on concretions.” The Interface Segregation Principle (ISP). “Many client-specific interfaces are better than one general purpose interface. Example – FloorPlan class for the SafeHome Sensor management may be different from and camera management Need specific operations for surveillance interface

10 Basic OO-Design Principles (cont.) Additional packaging principles The Release Reuse Equivalency Principle (REP). “The granule of reuse is the granule of release.” component level or package level The Common Closure Principle (CCP). “Classes that change together belong together.” Class should be packaged cohesively The Common Reuse Principle (CRP). “Classes that aren’t reused together should not be grouped together.”

11 Guidelines for OO-Component Design Components Naming conventions should be established for components that are specified as part of the architectural model and then refined and elaborated as part of the component-level model For problem domain component: use meaningful name for all stakeholders viewing the architectural model Example: class FloorPlan For infrastructure component: Use implementation-specific name Example: manageList()

12 Guidelines for OO-Component Design (cont.) Interfaces Interfaces provide important information about communication and collaboration (as well as helping us to achieve the OCP) Recommendation for simplified UML component diagram Use lollipop representation when diagrams grow complex Interfaces should flow from the left-hand side of the component box Show only those interfaces relevant to the component

13 Guidelines for OO-Component Design (cont.) Dependencies and Inheritance It is a good idea to model dependencies from left to right and inheritance from bottom (derived classes) to top (base classes) Represent component interdependencies through interfaces

14 Cohesion Conventional view: the “single-mindedness” of a module OO view: cohesion implies that a component or class encapsulates only attributes and operations that are closely related to one another and to the class or component itself Levels of cohesion Functional Layer Communicational Sequential Procedural Temporal Utility: Statistics class The most basic and important

15 Example–Layer Cohesion

16 Coupling Conventional view: The degree to which a component is connected to other components and to the external world OO view: A qualitative measure of the degree to which classes are connected to one another Level of coupling Content: violate information hiding Common: invoke global variable Control: A() invoke B() passing a flag Stamp: a class B is declared as type of operation in A Data: passing long strings of arguments Routine call Type use: a component A use data type defined in B Inclusion or import External

17 Component Level Design-I Step 1. Identify all design classes that correspond to the problem domain. Step 2. Identify all design classes that correspond to the infrastructure domain. Step 3. Elaborate all design classes that are not acquired as reusable components. Step 3a. Specify message details when classes or component collaborate. ExampleExample Step 3b. Identify appropriate interfaces for each component. Check cohesion and apply refactoring.refactoring Step 3c. Elaborate attributes and define data types and data structures required to implement them. ExampleExample Step 3d. Describe processing flow within each operation in detail. Use pseudocode or UML activity diagram.activity diagram

18 Component-Level Design-II Step 4. Describe persistent data sources (databases and files) and identify the classes required to manage them. Step 5. Develop and elaborate behavioral representations for a class or component. Use UML statechart diagram.statechart diagram Step 6. Elaborate deployment diagrams to provide additional implementation detail. Specific hardware, operating system Step 7. Factor every component-level design representation and always consider alternatives.

19 Collaboration Diagram

20 Refactoring

21 Attribute Type Defined UML type declaration paperWeight: string = ‘A’ {contains 1 of 4 values – A, B, C, or D}

22 Activity Diagram computePaperCost(weight, size, color): numeric

23 Statechart Transition form: Event-name (parameter-list) [guard-condition]/action expression written in Object ConstraintLanaguage (OCL) Example: for jobCostAccepted event customer self.authorizationAuthority = ‘yes’

24 Object Constraint Language (OCL) Complements UML by allowing a software engineer to use a formal grammar and syntax to construct unambiguous statements about various design model elements Simplest OCL language statements are constructed in four parts: (1) a context that defines the limited situation in which the statement is valid; (2) a property that represents some characteristics of the context (e.g., if the context is a class, a property might be an attribute) (3) an operation (e.g., arithmetic, set-oriented) that manipulates or qualifies a property, and (4) keywords (e.g., if, then, else, and, or, not, implies) that are used to specify conditional expressions.

25 OCL Example context PrintJob::validate(upperCostBound : Integer, custDeliveryReq : Integer) pre: upperCostBound > 0 and custDeliveryReq > 0 and self.jobAuthorization = 'no' post: if self.totalJobCost <= upperCostBound and self.deliveryDate <= custDeliveryReq then self.jobAuthorization = 'yes' endif

26 Algorithm Design the closest design activity to coding the approach: review the design description for the component use stepwise refinement to develop algorithm use structured programming to implement procedural logic use ‘formal methods’ to prove logic

27 Stepwise Refinementopen walk to door; reach for knob; open door; walk through; close door. repeat until door opens turn knob clockwise; if knob doesn't turn, then take key out; take key out; find correct key; find correct key; insert in lock; insert in lock; endif pull/push door move out of way; end repeat

28 Algorithm Design Model represents the algorithm at a level of detail that can be reviewed for quality options: graphical (e.g. flowchart, box diagram) pseudocode (e.g., PDL)... choice of many programming language decision table conduct walkthrough to assess quality

29 Structured Programming for Procedural Design uses a limited set of logical constructs: sequence conditional — if-then-else, select-case — if-then-else, select-case loops — do-while, repeat until — do-while, repeat until leads to more readable, testable code important for achieving high quality, but not enough can be used in conjunction with ‘proof of correctness’

30 A Structured Procedural Design

31 Decision Table

32 Program Design Language (PDL)

33 component alarmManagement; The intent of this component is to manage control panel switches and input from sensors by type and to act on any alarm condition that is encountered. set default values for systemStatus (return value), all data items initialize all system ports and reset all hardware check controlPanelSwitches (cps) if cps = “test” then invoke alarm set to “on” if cps = “alarmOff” then invoke alarm set to “off”. default for cps = none reset all singalValues and switches do for all sensors invoke checkSensor procedure returning singalValue if signalValue > bound [alarmType] then phone.message = message [alarmType] set alarmBell to “on” for alarmTimeSeconds set system status = “alarmCondition” parbegin invoke alarm procedure with “on”, alarmTimeSeconds; invoke phone procedure set to alarmType, phoneNumber parend else skip endif enddofor end alarmManagement component alarmManagement; The intent of this component is to manage control panel switches and input from sensors by type and to act on any alarm condition that is encountered. set default values for systemStatus (return value), all data items initialize all system ports and reset all hardware check controlPanelSwitches (cps) if cps = “test” then invoke alarm set to “on” if cps = “alarmOff” then invoke alarm set to “off”. default for cps = none reset all singalValues and switches do for all sensors invoke checkSensor procedure returning singalValue if signalValue > bound [alarmType] then phone.message = message [alarmType] set alarmBell to “on” for alarmTimeSeconds set system status = “alarmCondition” parbegin invoke alarm procedure with “on”, alarmTimeSeconds; invoke phone procedure set to alarmType, phoneNumber parend else skip endif enddofor end alarmManagement Example PDL