Top Banner
INT NTION L S O F T W A R E E A Magnus Christerson Intentional Software Corporation Henk Kolk CTO Financial Services, Capgemini Domain Expert DSLs
45
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Magnus Christerson Henk Kolk Domain Expert DSLs

INT NTION LS O F T W A R E

E A™

Magnus ChristersonIntentional Software Corporation

Henk Kolk CTO Financial Services, Capgemini

Domain Expert DSLs

Page 2: Magnus Christerson Henk Kolk Domain Expert DSLs

The Challenge

Innovation

Business to accelerate

Business Domain Expert

Colla

bora

tion

© 2008 Intentional Software Corporation

Innovation

Software main tool

ProgrammerColla

bora

tion

Page 3: Magnus Christerson Henk Kolk Domain Expert DSLs

The Key Players

© 2008 Intentional Software Corporation

Domain Expert Programmer

Page 4: Magnus Christerson Henk Kolk Domain Expert DSLs

A brief history of software

• A struggle to distinguish and treat separately

problem and program

1954:

© 2008 Intentional Software Corporation

Page 5: Magnus Christerson Henk Kolk Domain Expert DSLs

Software progress?public CodeTable(){

rgcod = new ArrayList();}

public ArrayList rgcod;

public void Pass4(XCOD xcod, int i, NTE nte){

Console.WriteLine("P4: " + xcod.ToString());this.rgcod.Add(new MICOP(xcod, i, nte));

}

public MICOP MicopLast(){

return (MICOP)this.rgcod[this.rgcod.Count - 1];

19632008

© 2008 Intentional Software Corporation

return (MICOP)this.rgcod[this.rgcod.Count - 1];}

public void DeleteLastMicop(){

this.rgcod.RemoveAt(this.rgcod.Count - 1);}

public void Px(){

Console.WriteLine("Produced code");int i = 0;foreach (MICOP micop in this.rgcod){

Console.WriteLine("{0,4}\t{1,-14}\t{2}\t{3}",i++, micop.xcod.ToString(),micop.i,micop.nte == null ? " " : micop.nte.ToString());

}

}

Page 6: Magnus Christerson Henk Kolk Domain Expert DSLs

A brief history continued

• When we fail to treat separately the problem and the program

– The problem and the program get mixed up creating the complexity we hear aboutthe complexity we hear about

– Complexity becomes (problem x program), not (problem + program)

– We get stuck with improving the resulting complex mess

© 2008 Intentional Software Corporation

Page 7: Magnus Christerson Henk Kolk Domain Expert DSLs

Complexity of scrambled eggs

• Scrambled

• Before preparation

• Neatly arranged on plate – after CASE slide?

© 2007 Intentional Software Corporation

slide?

Page 8: Magnus Christerson Henk Kolk Domain Expert DSLs

Input + Process

• Scrambled

• Before preparation

• Neatly arranged on plate – after CASE slide?

© 2007 Intentional Software Corporation

slide?

Page 9: Magnus Christerson Henk Kolk Domain Expert DSLs

After refactoring ;-)

© 2007 Intentional Software Corporation

Page 10: Magnus Christerson Henk Kolk Domain Expert DSLs

Software Development Today

public CodeTable(){

rgcod = new ArrayList();}

public ArrayList rgcod;

public void Pass4(XCOD xcod, int i, NTE nte){

Console.WriteLine("P4: " + xcod.ToString());

this.rgcod.Add(new MICOP(xcod, i, nte));}

