generating business applications from executable models
play

Generating Business Applications from Executable Models Rafael - PowerPoint PPT Presentation

Generating Business Applications from Executable Models Rafael Chaves (@abstratt) rafael@abstratt.com http://abstratt.com Motivation Business applications Domain knowledge + Applied technology How it should be... Persistence Integration


  1. Generating Business Applications from Executable Models Rafael Chaves (@abstratt) rafael@abstratt.com http://abstratt.com

  2. Motivation

  3. Business applications Domain knowledge + Applied technology

  4. How it should be...

  5. Persistence Integration Serialization Security Domain knowledge Programming language Communication Transactions Caching protocols Memory management Concurrency

  6. How it usually goes...

  7. Persistence Integration Serialization Security Domain knowledge Programming language Communication Transactions Caching protocols Memory management Concurrency

  8. Executable models to the rescue

  9. Executable models are models but... Precise (as much as needed) Complete (about what matters)

  10. Executable models are programs but... Focused (on problem domain concepts) Oblivious (regarding technological choices)

  11. Executable models promote a complete separation between business and technology

  12. Entities Relationships Constraints Operations and queries States Domain knowledge Events (synthesized by programmer) Services Roles Persistence Authentication Querying Backups Architecture Authorization Scaling (applied automatically REST API Email notifications by platform or code Text search Usage-based billing generator) Integration Payment processing User interface Prog. language Logging

  13. Demonstration

  14. Tools ● vanilla UML as executable modeling language ○ extended via profiles/conventions ● TextUML - textual notation over UML ● Eclipse Xtend - for implementing generators ● Cloudfier - web-based modeling IDE with interpreter/generators General concepts > Particular tools

  15. Modeling

  16. Test-driven modeling

  17. User-driven validation

  18. Code generation

  19. Structure-based generation Classes Attributes Operations (signatures) Associations Other classifiers (enumerations, signals etc) Default values/derivations

  20. State machine-based generation States Transitions Triggers Guards Entry/exit/do activities

  21. Activity-based generation Activities Actions Input and output pins Object flows

  22. Available actions ● structured node (blocks) ● read/write variable ● test identity ● create/destroy object ● conditional (if/switch) ● read self ("this") ● loop (for/while) ● read/write attribute ● raise exception ● create/destroy link ● send signal ● call operation

  23. operation deposit(depositedAmount : Decimal) { this.balance = this.balance + depositedAmount; }

  24. Plain Java Plain Javascript

  25. Lessons learned

  26. Knowing the target platform matters ● Better to know what the destination looks like before you start ● At a minimum, have fully-functional handwritten example code

  27. Pick your generator language wisely ● Java ○ full power, but awkward with collections (improved in 1.8), no string interpolation ● StringTemplate ○ standalone templates, but less control ● Groovy ○ graph navigation/transformation, string interpolation ● Xtend ○ plus static type checking, IDE support

  28. Testing the generator ● have sample applications covering all modeling language features ○ use a compiler/lint to check for syntactical errors ● have tests in your sample apps ○ generate then run tests to detect runtime/integration problems

  29. Generator Reuse ● within a platform (Plain Java, JPA-enabled) ○ share base templates, differ on details ● across target platforms ○ reasoning about models is often the same ● design reuse helps too ○ second generator is much easier

  30. References Blog http://abstratt.com/blog/ Executable UML http://www.executableumlbook.com/ http://www.omg.org/spec/FUML/ http://www.omg.org/spec/ALF/ Cloudfier/TextUML http://doc.cloudfier.com - http://github.com/abstratt/cloudfier http://abstratt.com/textuml

  31. Status ● JavaEE generator under active development (open-source EPL) (dev. started on Feb. 18) ● MEAN generator in the back burner ● Looking for sponsors / contracts to further develop the generators ● Cloudfier is still alpha, you are welcome to try it

  32. Evaluate the sessions Sign in: www.eclipsecon.org +1 0 -1

  33. Generating Business Applications from Executable Models Rafael Chaves (@abstratt) rafael@abstratt.com http://abstratt.com

Recommend


More recommend