Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE...

41
Executable Translatable UML for Enterprise Applications Dr Malte Stien Software Engineer

Transcript of Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE...

Page 1: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

Executable Translatable UMLfor Enterprise Applications

Dr Malte StienSoftware Engineer

Page 2: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 2Dr Malte Stien

Overview

▪ Introduction− The ARC, xtUML, MDA, enterprise applications

▪ Practical experience, the task...− Building an enterprise application with MDA/xtUML

▪ ... and why this is cool!− Economics, advantages, etc.

▪ Results− Some metrics, team size, lines of code, etc.

▪ Questions and discussion

Page 3: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 3Dr Malte Stien

Introduction

Page 4: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 4Dr Malte Stien

ARC Business

▪ “Advance Australia's research excellence to be globally competitive and deliver benefits to the community”− administer the research programs for which it has

responsibility− make recommendations to the minister on the allocation

of funds− provide advice to the minister in research matters

▪ RMS to support all processes directlyassociated with research funding

Page 5: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 5Dr Malte Stien

Research Management System (RMS):Four Phases of Roll-out▪ Selection/Decision support functionality− Limited in time use (1 to 5 days)− Up to 6 active/72 passive users

▪ Post selection/post award functionality− Continuous use; up to 80 users (internal to ARC)

▪ Pre-award functionality− Continuous use; up to 80 users (internal to ARC)

▪ ARC external functionality− Continuous use, characterised by peak-load− Up to 50,000 assessors and applicants

Page 6: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 6Dr Malte Stien

What is xtUML?

▪ ...it's executable and translatable

▪ ...it's a profile of UML

▪ ...it has precise meaning (well, it should!)

▪ ...it's a model-driven technique (MDA)

▪ ...users can understand and review it

▪ ...is supported by− BridgePoint (Accelerated Technologies)− iUML/iCCG (KennedyCarter)− Pathfinder (Pathfinder Solutions)

Page 7: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 7Dr Malte Stien

What is xtUML?

▪ Domain model− Interaction between autonomous domains

▪ Class model− Classes, Attributes, Relationships, Constraints− Synchronous behaviour

▪ State model− States, Transitions, Asynchronous behaviour− Some classes feature state machines

▪ Action procedures− Specified in Action Specification Language

Page 8: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 8Dr Malte Stien

MDA – There are two ways about it

▪ Model Driven Architecture

▪ Pure approach− PIM → Code

▪ Polluted approach− PIM → PSM (potentially edited) → Code

PIM: Platform independent modelsPSM: Platform specific models

Page 9: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 9Dr Malte Stien

Building the System

Research Management System

Platform/Architecture/DesignSpecification

Handwritten code +Mechanisms

Code Generator

Page 10: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 10Dr Malte Stien

Enterprise [Application | Software]

▪ Enterprise [Application | Software] is...− ...software that solves an enterprise problem (rather than a

departmental problem) and usually enterprise software is written using Enterprise Software Architecture. Due to the cost of building what is often proprietary software only large organizations attempt to build software that models the entire business enterprise and is the core system of governing the enterprise and the core of business communications within the enterprise. --wikipedia

− ...is application software that performs business functions such as accounting, production scheduling, customer information tracking, bank account maintenance, and the like. It is almost always hosted on servers, and is used by multiple employeesof the same organization. --wikipedia

Page 11: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 11Dr Malte Stien

Enterprise Architectures

▪ Generic platforms...− SUN Java 2 Enterprise Edition (J2EE)− Microsoft .NET

▪ Specific solutions...− SAP− PeopleSoft− Oracle

Page 12: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 12Dr Malte Stien

The J2EE Architecture

source: Sun Microsystems

Page 13: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 13Dr Malte Stien

Enterprise Application Architecture

EnterpriseTier

WebTier Database

Intranet/Internet

Webpage designs,images, buttons, etc.

Business rules,system behaviour,

etc.Storage of

entitiesWeb browser:

The user interface

DatabaseServer

ApplicationServer

Client Computer Web Server

Page 14: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 14Dr Malte Stien

Practical ExperienceThe Task

Page 15: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 15Dr Malte Stien

Research Management System (RMS)

Page 16: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 16Dr Malte Stien

The xtUML Model

Page 17: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 17Dr Malte Stien

The xtUML Model – Example

Page 18: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 18Dr Malte Stien

Action Specification Language

function BGT_GRP10:getRecursiveBudgetLineSum input: inContributor, inProposalYear, inBudgetContainer output: outCashAmount, outInKindAmount# Initialise variablesoutCashAmount=0outInKindAmount=0

# Retrieve the BudgetCategories for this BudgetGroup{budgetCategories}=this->R69.BudgetCategory

# Iterate over the BudgetCategories and sum them upfor budgetCategory in {budgetCategories} do [budgetItemCashAmount, budgetItemInKindAmount, budgetItemIsMaster] =

BGT_CAT10:getRecursiveBudgetLineSum[inContributor, inProposalYear, inBudgetContainer] on budgetCategory

outCashAmount = outCashAmount+budgetItemCashAmount outInKindAmount = outInKindAmount+budgetItemInKindAmountendfor

Page 19: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 19Dr Malte Stien

Code Generators

EJBLogging

Security

RMA Domain

WikiGenerator wikiWikiGenerator wiki

PostgreSQL

SQLDDL

SQL Generator

RMA database

SQLDDL

SQL Generator

RMA database

J2EE Application Server(JBoss)

Web Server(Apache and Tomcat)

JavaBeans

XDoclet

EJB Generator

DeployXMLJava

Beans

XDoclet

EJB Generator

DeployXML

Models

JavaBeans,JSPs,

Tags ...

DeployXML

Web Generator

JavaBeans,JSPs,

Tags ...

DeployXML

Web Generator

Page 20: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 20Dr Malte Stien

Why is this cool?

Page 21: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 21Dr Malte Stien

About houses and cars

▪ Traditional−…is like building houses

▪ Model Driven−…is like building cars

Page 22: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 22Dr Malte Stien

About Houses and Cars: Houses...

Product

ProductWork &Effort

Work &Effort

Architecture/Design

Work &Effort

Page 23: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 23Dr Malte Stien

About Houses and Cars: Cars...

Work &Effort

ProductionFacility

Product

RMS

Architecture/Design

Work &Effort

Page 24: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 24Dr Malte Stien

About Houses and Cars: Cars...

Work &Effort

…and using the sameproduction facility.

RMSv1RMSv2

ProductionFacility

Product

Imagine you could getdifferent cars just bychanging your model

Page 25: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 25Dr Malte Stien

More on houses and cars...

▪ Houses− Architectural/design

description− Always a one-off− No tooling effort− Defects are fixed

one-by-one− First house: T− Next house: T− Assets: Architecture

▪ Cars− Architectural/design

description− Serial production− Large tooling effort− Defects are fixed in

the production line− First car: >T− Next car: <<T− Assets: Production

facility and design

Page 26: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 26Dr Malte Stien

Valuable Assets for the ARC

▪ Architecture− Help the ARC to

understand the architecture− The ARC can build any

system using the RMS architecture− Maintain/publish the

architecture

▪ Models− Help the ARC to

understand their business− Facilitates process re-

engineering− The ARC can build the

RMS using any architecture− Maintain/publish

the models

Page 27: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 27Dr Malte Stien

Traditional vsModel Driven DevelopmentSoftware development: Traditional

Software development: Model driven

Requirements

Hand-written code

Architecture/Design

Requirements

Hand-written code

Architecture/Design

Page 28: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 28Dr Malte Stien

Timeline: Traditional Approach

Gather requirements

Design system

Test system

Procure hardware

Implement software

DeployRMS

...or here!

...or here…

And thenfixed here …

...or evenhere!

TimeProblems and

