Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Software Engineering Lecture 8 André van der Hoek.

Similar presentations


Presentation on theme: "Introduction to Software Engineering Lecture 8 André van der Hoek."— Presentation transcript:

1 Introduction to Software Engineering Lecture 8 André van der Hoek

2 Today’s Lecture USES relation IS-COMPOSED-OF relation COMPRISES diagram USES diagram

3 In Design, We Can Do Anything… Provided Interface Big Component Required Interface Provided Interface Tiny Component Required Interface Provided Interface B Component Required Interface Provided Interface Mr. Component Required Interface Provided Interface A Component Required Interface Provided Interface Yet Component Required Interface Provided Interface Some Component Required Interface Provided Interface One Component Required Interface Provided Interface Mrs. Component Required Interface

4 …Even when Restricted by Style What happened here? Provided Interface Layer 4 Required Interface Provided Interface Layer 3 Required Interface Provided Interface Layer 2 Required Interface Provided Interface Layer 1 Required Interface

5 Fan-in and Fan-out High fan-in Low fan-out Low fan-in High fan-out USUALLY GOOD!USUALLY BAD! Provided Interface Component Required Interface Provided Interface Component Required Interface

6 USES Relation Definition Level 0: those modules that do not use any other modules Level i: those modules that use at least one module at level i – 1 and use no modules at level i or greater Use Determine flexibility Determine reuse Determine incremental testability

7 Example Level 2 Level 1 Level 0 Provided Interface Big Component Required Interface Provided Interface A Component Required Interface Provided Interface Tiny Component Required Interface Provided Interface Yet Component Required Interface

8 Observations The USES relation does not necessarily form a hierarchy An acyclic directed graph is good Cycles generally are bad Indication of high coupling Indication of broken separation of concerns Rules of thumb: allow a to use b… …if it makes a simpler …if b is not only used by a but also by other components

9 IS-COMPONENT-OF Relation Definition Module M i IS-COMPONENT-OF module M if M is realized by aggregating several modules, one of which is M i The combined set of all modules that exhibit the IS-COMPONENT-OF relation with respect to module M are said to implement module M Use Determine hierarchical decomposition of a component in its subcomponents Abstract details

10 Example Compressor IS-COMPONENT-OF Audio Encoder Encoder IS-COMPONENT-OF Audio Encoder Reader IS-COMPONENT-OF Audio Encoder Compressor, Encoder, and Reader IMPLEMENT Audio Encoder Audio Encoder IS-COMPOSED-OF Compressor, Encoder, and Reader Provided Interface Audio Encoder Required Interface Compressor Provided Interface EncoderReader Required Interface

11 Comprises Diagram Provided Interface Yet Component Required Interface Provided Interface Tiny Component Required Interface Provided Interface B Component Required Interface Provided Interface Mr. Component Required Interface Provided Interface Required Interface Provided Interface Big Component Required Interface Provided Interface A Component Required Interface Provided Interface Required Interface Bla Component Duh Component Doh Component

12 USES Diagram – Step 1 Provided Interface Yet Component Required InterfaceProvided Interface Tiny Component Required Interface Provided Interface B Component Required Interface Provided Interface Mr. Component Required Interface Provided Interface Required Interface Provided Interface Big Component Required Interface Provided Interface A Component Required Interface Provided Interface Duh Component Doh Component

13 USES Diagram – Step 2 Provided Interface Yet Component Required Interface Provided Interface Tiny Component Required Interface Provided Interface B Component Required Interface Provided Interface Mr. Component Required Interface Provided Interface Big Component Required Interface Provided Interface A Component Required Interface

14 USES Diagram – Step 3 Provided Interface Yet Component Required Interface Provided Interface Tiny Component Required Interface Provided Interface B Component Required Interface Provided Interface Mr. Component Required Interface Provided Interface Big Component Required Interface Provided Interface A Component Required Interface

15 USES Diagram – Step 4 Provided Interface Yet Component Required Interface Provided Interface Tiny Component Required Interface Provided Interface B Component Required Interface Provided Interface Mr. Component Required Interface Provided Interface Big Component Required Interface Provided Interface A Component Required Interface 2 3 2 1 1 0

16 Observations Why do we identify higher-level modules in the first place? Understanding Abstraction through composition IS-COMPONENT-OF is not is-attribute-of is-inside-of-on-the-screen is-subclass-of is-accessed-through-the-menu-of

17 The Design Process Repeat the design process Design the internal architecture of a component Define the purpose of each module Define the provided interface of each module Define the required interface of each module Do this over and over again Until each module has… …a simple, well-defined internal architecture …a simple, well-defined purpose …a simple, well-defined provided interface …a simple, well-defined required interface Until all modules “hook up”

18 Techniques to Use Tools of the trade Apply information hiding Use requirements specification Determine usage patterns Anticipate change Design for generality/incrementality Design for program families Strive for Low coupling/high cohesion A clean IS-COMPOSED-OF structure A clean USES structure

19 Your Tasks 1. Read and study slides of this lecture


Download ppt "Introduction to Software Engineering Lecture 8 André van der Hoek."

Similar presentations


Ads by Google