introduction and real world samples - uni koblenz-landaulaemmel/pttcourse/slides/xtext.pdf ·...

41
© itemis AG Xtext Introduction and Real World Samples Hendrik Bünder, itemis AG

Upload: trinhcong

Post on 09-Mar-2018

217 views

Category:

Documents


1 download

TRANSCRIPT

© itemis AG

XtextIntroduction and Real World Samples

Hendrik Bünder, itemis AG

© itemis AG

Who is this guy?

Hendrik BünderIT-Consultant

© itemis AG

Agenda

Introduction to XtextWhat, How, Why?

Common DSLsDSLs that no longer impress anybody….

Advanced Use Cases for DSLsThe fancy real world stuff…

DiscussionWhat you always wanted to know about DSLs and Xtext

© itemis AG

Xtext is a language workbench External DSL

Xtext grammar notation is central artifact for DSL definition (EBNF++)

Xtext DSL by default have a textual representation

The concrete syntax is parsed using an ANTLR parser

Generator templates implemented using Xtend

Connecting to what I know you (should) know….

© itemis AG

• Since 2006 developed by itemis

• Eclipse-base• Part of the Eclipse Modeling Project 

• Eclipse Project since 2008

• Open-Source (EPL)

• Textuall DSLs

• Parser-based• Grammar as central artifact

• ANTLR Parser

Language WorkbenchesXtext

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

Structure and Runtime

© itemis AG

EntitiesServices

ScreenFlow

GuiWidgets

MappingDatatypes Constraints

ExceptionsForms

LANGUAGES

© itemis AG

„Common DSLs“

Entity

DSL

Enumeration DSL

`Service DSL

Persistence DSL

© itemis AG

Model-Based Migration UML-2-Xtext

© itemis AG

Insurance Life System

● 15 million LOC○ 60% RPG○ 40% Java

● Hardware○ IBM iSeries Hardware (AS/400)

● User interface○ IBM Webfacing

● Database DB/2

Migratin a legacy system

© itemis AG

Migration – Why? What? How?

● Why?○ Ending support○ A desire to reduce maintenance and working costs○ Retiring „know-how“○ A desire to increase attractiveness and market

acceptance● What?

○ Data, user interfaces, ports, functions● How?

○ Redevelopment, fully automated, semi-automated (= model-based)

© itemis AG

Model-Based Migration

22

Model-based migration with adapted tools

Target system

22

Legacy system(e.g. Forms / RPG)

© itemis AG

The Approach

23

© itemis AG

UI Replatforming: Motivation

24

● Web solution exists (IBM WebFacing), but still has a text-mode look&feel

● Hard to internationalize and make accessible

● Still bound to mainframe platform and RPG

Not future-proof

© itemis AG

UI-Replatforming: Target Architecture

25

● J2EE

● Spring Framework

● JavaServer Faces (JSF) 2.x

● Facelets

● Apache Tobago ( grid layout)

● Data binding using Java Expression Language

● CSS, JavaScript

© itemis AG

UI-Replatforming: DSLs und Generatoren

26

BODSL models

ViewmodelDSL models

ScreenDSL models

BO generat

or

BOJava Beans

Viewmodel Java Beans

JSFFacelets

Viewmodel generator

Screen generator

use/extend use

useuse

© itemis AG

27

Screen DSL <-> Screen Preview

© itemis AG

The result

28

7 million loc RPG

700.000 loc model

1 million loc XHTML4.3 milllion loc Java

3 million loc Java

© itemis AG

Testing

29

Problem● No automated Tests

Solution● Record test cases in legacy system in browser (IBM WebFacing)

○ Recording done with HP Quality Center● Transform recorded legacy tests to Test DSL● Generate Selenium tests out of test cases in Test DSL● Test migrated system

Prerequisite ● Ensure that UI widget ID is preserved

© itemis AG

Testing – Terminal

30

© itemis AG

Testing – IBM WebFacing

31

© itemis AG

Testing - HP Quality Center (UFT) - UFT DSL

32

© itemis AG

Testing - Test DSL

33

© itemis AG

Testing – Generated Selenium Test

34

© itemis AG

Behavior-Driven UI Testing

© itemis AG

Automatically Executable Test Cases

Mapping

FeatureScreen

Flexible Generators

© itemis AG

We also got DSLs for…..

Requirements

Traceability

Docker

Typesystems

UI Descriptions

Business Rules

Router Configuration

Embedded DevelopmentStatemachines

© itemis AG

Industry-proven

© itemis AG

Xtext is a powerful language workbench to create state of the art languages and editors

Industry-proven for Domain-specific languages

Model-based migration

Testing

Typesystems

….

Xtext is backed by a vivid open-source comunity

Feel free to join the Xtext community

Take away

© itemis AG

© itemis AG

itemis AG | Am Brambusch 15-24 | D-44536 Lünen | www.itemis.de

Thank you for your attention!