fd91cb1282834c3db1607e9ab2457308.ppt
- Количество слайдов: 35
Build-level Components Merijn de Jonge IPA Spring Days 2005 April 1, 2005
Overview • Introduction/motivation • Build-level components • Build-level composition • Decoupling into build-level components • Concluding remarks April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Overview • Introduction/motivation • Build-level components • Build-level composition • Decoupling into build-level components • Concluding remarks April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Mozilla April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Mozilla Directory Structure • One very large directory tree • 26, 000 files • 2, 500 subdirectories • 240 file types April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Mozilla Directory References • 1, 521 directory references • Avg. fan-in/fan-out 12 • Max fan-in=100 • Max fan-out=42 • Median fan-in=5 • Median fan-out=12 April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Build-level • File (atomic entity) – Source – Documentation • Directory tree (container) = source tree • Build process – To build/install software – Driven by make/ANT/… • Configuration process – To control build process – Driven by configure/configuration files/… • Build-level interfaces – Build interface – Configuration interface April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Mozilla Build Level • 1, 350 Makefiles • 40, 000 LOC build instructions • 16, 000 LOC configuration • Cyclic dependencies • Two-phase build process • Centralized build/configuration knowledge • Code duplication • Component implementations scattered April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Wishes • Independent deployment (of build-level artifacts) – No circular dependencies – Individual build processes – Individual configuration processes • Automated composition – Standardized build interface – Standardized configuration interface – Standardized binding mechanism for build-level variability and dependencies April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Idea Apply CBSE principles to the build level • Make build-level artefacts available for reuse by decomposing software systems into build-level components • Make build-level component usable by assembling them into software systems using automated composition techniques April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Overview • Introduction/motivation • Build-level components • Build-level composition • Decoupling into build-level components • Concluding remarks April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Component Definition (Szyperski) A software component is • A unit of composition … • with contractually specified interfaces … • and explicit context dependencies only. • It is subject to independent deployment … • and to third-party composition. April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Standardized Build Interface • Different build systems exist, e. g. , – make, ANT, shell scripts, IDE • Different software systems require different build actions, e. g. , – make bootstrap, make install • Standardized build interface to enable that software construction can be controlled via a standard set and sequence of build actions: April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Standardized Configuration Interface • Different mechanisms exist to control software construction, e. g. , – configuration files, configuration tools, Makefile editing • Standardized configuration interface to enable uniform compile-time configuration: April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Explicit Context Dependencies • Dependencies on build-level components are declared in configuration interfaces April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Independent Deployment April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Third-party Composition • A configuration interface enables late-binding of dependencies • Compositions are thus not predefined • and can be defined by a third party April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Overview • Introduction/motivation • Build-level components • Build-level composition • Decoupling into build-level components • Concluding remarks April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Architectural Description Language • Package Definition Language (PDL) – Domain-specific language designed specially for build-level component composition – Used for initial implementations – No explicit provides interfaces • Koala – Re-use of existing composition language – Implementation is work in progress – Multiple provides interfaces – No version resolution April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Koala Concepts for Build-level Composition • Interface definitions – To group build-level artefacts into types • Explicit provides interfaces – To declare the type(s) of a component • Diversity interfaces – To declare build-level variation points • Module as atomic entity – To declare the implementation of a component April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Koala Definition for Build-level Component April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Mapping Koala to Build-level Concepts April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Implementation • Koala source tree composition • Checkout www. program-transformation. org/Tools/Koala. Compiler April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Unbound Diversity/Requires Interfaces r r • Propagate upwards to top-level configuration interface April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Online Package Base www. program-transformation. org/package-base April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Overview • Introduction/motivation • Build-level components • Build-level composition • Decoupling into build-level components • Concluding remarks April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Three Phases of Source Tree Decoupling April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Source Tree Analysis • Find component references • Fine tune – Add missing arrows – Remove cycles – Combine nodes with strong cohesion April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Source Tree Transformation • Create components • Create component definitions • Fine tune April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Decoupling Mozilla • Cyclic dependencies • Centralized build/configuration knowledge April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Dealing with Cyclic Dependencies • 108 potential build-level components • 4 cyclic-dependent clusters • 37 non-cyclic components April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Dealing with Cyclic Dependencies • For each cluster create a composite component and a Koala component definition • One provides interface for each sub-component • On-demand refactoring to remove cyclic dependencies • If all cyclic dependencies for a sub-component are removed, the component can be separated April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Dealing with centralized build/configuration • Build knowledge – Duplicate build system for each component, or … – Generate (Automake) build process, or … – Dedicated component with build knowledge • Configuration knowledge – Duplicate for each component, – Prune to remove irrelevant code April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Overview • Introduction/motivation • Build-level components • Build-level composition • Decoupling into build-level components • Concluding remarks April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
Concluding Remarks • Reusable functionality is often not independently deployable due to build-level deficiencies • CBSE principles help to decouple source trees into build-level components • Composition of build-level components can be automated • Introducing CBSE principles can be (partly) automated April 1, 2005 IPA Spring Days Merijn de Jonge Build-level Components 0
fd91cb1282834c3db1607e9ab2457308.ppt