Reuse Technologies & Niches
Ted J. BiggerstaffTed J. Biggerstaff
The scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
Feature variabilityOne-sizefits all
Customized
Small, lowpayoff
Large, highpayoff
Reu
se P
ayof
f
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, …
Concrete Components Small components don’t work wellSmall components don’t work well
Assembly work per unit payoff is lowAssembly work per unit payoff is low Small components specialized niches OKSmall components specialized niches OK
Overhead masked by human response (e.g., UI)Overhead masked by human response (e.g., UI) Standards or domain narrowness mitigateStandards or domain narrowness mitigate
Big components work wellBig components work well Programs or subsystemsPrograms or subsystems High programming leverageHigh programming leverage Payoff dominates overhead costsPayoff dominates overhead costs
Example: UI Controls
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
ConventionalComponents
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components Compositionally Derived Components
e.g., Templates, GenVoca, …e.g., Templates, GenVoca, …
GenVoca derives a container
deque_usm = deq_sync [ deque2c [ dlist [ avail [ heap [ transient ]]]]];
ContainerClass
ElementClass
dlist
heap
deq-sync
deque2c
avail
transient
Refinements
List elements from heap
Deque
Synchronized deque
Container
Doubly linked list
Managed linked list
Transient elements
TypeEquation
Compositional Derivation Example domain: Data structuresExample domain: Data structures Benefits:Benefits:
Improve reuse by raising level of abstractionImprove reuse by raising level of abstraction Combinatorial amplification of library (horz.)Combinatorial amplification of library (horz.) Generation is fastGeneration is fast
Shortcomings:Shortcomings: Level of abstraction still lowLevel of abstraction still low Large grain components mitigate horz. scalingLarge grain components mitigate horz. scaling Dependencies limit extensibilityDependencies limit extensibility Inter-component optimization difficultInter-component optimization difficult
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.CompositionComposition Abstract PL Abstract PL InliningInlining
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
DerivedComponents
ConventionalComponents
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components Compositionally Derived Components
e.g., Templates, GenVoca, …e.g., Templates, GenVoca, … Pattern-directed transformation systemsPattern-directed transformation systems
e.g., Draco, CAPE, IP, DMS, ...e.g., Draco, CAPE, IP, DMS, ...
Draco Domains
Abstractions:
Keys,Relations,Attributes, …Operations:
Search, Delete,Add, Update,
Attach,Detach, ...
Abstractions:Cursor, Container,
Keys,Relations,Attributes, …Operations:
Search, Delete,Add, Update,
Attach,Detach, ...
Data Base
RelationalAlgebra
Abstract DataTypes
C Code
Tuple Index
Refinements
Data Base
Relational
Algebra
Abstract Data
TypesC Code
Tuple Index
Component: Insert(Value V, Container C){Refinement: Stack Condition: LIFO(C) Code: {Push(V,C)}}{Refinement: Sorted Container Condition: SortedOn(C, Value) Assertion: SortedOn(C, Value) Code: {Merge(V,C)}}
...}
Domain to self:Join(?Relation1, Empty_Relation, ?Attribute)=>Empty_RelationSelect(?Relation1,TRUE_expression)=>Relation1Select(?Relation1,FALSE_expression)=> Empty_Relation
Data Base
Relational
Algebra
Abstract Data
TypesC Code
Tuple Index
Optimizing Transforms
Pattern-Directed Transformations Example domain: communications protocols Example domain: communications protocols Benefits:Benefits:
Fine grain rules allow great horizontal scalingFine grain rules allow great horizontal scaling Mapping between language objectsMapping between language objects Powerful in-domain optimizationsPowerful in-domain optimizations
Shortcomings:Shortcomings: Cross domain optimizations (interweavings) can Cross domain optimizations (interweavings) can
explode search spaceexplode search space
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.CompositionComposition Abstract PL Abstract PL InliningInliningPD GeneratorPD Generator DSL Struct. DSL Struct. PD XformsPD Xforms
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
DerivedComponents
PatternDirected
ConventionalComponents
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components Compositionally Derived Components
e.g., Templates, GenVoca, …e.g., Templates, GenVoca, … Pattern-directed transformation systemsPattern-directed transformation systems
e.g., Draco, CAPE, IP, DMS, ...e.g., Draco, CAPE, IP, DMS, ... Reorganizing generator systemsReorganizing generator systems
AO generator, AOP, ...AO generator, AOP, ...
Problem: Antagonistic Goals
High level operators and operands provide High level operators and operands provide programming leverage & variationsprogramming leverage & variations
E.g., (image E.g., (image neighborhood) convolution neighborhood) convolution But fracture and de-localize code piecesBut fracture and de-localize code pieces
b=((a b=((a s) s)22 + (a + (a s’) s’)22 ) )1/21/2
Needed optimizations: code sharing, re-org. & re-weavingNeeded optimizations: code sharing, re-org. & re-weaving Conventional Optimization approaches induce Conventional Optimization approaches induce
large search spaceslarge search spaces
AOG Features Schema language foundationSchema language foundation Pattern-driven & tag-driven transformsPattern-driven & tag-driven transforms
Organized by inheritance type and by stageOrganized by inheritance type and by stage Tags capture non-pattern-driven knowledgeTags capture non-pattern-driven knowledge Tags act like AST-localized interrupts for performing Tags act like AST-localized interrupts for performing
optimizationsoptimizations
TD’s are large-grain programmatic transformsTD’s are large-grain programmatic transforms Specialists: Partial evaluator & inference engineSpecialists: Partial evaluator & inference engine No explicit loopsNo explicit loops PerformancePerformance with small search spaceswith small search spaces
Reorganizing Generators
Benefits:Benefits: Inter-component optimizations (reweavings)Inter-component optimizations (reweavings) Small search space = reasonably fastSmall search space = reasonably fast
Shortcomings:Shortcomings: Technology immatureTechnology immature Unclear how far it can be pushedUnclear how far it can be pushed
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.CompositionComposition Abstract PL Abstract PL InliningInliningPD GeneratorPD Generator DSL Struct. DSL Struct. PD XformsPD XformsReorg Generator Tagged DSLReorg Generator Tagged DSL PDX & PDX &
TDXTDX
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
PatternDirected
ReorganizingSubsystem
LevelComponents
DerivedComponents
ConventionalComponents
Reuse Technologies Concrete componentsConcrete components
e.g., Functions, OOP, Frameworks, DCOM, …e.g., Functions, OOP, Frameworks, DCOM, … Compositionally Derived Components Compositionally Derived Components
e.g., Templates, GenVoca, …e.g., Templates, GenVoca, … Pattern-directed transformation systemsPattern-directed transformation systems
e.g., Draco, CAPE, IP, DMS, ...e.g., Draco, CAPE, IP, DMS, ... Reorganizing generator systemsReorganizing generator systems
AO generator, AOP, ...AO generator, AOP, ...
Inference-driven generator systemsInference-driven generator systems Kids, Synapse, ...Kids, Synapse, ...
Inference-Based Generators
Paradigm: Schema + rules of inferenceParadigm: Schema + rules of inference Example: Divide-and-conquer schemaExample: Divide-and-conquer schema
Broad framework for solutionBroad framework for solution User specification: Formal specification User specification: Formal specification
(e.g., predicate calculus)(e.g., predicate calculus)
Inference-Based Generators Example: Kids generatorExample: Kids generator Benefits:Benefits:
Highest levels of horizontal scalingHighest levels of horizontal scaling Shortcomings:Shortcomings:
Formal specifications require ultra-stable Formal specifications require ultra-stable applicationapplication
Requires well-understood domain with deep theoryRequires well-understood domain with deep theory Immaturity and narrow => low vertical scaling Immaturity and narrow => low vertical scaling
Essence of The Technology
ClassClass ElementsElements OperationsOperationsConcrete Reuse PL Struct. Concrete Reuse PL Struct. Hand Assem.Hand Assem.CompositionComposition Abstract PL Abstract PL InliningInliningPD GeneratorPD Generator DSL Struct. DSL Struct. PD XformsPD XformsReorg Generator Tagged DSLReorg Generator Tagged DSL PDX & PDX &
TDXTDXInfer GeneratorInfer Generator DSL+Logic DSL+Logic InferenceInference
Niches in the scaling plane
Vertical(Programming
leverage)
Horizontal (Optimality of fit)
SubsystemLevel
Components
DerivedComponents
PatternDirected
Reorganizing
InferenceBasedConventional
Components
Reuse Technologies Concrete componentsConcrete components
Limited islands of successful reuseLimited islands of successful reuse Compositionally Derived Components Compositionally Derived Components
More horizontal scaling but no inter-part reweavingMore horizontal scaling but no inter-part reweaving Pattern-directed transformation systemsPattern-directed transformation systems
Extends both but big search space for reweavingExtends both but big search space for reweaving Reorganizing generator systemsReorganizing generator systems
Reweavings gain horiz. scaling but immature Reweavings gain horiz. scaling but immature
Inference-driven generator systemsInference-driven generator systems Greatest horiz. scaling but formality limits useGreatest horiz. scaling but formality limits use
References Biggerstaff, A Perspective of Generative Reuse, Biggerstaff, A Perspective of Generative Reuse,
Annals of Software EngAnnals of Software Eng., 1998., 1998 Biggerstaff, Fixing Some Transformation Biggerstaff, Fixing Some Transformation
Problems, Problems, Proc. Of Automated Software Engineering, 1999.
Batory et al, Scalable Software Libraries, Foundations of SE, 1993
Neighbors, Draco: A Method for Engineering Reusable Software Systems, in Software Reusability, 1989.
The End