Presentation on theme: "Generative Programming and Active Libraries Krzysztof Czarnecki DaimlerChrysler Research and Technology Software Engineering Lab Ulm, Germany www.generative-programming.org."— Presentation transcript:
Generative Programming and Active Libraries Krzysztof Czarnecki DaimlerChrysler Research and Technology Software Engineering Lab Ulm, Germany
The Vision zThink & program è“one of a kind” programming zSurvey & assembly ècomponent-based programming zOrder & generate ègenerative programming
Component-Based Programming zExample: Standard Template Library (STL) zAs set of basic, carefully factored data container and algorithm components (minimum redundancy, maximum combinability and reuse) ystack > zProblem of manual assembly in STL yextensive knowledge of implementation detail needed ximplementation components, illegal & optimal configurations ypoor error reporting
Example of an STL Usage Error stl_algo.h: In function ‘void __merge_sort_loop<_List_iterator, foo *, int>(_List_iterator, _List_iterator, foo *, int)’: stl_algo.h:1448: instantiated from ‘__merge_sort_with_buffer, foo *, int>( _List_iterator, foo *, int *)’ stl_algo.h:1485: instantiated from ‘__stable_sort_adaptive< _List_iterator, foo *, int>(_List_iterator, _List_iterator, foo *, int)’ stl_algo.h:1524: instantiated from here stl_algo.h:1377: no match for ‘_List_iterator & -_...
Generative Programming The programmer states what she needs... LIST_GENERATOR ::RET ACCOUNT_GENERATOR ::RET MATRIX_GENERATOR,speed >::RET and gets the desired component!
Active Libraries zThe idea of putting compile-time metacode into domain-specific libraries zActive libraries – in addition to classes and functions – also contain metacode for configuration, generation, optimization, error reporting, debugging and profiling, editing and visualization of code, code refactoring, versioning,... zExtensible programming environments ye.g. Intentional Programming (Microsoft Research)
Generative Domain Model Problem Space Domain-specific concepts and Features Solution Space Elementary components Maximum combinability Minimum redundancy Configuration Knowledge Illegal feature combinations Default settings Default dependencies Construction rules Optimizations Domain Specific Languages (DSLs) Generators Components + System Family Architecture
System Family Approach zDomain Engineering yanalysis: scoping, common and variable features, feature dependencies (FODA feature diagrams) ydesign: common architecture for the system family domain-specific languages, configuration generators yimplementation: reusable components, domain- specific languages, configuration generators zApplication Engineering yproduction of concrete, highly customized systems and components using the above-mentioned results
Further Information zCzarnecki, Eisenecker: Generative Programming - Methods, Tools, and Applications, Addison- Wesley, 2000 zwww.generative-programming.org zGenerative and Component-Based Software Development (GCSE 2000), October , 2000, Erfurt, Germany,
Industrial Revolution 1826 interchangeable parts successfully introduced by John Hall (after 25 years of unsuccessful attempts!) 1901 assembly lines introduced by Ransom Olds; popularized and refined by Henry Ford in s automated assembly lines first industrial robot installed in 1961 at General Motors; 1970’s advance of microchips
Industrializing Software Production Current practice Searching for and adapting components and manual assembly Generating the needed components and automatic assembly Generative Programming Better composition technologies AOP, SOP, APPC, CFs, etc. Better composition automation active libs, extendible programming environments (e.g. IP), etc. Product-Line Engineering FODA, ODM, etc.
Issues to discuss... zDSL design zcomposability of DSLs
Workshop Issues zIndustrial Experiences: experiences with generative techniques for product lines in industrial settings hard problems in industrial settings that research needs to address organizational and other problems in industrial settings (how to install and successfully run generative technology projects) zProperties and Design of Domain-Specific Languages DSLs: composability of DSLs adaptability and parameterization of DSLs textual vs. GUI DSLs wizards vs. more complex modeling languages zApproaches to generation: classification of different approaches to generation properties of a generator architecture pros and cons of different generative technologies and when to apply which zApproaches to developing generative models: Domain Engineering Jargons experiences and managing the process in industrial settings