Application generators
Download
1 / 40

application generators - PowerPoint PPT Presentation


  • 167 Views
  • Updated On :

Application Generators. Advanced Seminars in Software Reuse Leandro Marques do Nascimento. “Every minute spent on infrastructure programming is a wasted minute.” Juval Lowy, .NET Software Legend, April 2003. “Code generation is a formalized version of copy-and-paste programming.” (CGN, 2005).

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'application generators' - Sophia


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Application generators l.jpg

Application Generators

Advanced Seminars in Software Reuse

Leandro Marques do Nascimento


Slide2 l.jpg

“Every minute spent on infrastructure programming is a wasted minute.”

Juval Lowy, .NET Software Legend, April 2003

“Code generation is a formalized version of copy-and-paste programming.”

(CGN, 2005)


Software reuse l.jpg

Software Reuse wasted minute.”


Mcilroy 1968 l.jpg
(McIlroy, 1968) wasted minute.”

“Mass Produced Software Components”

  • Felt that component libraries could be effectively used for numerical computation, I/0 conversion, text processing, and dynamic storage allocation.


Freeman 1983 l.jpg
(Freeman, 1983) wasted minute.”

  • Not only source code can be reused

  • “Different types of artifacts which are not limited to source code fragments can be reused including: design structures, module-level implementation structures, specifications, documentation, transformations, and so on.”


Biggerstaff and perlis 1989a biggerstaff and perlis 1989b l.jpg
(Biggerstaff and Perlis, 1989a) (Biggerstaff and Perlis, 1989b)

  • Commonality among the software reuse techniques used:

    • Abstraction: essencial feature in any reuse activity

    • Selection: selects the appropriate artifacts to the specific domain.

    • Specialization: specialize the artifacts through transformations, constraints, parameters or other refinement

    • Integration: combine a collection of selected and specialized artifacts into a complete software system


Krueger 1992 l.jpg
(Krueger, 1992) 1989b)

  • “Software reuse is the process of creating software systems from existing software rather than building software systems from scratch.”

  • “Application generators operate like programming language compilers—input specifications are automatically translated into executable programs.”

  • Using Generators the code expansion (input/output) may reach 2000 lines of code per day.

System

specification

Generators

what to do

System

implementation

how to do


Krueger 19928 l.jpg
(Krueger, 1992) 1989b)

System Architecture (Domain Dependent)

  • Abstraction:

Textual

Specifcation

Languages (4th

generation

languages)

Graphical

Diagrams

Templates

Interactive menu

driven dialogs

Structure-oriented

interface


Krueger 19929 l.jpg
(Krueger, 1992) 1989b)

  • Selection:

    • Depends on domain covarage

    • Application generators are often highly specialized, limiting their domain coverage

  • Specialization:

    • Primary task of a software developer, by providing an input specification

    • “Conventional” generators: business-oriented, data intensive applications. Report generation, data processing and displaying

    • “Expert” generators: expert knowledge to solve problems in a particular domain

    • Parser and compilers generators: the most known examples of application generators, such as Lex (Lesk and Schmidt, 1979) and Yacc (Johnson, 1979)

  • Integration:

    • Generators that produce a complete executable system do not need integration


Krueger 199210 l.jpg
(Krueger, 1992) 1989b)

Automated

Automated

  • Software life-cycle using application generators (ideally):

System

specification

(requirements)

Architectural

design

Detailed

design

Testing

Coding

Unnecessary

Automated


Sametinger 1997 l.jpg
(Sametinger, 1997) 1989b)

  • Reuse techniques:

    • Compositional Reuse: mounting systems from unmodified components (ideally)

Component

repositories

Component

composition

Code and design

Scavenging

Code

Design

Blocks of code copied from

other system

Large blocks of code. Details deleted.

Design retained.


Sametinger 199712 l.jpg
(Sametinger, 1997) 1989b)

  • Reuse techniques:

    • Generative Reuse: reuse of a generation process instead of reuse of components. Examples: lexical analysers, parsers and compilers.

Application

Generators

Transformation

Systems

Language based

generators

Programming

Languages


Sametinger 199713 l.jpg
( 1989b)Sametinger, 1997)

  • Generation vs. Composition


Czarnecki and eisenecker 2000 l.jpg

(Czarnecki and Eisenecker, 2000)


Czarnecki and eisenecker 200015 l.jpg
(Czarnecki and Eisenecker, 2000) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”


Czarnecki and eisenecker 200016 l.jpg
(Czarnecki and Eisenecker, 2000) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • “Generative Programming (GP) is about automating of intermediate and end-products (i.e., components and applications)”

  • Domain Engineering helps in GP:

System

Families

Model

Problem

Space

Find

