a generator composition approach for aspect oriented dsls
play

A Generator Composition Approach for Aspect-Oriented DSLs ICMT 2016 - PowerPoint PPT Presentation

A Generator Composition Approach for Aspect-Oriented DSLs ICMT 2016 Reiner Jung Robert Heinrich Wilhelm Hasselbring 5 st July 2016 Introduction Motivation Software development and evolution Domain, technology and environment changes


  1. Introduction Modeling CoCoME System Repository Data Types Behavior package data package cocome WebFrontend::UseCases ICashDesk WebService::CashDesk :ServiceAdapter Source Model ICardReader entity TradingEnterprise { import data.TradingEnterprise long id IUserDisplay WebService::Inventory string name repository "cocome/model/cocome.repository" IPrinter Store[] stores IBarcodeScanner :Store ProductSupplier[] productSuppliers realize stateless TradingSystem.Inventory.Data.Enterprise { } iface EnterpriseQueryIf IExpressLight operation queryEnterpriseById { ICashBox :Reporting entity ProductSupplier { return query TradingEnterprise long id "SELECT t FROM TradingEnterprise WHERE id=" + enterpriseId IBarcodeScannerModel string name } IExpressLightModel IUserDisplayModel ICardReaderModel :Enterprise ICashBoxModel ICashDeskModel IPrinterModel Product[] offers } } Kieker - Monitoring TradingSystem::CashDeskLine IStoreInventory AccountSaleEvent use pcm on cocome "irl-examples/src/cocome.repository" TradingSystem::Inventory advice TraceLogger () { IStoreInventoryManager IReporting ServiceAdapter before OperationBeforeEvent(time, signature, classname, signature) after OperationAfterEvent(time, signature, classname) IStoreManager WebService::Inventory :ServiceAdapter } IEnterpriseReporting pointcut point class cocome.TradingSystem.Inventory.Data.Persistence IEnterpriseManager aspect point : EntryLogger Generator Target Code AspectJ JavaEE JPA - Entity Beans <? xml version = "1.0" encoding= "UTF-8" standalone = "no" ?> package org.cocome.tradingsystem.inventory.data.enterprise; @Entity <aspectj> public class TradingEnterprise { <weaver options= "" /> ... private long id; <aspects> private String name; <aspect name= "AbstractEntryLoggerAdvice0" /> public final class EnterpriseQueryProvider implements IEnterpriseQuery { private List<Store> stores; <aspect name= "AbstractEntryLoggerAdvice1" /> private List<ProductSupplier> productSuppliers; <concrete − aspect extends= "AbstractEntryLoggerAdvice0" name= "EntryLoggerAdvice0" > @Override private @Transient boolean selected; <pointcut expression= "TradingSystem.Inventory.Data.Persistence" name= "point" /> public TradingEnterprise queryEnterpriseById( final long enterpriseId, final IPersistenceContext pctx) { </concrete − aspect> final EntityManager em = __getEntityManager(pctx); public long getId() { </aspects> return em.createQuery( "SELECT te FROM TradingEnterprise te WHERE te.id" + enterpriseID, return this .id; </aspectj> TradingEnterprise. class ).getResultList(); } } public void setId( final long id) { this .id = id; } Reiner Jung 4 / 33

  2. Introduction Modeling CoCoME System Repository Data Types Data Types Data Types Behavior package data package data package cocome WebFrontend::UseCases ICashDesk WebService::CashDesk :ServiceAdapter Source Model ICardReader entity TradingEnterprise { entity TradingEnterprise { import data.TradingEnterprise long id long id IUserDisplay WebService::Inventory string name string name repository "cocome/model/cocome.repository" IPrinter Store[] stores Store[] stores IBarcodeScanner :Store ProductSupplier[] productSuppliers ProductSupplier[] productSuppliers realize stateless TradingSystem.Inventory.Data.Enterprise { } transient boolean selected iface EnterpriseQueryIf IExpressLight } operation queryEnterpriseById { ICashBox :Reporting entity ProductSupplier { return query TradingEnterprise entity ProductSupplier { long id "SELECT t FROM TradingEnterprise WHERE id=" + enterpriseId IBarcodeScannerModel long id string name } IExpressLightModel IUserDisplayModel ICardReaderModel :Enterprise ICashBoxModel ICashDeskModel IPrinterModel Product[] offers string name } } Product[] offers } Kieker - Monitoring TradingSystem::CashDeskLine IStoreInventory AccountSaleEvent use pcm on cocome "irl-examples/src/cocome.repository" TradingSystem::Inventory advice TraceLogger () { IStoreInventoryManager IReporting ServiceAdapter before OperationBeforeEvent(time, signature, classname, signature) after OperationAfterEvent(time, signature, classname) IStoreManager WebService::Inventory :ServiceAdapter } IEnterpriseReporting pointcut point class cocome.TradingSystem.Inventory.Data.Persistence IEnterpriseManager aspect point : EntryLogger 1 Generator Target Code AspectJ JavaEE JPA - Entity Beans <? xml version = "1.0" encoding= "UTF-8" standalone = "no" ?> package org.cocome.tradingsystem.inventory.data.enterprise; @Entity <aspectj> public class TradingEnterprise { <weaver options= "" /> ... private long id; <aspects> private String name; <aspect name= "AbstractEntryLoggerAdvice0" /> public final class EnterpriseQueryProvider implements IEnterpriseQuery { private List<Store> stores; <aspect name= "AbstractEntryLoggerAdvice1" /> private List<ProductSupplier> productSuppliers; <concrete − aspect extends= "AbstractEntryLoggerAdvice0" name= "EntryLoggerAdvice0" > @Override private @Transient boolean selected; <pointcut expression= "TradingSystem.Inventory.Data.Persistence" name= "point" /> public TradingEnterprise queryEnterpriseById( final long enterpriseId, final IPersistenceContext pctx) { </concrete − aspect> final EntityManager em = __getEntityManager(pctx); public long getId() { </aspects> return em.createQuery( "SELECT te FROM TradingEnterprise te WHERE te.id" + enterpriseID, return this .id; </aspectj> TradingEnterprise. class ).getResultList(); } } public void setId( final long id) { this .id = id; } Reiner Jung 4 / 33

  3. Introduction Modeling CoCoME System Repository Data Types Behavior Behavior package data package cocome WebFrontend::UseCases ICashDesk WebService::CashDesk :ServiceAdapter Source Model ICardReader entity TradingEnterprise { import data.TradingEnterprise long id IUserDisplay WebService::Inventory string name repository "cocome/model/cocome.repository" IPrinter Store[] stores IBarcodeScanner :Store ProductSupplier[] productSuppliers realize stateless TradingSystem.Inventory.Data.Enterprise { transient boolean selected iface EnterpriseQueryIf IExpressLight } operation queryEnterpriseById { ICashBox :Reporting return from TradingEnterprise te where te.id=enterpriseId return query TradingEnterprise entity ProductSupplier { "SELECT t FROM TradingEnterprise WHERE id=" + enterpriseId IBarcodeScannerModel long id } IExpressLightModel IUserDisplayModel ICardReaderModel :Enterprise ICashBoxModel ICashDeskModel IPrinterModel string name } Product[] offers } Kieker - Monitoring TradingSystem::CashDeskLine IStoreInventory AccountSaleEvent use pcm on cocome "irl-examples/src/cocome.repository" TradingSystem::Inventory advice TraceLogger () { IStoreInventoryManager IReporting ServiceAdapter before OperationBeforeEvent(time, signature, classname, signature) after OperationAfterEvent(time, signature, classname) IStoreManager WebService::Inventory :ServiceAdapter } IEnterpriseReporting pointcut point class cocome.TradingSystem.Inventory.Data.Persistence IEnterpriseManager aspect point : EntryLogger 2 Generator Target Code AspectJ JavaEE JPA - Entity Beans <? xml version = "1.0" encoding= "UTF-8" standalone = "no" ?> package org.cocome.tradingsystem.inventory.data.enterprise; @Entity <aspectj> public class TradingEnterprise { <weaver options= "" /> ... private long id; <aspects> private String name; <aspect name= "AbstractEntryLoggerAdvice0" /> public final class EnterpriseQueryProvider implements IEnterpriseQuery { private List<Store> stores; <aspect name= "AbstractEntryLoggerAdvice1" /> private List<ProductSupplier> productSuppliers; <concrete − aspect extends= "AbstractEntryLoggerAdvice0" name= "EntryLoggerAdvice0" > @Override private @Transient boolean selected; <pointcut expression= "TradingSystem.Inventory.Data.Persistence" name= "point" /> public TradingEnterprise queryEnterpriseById( final long enterpriseId, final IPersistenceContext pctx) { </concrete − aspect> final EntityManager em = __getEntityManager(pctx); public long getId() { </aspects> return em.createQuery( "SELECT te FROM TradingEnterprise te WHERE te.id" + enterpriseID, return this .id; </aspectj> TradingEnterprise. class ).getResultList(); } } public void setId( final long id) { this .id = id; } Reiner Jung 4 / 33

  4. Introduction Modeling CoCoME System Repository Data Types Behavior package data package cocome WebFrontend::UseCases ICashDesk WebService::CashDesk :ServiceAdapter Source Model ICardReader entity TradingEnterprise { import data.TradingEnterprise long id IUserDisplay WebService::Inventory string name repository "cocome/model/cocome.repository" IPrinter Store[] stores IBarcodeScanner :Store ProductSupplier[] productSuppliers realize stateless TradingSystem.Inventory.Data.Enterprise { transient boolean selected iface EnterpriseQueryIf IExpressLight } operation queryEnterpriseById { ICashBox :Reporting return from TradingEnterprise te where te.id=enterpriseId return query TradingEnterprise entity ProductSupplier { "SELECT t FROM TradingEnterprise WHERE id=" + enterpriseId IBarcodeScannerModel long id } IExpressLightModel IUserDisplayModel ICardReaderModel :Enterprise ICashBoxModel ICashDeskModel IPrinterModel string name } Product[] offers } Kieker - Monitoring TradingSystem::CashDeskLine IStoreInventory AccountSaleEvent use pcm on cocome "irl-examples/src/cocome.repository" TradingSystem::Inventory advice TraceLogger () { IStoreInventoryManager IReporting ServiceAdapter before OperationBeforeEvent(time, signature, classname, signature) after OperationAfterEvent(time, signature, classname) IStoreManager WebService::Inventory :ServiceAdapter } IEnterpriseReporting pointcut point class cocome.TradingSystem.Inventory.Data.Persistence IEnterpriseManager aspect point : EntryLogger 3 Generator Target Code AspectJ JavaEE JavaEE JPA - Entity Beans <? xml version = "1.0" encoding= "UTF-8" standalone = "no" ?> package org.cocome.tradingsystem.inventory.data.enterprise; @Entity <aspectj> public class TradingEnterprise { <weaver options= "" /> ... private long id; <aspects> private String name; <aspect name= "AbstractEntryLoggerAdvice0" /> public final class EnterpriseQueryProvider implements IEnterpriseQuery { private List<Store> stores; <aspect name= "AbstractEntryLoggerAdvice1" /> private List<ProductSupplier> productSuppliers; <concrete − aspect extends= "AbstractEntryLoggerAdvice0" name= "EntryLoggerAdvice0" > @Override private @Transient boolean selected; <pointcut expression= "TradingSystem.Inventory.Data.Persistence" name= "point" /> public TradingEnterprise queryEnterpriseById( final long enterpriseId, final IPersistenceContext pctx) { </concrete − aspect> final EntityManager em = __getEntityManager(pctx); public long getId() { </aspects> return em.createQuery( "SELECT te FROM TradingEnterprise te WHERE te.id" + enterpriseID, return this .id; </aspectj> TradingEnterprise. class ).getResultList(); } } public void setId( final long id) { this .id = id; } Reiner Jung 4 / 33

  5. Experts Generator and DSL reuse are not applied by industry Introduction Challenges Key challenges in generator development ‚ Domain and technology evolution ‚ Increasing complexity of generators ‚ Reusability of metamodels and generators Reiner Jung 5 / 33

  6. Introduction Challenges Key challenges in generator development ‚ Domain and technology evolution ‚ Increasing complexity of generators ‚ Reusability of metamodels and generators Experts Generator and DSL reuse are not applied by industry Reiner Jung 5 / 33

  7. Introduction Contributions GECO Approach ‚ Generator megamodel patterns (Jung et al. 2016) ‚ Generator fragment design GECO Artifacts ‚ Instrumentation aspect and record languages (Jung et al. 2013) ‚ Generator composition language ‚ Software architecture evaluation (Jung et al. 2015) Reiner Jung 6 / 33

  8. Foundations Reiner Jung 7 / 33

  9. Expressions Declaration Maps, e.g., Traces, Pointcuts Foundations Metamodel Partitions Metamodel Structures ‚ Structure and typing base type type Type Array Type Named Type size : Integer name : String * Record Type Feature features name : String (Jung et al. 2014) Reiner Jung 8 / 33

  10. Declaration Maps, e.g., Traces, Pointcuts Foundations Metamodel Partitions Metamodel Structures ‚ Structure and typing expression Expression ‚ Expressions * Operation Simple Expression Assignment operands operator : String variable Literal Variable Reference (Jung et al. 2014) Reiner Jung 8 / 33

  11. Maps, e.g., Traces, Pointcuts Foundations Metamodel Partitions Metamodel Structures ‚ Structure and typing Declaration ‚ Expressions type Type name : String ‚ Declaration * Record Type Feature Variable feature variable Variable Reference (Jung et al. 2014) Reiner Jung 8 / 33

  12. Foundations Metamodel Partitions Metamodel Structures ‚ Structure and typing Map ‚ Expressions ‚ Declaration relationships * ‚ Maps, e.g., Traces, Left Relation Right Pointcuts (Jung et al. 2014) Reiner Jung 8 / 33

  13. Foundations Metamodel Roles Aspect-Oriented Modeling System (Jung et al. 2014) Reiner Jung 9 / 33

  14. Foundations Metamodel Roles Aspect-Oriented Modeling Access Control aspect base System (Jung et al. 2014) Reiner Jung 9 / 33

  15. Foundations Metamodel Roles Aspect-Oriented Modeling Monitoring aspect base Access Control aspect base System (Jung et al. 2014) Reiner Jung 9 / 33

  16. Foundations Metamodel Roles Aspect-Oriented Modeling View-Based Modeling Monitoring Data aspect base Access Control aspect base System (Jung et al. 2014) Reiner Jung 9 / 33

  17. Foundations Metamodel Roles Aspect-Oriented Modeling View-Based Modeling Monitoring Data aspect independent base Access Control aspect dependent base System (Jung et al. 2014) Reiner Jung 9 / 33

  18. Foundations Metamodel Roles Aspect-Oriented Modeling View-Based Modeling Monitoring Data aspect independent base Behavior Access Control aspect dependent base System (Jung et al. 2014) Reiner Jung 9 / 33

  19. Foundations Metamodel Roles Aspect-Oriented Modeling View-Based Modeling Monitoring Data aspect independent base Behavior Access Control dependent aspect dependent base System independent (Jung et al. 2014) Reiner Jung 9 / 33

  20. Foundations Megamodel Notation Example Megamodel based on CoCoME Szenario CoCoME Architecture (Bézivin et al. 2004; Favre 2004) Reiner Jung 10 / 33

  21. Foundations Megamodel Notation Example Megamodel based on CoCoME Szenario System conforms to CoCoME Architecture (Bézivin et al. 2004; Favre 2004) Reiner Jung 10 / 33

  22. Foundations Megamodel Notation Example Megamodel based on CoCoME Szenario Repository System conforms to conforms to CoCoME CoCoME Component- Architecture Types (Bézivin et al. 2004; Favre 2004) Reiner Jung 10 / 33

  23. Foundations Megamodel Notation Example Megamodel based on CoCoME Szenario Repository System conforms to conforms to CoCoME CoCoME Component- Architecture Types Transformation Target Model/Code (Bézivin et al. 2004; Favre 2004) Reiner Jung 10 / 33

  24. The GECO Approach Reiner Jung 11 / 33

  25. The GECO Approach Generator Composition Pattern Candiates A B C D A B C D 1 7 2 8 3 9 4 10 5 11 12 6 Model Transformation Reference Reiner Jung 12 / 33

  26. The GECO Approach Generator Composition Pattern Candiates A B C D A B C D 1 7 2 8 3 9 4 10 5 11 12 6 Model Transformation Reference Reiner Jung 12 / 33

  27. The GECO Approach Generator Composition Pattern Candiates A B C D A B C D 1 7 2 8 3 9 4 10 5 11 12 6 Model Transformation Reference Reiner Jung 12 / 33

  28. The GECO Approach Generator Composition Pattern Candiates A B C D A B C D 1 7 2 8 3 9 4 10 5 11 12 6 Model Transformation Reference Reiner Jung 12 / 33

  29. The GECO Approach Generator Composition Megamodel Patterns Simple Normal Aspect Inverted References Model Weaving P1 P2 P3 P4 SBM SBM SAM SBM SAM BM SAM T T T T T T BM BM AM BM AM Merge TBM TBM TAM TBM TAM BM' T SBM Source Base Model Transformation SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model Reference Reiner Jung 13 / 33

  30. The GECO Approach Generator Composition Megamodel Patterns Simple Normal Aspect Inverted References Model Weaving P1 P2 P3 P4 SBM SBM SAM SBM SAM BM SAM T T T T T T BM BM AM BM AM Merge TBM TBM TAM TBM TAM BM' T SBM Source Base Model Transformation SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model Reference Reiner Jung 13 / 33

  31. The GECO Approach Generator Composition Megamodel Patterns Simple Normal Aspect Inverted References Model Weaving P1 P2 P3 P4 SBM SBM SAM SBM SAM BM SAM T T T T T T BM BM AM BM AM Merge TBM TBM TAM TBM TAM BM' T SBM Source Base Model Transformation SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model Reference Reiner Jung 13 / 33

  32. The GECO Approach Generator Composition Megamodel Patterns Simple Normal Aspect Inverted References Model Weaving P1 P2 P3 P4 SBM SBM SAM SBM SAM BM SAM T T T T T T BM BM AM BM AM Merge TBM TBM TAM TBM TAM BM' T SBM Source Base Model Transformation SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model Reference Reiner Jung 13 / 33

  33. The GECO Approach Generator Composition Megamodel Patterns Simple Normal Aspect Inverted References Model Weaving P1 P2 P3 P4 SBM SBM SAM SBM SAM BM SAM T T T T T T BM BM AM BM AM Merge TBM TBM TAM TBM TAM BM' T SBM Source Base Model Transformation SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model Reference Reiner Jung 13 / 33

  34. The GECO Approach Pattern P2 - Normal Aspect SBM Source Base Model SBM SAM SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model TRM Trace Model T BM T AM T Transformation Reference TBM TAM Reiner Jung 14 / 33

  35. The GECO Approach Pattern P2 - Normal Aspect SBM Source Base Model SBM SAM SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model TRM Trace Model T BM T AM T Transformation Reference TBM TAM Reiner Jung 14 / 33

  36. The GECO Approach Pattern P2 - Normal Aspect SBM Source Base Model SBM SAM SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model TRM Trace Model T BM TRM T AM T Transformation Reference TBM TAM Reiner Jung 14 / 33

  37. The GECO Approach Pattern P2 - Normal Aspect SBM Source Base Model SBM SAM SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model TRM Trace Model T BM TRM T AM T Transformation Reference TBM TAM Reiner Jung 14 / 33

  38. The GECO Approach Pattern P3 - Inverted References SBM Source Base Model SBM SAM SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model TRM Trace Model JPM Join Point Model T BM T AM T Transformation Reference TBM TAM Reiner Jung 15 / 33

  39. The GECO Approach Pattern P3 - Inverted References SBM Source Base Model SBM SAM SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model TRM Trace Model JPM Join Point Model T BM TRM T AM JPM T Transformation Reference TBM TAM Reiner Jung 15 / 33

  40. The GECO Approach Pattern P3 - Inverted References SBM Source Base Model SBM SAM SAM Source Aspect Model TBM Target Base Model TAM Target Aspect Model TRM Trace Model JPM Join Point Model T BM TRM T AM JPM T Transformation Reference TBM TAM Reiner Jung 15 / 33

  41. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model Repository System Reiner Jung 16 / 33

  42. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model data types data types Repository System Behavior DTL opera- tions Reiner Jung 16 / 33

  43. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model data types data types Repository System Behavior DTL opera- tions T ProtoCom EJB/Servlets Stubs Reiner Jung 16 / 33

  44. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model data types data types Repository System Behavior DTL opera- tions T Behavior T DTL T ProtoCom Java methods EJB/Servlets Stubs Entities Snippets entity classes Reiner Jung 16 / 33

  45. The GECO Approach CoCoME Case Study - Generator Megamodel P2 - Normal Aspect Palladio Component Model Repository System Behavior DTL T Behavior T DTL T ProtoCom Java EJB/Servlets Stubs Entities Snippets Reiner Jung 16 / 33

  46. The GECO Approach CoCoME Case Study - Generator Megamodel P2 - Normal Aspect Palladio Component Model Repository System Behavior DTL T Behavior T DTL T ProtoCom Java EJB/Servlets Stubs Entities Snippets Reiner Jung 16 / 33

  47. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model data types data types Repository System Behavior DTL opera- tions T Behavior T DTL T ProtoCom Java methods EJB/Servlets Stubs Entities Snippets entity classes T JW entity classes EJB/Servlets T javac T javac entity classes Classes Classes Reiner Jung 16 / 33

  48. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model Repository System Behavior DTL P4 - Weaving T Behavior T DTL T ProtoCom Java EJB/Servlets Stubs Entities Snippets T JW entity classes EJB/Servlets T javac T javac entity classes Classes Classes Reiner Jung 16 / 33

  49. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model record data types types data types operations Repository System IRL IAL Behavior DTL opera- tions T Behavior T DTL T ProtoCom Java methods EJB/Servlets Stubs Entities Snippets entity classes T JW entity classes EJB/Servlets T javac T javac entity classes Classes Classes Reiner Jung 16 / 33

  50. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model record data types types data types operations Repository System IRL IAL Behavior DTL opera- tions T Behavior T DTL T ProtoCom T IRL Java T aspect methods EJB/Servlets Stubs Entities T sensor Snippets entity classes T JW Kieker methods entity classes aspect.xml Sensors EJB/Servlets T javac Records record types T javac,ajc T javac entity classes Classes Classes Classes Reiner Jung 16 / 33

  51. The GECO Approach CoCoME Case Study - Generator Megamodel P2 - Normal Aspect Palladio Component Model Repository System IRL IAL Behavior DTL T Behavior T DTL T ProtoCom T IRL Java T aspect EJB/Servlets Stubs Entities T sensor Snippets T JW Kieker entity classes aspect.xml Sensors EJB/Servlets T javac Records T javac,ajc T javac entity classes Classes Classes Classes Reiner Jung 16 / 33

  52. The GECO Approach CoCoME Case Study - Generator Megamodel P2 - Normal Aspect Palladio Component Model Repository System IRL IAL Behavior DTL T Behavior T DTL T ProtoCom T IRL Java T aspect EJB/Servlets Stubs Entities T sensor Snippets T JW Kieker entity classes aspect.xml Sensors EJB/Servlets T javac Records T javac,ajc T javac entity classes Classes Classes Classes Reiner Jung 16 / 33

  53. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model record data types types data types operations Repository System IRL IAL Behavior DTL opera- tions T Behavior T DTL T ProtoCom T IRL Java T aspect methods EJB/Servlets Stubs Entities T sensor Snippets entity classes T web T JW Kieker methods entity classes aspect.xml Sensors EJB/Servlets T javac Records record types T javac,ajc T javac T javac record types methods entity classes Classes Classes web.xml Classes Classes Reiner Jung 16 / 33

  54. The GECO Approach CoCoME Case Study - Generator Megamodel Palladio Component Model record data types types data types operations Repository System IRL IAL Behavior DTL opera- tions T Behavior T DTL T ProtoCom T IRL Java T aspect methods EJB/Servlets Stubs Entities T sensor Snippets entity classes T web T JW Kieker methods entity classes aspect.xml Sensors EJB/Servlets T javac Records record types T javac,ajc T javac T javac record types methods entity classes Classes Classes web.xml Classes Classes 7 P2 - Normal Aspect 2 P4 - Weaving Reiner Jung 16 / 33

  55. (Mens et al. 2006; Biehl 2010) The GECO Approach Internal Structure of Generator Fragments Technical Dimension Semantic Dimension Source Model Fragment Target Model Reiner Jung 17 / 33

  56. The GECO Approach Internal Structure of Generator Fragments Technical Dimension Semantic Dimension Source Model Fragment Model Query Control Aggregation Fragment State Output Creation Target Model (Mens et al. 2006; Biehl 2010) Reiner Jung 17 / 33

  57. The GECO Approach Internal Structure of Generator Fragments Technical Dimension Semantic Dimension Source Model Source Metamodel Fragment Model Query Control Aggregation Fragment State Output Creation Target Model Target Metamodel (Mens et al. 2006; Biehl 2010) Reiner Jung 17 / 33

  58. The GECO Approach Internal Structure of Generator Fragments Technical Dimension Semantic Dimension Source Model Source Metamodel Fragment Model Query Control Aggregation Fragment State Output Creation Target Model Target Metamodel (Mens et al. 2006; Biehl 2010) Reiner Jung 17 / 33

  59. The GECO Approach Internal Structure of Generator Fragments Technical Dimension Semantic Dimension Source Model Source Metamodel Source Model Fragment Fragment Model Query Control Control Aggregation Fragment Structure Typing Expressions Evaluation Initialization State Output Creation Target Model Target Metamodel Target Model (Mens et al. 2006; Biehl 2010) Reiner Jung 17 / 33

  60. The GECO Approach Internal Structure of Generator Fragments Technical Dimension Semantic Dimension Source Model Source Metamodel Source Model Fragment Fragment Model Query Control Control Aggregation Fragment Structure Typing Expressions Evaluation Initialization State Output Creation Target Model Target Metamodel Target Model (Mens et al. 2006; Biehl 2010) Reiner Jung 17 / 33

  61. Evaluation Reiner Jung 18 / 33

  62. Evaluation Evaluation Design Qualitative Evaluation with two case studies (based on GQM) Evaluate the effect of GECO on Goal G1 the utility and program quality Goal G2 the evolvability Goal G3 the reusability Reiner Jung 19 / 33

  63. Evaluation Q uestions Utility and program quality (IS091; ISO11) ‚ effort spent on the development of features ‚ modularity of different generator implementations ‚ understandability of the implementations Evolvability (Rowe et al. 1998; Koziolek 2011) ‚ Change in modularity during the evolution ‚ Change in understandability during the evolution ‚ Effects on the changeability during evolution ‚ Change in stability during evolution Reusability (IS091; ISO11) ‚ modifiability of the generator implementations ‚ modularity of the generator implementations ‚ generality of the generator implementations Reiner Jung 20 / 33

  64. effort spent on the development of features understandability of the implementations Change in understandability during the evolution Effects on the changeability during evolution Change in stability during evolution modifiability of the generator implementations generality of the generator implementations Evaluation Q uestions Utility and program quality (IS091; ISO11) ‚ modularity of different generator implementations Evolvability (Rowe et al. 1998; Koziolek 2011) ‚ Change in modularity during the evolution Reusability (IS091; ISO11) ‚ modularity of the generator implementations Reiner Jung 20 / 33

  65. Evaluation M etrics Modularity (Allen 2002; Allen et al. 2007) ‚ Low complexity of the system ‚ Low coupling of modules of a system ‚ High inner module cohesion of a system Reiner Jung 21 / 33

  66. Evaluation CoCoME Case Study Common Component Modeling Example (Heinrich et al. 2015) ‚ Domain : Information system ‚ Source : PCM, data type, behavior and monitoring DSLs ‚ Target : Java EE and AspectJ ‚ Evaluation : Combination of existing and new generators ‚ ProtoCom (Giacinto et al. 2013) ‚ Data types, behavior and monitoring (Jung et al. 2013) ‚ Evolution steps ( F Behavior ): 4 ③ Test GECO ’s feasibility for generator construction Reiner Jung 22 / 33

  67. 1. Basic functionality 2. Stateless/-full components 3. Java EE lifecycle functions 4. Persistence support Evaluation CoCoME Case Study – Behavior Evolution Behavior Generator 155 ● 800 Control Edges [count] LOC [count] 145 750 Structure Name Resolver ● 700 135 ● LOC 650 Expression T ype Statement ● 125 Edges ● 1 2 3 4 Reiner Jung 23 / 33 Revisions

  68. 2. Stateless/-full components 3. Java EE lifecycle functions 4. Persistence support Evaluation CoCoME Case Study – Behavior Evolution Behavior Generator ● Complexity/Coupling [bits] 0.044 1. Basic functionality 900 Cohesion [ratio] ● ● ● 0.042 700 ● Complexity Coupling 0.040 500 Cohesion 1 2 3 4 Revisions 155 ● 800 Control Edges [count] LOC [count] 145 750 Structure Name Resolver ● 700 135 ● LOC 650 Expression T ype Statement ● 125 Edges ● 1 2 3 4 Reiner Jung 23 / 33 Revisions

  69. 3. Java EE lifecycle functions 4. Persistence support Evaluation CoCoME Case Study – Behavior Evolution Behavior Generator ● Complexity/Coupling [bits] 0.044 1. Basic functionality 900 Cohesion [ratio] ● 2. Stateless/-full components ● ● 0.042 700 ● Complexity Coupling 0.040 500 Cohesion 1 2 3 4 Revisions 155 ● 800 Control Edges [count] LOC [count] 145 750 Structure Name Resolver ● 700 135 ● LOC 650 Expression T ype Statement ● 125 Edges ● 1 2 3 4 Reiner Jung 23 / 33 Revisions

  70. 4. Persistence support Evaluation CoCoME Case Study – Behavior Evolution Behavior Generator ● Complexity/Coupling [bits] 0.044 1. Basic functionality 900 Cohesion [ratio] ● 2. Stateless/-full components ● ● 0.042 700 3. Java EE lifecycle functions ● Complexity Coupling 0.040 500 Cohesion 1 2 3 4 Revisions 155 ● 800 Control Edges [count] LOC [count] 145 750 Structure Name Resolver ● 700 135 ● LOC 650 Expression T ype Statement ● 125 Edges ● 1 2 3 4 Reiner Jung 23 / 33 Revisions

  71. Evaluation CoCoME Case Study – Behavior Evolution Behavior Generator ● Complexity/Coupling [bits] 0.044 1. Basic functionality 900 Cohesion [ratio] ● 2. Stateless/-full components ● ● 0.042 700 3. Java EE lifecycle functions 4. Persistence support ● Complexity Coupling 0.040 500 Cohesion 1 2 3 4 Revisions 155 ● 800 Control Edges [count] LOC [count] 145 750 Structure Name Resolver ● 700 135 ● LOC 650 Expression T ype Statement ● 125 Edges ● 1 2 3 4 Reiner Jung 23 / 33 Revisions

  72. Evaluation MENGES Case Study New Generator for MENGES (Goerigk et al. 2012) ‚ Domain : Embedded system for railway control centers ‚ Source : Nine DSLs covering different aspects and views ‚ Target : Single output model in PLCOpenXML for IEC61131-3 (IEC03) ‚ Evaluation : Comparison of generator implementations ‚ Original MENGES generator ‚ GECO-based generator ‚ Evolution steps : 14 ③ Test evolution effects of using GECO Reiner Jung 24 / 33

  73. MENGES GECO Ratio Lines of code 10816 7025 1.5396 Complexity 13921.88 6675.88 2.0854 Coupling 10983.81 5060.83 2.1704 Evaluation MENGES Case Study – Generator Comparison 15000 15000 ● ● ● 10000 ● MENGES ● ● ● ● GECO ● ● ● ● ● ● ● 8000 ● ● ● ● Complexity [bits] ● 10000 10000 ● Coupling [bits] LOC [count] 6000 4000 5000 5000 ● 2000 ● ● ● ● MENGES GECO ● ● Complexity Complexity ● Coupling Coupling 0 0 ● 0 1 2 3 4 5 6 7 8 9 10 12 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Revisions Revisions Reiner Jung 25 / 33

  74. MENGES GECO Ratio Lines of code 10816 7025 1.5396 Complexity 13921.88 6675.88 2.0854 Coupling 10983.81 5060.83 2.1704 Evaluation MENGES Case Study – Generator Comparison Structure and Typing 15000 15000 ● ● ● 10000 ● MENGES ● ● ● ● GECO ● ● ● ● ● ● ● 8000 ● ● ● ● Complexity [bits] ● 10000 10000 ● Coupling [bits] LOC [count] 6000 4000 5000 5000 ● 2000 ● ● ● ● MENGES GECO ● ● Complexity Complexity ● Coupling Coupling 0 0 ● 0 1 2 3 4 5 6 7 8 9 10 12 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Revisions Revisions Reiner Jung 25 / 33

  75. MENGES GECO Ratio Lines of code 10816 7025 1.5396 Complexity 13921.88 6675.88 2.0854 Coupling 10983.81 5060.83 2.1704 Evaluation MENGES Case Study – Generator Comparison Expressions and Statements 15000 15000 ● ● ● 10000 ● MENGES ● ● ● ● GECO ● ● ● ● ● ● ● 8000 ● ● ● ● Complexity [bits] ● 10000 10000 ● Coupling [bits] LOC [count] 6000 4000 5000 5000 ● 2000 ● ● ● ● MENGES GECO ● ● Complexity Complexity ● Coupling Coupling 0 0 ● 0 1 2 3 4 5 6 7 8 9 10 12 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Revisions Revisions Reiner Jung 25 / 33

  76. MENGES GECO Ratio Lines of code 10816 7025 1.5396 Complexity 13921.88 6675.88 2.0854 Coupling 10983.81 5060.83 2.1704 Evaluation MENGES Case Study – Generator Comparison Refactoring and Communications 15000 15000 ● ● ● 10000 ● MENGES ● ● ● ● GECO ● ● ● ● ● ● ● 8000 ● ● ● ● Complexity [bits] ● 10000 10000 ● Coupling [bits] LOC [count] 6000 4000 5000 5000 ● 2000 ● ● ● ● MENGES GECO ● ● Complexity Complexity ● Coupling Coupling 0 0 ● 0 1 2 3 4 5 6 7 8 9 10 12 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Revisions Revisions Reiner Jung 25 / 33

  77. MENGES GECO Ratio Lines of code 10816 7025 1.5396 Complexity 13921.88 6675.88 2.0854 Coupling 10983.81 5060.83 2.1704 Evaluation MENGES Case Study – Generator Comparison Improvment of Polymorphism 15000 15000 ● ● ● 10000 ● MENGES ● ● ● ● GECO ● ● ● ● ● ● ● 8000 ● ● ● ● Complexity [bits] ● 10000 10000 ● Coupling [bits] LOC [count] 6000 4000 5000 5000 ● 2000 ● ● ● ● MENGES GECO ● ● Complexity Complexity ● Coupling Coupling 0 0 ● 0 1 2 3 4 5 6 7 8 9 10 12 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Revisions Revisions Reiner Jung 25 / 33

  78. MENGES GECO Ratio Lines of code 10816 7025 1.5396 Complexity 13921.88 6675.88 2.0854 Coupling 10983.81 5060.83 2.1704 Evaluation MENGES Case Study – Generator Comparison Timers and Template Improvements 15000 15000 ● ● ● 10000 ● MENGES ● ● ● ● GECO ● ● ● ● ● ● ● 8000 ● ● ● ● Complexity [bits] ● 10000 10000 ● Coupling [bits] LOC [count] 6000 4000 5000 5000 ● 2000 ● ● ● ● MENGES GECO ● ● Complexity Complexity ● Coupling Coupling 0 0 ● 0 1 2 3 4 5 6 7 8 9 10 12 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Revisions Revisions Reiner Jung 25 / 33

  79. MENGES GECO Ratio Lines of code 10816 7025 1.5396 Complexity 13921.88 6675.88 2.0854 Coupling 10983.81 5060.83 2.1704 Evaluation MENGES Case Study – Generator Comparison Maintenance 15000 15000 ● ● ● 10000 ● MENGES ● ● ● ● GECO ● ● ● ● ● ● ● 8000 ● ● ● ● Complexity [bits] ● 10000 10000 ● Coupling [bits] LOC [count] 6000 4000 5000 5000 ● 2000 ● ● ● ● MENGES GECO ● ● Complexity Complexity ● Coupling Coupling 0 0 ● 0 1 2 3 4 5 6 7 8 9 10 12 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Revisions Revisions Reiner Jung 25 / 33

  80. Evaluation MENGES Case Study – Generator Comparison Maintenance 15000 15000 ● ● ● 10000 ● MENGES ● ● ● ● GECO ● ● ● ● ● ● ● 8000 ● ● ● ● Complexity [bits] ● 10000 10000 ● Coupling [bits] LOC [count] 6000 4000 5000 5000 ● 2000 ● ● ● ● MENGES GECO ● ● Complexity Complexity ● Coupling Coupling 0 0 ● 0 1 2 3 4 5 6 7 8 9 10 12 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Revisions Revisions MENGES GECO Ratio Lines of code 10816 7025 1.5396 Complexity 13921.88 6675.88 2.0854 Coupling 10983.81 5060.83 2.1704 Reiner Jung 25 / 33

  81. Related Work Reiner Jung 26 / 33

  82. Related Work Modeling and Code Generation Aspect-oriented and view-based modeling ‚ Reusable aspect models (RAM) (Klein et al. 2007) ‚ Orthographic software modeling (OSM) (Atkinson et al. 2010) Aspect-oriented code generation (Mehmood et al. 2013) ‚ Theme/UML (Clarke et al. 2005) ‚ FDAF (Bennett et al. 2010) ‚ RAM-based (Kienzle et al. 2009; Kramer et al. 2011) Reiner Jung 27 / 33

  83. Related Work Transformation Modularization Reuse and product lines ‚ Template-based transformations (Kapova et al. 2010) ‚ Genesys approach (Jörges 2013) Modularization ‚ Genericity for model management operations (Wimmer et al. 2011) ‚ Factorization and composition (Sánchez Cuadrado et al. 2008) of transformation ‚ Chaining of transformations (Vanhooff et al. 2006) ‚ Localized transformations (Etien et al. 2015) Reiner Jung 28 / 33

  84. Related Work Transformation Modularization Reuse and product lines ‚ Template-based transformations (Kapova et al. 2010) ‚ Genesys approach (Jörges 2013) Modularization ‚ Genericity for model management operations (Wimmer et al. 2011) ‚ Factorization and composition (Sánchez Cuadrado et al. 2008) of transformation ‚ Chaining of transformations (Vanhooff et al. 2006) ‚ Localized transformations (Etien et al. 2015) Reiner Jung 28 / 33

  85. Conclusion Reiner Jung 29 / 33

  86. http://dx.doi.org/10.5281/zenodo.46552 http://dx.doi.org/10.5281/zenodo.47129 Conclusion Contributions Approach ‚ Generator composition megamodel patterns ‚ Internal modularization of generator fragments Replication Package ‚ Sources and datasets ‚ Software snapshots ‚ MENGES sources can be accessed via b+m informatik AG Reiner Jung 30 / 33

  87. Conclusion Contributions Generator framework and composition tooling https://github.com/rju/geco-composition-language.git Architecture analysis tool https://github.com/rju/architecture-evaluation-tool.git Generators used in CoCoME case study https://github.com/research-iobserve/ Reiner Jung 31 / 33

  88. Conclusion Future Work Evaluation ‚ GECO used for modernization, e.g., ProtoCom ‚ Evaluating technology impact on megamodel patterns Tool Development ‚ Integration of GECO generators in build systems ‚ Instrumentation aspect and record language ‚ IAL integration in Kieker ‚ IRL evolution, e.g., trace support Reiner Jung 32 / 33

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend