SlideShare una empresa de Scribd logo
1 de 30
Code generation: Going all the way Rafael Chaves [email_address] http://alphasimple.com
Defining "code generation"
Code generation is everywhere ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],<<< this will be our focus
Step 1: basic code generation from models
 
package banking; public class Account {     private Double balance;      public Double getBalance() {         return this.balance;     }      public void setBalance(Double balance) {         assert balance != null;         this.balance = balance;      }      public void deposit(Double amount) {         /* FILL ME IN */     }     public void withdraw(Double amount) {         /* FILL ME IN */     }  }
Step 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Step 2: using protected regions
package banking; public class Account {     private Double balance;      public Double getBalance() {         return this.balance;     }      public void setBalance(Double balance) {         assert balance != null;         this.balance = balance;      }      public void deposit(Double amount) {         //BEGIN-USER-CODE          this.balance = this.balance + amount;          //END-USER-CODE           }    ... }
Step 2: Protected regions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Step 3: applying the Generation Gap pattern
Source:  IBM Research
// GENERATED - DO NOT MODIFY  package banking; public class AccountCore {     protected Double balance;      public Double getBalance() {         return this.balance;     }      public void setBalance(Double balance) {         assert balance != null;         this.balance = balance;      }      public void deposit(Double amount) {         // override me      }      public void withdraw(Double amount) {         // override me      }  }
package banking; public class Account extends AccountCore {      public void deposit(Double amount) {         this.balance = this.balance + amount;      }      public void withdraw(Double amount) {         this.balance = this.balance - amount;      }  }
Step 3: generation gap ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What problem are we trying to solve again?
Enterprise software is  much  harder than it should be Problem domains are typically not very complex (information management + business rules) How come? Secondary concerns abound   persistence, concurrency, (a)synchronism, distribution, transactions, security, caching, replication, logging, ...
Two dimensions of enterprise software ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Why do we treat them the same? Business Technical ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Problem hypothesis: lack of separation between technical and domain concerns is the root of all evil
Solutions Using ordinary 3GL + reflection/AOP   Model-driven development with DSLs   Model-driven development with a GPL (like UML)
Using ordinary 3GL + reflection/AOP ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Model-driven development (with DSL or GPL) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Solution hypothesis: Model-driven development with a GPL and full code generation
Models in software ,[object Object],[object Object],[object Object],[object Object],That is  not  what MDD is about
Models in MDD ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Demo: Executable modeling and full code generation with AlphaSimple
Validating hypotheses
How disappointed would you be if AlphaSimple 1.0 didn't allow you to: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Model-driven development is not about taking work (or fun) away from developers, but making their work more meaningful and valuable
Code generation: Going all the way Rafael Chaves [email_address] http://alphasimple.com

Más contenido relacionado

La actualidad más candente

50500113 spiral-model
50500113 spiral-model50500113 spiral-model
50500113 spiral-model
asidharath
 
Iterative Development: Breaking from the Waterfall
Iterative Development: Breaking from the WaterfallIterative Development: Breaking from the Waterfall
Iterative Development: Breaking from the Waterfall
Andrei Navarro
 
Spiral Model & Requirement Validation
Spiral Model & Requirement ValidationSpiral Model & Requirement Validation
Spiral Model & Requirement Validation
Abhijat Dhawal
 
Software development slides
Software development slidesSoftware development slides
Software development slides
iarthur
 

La actualidad más candente (20)

The Spiral Model
The Spiral ModelThe Spiral Model
The Spiral Model
 
Assignment
AssignmentAssignment
Assignment
 
Software development life cycle
Software development life cycleSoftware development life cycle
Software development life cycle
 
[2015/2016] Software development process
[2015/2016] Software development process[2015/2016] Software development process
[2015/2016] Software development process
 
Evolutionary models
Evolutionary modelsEvolutionary models
Evolutionary models
 
RAD Model
RAD ModelRAD Model
RAD Model
 
Interactive sketching for the early stages of user interface design
Interactive sketching for the early stages of user interface designInteractive sketching for the early stages of user interface design
Interactive sketching for the early stages of user interface design
 
RAD Model
RAD ModelRAD Model
RAD Model
 
The software management and engineering in the AI-oriented projects tutorial
The software management and engineering in the AI-oriented projects tutorialThe software management and engineering in the AI-oriented projects tutorial
The software management and engineering in the AI-oriented projects tutorial
 
Slides chapter 3
Slides chapter 3Slides chapter 3
Slides chapter 3
 
Sohrab Waterfall Vs Rad
Sohrab Waterfall Vs RadSohrab Waterfall Vs Rad
Sohrab Waterfall Vs Rad
 
50500113 spiral-model
50500113 spiral-model50500113 spiral-model
50500113 spiral-model
 
Iterative Development: Breaking from the Waterfall
Iterative Development: Breaking from the WaterfallIterative Development: Breaking from the Waterfall
Iterative Development: Breaking from the Waterfall
 
PROTOTYPE MODEL
PROTOTYPE MODELPROTOTYPE MODEL
PROTOTYPE MODEL
 
Software Engineering Lec 2
Software Engineering Lec 2Software Engineering Lec 2
Software Engineering Lec 2
 
Prototyping
PrototypingPrototyping
Prototyping
 
Spiral model : System analysis and design
Spiral model : System analysis and designSpiral model : System analysis and design
Spiral model : System analysis and design
 
3. ch 2-process model
3. ch 2-process model3. ch 2-process model
3. ch 2-process model
 
Spiral Model & Requirement Validation
Spiral Model & Requirement ValidationSpiral Model & Requirement Validation
Spiral Model & Requirement Validation
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 

Destacado

Destacado (11)

11 Dogmas of model driven development
11 Dogmas of model driven development11 Dogmas of model driven development
11 Dogmas of model driven development
 
Model Driven Prototyping
Model Driven PrototypingModel Driven Prototyping
Model Driven Prototyping
 
TDC SP 2016 - Dos requisitos à implantação em uma palestra
TDC SP 2016 - Dos requisitos à implantação em uma palestraTDC SP 2016 - Dos requisitos à implantação em uma palestra
TDC SP 2016 - Dos requisitos à implantação em uma palestra
 
Modernização de Sistemas de Gestão
Modernização de Sistemas de GestãoModernização de Sistemas de Gestão
Modernização de Sistemas de Gestão
 
Cloudfier business pitch deck
Cloudfier business pitch deckCloudfier business pitch deck
Cloudfier business pitch deck
 
TDC Floripa 2015 Desenvolvendo Sistemas de Gestão a partir de Modelos Execut...
TDC Floripa 2015  Desenvolvendo Sistemas de Gestão a partir de Modelos Execut...TDC Floripa 2015  Desenvolvendo Sistemas de Gestão a partir de Modelos Execut...
TDC Floripa 2015 Desenvolvendo Sistemas de Gestão a partir de Modelos Execut...
 
Refatorando o software corporativo
Refatorando o software corporativoRefatorando o software corporativo
Refatorando o software corporativo
 
Separando arquitetura e negócios em sistemas de gestão
Separando arquitetura e negócios em sistemas de gestãoSeparando arquitetura e negócios em sistemas de gestão
Separando arquitetura e negócios em sistemas de gestão
 
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutos
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutosTDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutos
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutos
 
MDD with Executable UML Models
MDD with Executable UML ModelsMDD with Executable UML Models
MDD with Executable UML Models
 
TextUML Toolkit
TextUML ToolkitTextUML Toolkit
TextUML Toolkit
 

Similar a Code generation

Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
LiquidHub
 
Vipul divyanshu mahout_documentation
Vipul divyanshu mahout_documentationVipul divyanshu mahout_documentation
Vipul divyanshu mahout_documentation
Vipul Divyanshu
 

Similar a Code generation (20)

Intro1
Intro1Intro1
Intro1
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
Dot Net Fundamentals
Dot Net FundamentalsDot Net Fundamentals
Dot Net Fundamentals
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
Pragmatic Model Driven Development using openArchitectureWare
Pragmatic Model Driven Development using openArchitectureWarePragmatic Model Driven Development using openArchitectureWare
Pragmatic Model Driven Development using openArchitectureWare
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
 
Why Gradle?
Why Gradle?Why Gradle?
Why Gradle?
 
resume
resumeresume
resume
 
DAE Tools 1.8.0 - Introduction
DAE Tools 1.8.0 - IntroductionDAE Tools 1.8.0 - Introduction
DAE Tools 1.8.0 - Introduction
 
Intro To AOP
Intro To AOPIntro To AOP
Intro To AOP
 
NEXiDA at OMG June 2009
NEXiDA at OMG June 2009NEXiDA at OMG June 2009
NEXiDA at OMG June 2009
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 
Vipul divyanshu mahout_documentation
Vipul divyanshu mahout_documentationVipul divyanshu mahout_documentation
Vipul divyanshu mahout_documentation
 
Java Chapter 2 Overview.ppt
Java Chapter 2 Overview.pptJava Chapter 2 Overview.ppt
Java Chapter 2 Overview.ppt
 
Java Chapter 2 Overview.ppt
Java Chapter 2 Overview.pptJava Chapter 2 Overview.ppt
Java Chapter 2 Overview.ppt
 
Magento 2 Community Project - Moving from LESS to SASS
Magento 2 Community Project - Moving from LESS to SASSMagento 2 Community Project - Moving from LESS to SASS
Magento 2 Community Project - Moving from LESS to SASS
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Code generation

  • 1. Code generation: Going all the way Rafael Chaves [email_address] http://alphasimple.com
  • 3.
  • 4. Step 1: basic code generation from models
  • 5.  
  • 6. package banking; public class Account {     private Double balance;     public Double getBalance() {         return this.balance;     }     public void setBalance(Double balance) {         assert balance != null;         this.balance = balance;     }     public void deposit(Double amount) {         /* FILL ME IN */     }     public void withdraw(Double amount) {         /* FILL ME IN */     } }
  • 7.
  • 8. Step 2: using protected regions
  • 9. package banking; public class Account {     private Double balance;     public Double getBalance() {         return this.balance;     }     public void setBalance(Double balance) {         assert balance != null;         this.balance = balance;     }     public void deposit(Double amount) {         //BEGIN-USER-CODE         this.balance = this.balance + amount;         //END-USER-CODE         }    ... }
  • 10.
  • 11. Step 3: applying the Generation Gap pattern
  • 12. Source: IBM Research
  • 13. // GENERATED - DO NOT MODIFY package banking; public class AccountCore {     protected Double balance;     public Double getBalance() {         return this.balance;     }     public void setBalance(Double balance) {         assert balance != null;         this.balance = balance;     }     public void deposit(Double amount) {         // override me     }     public void withdraw(Double amount) {         // override me     } }
  • 14. package banking; public class Account extends AccountCore {     public void deposit(Double amount) {         this.balance = this.balance + amount;     }     public void withdraw(Double amount) {         this.balance = this.balance - amount;     } }
  • 15.
  • 16. What problem are we trying to solve again?
  • 17. Enterprise software is much harder than it should be Problem domains are typically not very complex (information management + business rules) How come? Secondary concerns abound persistence, concurrency, (a)synchronism, distribution, transactions, security, caching, replication, logging, ...
  • 18.
  • 19. Problem hypothesis: lack of separation between technical and domain concerns is the root of all evil
  • 20. Solutions Using ordinary 3GL + reflection/AOP   Model-driven development with DSLs   Model-driven development with a GPL (like UML)
  • 21.
  • 22.
  • 23. Solution hypothesis: Model-driven development with a GPL and full code generation
  • 24.
  • 25.
  • 26. Demo: Executable modeling and full code generation with AlphaSimple
  • 28.
  • 29. Model-driven development is not about taking work (or fun) away from developers, but making their work more meaningful and valuable
  • 30. Code generation: Going all the way Rafael Chaves [email_address] http://alphasimple.com

Notas del editor

  1. code generator = a program that produces other programs
  2. Code generation is just a tool   Productivity   Automate what can be automated    What problem does it solve?   To extract architectural decisions as reusable artifacts   To reduce time to market   To ensure consistency (developers like to pretend they are robots)
  3. Code generation is just a tool   Productivity   Automate what can be automated    What problem does it solve?   To extract architectural decisions as reusable artifacts   To reduce time to market   To ensure consistency (developers like to pretend they are robots)