defects arefirst found here...

Page 29: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 29Dr Malte Stien

Timeline: Model Driven Approach

Time

Model requirements

Design architecture

GenerateRMSBuild platform

Build code generator

DeployRMS

TestModel

Problems anddefects are

first found here...

And thenfixed here…

Model requirements TestModel Model requirements Test

Model

...or here…

...or here…

...or here!

Page 30: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 30Dr Malte Stien

The Economy of Defects...

▪ Defect distribution is different− Either in the model (requirements defects), or...− ... in the code generator (architectural defects)

▪ Requirements defects...− ...are defects in your analysis

▪ Architectural defects...− are easy to find...

● as they are likely to manifest all over the place− ... and easy to fix!

● as you only fix them once to fix themeverywhere

Page 31: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 31Dr Malte Stien

Does all this actually work?

Page 32: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 32Dr Malte Stien

Results

▪ xtUML Model...− Captures the business' requirements, classes,

relationships, attributes, operations, state machines, etc.

▪ J2EE/EJB Code Generator− Generates entity beans and session beans, value

objects, behaviours, administration application, etc.

▪ SQL Code Generator− Generates tables, columns, foreign key constraints,

additional constraints, triggers, consistency report, etc.

Page 33: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 33Dr Malte Stien

Statistics – Phase 1The Input▪ The model− Classes: 125 (13 of which are “switched off”)− Attributes: 503

● Referential attributes: 198● Non-referential attributes: 304− Relationships: 137

● Generalisations: 15● Associations: 112− Synchronous operations: 138 (3,361 lines of ASL total)− State machines (asynchronous operations): 0

Page 34: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 34Dr Malte Stien

Project Team

▪ One xtUML modeller – 14 months

▪ One J2EE software engineer – 8 months

▪ One web developer – 6 months

▪ One database administrator – 9 months (eff.)

▪ Business experts – continuous/embedded▪ One solution architect▪ One project manager▪ One test coordinator

Page 35: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 35Dr Malte Stien

Statistics – Phase 1The Output▪ Web tier− Generated by Code Generator:

0 lines (not counting value objects)− Handwritten: 7,562 lines

● Screen layouts (JSPs): 1,963 lines● JavaScript for components: 3,062 lines● Java backing beans: 2,537 lines− Mechanisms: 3,264 lines

Numbers include comments

Page 36: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 36Dr Malte Stien

Statistics – Phase 1The Output▪ Application/EJB tier− Generated by Code Generator:

270,665 lines (100%)● EJBs (excluding behaviours): 139,980 lines● EJB behaviours: 59,875 lines● Value objects: 4,051 lines● Administration application: 62,907 lines− Generated by XDoclet: 226,520 lines− Handwritten: 0 lines− Mechanisms: 2,047 lines

Numbers include comments

Page 37: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 37Dr Malte Stien

Statistics – Phase 1The Output▪ Database tier− Generated by Code Generator: 2,309 lines (78%)− Handwritten: 656 lines (Fast Data Readers)− Mechanisms: 257 lines

Page 38: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 38Dr Malte Stien

EnterpriseTier

WebTier Database

Intranet/Internet

Enterprise Application Architecture

DatabaseServer

ApplicationServer

Client Computer

Leve

l of C

ode

Gen

erat

ion

Web Server

Page 39: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 39Dr Malte Stien

Statistics – Phase 1

95%

3%2%

GeneratedHand-writtenMechanisms

Numbers include the administration application and exclude XDoclet generated code

Page 40: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 40Dr Malte Stien

Code generation or not...?

Requirements

modelling

code-generation

hand-translation

hand-implementation

Page 41: Dr Malte Stien Software Engineer content/White Papers/xtUML for... · 2016-06-20 · One J2EE software engineer – 8 months One web developer – 6 months One database administrator

xtUML for Enterprise Applications Slide 41Dr Malte Stien

Thank you– some time for discussion...?

[email protected]