Components

Model the

Config.

Knowledge


Czarnecki and eisenecker 200017 l.jpg
(Czarnecki and Eisenecker, 2000) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

Feature and

Concept

Modeling

Design

Common

Architec.

Identify

Components

Specify

DSLs

Domain

Scoping

  • Steps in GP:

Implement

Using

Generators

Implement

DSLs

Implement

Components

Specify

Config.

Knowledge


Application generators18 l.jpg

Application Generators organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”


Neighbors 1980 l.jpg
(Neighbors, 1980) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • DRACO

    • First system to support the transformation of high-level domain-specific programs to executable code

    • DE based

    • Idea: organize software construction knowledge into a number of related domains

    • DRACO domain encapsulates:

DSLs

Optimization

Transformations

Transformational

Components

Domain-Specific

Procedures

Transformation

Strategies

Parse Tree

Rules

Refinements

When a set of transformations can be performed algorithmically

Domain Dependant


Neighbors 198020 l.jpg

DRACO organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…” – Practical Example

(Neighbors, 1980)


Batory 1996 l.jpg
(Batory, 1996) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • GenVoca

    • “...building software generators based on composing OO layers of abstraction, whereby layers are stacked.”

    • Roughly corresponds to the refinement occurring in OO frameworks

    • Steps:

Identify layers

of abstraction

Put more

specialized

layers

on top

Layer below

as parameter

to the above

Families of

parameterized

layers


Batory 199622 l.jpg
(Batory, 1996) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • GenVoca Model (layering with Booch C++ Data sctructure)


Cgn 2005 l.jpg

  • Four key benefits of code generation: organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

    • Quality: increased because of the fixes in templates applied to all code base

    • Consistency: generated APIs are consistent in class structure

    • Productivity: generators use a fraction of time of an engineer. So, the engineer can concentrate on more creative solutions

    • Abstraction: layer of abstraction between design and code base. Definitions input files hold the business schema in a abstracted declarative form which can be inspected by domain experts

(CGN, 2005)


Cgn 200524 l.jpg

  • Code generators models: organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

    • Code Munger

    • Inline Code Expander

    • Mixed Code Generator

    • Partial Class Generator

    • Tier Generator

    • Domain Language

(CGN, 2005)


Cgn 200525 l.jpg

  • Code Munger organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”– Example: JavaDOC

(CGN, 2005)

  • Q– accurate with the code

  • C– consistent and reliable

  • P – no external docs

  • A – little abstraction


Cgn 200526 l.jpg

  • Inline Code Expander organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”– Examples: CSQL, JSQL

(CGN, 2005)

  • Q– infra-structure code reduced

  • C– consistent code adaptable to other DBs

  • P – save time in DB intensive applications

  • A – easier inspections in all SQL commands


Cgn 200527 l.jpg

  • Mixed Code Generator organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”– Examples: CSQL, JSQL

(CGN, 2005)

  • Q– infra-structure code reduced. Better with IDEs

  • C– consistent code adaptable to other DBs according to templates

  • P – save time to focus on SQL

  • A – easily extracted from code


Cgn 200528 l.jpg

  • Partial Class Generator organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”– Example: Visual Studio .NET

(CGN, 2005)

  • Q– database layer controlled by templates. OO to DB errors reduced

  • C– consistent in all generated classes and API

  • P – save time to upper layers and not worrying with persistence bugs

  • A – abstracted into definition files and templates


Cgn 200529 l.jpg

  • Tier Generator organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”– Example: Hibernate

(CGN, 2005)

  • Q– equivalent to quality in templates

  • C– class structure reliable

  • P – entire tier generated reduces much time

  • A – tier abstraction is held outside of the code


Cgn 200530 l.jpg

  • Domain Language organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”– Examples: Mathematica, Matlab

    • Types, syntax and operations mapped directly to concepts in the domain

    • Easier to represent specific structures that general purpose languages do not provide, such as multi-dimensional matrix

    • Other examples:

      • COBOL: COmmon Business Oriented Language

      • Domain-Specific Language (DSL) Tools for Microsoft Visual Studio 2005

      • CSound: to create audio files

      • GraphViz: define graphs and get a visual representation

(CGN, 2005)


Cgn 200531 l.jpg
(CGN, 2005) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”


Slide32 l.jpg

Qualiti Coder (Qualiti, 2005) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • Java e C#

  • Eclipse Plugin

  • Wizard based

  • Layer architecture –Presentation, Data and Communication (PDC)


Velocity 2005 l.jpg
(Velocity, 2005) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • Based on Model-View-Controller:

    • Allows to separate Java programmers from web designers

    • Can be used to generate SQL, PostScript and XML from templates

    • Also can be used to generate source code and reports


