Presentation is loading. Please wait.

Presentation is loading. Please wait.

Towards Modular Code Generators Using Symmetric Language-Aware Aspects Steffen Zschaler, Awais Rashid FREECO’11 Lancaster, 26 July 2011.

Similar presentations


Presentation on theme: "Towards Modular Code Generators Using Symmetric Language-Aware Aspects Steffen Zschaler, Awais Rashid FREECO’11 Lancaster, 26 July 2011."— Presentation transcript:

1 Towards Modular Code Generators Using Symmetric Language-Aware Aspects Steffen Zschaler, Awais Rashid FREECO’11 Lancaster, 26 July 2011

2 Motivation Code generators can become quite complex –Generate code related to a number of different concerns / features Different model elements (global-to-local transformation) Additional technical concerns (e.g., persistence annotations) –Flexibly combine generation pipeline depending on features required 26/07/2011(c) Steffen Zschaler2

3 Configuring Code Generators 26/07/2011(c) Steffen Zschaler3 Application Model Java Code Business Logic Generator Business Logic Generator Java Data Model Generator Java Data Model Generator EMF Generator GUI Generator plugin.xml

4 Existing Modularity Techniques Templates –Typically one template per target file –May produce more than one file Generation Rules –Allow hierarchy similar to operations –Good for capturing common design rules Import of module templates –Allow reuse of rules Asymmetric Aspects –Explicitly address tangling –BUT... 26/07/2011(c) Steffen Zschaler4

5 Drawbacks of Asymmetric AO Need for a base template Need for scaffolding No explicit support for weaving context Not language aware 26/07/2011(c) Steffen Zschaler5

6 Registration + Weaving = Symmetric AO for Code Generation 26/07/2011(c) Steffen Zschaler6 CG Template 1 CG Template 2 CG Template n Code Slice Registry Code Slice Registry Code Slice Weaver Output Files...

7 Text Merging 2-way vs 3-way –We can only support 2-way merging State-based vs change-based –We can only support state-based merging Textual vs syntactic vs semantic –The more semantic the more powerful –But also the more configuration needed! 26/07/2011(c) Steffen Zschaler7 based on Tom Mens’ classification

8 Prototype Extends Epsilon Generation Language (EGL) –New workflow tasks: eglRegister – generate from a template, but store result in registry eglMerge – merge registry contents for specific files –Can be configured with different text merging algorithms Distribution uses FeatureHouse Available from EpsilonLabs: https://sourceforge.net/apps/mediawiki/epsilonlabs/ 26/07/2011(c) Steffen Zschaler8

9 Conclusions & Outlook Asymmetric aspects can address some modularity issues in code generation Presented a prototype Larger comparative study of modularity properties currently under way 26/07/2011(c) Steffen Zschaler9

10 THANK YOU FOR YOUR ATTENTION! 26/07/2011(c) Steffen Zschaler10


Download ppt "Towards Modular Code Generators Using Symmetric Language-Aware Aspects Steffen Zschaler, Awais Rashid FREECO’11 Lancaster, 26 July 2011."

Similar presentations


Ads by Google