Title: Generative programming
1Generative programming Middleware
- Farid Hosseini
- Reza Azimi
- Feb 6,2003
- University of Toronto
2Agenda,
- Part 1 (by Farid Hosseini)
- What is Generative Programming (GP)
- How GP Helps middleware
- Q/A
- Part 2 (by Reza Azimi)
- How Middleware Helps GP
- Q/A
3What is Generative Programming?
4Status of Generative Programming (GP)
- GP requires skills that are not mainstream.
- GP is not user-friendly.
- GP is not widely used.
- Most Developers do not use GP as a design or
implementation strategy. - ( ECOOP2002 Workshop on Generative
Programming)
5Whats new in Generative Programming?
- The current practice
- Manually Searching for components
- Manually adapting components
- Manual assembly
- Generative Programming,
- automatic selection and assembly of components on
demand. - (Definition provided by K. Czarnecky )
6What does the Programmer do in GP?
- The programmer states what s/he wants
- Modelling
- The generator produces the desired system or
component. - Code generation
- (K. Czarnecky )
7Aspects of Generative Programming
- representation of the problem domain
- implementation of the solution domain
- ( ECOOP2002 Workshop on Generative
Programming)
8Domain-Modelling Code Generation
- Three things are required
- A modelling tool
- To define what you want
- A code generator
- To close the gap between the domain and the code
worlds - A component library.
- To facilitate the code generation
- (Application Development Advisor Magazine)
9How is it possible?
GENERATOR
- Model
- Generator
- Library of components
- Code
Code
10How is it possible?
- By direct mapping from each modeling element to
the generation of a set of intentionally
equivalent source code statements. - When a library of components is available, the
model interpreter can leverage a larger
granularity of reuse by generating configurations
of the available components. - (Generating Aspect Code from Models paper)
11Templates and Generators
- Templates are a user-friendly way to specify an
implementation. - A templating component can be used by the code
generator to emit source code. - This approach is language and domain model
neutral. - ( ECOOP2002 Workshop on Generative
Programming)
12A Pretty Template
- public class Person
- //-for-each-field-//
- private String mField ""
- public String getField()
- return mField
-
- public void setField( String pField )
- mField pField
-
- //-end-//
13How Middleware Helps Generative Programming?
14Introduction
- Our methodology of pursuing the interoperability
of different models is established on the idea of
Generative Programming (GP) - The generative automation of middleware for
building the interoperability. - (Wei Zhao)
15How is it possible?
- What are the Modelling Elements for a Middleware?
Model
GENERATOR
Modelling Elements
16Middleware Elements
Scheduling Service
Standard Synchronizers
Thread Pools
Protocol Properties
Explicit Binding
Portable Priorities
www.cs.wustl.edu/schmidt/TAO.html
17Component Of The Shelf (COTS)
Many hardware software APIs and protocols are
now standardized, e.g.
(Douglas C. Schmith)
18Middleware Generator
(Douglas C. Schmith)
19Middleware Generator at work
CORBA/Java/COM Applications
- A Generated Middleware needs
- A common internal representation (ideally
auto-generated) for each middleware specification
- Based on generalizing the middleware semantics
Common ORB Assorted Tools
- A generated implementation that is optimized
automatically for each target platform
application use-case - Based on reflective assessment of platform
descriptions application use-case
Common Semantic Representation
Plat1 Impl
Plat2 Impl
Plat3 Impl
(Douglas C. Schmith)
20Q/A