Generating Business Applications from Executable Models Rafael - - PowerPoint PPT Presentation

generating business applications from executable models
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Generating Business Applications from Executable Models

Rafael Chaves (@abstratt)

rafael@abstratt.com http://abstratt.com

slide-2
SLIDE 2

Motivation

slide-3
SLIDE 3

Business applications

Domain knowledge

+

Applied technology

slide-4
SLIDE 4

How it should be...

slide-5
SLIDE 5

Domain knowledge

Memory management Persistence Caching Transactions Serialization Concurrency Integration Communication protocols Security Programming language

slide-6
SLIDE 6

How it usually goes...

slide-7
SLIDE 7

Domain knowledge

Memory management Persistence Caching Transactions Serialization Concurrency Integration Communication protocols Security Programming language

slide-8
SLIDE 8

Executable models to the rescue

slide-9
SLIDE 9

Executable models are models but... Precise

(as much as needed)

Complete

(about what matters)

slide-10
SLIDE 10

Executable models are programs but... Focused

(on problem domain concepts)

Oblivious

(regarding technological choices)

slide-11
SLIDE 11

Executable models promote a complete separation between business and technology

slide-12
SLIDE 12

Persistence Querying Authorization REST API Text search Integration User interface Logging Authentication Backups Scaling Email notifications Usage-based billing Payment processing

  • Prog. language

Entities Relationships Constraints Operations and queries States Events Services Roles Architecture

(applied automatically by platform or code generator)

Domain knowledge

(synthesized by programmer)

slide-13
SLIDE 13

Demonstration

slide-14
SLIDE 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

slide-15
SLIDE 15

Modeling

slide-16
SLIDE 16

Test-driven modeling

slide-17
SLIDE 17

User-driven validation

slide-18
SLIDE 18

Code generation

slide-19
SLIDE 19

Structure-based generation

Classes Attributes Operations (signatures) Associations Other classifiers (enumerations, signals etc) Default values/derivations

slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32

State machine-based generation

States Transitions Triggers Guards Entry/exit/do activities

slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37
slide-38
SLIDE 38
slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43

Activity-based generation

Activities Actions Input and output pins Object flows

slide-44
SLIDE 44
slide-45
SLIDE 45

Available actions

  • read/write variable
  • create/destroy object
  • read self ("this")
  • read/write attribute
  • create/destroy link
  • call operation
  • structured node (blocks)
  • test identity
  • conditional (if/switch)
  • loop (for/while)
  • raise exception
  • send signal
slide-46
SLIDE 46
  • peration deposit(depositedAmount : Decimal) {

this.balance = this.balance + depositedAmount; }

slide-47
SLIDE 47

Plain Java Plain Javascript

slide-48
SLIDE 48
slide-49
SLIDE 49
slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52

Lessons learned

slide-53
SLIDE 53

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

slide-54
SLIDE 54

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

slide-55
SLIDE 55

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

slide-56
SLIDE 56

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

slide-57
SLIDE 57

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

slide-58
SLIDE 58

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
slide-59
SLIDE 59

+1 0 -1

Sign in: www.eclipsecon.org

Evaluate the sessions

slide-60
SLIDE 60

Generating Business Applications from Executable Models

Rafael Chaves (@abstratt)

rafael@abstratt.com http://abstratt.com