public MICOP MicopLast(){

return (MICOP)this.rgcod[this.rgcod.Count

Domain Knowledge

© 2008 Intentional Software Corporation

Domain Expert Programmer

(MICOP)this.rgcod[this.rgcod.Count- 1];}

public void DeleteLastMicop(){

this.rgcod.RemoveAt(this.rgcod.Count - 1);}

public void Px(){

Console.WriteLine("Produced code");

int i = 0;foreach (MICOP micop in

this.rgcod){

Console.WriteLine("{0,4}\t{1,-14}\t{2}\t{3}",

i++,

micop.xcod.ToString(),

micop.i,micop.nte ==

null ? " " : micop.nte.ToString());}

}

Edits

Ed

its

Explains

Page 11: Magnus Christerson Henk Kolk Domain Expert DSLs

Intentional: Input + Process

public CodeTable(){

rgcod = new ArrayList();}

public ArrayList rgcod;

public void Pass4(XCOD xcod, int i, NTE nte){

Console.WriteLine("P4: " + xcod.ToString());

this.rgcod.Add(new MICOP(xcod, i, nte));}

public MICOP MicopLast(){

return (MICOP)this.rgcod[this.rgcod.Count

Domain Code Generator

input output

© 2008 Intentional Software Corporation

Domain Expert Programmer

(MICOP)this.rgcod[this.rgcod.Count- 1];}

public void DeleteLastMicop(){

this.rgcod.RemoveAt(this.rgcod.Count - 1);}

public void Px(){

Console.WriteLine("Produced code");

int i = 0;foreach (MICOP micop in

this.rgcod){

Console.WriteLine("{0,4}\t{1,-14}\t{2}\t{3}",

i++,

micop.xcod.ToString(),

micop.i,micop.nte ==

null ? " " : micop.nte.ToString());}

}

Cre

ate

s

Ed

its

Page 12: Magnus Christerson Henk Kolk Domain Expert DSLs

Analogy: Blog Software

© 2008 Intentional Software Corporation

As viewed

As generated(output)

As edited(input)

Page 13: Magnus Christerson Henk Kolk Domain Expert DSLs

More ”Input + Process” Analogies

• DNA

– Growing an organ, e.g. Optic nerve

– Brevity of DNA makes evolution possible

• Kolmogorov complexity

© 2008 Intentional Software Corporation

Page 14: Magnus Christerson Henk Kolk Domain Expert DSLs

Separating and Weaving Domains

BusinessDomain

OrientationPowerPoint

ExcelWord

Business Experts

Domain Workbench

© 2008 Intentional Software Corporation

Computing Power

RubyJava/C#

C/C++

Programmers

Business Experts

Non-executable Executable

Page 15: Magnus Christerson Henk Kolk Domain Expert DSLs

Key Benefits

• Domain Expert participation feasible – domain knowledge isolated from technology

• Separation of concerns – complexity is • Separation of concerns – complexity is reduced

• Programmers create a more valuable artifact: Generator –weaves domain input with Software Engineering knowledge

© 2008 Intentional Software Corporation

Page 16: Magnus Christerson Henk Kolk Domain Expert DSLs

Domain Orientation Trends:

• Domain Specific Languages (DSL)

• Code Generation/Generative Programming (GP)

• Domain Specific Modeling (DSM)

• Domain Driven Design (DDD)• Domain Driven Design (DDD)

• Model Driven Development (MDD)

• Meta Programming

• ...

© 2008 Intentional Software Corporation

Page 17: Magnus Christerson Henk Kolk Domain Expert DSLs

What prevents DSL mainstream use?

• Integrate Domain Experts fully– Matching existing notations

– Mixing graphical/textual notations

• Multi-domain– Compose independent domains– Compose independent domains

– References between domains

• Domain evolution, domains must be able to evolve without limitations (structure and notation)

• Groupware for domain experts

© 2008 Intentional Software Corporation

Page 18: Magnus Christerson Henk Kolk Domain Expert DSLs

Programming Languages as Base?

• Programming languages as the model leaves

major issues:

– Text-only not satisfactory

– Parsing requirement constrains language design– Parsing requirement constrains language design

– Multi-domain is unaddressed

– Domain evolution is unaddressed

– Current groupware (CM) not feasible for domain

experts

© 2008 Intentional Software Corporation

Page 19: Magnus Christerson Henk Kolk Domain Expert DSLs

Intentional Domain Workbench

• Bring domain orientation to a new level by

changing software creation to truly integrate changing software creation to truly integrate

Domain Experts

© 2008 Intentional Software Corporation

Page 20: Magnus Christerson Henk Kolk Domain Expert DSLs

Def Domain Workbench (Martin Fowler)

1. Users can freely define new domains, including languages, that

are fully integrated with each other.

2. The primary source of information is a persistent abstract

representation.

3. Domain designers define domains in three main parts: schemas, 3. Domain designers define domains in three main parts: schemas,

editors, and generators.

4. Domain users manipulate a domain through a projectional editor.

5. A domain workbench can work with incomplete and

contradictory information.

CONFIDENTIAL © 2007 Intentional Software Corporation

Page 21: Magnus Christerson Henk Kolk Domain Expert DSLs

Inside the Domain Workbench

Projector Generator

public CodeTable(){

rgcod = new ArrayList();}

public ArrayList rgcod;

public void Pass4(XCOD xcod, int i, NTE nte){

Console.WriteLine("P4: " + xcod.ToString());this.rgcod.Add(new MICOP(xcod, i, nte));

}

public MICOP MicopLast(){

return (MICOP)this.rgcod[this.rgcod.Count - 1];}

© 2008 Intentional Software Corporation

Intentional Tree

(Schema)

Projector

Projectional editor

Generatorpublic void DeleteLastMicop(){

this.rgcod.RemoveAt(this.rgcod.Count - 1);}

public void Px(){

Console.WriteLine("Produced code");int i = 0;foreach (MICOP micop in this.rgcod){

Console.WriteLine("{0,4}\t{1,-14}\t{2}\t{3}",i++,

micop.xcod.ToString(),

micop.i,micop.nte ==

null ? " " : micop.nte.ToString());}

}

Page 22: Magnus Christerson Henk Kolk Domain Expert DSLs

Intentional Tree

• Extendible, uniform representation

• Strong identities throughout

• No fixed meta-levels

• Versioned • Versioned

storage

• Separated

concerns

© 2008 Intentional Software Corporation

Return

Assign

a Div

b Plus

c 1

Def Assign...

Def Div...

Domain Code Domain Schema

Page 23: Magnus Christerson Henk Kolk Domain Expert DSLs

Projectional editing

• Separates underlying representation from notation (syntax)

• Works in two directions: output and editing

• Special selections that take tree structure into account

• Large number of notations for:• Large number of notations for:

– matching existing notations

– multi-domain

– ambiguity resolving

– domain evolution

• Can also edit Programs, Schema, Generators

Page 24: Magnus Christerson Henk Kolk Domain Expert DSLs

Some Notational Examples

or

or

or

© 2008 Intentional Software Corporation

or

Page 25: Magnus Christerson Henk Kolk Domain Expert DSLs

Integrate Domain Experts

• Projectional editor supplies appropriate notation

• Projectional editor decouples domain code from notation – Multi-view, embedding, extension…

• Matching existing notations

• Mixing notation graphics / text

– Multi-view, embedding, extension…

• Graphics / text are treated uniformly

• Notation can change on domain or other selected boundaries

© 2008 Intentional Software Corporation

Page 26: Magnus Christerson Henk Kolk Domain Expert DSLs

Multi domain

• Tree structure accommodates composition

• Compose independent domains

• References between domains

• Tree structure accommodates composition

• Inter-domain references connecting domains

© 2008 Intentional Software Corporation

Page 27: Magnus Christerson Henk Kolk Domain Expert DSLs

Domain evolution

• Tree storage is independent of schema – will not “break” if schema changes

• Notation can keep up with evolution• Notation can keep up with evolution

• Further parameterization is always possible

• Independent concerns can be added without interfering with others

© 2008 Intentional Software Corporation

Page 28: Magnus Christerson Henk Kolk Domain Expert DSLs

Groupware

• Tree storage requires rethinking groupware

– Change logs for fully general solution

– Edit “conflicts” are a “mini domain” – integrated

with notationswith notations

– Versioning and audit trails

• Familiar metaphors: versions, branches, open,

update, commit, merge

© 2008 Intentional Software Corporation

Page 29: Magnus Christerson Henk Kolk Domain Expert DSLs

Intentional Domain Workbench Status

• Technology is fully capable of handling the

Domain Workbench requirements.

• Nearing operational use in selected domains• Nearing operational use in selected domains

• Working with selected customers only, for

example with Capgemini.

© 2008 Intentional Software Corporation

Page 30: Magnus Christerson Henk Kolk Domain Expert DSLs

Henk Kolk

CTO Financial Services Capgemini

Page 31: Magnus Christerson Henk Kolk Domain Expert DSLs

Problems for Pension Companies

• Need for pension product innovation

• Governmental interest – New Pension Laws

• Mergers

• Transparency • Transparency

• Problems

• Time to market

• Abstract product models

• Ensuring quality

© 2008 Intentional Software Corporation

Page 32: Magnus Christerson Henk Kolk Domain Expert DSLs

Old way: disconnected domains

Pension PlanAnalysis

Functionaldesign

Current issues:• Expensive handovers•Traceability

Technicaldesign

Program

ValidationHandover

Execute© 2008 Intentional Software Corporation

Page 33: Magnus Christerson Henk Kolk Domain Expert DSLs

New way: connected domains

Pension PlanAnalysis

Functionaldesign

No apparent handoverTraceability comes for free

Technicaldesign

Program

Validation &Handover

Execute© 2008 Intentional Software Corporation

Page 34: Magnus Christerson Henk Kolk Domain Expert DSLs

Old way: Excel & Word

Page 35: Magnus Christerson Henk Kolk Domain Expert DSLs

New way: Pension Workbench

• Matching existing notations

– Pension experts record pension world in their

notations

Old spreadsheet Pension WorkbenchOld spreadsheet Pension Workbench

Page 36: Magnus Christerson Henk Kolk Domain Expert DSLs

Multiple Views with Graphics

Pension Plan versions Rule dependencies

© 2008 Intentional Software Corporation

Page 37: Magnus Christerson Henk Kolk Domain Expert DSLs

Compose Business Domain

• Domain Schema

• Projectional Editors

© 2008 Intentional Software Corporation

Page 38: Magnus Christerson Henk Kolk Domain Expert DSLs

Integrate Rule Test Domain

• Unit Tests for pension rules

• Real time evaluation

© 2008 Intentional Software Corporation

Page 39: Magnus Christerson Henk Kolk Domain Expert DSLs

Integrate System Test Domain

• Test cascading rules and their interrelations

• Real time evaluation

© 2008 Intentional Software Corporation

Page 40: Magnus Christerson Henk Kolk Domain Expert DSLs

Build Code Generators

• Multiple implementation target languages

© 2008 Intentional Software Corporation

Page 41: Magnus Christerson Henk Kolk Domain Expert DSLs

Domain Language Evolution

Capgemini

Unified Pension LanguageCapgemini

Capgemini Pension Language

Capgemini Pension expert discussion

Jan March May July Oct

Capgemini Capgemini Pension expert discussion

Client 1 Client Pension Language 1

Client 2 Client Pension Language 2

Client 1

Client 1: “Please raise abstraction level of my language”

© 2008 Intentional Software Corporation

Page 42: Magnus Christerson Henk Kolk Domain Expert DSLs

Testing – Lack of “groupware”

Input

TD

Pseudo codeMS Access

Version Control

Manual HandoverMA Automated support

M

• Rules domain • Rules• Test cases (VBA)• XML Export domain• Multiple users

M

Output

Excel

• Issues

• Version control

• Consistency of 800+ separate files

• Debugging VBA code

Changes

RulesEntry

(pseudo code)

Test casesProgramming

(VBA)

Test resultsCalculation

Rules Issue Mgmt

Test CaseDebugging

(VBA)

M

M A

M

M

M

FD’sText

MS WordXMLExport

AOutput

© 2008 Intentional Software Corporation

Page 43: Magnus Christerson Henk Kolk Domain Expert DSLs

New Groupware

GroupwareVersion control

AA

Pension WorkbenchTD

Pseudo codeMS Access

Manual HandoverMA Automated supportInput

Output

Rules Issue Mgmt

Changes

RulesEntry

(pseudo code)

Test casesEntry

(automated)

Test resultsCalculation

XMLExport

M

A AM

M

FD’sText

MS Word

AOutput

© 2008 Intentional Software Corporation

Page 44: Magnus Christerson Henk Kolk Domain Expert DSLs

Integrating Pension Experts

Herman Gerbscheid, Pension Architect:

• “This is the stuff I had to do mentally and keep consistent in my head all the time. It’s great to finally have tools for it.”

Suzanne Pront, Pension Expert:

• “Normally I know what I want, but don’t know how to • “Normally I know what I want, but don’t know how to tell engineers. Now I can do this myself. This is a revolution!”

Sybren den Hartog, Java Architect:

• “Now we can generate business rules and domain structure, which we could not do in UML based MDA.”

© 2008 Intentional Software Corporation

Page 45: Magnus Christerson Henk Kolk Domain Expert DSLs

Summary

• Intentional Software is helping us to accelerate Pension Product innovation for our clients

• We were able to demonstrate a radical change in time to market and quality

• We used Pensions as a pilot, but we see many opportunities in other domains

© 2008 Intentional Software Corporation