magritte - a meta-driven approach to empower developers and end users

59
Magritte A Meta-Driven Approach to Empower Developers and End Users Lukas Renggli Stéphane Ducasse Adrian Kuhn University of Bern, Switzerland Software Composition Group

Upload: lukas-renggli

Post on 21-Jan-2015

2.361 views

Category:

Economy & Finance


3 download

DESCRIPTION

Model-driven engineering is a powerful approach to build large-scale applications. However, an application's metamodel often remains static after the initial development phase and cannot be changed unless a new development effort occurs. Yet, end users often need to rapidly adapt their applications to new needs. In many cases, end users would know how to make the required adaptations, if only the application would let them do so. In this paper we present how we built a runtime-dynamic meta-environment into Smalltalk's reflective language model. Our solution offers the best of both worlds: developers can develop their applications using the same tools they are used to and gain the power of meta-programming. We show in particular that our approach is suitable to support end user customization without writing new code: the adaptive model of Magritte not only describes existing classes, but also lets end users build their own metamodels on the fly.

TRANSCRIPT

Page 1: Magritte - A Meta-Driven Approach to Empower Developers and End Users

MagritteA Meta-Driven Approach to Empower

Developers and End Users

Lukas Renggli

Stéphane Ducasse

Adrian Kuhn

University of Bern, Switzerland

Software Composition Group

Page 2: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Roadmap

Problem

Demo

Implementation

Evaluation

Questions

Page 3: Magritte - A Meta-Driven Approach to Empower Developers and End Users

What is the problem?

Page 4: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Rapidly changing

requirements

Page 5: Magritte - A Meta-Driven Approach to Empower Developers and End Users

End users would

know their requirements

Page 6: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 7: Magritte - A Meta-Driven Approach to Empower Developers and End Users

What did we see?

Page 8: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Meta-driven

software

Page 9: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Developer defined

meta-model

Page 10: Magritte - A Meta-Driven Approach to Empower Developers and End Users

End user defined

meta-model

Page 11: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Run-time dynamic

meta-model

Page 12: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Domain Model

Metamodel

Meta-

Metamodel

<described-by>

<described-by>

Developer

End User

Page 13: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Domain Model

Metamodel

Meta-

Metamodel

Magritte

Developer

<described-by>

<described-by>

Magritte

End User

Page 14: Magritte - A Meta-Driven Approach to Empower Developers and End Users

How does it work?

Page 15: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

[Yoder et al, 2001] Architecture and design of adaptive object models

Page 16: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

[Yoder et al, 2001] Architecture and design of adaptive object models

Page 17: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) MagritteComponent

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Page 18: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) MagritteComponent

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Page 19: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) MagritteComponent

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Component

TypeComponent

Property

TypeProperty

1 *

1

*

*1

*

1

Type Object

Type Object

(a) Type-Square

Object

Description

Typ

e

Ob

ject

*

*

descrip

tio

n

attributes

1 *

(b) Magritte

Page 20: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Describe Objects

Page 21: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Describe Descriptions

Page 22: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Describe Constraints

Page 23: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Describe Behavior

Page 24: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 25: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Squeak is a modern open-source development environment for

the classic Smalltalk-80 programming language. Despite being the

first purely object-oriented language and environment, Smalltalk

is in many ways still far ahead of its successors in promoting a

vision of an environment where everything is an object, and

anything can change at run-time.

Squeak by Example, intended for both students and developers,

will guide you gently through the Squeak language and

environment by means of a series of examples and exercises.

This book is made available under the Creative Commons

Attribution-ShareAlike 3.0 license. You can either download the

PDF for free, or you can buy a softcover copy from lulu.com.

Additional material is available from the book's web page at

SqueakByExample.org, hosted by the University of Bern,

Switzerland.

Squeak by Example is endorsed by ESUG, the European Smalltalk

User Group. To learn more about Smalltalk and ESUG, see

www.esug.org.

by Example

Square Bracket Associates

with Damien Cassou and Marcus Denker

Version of 2007-09-13

Andrew P. Black, Stéphane Ducasse, Oscar Nierstrasz, Damien Pollet

SqueakSq

ueak b

y Examp

leB

lack!•!D

ucasse

!•!N

ierstrasz!•!P

ollet

3341027839529

ISBN 978-3-9523341-0-2

Smalltalkwww.squeak.org

ww

w.s

que

akb

yexa

mp

le.o

rg

Page 26: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Reflection

Page 27: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Integration with Tools

Page 28: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Class Extension

Page 29: Magritte - A Meta-Driven Approach to Empower Developers and End Users

What can we do with it?

Page 30: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Automatic Views

Page 31: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 32: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Automatic Editors

Page 33: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 34: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 35: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Automatic Validation

Page 36: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Move Page

Page 37: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Automatic Reports

Page 38: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 39: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Automatic Querying

Page 40: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Automatic Persistency

Page 41: Magritte - A Meta-Driven Approach to Empower Developers and End Users

What did we gain?

Page 42: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Reduce recurrent workGet rid of

Page 43: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Describe once,

get everywhere

Page 44: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Extensible

Object Model

Page 45: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Adaptive object modelRun-time

Page 46: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Code Generation

Page 47: Magritte - A Meta-Driven Approach to Empower Developers and End Users

End users

customizability

Page 48: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 49: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Industrial Users

Page 50: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 51: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 52: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 53: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 54: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 55: Magritte - A Meta-Driven Approach to Empower Developers and End Users

AareWorkflow definition

and runtime system

Page 56: Magritte - A Meta-Driven Approach to Empower Developers and End Users

Magritte

[Ren

é M

agrit

te, 1

966]

Dec

alco

man

ia

www.lukas-renggli.ch

Page 57: Magritte - A Meta-Driven Approach to Empower Developers and End Users
Page 58: Magritte - A Meta-Driven Approach to Empower Developers and End Users

LOC Comparison

SmallWiki

Model

1561 LOC

44%

View

1983 LOC

56%

Pier

Model

3078 LOC

63%

View

1812 LOC

37%

Meta-describedTraditional

Page 59: Magritte - A Meta-Driven Approach to Empower Developers and End Users

0

2,250

4,500

6,750

9,000

Traditional Meta-Described

8,190

2,456

Speed Comparison