aspect orientation for your language of choice florian heidenreich, jendrik johannes, steffen...

14
Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September, 2007

Upload: bailey-hensley

Post on 26-Mar-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

Aspect Orientation for Your Language of Choice

Florian Heidenreich, Jendrik Johannes, Steffen Zschaler

Workshop on Aspect-Oriented Modelling30 September, 2007

Page 2: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 2 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Outline

1. Motivation2. Invasive Software Composition3. Reuseware – ISC for arbitrary languages4. Aspect Orientation with Reuseware5. Conclusions

Page 3: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 3 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Motivation

What do you look for when developing a domain-specific language?

– Fitness for purposeProvision of appropriate concepts for the domain

- Support for modular development?for components?for reuse?for cross-cutting concerns?

Would be good, BUT difficult and time-consuming!

Page 4: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 4 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Motivation (2)

DSL embedded inHost Language

Standalone DSL

Domain-SpecificConcepts Available

General EngineeringConcepts Available(Modules, Components…)

Here in particular:

Aspect Orientation Support

Here in particular:

Aspect Orientation Support

Page 5: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 5 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

taxComputation: Expression

public class TaxPayer { private double income;

public double deductTax() { return <slot taxComputation: Expression>; }}

public class TaxPayer { private double income;

public double deductTax() { return <slot taxComputation: Expression>; }}

public class TaxPayer { private double income;

public double deductTax() { return income * 0.4; }}

public class TaxPayer { private double income;

public double deductTax() { return income * 0.4; }}

Invasive Software Composition

Generic grey-box composition techniqueBased on manipulation of abstract syntax trees / abstract syntax models

bind

bindincome * 0.7 + 17income * 0.7 + 17

income * 0.4income * 0.4public class TaxPayer { private double income;

public double deductTax() { return income * 0.7 + 17; }}

public class TaxPayer { private double income;

public double deductTax() { return income * 0.7 + 17; }}

Page 6: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 6 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Reuseware – ISC for arbitrary languages

Language

Existing tools

Program

Reuse Language

Reuseware

Define components Describe how to compose them Define special-purpose composition operators

Define components Describe how to compose them Define special-purpose composition operators

Compose with

written in written in

executed / edited / analysed with

Monolithic ProgramNo ReuseLimited Structuring Capabilities

Monolithic ProgramNo ReuseLimited Structuring Capabilities

Reuseware provides…

• Primitives to easily construct composition systems• An engine to execute compositions

…for any language

Reuseware provides…

• Primitives to easily construct composition systems• An engine to execute compositions

…for any language

Page 7: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 7 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

AOM: CDATAStringAOM: CDATAString

WSHome: HTMLDocumentWSHome: HTMLDocument

Aspect Orientation with Reuseware

<html> <head> <title> <slot WSTitle: CDATAString> -- Home </title> </head> <body> <h1> <slot WSTitle: CDATAString> -- Home </h1>

...

</body></html>

<html> <head> <title> <slot WSTitle: CDATAString> -- Home </title> </head> <body> <h1> <slot WSTitle: CDATAString> -- Home </h1>

...

</body></html>

Aspect-Oriented ModellingAspect-Oriented Modelling

WSTitle: CDATAString

bind

Quantificationthrough multiple slots of the same name

Quantificationthrough multiple slots of the same name

Page 8: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 8 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Aspect Orientation with Reuseware (2)

WSHome: HTMLDocumentWSHome: HTMLDocument

<html> <head> <title> <slot WSTitle: CDATAString> -- Home </title> </head> <body> <h1> <slot WSTitle: CDATAString> -- Home </h1>

...

</body></html>

<html> <head> <title> <slot WSTitle: CDATAString> -- Home </title> </head> <body> <h1> <slot WSTitle: CDATAString> -- Home </h1>

...

</body></html>

AOM: CDATAStringAOM: CDATAString

Aspect-Oriented ModellingAspect-Oriented Modelling

WSTitle: CDATAString

bind

Quantificationthrough fragment queries encapsulating multiple fragments

Quantificationthrough fragment queries encapsulating multiple fragments

WSProgramme: HTMLDocumentWSProgramme: HTMLDocument

<html> <head> <title> <slot WSTitle: CDATAString> -- Programme </title> </head> <body> <h1> <slot WSTitle: CDATAString> -- Programme </h1>

...

</body></html>

<html> <head> <title> <slot WSTitle: CDATAString> -- Programme </title> </head> <body> <h1> <slot WSTitle: CDATAString> -- Programme </h1>

...

</body></html>

WSTitle: CDATAString

WSPages: Set(HTMLDocument)WSPages: Set(HTMLDocument)

Page 9: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 9 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Aspect Orientation with Reuseware (3)

Page 10: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 10 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Aspect-Oriented Modelling with Reuseware

<<Anchor>>FileSystem

<<Hook>> +fileSystemPropertyHook

<<Hook>> +fileSystemOperationHook()

<<Anchor>>FSFolder

+name<<Hook>> +fsFolderPropertyHook

<<Hook>> +fsFolderOperationHook()

<<Anchor>>FSFile

+name+content<<Hook>> +fsFilePropertyHook

<<Hook>> +fsFileOperationHook()

<<Hook>>fileSystemPackageHook

<<Hook>>fileSystemPackageHook

fileSystem

1

1

rootFolder

child

*

1

parent

1 folder

* file

Page 11: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 11 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Aspect-Oriented Modelling with Reuseware (2)

observer

*

<<Slot>>Observer

<<Anchor>> +update()

<<Slot>>Subject

<<Anchor>> +attach (observer: Observer)<<Anchor>> +detach (observer: Observer)<<Anchor>> +notify ()

1

subject

observer

1

*

subjects

<<Anchor>> <<Anchor>>

Page 12: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 12 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Aspect-Oriented Modelling with Reuseware (3)

FileSystemCoreFileSystemCoreFS.*

FileSystemAnchor

fileSystemOperationHook

fs.*OperationHook

fileSystemPackageHook

ObserverPattern.umlObserverPattern.uml

subjectClassSlot

observerClassSlot

observerOperationAnchor

subjectOperationAnchor

observerAssociation

subjectAssociation

Page 13: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 13 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

Conclusions & Outlook

DSLs need modularisation techniques, such as AOPDifficult and time consuming to develop

Presented a Reuseware Extension to support aspect orientation for arbitrary languages

- Including modelling languages such as UML- Supported by graphical editor for defining aspect weaving

Page 14: Aspect Orientation for Your Language of Choice Florian Heidenreich, Jendrik Johannes, Steffen Zschaler Workshop on Aspect-Oriented Modelling 30 September,

TU Dresden, 30.09.2007 (c) Steffen Zschaler Folie 14 von 14

Fakultät Informatik, Institut für Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie

The End!

Thank you for your attention!

I will happily answer your questions.