Title: Framework Design by Systematic Generalization
1Framework Design by Systematic Generalization
- Jian Tang
- CSCE 896
- Software Framework and Architecture
2Overview
- Introduction
- Framework Design Activities
- Summary
3Introduction
- Framework Domain
- Hot spot VS. Frozen spot
- Framework design requires a great deal of
experience and experimentation - Flexibility and Variability
- 3 heuristics
- start with a fixed application
- work on different variable aspects at one time
- capture and specify the degree of variability and
flexibility
4Framework Design Activities
- Create Class Model of Fixed Application
- Hot-Spot high-Level Analysis
- Detail Analysis and Specification of Hot-spots
- High-Level design of Hot-Spot Subsystem
- Transform Class Model by Generalization with
Hot-Spot Subsystem
5Step1 Create Class Model of Fixed Application
- Class Model
- fixed entities
- fixed relationship
- Example
- Editor
- Class diagram in next page
6Step1 Create Class Model of Fixed Application
(Contd)
7Hot Spots
- Characteristics
- Name
- Description
- Responsibility
- Concrete examples
- Variability
- Parameterization
- Granularity
- Multiplicity
- Binding time
8Step 2 3 Hot Spot Analysis
- All variables from the framework domain
- Hot Spot high-level analysis
- collects all hot spots
- Hot spot detail analysis
- create hot spot specification for each hot spot
9Step 2 Hot-Spot High-level Analysis
- Identify and collect all hot spots
- overview of all variability and flexibility
- Editor
- Other Elements besides texts (hs1)
- other composition facilities (hs2)
- different formatting algorithms (hs3)
- portability(hs4)
- variable application window embellishment (hs5)
- look-and-feel standards(hs6)
10Step 3 Hot-Spot Detail Analysis and Specification
- Do separately for each hot spot
- Describe its characteristics
- Partition to elementary HS
- Examples in next page
11Hot-Spot Detail Analysis and Specification (HS1)
- HS1 Variability of basic document elements
- Description other elements besides characters
- Responsibility print, width, height
- Concrete examples graphics, raster pic,
character - Variability same interface, different
implementation - Parameterization no
- Granularity elementary
- Multiplicity one
- Binding time runtime
12Hot-Spot Detail Analysis and Specification (HS2)
- HS2 Variable aggregation of document elements
- Description more facilities to compose a
document - Responsibility basic plus aggregation-related
responsibility - Concrete examples row, column
- Variability variable hierarchy of aggregation
- Parameterization no
- Granularity elementary
- Multiplicity n
- Binding time runtime, multiple times
13Hot-Spot Detail Analysis and Specification (HS3)
- HS3 Variability of formatting algorithms
- Description different algorithms
- Responsibility format a document on a service
request - Concrete examplesdifferent algorithms
- Variability different algorithms can be used
- Parameterization no
- Granularity elementary
- Multiplicity 1
- Binding time runtime, multiple times
14Hot-Spot Detail Analysis and Specification (HS4)
- HS4Variability of window system
- Description portable in different window systems
- Responsibility drawing operations, iconify,
resize - Concrete examples Mac, PM, Windows
- Variability can be used in different window
system - Parameterization no
- Granularity elementary
- Multiplicity 1
- Binding time creation time
15Hot-Spot Detail Analysis and Specification (HS5
HS6)
- HS5Variability of user interface embellishments
- Description different window embellishments
- Variability attach different decorations to
object - Multiplicity n
- Binding time creation time
- HS6Variability of look-and-feel standards
- Description different look-and-feel standards
- Variability create object from different classes
- Multiplicity 1
- Binding time creation time
16Step 4 High-level Design of Hot-Spot Subsystem
- Hot Spot Subsystem
- base class (typically, abstract)
- common R for all HS alternatives
- concrete derived class
- one of the instance
- possibly, additional classes and relationship
- Hot spot Subsystem design
- derives the high-level design of a hot-spot
subsystem from the hot-spot specification
17Hot Spot Subsystem
- How to introduce variability and flexibility
- Inheritance
- Inheritance-based hot spot subsystem
- aggregation
- Composition-based hot spot subsystem
18Inheritance-based hot spot sub-system and
composition-based sub-system
- Inheritance-based Vs. Composition-based
19Hot Spot Subsystem
- Three categories
- Nonrecursive
- service provided from one subclass object.
- Pattern Ex. Strategy
- 11 (chain-structured) recursive
- service provided by n chained subclass objects
- Pattern Ex. Decorator
- 1n (tree-structured) recursive
- service provided by a tree of n subclass objects
- Pattern Ex. Composite
20Hot Spot Subsystem (contd)
- Diagrams for three categories
21Hot Spot Subsystem (contd)
- Diagrams for three categories (contd)
22Hot Spot Subsystem (contd)
- Design patterns
- describe typical, common and frequently observed
relationships among classes. - Characteristics
- provide a different kind of variability and
flexibility - center around a base class and subclass
- some contains additional classes
- Get a clue?
- Structuring a hot-spot system following a design
pattern
23Hot Spot Subsystem High-level Design
- Derives the high-level design of a hot-spot
subsystem from the hot-spot specification - Hot-spot specification
- description of variable aspects
- multiplicity
- kind of variability
-
- select appropriate design pattern
- examples in next page
24Hot Spot Subsystem High-level Design (contd)
- Examples of hot spot subsystem HL design
- HS1
- Multiplicity 1 gt Nonrecursive DP
- Variability common interface with different
implementationsgtInterface Inheritance Pattern - HS2
- Multiplicity n gt 1n recursive DP
- Variability flexible hierarchical aggregation gt
Composite Pattern
25Step 5 Generalization Transformation
- Transforms the framework class structure and
generalizes it with regard to one aspect - Transform frozen spot to hot spot subsystem
- replace fixed, specialized class with hot spot
subsystem.
26Expanding VS. Extending
- Expanding transformation
- the base class of the HS subsystem is introduced
as a new class - Extending transformation
- the responsibility of an existing class is
extended by the responsibility of the base class
27Expanding Transformation
28Extending Transformation
29Transformations Generalizing the Editor
30Transformations Generalizing the Editor
31Transformations Generalizing the Editor
32Transformations Generalizing the Editor
33Transformations Generalizing the Editor
34Transformations Generalizing the Editor
35Summary
- 5 activities
- Review 3 important phases
- Hot spot specification
- Hot spot subsystem high-level design
- Transformations