Slide34 l.jpg

(Velocity, 2005) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

Template based

HIBERNATE

  • GCodCESAR: Usa o Velocity


J2me polish 2005 l.jpg
(J2ME Polish, 2005) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • J2ME GUI Code generation

  • Based on CSS (polish.css file)

  • Bitmap fonts


J2me polish 200536 l.jpg
(J2ME Polish, 2005) organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • The tool makes use of preprocessing directives:


Conclusions l.jpg
Conclusions organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • Difficulties to be covered:

  • Domain peculiarities

  • Code Size and efficiency

  • Libraries for algorithmic problems

  • Future to generators:

  • More readable languages (5th generation)

  • Large domain coverage

  • Efficient “Drag-and-Drop generation”


References l.jpg
References organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • (MacIlroy, 1968) MacIlroy, M. D. Mass Produced Software Components. Nato Software Engineering Conference. 1968.

  • (Freeman, 1983) Freeman, P. Reusable software engineering: Concepts and research directions. In Workshop on Reusability in Programming (Newport, R. I., Sept.). ITT Programming, Stratford, Corm., pp. 2-16.

  • (Biggerstaff and Ritcher, 1987) Biggerstaff, T. J.; Ritcher, C. Reusability framework, assessment, and directions. IEEE Software. 4, 2 (Mar.), 41–49. 1987.

  • (Biggerstaff and Perlis, 1989a) Biggerstaff, T. J.; Perlis, A. J. Frontier Series: So filoare Reusability: Volume I—Concepts and Models. ACM press, New York. EDS. 1989.

  • (Biggerstaff and Perlis, 1989b) Biggerstaff, T. J.; Perlis, A. J. Frontier Series: Software Reusability: Volume II—Applications and Experience. ACM Press, New York. EDS. 1989.

  • (Qualiti, 2005) Qualiti Coder. Available on http://coder.qualiti.com, accessed in November, 2005.

  • (Sametinger, 1997) Sametinger, J. Software Engineering with Reusable Components. Springer-Verlag, 1997.

  • (Krueger, 1992) Krueger, C. W. Software Reuse. ACM Computing Surveys, Vol. 24, No. 2, June 1992

  • (Lesk and Schmidt, 1979) Lesk, M. E.; Schmidt, E. Lex: A Lexical Analyzer Generator in the UNIX Programmer’s Manual—Supplementary Documents. 7th ed. AT& T Bell Laboratories, Indianapolis, Ind. 1979.

  • (Johnson, 1979) Johnson, S. C. Yacc: Yet Another Computer-Compiler in the UNIX Programmer’s Manual—Supplementary Documents. 7th ed. AT&T Bell Laboratories, Indianapolis, Ind. 1979.

  • (Czarnecki and Eisenecker, 2000) Czarnecki, K.; Eisenecker, U. W. Generative Programming: Methods, Tools, and Applications. Addison-Wesley, May, 2000.


References39 l.jpg
References organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

  • (Czarnecki and Eisenecker, 1999) Czarnecki, K.; Eisenecker, U. W. Components and generative programming. In Proceedings of the 7th European software engineering conference held jointly with the 7th ACM SIGSOFT international symposium on Foundations of software engineering ESEC/FSE-7. vol. 24. October, 1999.

  • (CGN, 2005) Code Generation Network. Available on http://www.codegeneration.net/, accessed in November, 2005.

  • (Pulvermüller and Speck, 2000) Pulvermüller, E.; Speck, A. Towards generative components. In ACM SIGSOFT Software Engineering Notes archive. Vol. 25 Issue 2. pp. 22-24. ACM Press, March, 2000.

  • (J2ME Polish, 2005) J2ME Polish. Available on http://www.j2mepolish.org/, accessed in November, 2005.

  • (Velocity, 2005) Jakarta Velocity. Available on http://jakarta.apache.org/velocity/, accessed in November, 2005.

  • (Neighbors, 1980) Neighbors, J. M. Software construction using components. Ph. D. Thesis, Department Information and Computer Science, University of California, Irvine, 1980.

  • (Neighbors, 1989) Neighbors, J. M. Draco: a method for engineering reusable software systems. In Source Software reusability: vol. 1, concepts and models. pp. 295-319. ACM Press, 1989.

  • (Batory, 1996) Batory, D. Software System Generators, Architectures, and Reuse. In Fourth International Conference on Software Reuse. Tutorial Notes, Orlando, 1996.


Application generators40 l.jpg

Application Generators organizing, and storing past experience in building systems or parts of systems in a particular domain in the form of reusable assets…”

Advanced Seminars in Software Reuse

Leandro Marques do Nascimento


ad