Generative programming - PowerPoint PPT Presentation

About This Presentation
Title:

Generative programming

Description:

GP requires skills that are not mainstream. GP is not user-friendly. GP is not widely used. ... Templates are a user-friendly way to specify an implementation. ... – PowerPoint PPT presentation

Number of Views:102
Avg rating:3.0/5.0
Slides: 21
Provided by: richard424
Category:

less

Transcript and Presenter's Notes

Title: Generative programming


1
Generative programming Middleware
  • Farid Hosseini
  • Reza Azimi
  • Feb 6,2003
  • University of Toronto

2
Agenda,
  • 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

3
What is Generative Programming?
4
Status 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)

5
Whats 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 )

6
What 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 )

7
Aspects of Generative Programming
  • representation of the problem domain
  • implementation of the solution domain
  • ( ECOOP2002 Workshop on Generative
    Programming)

8
Domain-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)

9
How is it possible?
GENERATOR
  • Model
  • Generator
  • Library of components
  • Code

Code
10
How 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)

11
Templates 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)

12
A Pretty Template
  • public class Person
  • //-for-each-field-//
  • private String mField ""
  • public String getField()
  • return mField
  • public void setField( String pField )
  • mField pField
  • //-end-//

13
How Middleware Helps Generative Programming?
14
Introduction
  • 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)

15
How is it possible?
  • What are the Modelling Elements for a Middleware?

Model

GENERATOR
Modelling Elements
16
Middleware Elements
Scheduling Service
Standard Synchronizers
Thread Pools
Protocol Properties
Explicit Binding
Portable Priorities
www.cs.wustl.edu/schmidt/TAO.html
17
Component Of The Shelf (COTS)
Many hardware software APIs and protocols are
now standardized, e.g.
(Douglas C. Schmith)
18
Middleware Generator
(Douglas C. Schmith)
19
Middleware 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)
20
Q/A
Write a Comment
User Comments (0)
About PowerShow.com