Automatic Code Generation - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Automatic Code Generation

Description:

Borland ECO (Enterprise Core Object) Generating Purpose Language. XSL/XSLT ... Borland C# Builder. with. Enterprise Core Object (ECO) Example - XSL/XSLT ... – PowerPoint PPT presentation

Number of Views:221
Avg rating:3.0/5.0
Slides: 14
Provided by: antho7
Category:

less

Transcript and Presenter's Notes

Title: Automatic Code Generation


1
Automatic Code Generation
  • Present by Jiajing Liu
  • Team 10

2
Outline
  • Introduction to CODE GENERATION
  • Forms of Auto-Code Generation
  • Click and Code
  • Generating Purpose Language
  • Code Generation Engine
  • Code Generator
  • Concerns and Constraints
  • Reference
  • Q A

3
Introduction
  • CODE GENERATION is code that writes code1.
  • Automatic Code Generation can
  • Maintain consistent code quality and allows your
    code to evolve quickly in response to metadata
    changes
  • Extend reuse to include code with similar
    patterns
  • Result increased speed, reusability, agility,
    and consistency in your application development

4
Forms of Code Generation
  • Click and Code - Visual IDE
  • Microsoft Visual Studio .net
  • Altova Enterprise XML Suite
  • Borland ECO (Enterprise Core Object)
  • Generating Purpose Language
  • XSL/XSLT
  • Code Generation Engine
  • Velocity
  • MiddleGen

5
Example - Visual IDE
  • Microsoft VS.net

6
Example - Visual IDE
  • Borland C Builder
  • with
  • Enterprise Core Object (ECO)

7
Example - XSL/XSLT
  • XSL/XSLT(Template) XML (Data) HTML Page
    (Static Code)

8
Example CodeGen Engine
  • CustomerDetailAction()
  • int i
  • web_submit_data("CustomerDetailNavBarAction.do",
  • "ActionactionURL/CustomerDetailNavBarAction.do
    ",
  • "RefererrefererURL/CustomerNavBar.jsp",
  • "NamenavToPage", "ValueCustomerDetail",
    ENDITEM,
  • LAST)
  • for(i0 iltNO_OF_LIST_ENTRIES i)
  • lr_start_transaction("CustomerDetailDetailActi
    on")
  • web_submit_data("CustomerDetailDetailAction.do",
  • "ActionactionURL/CustomerDetailDetailAction.d
    o",
  • "RefererrefererURL/CustomerDetailDetail.jsp",
  • ITEMDATA,
  • "NamevalueObject.IdName", "ValueIndia",
    ENDITEM,
  • "NamevalueObject.MasterMediaSysId",
    "Value45", ENDITEM,
  • "NamevalueObject.TerritoryArray",
    "Valueparameter.Value", ENDITEM,
  • "NamevalueObject.MasterMedia", "ValueHome
    Video", ENDITEM,

Velocity Template (left) and Generated Result
(right)
  • foreach(action in actions)
  • action.NameAction()
  • int i
  • web_submit_data("wrapperNameDetailNavBarAction
    .do",
  • "ActionactionURL/wrapperNameDetailNavBarAct
    ion.do",
  • "RefererrefererURL/wrapperNameNavBar.jsp",
  • "NamenavToPage", "Valueaction.Name",
    ENDITEM,
  • LAST)
  • for(i0 iltNO_OF_LIST_ENTRIES i)
  • foreach(vObj in action.valueObjects)
  • set(vObjName vObj.Name)
  • lr_start_transaction("vObjNameDetailAction")
  • web_submit_data("vObjNameDetailAction.do",
  • "ActionactionURL/vObjNameDetailAction.do",
  • "RefererrefererURL/vObjNameDetail.jsp",
  • ITEMDATA,
  • foreach(parameter in vObj.Parameters)

9
Forms of Code Generation
  • Code Generator
  • Template independent
  • Domain Specific
  • Template based
  • Code Munger
  • Inline Code Expander
  • Mixed Code Generator
  • Partial Class Generator
  • Tier Generator

10
Example Code Generator
  • CodeSmith
  • nHibernate Mapping Files Generation

11
Concerns and Constraints
  • Code generation is a design smell.
  • Engineers will ignore the 'do not edit' comments.
  • The generator won't be used or maintained.
  • My application isn't complex enough for
    generation.
  • My application is too complex for generation.

12
Reference
  • 1 Code Generation in Microsoft .NET. Kathleen
    Dollard. Apress.
  • 2 Generative Programming Methods, Tools, and
    Applications. Krzysztof Czarnecki.
  • 3 Click and code automatic code generation.
    Maclay, D. IEE Review. Volume 46, Issue 3, May
    2000.
  • 4 Graphical modelling and design with automatic
    code generation. Smith, M. Partitioning in
    Hardware-Software Codesigns, IEE Colloquium on.13
    Feb 1995.
  • 5 Automatic code generation for actuator
    interfacing from a declarative specification.
    Jung, E. Kapoor, C. Batory, D. (IROS 2005).
    2005 IEEE/RSJ International Conference on. 2-6
    Aug. 2005
  • 6 Tools for the code generation. Johanna
    Ambrosio. Application Development Trends.
    6/30/2003.
  • 7 http//www.codegeneration.net/tiki-index.php
  • 8 http//www.codesmithtools.com/

13
Thank you
  • Question on Auto-Code Generation?
Write a Comment
User Comments (0)
About PowerShow.com