context traits dynamic behaviour adaptation through run-time trait recomposition

103
Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition Sebastián González Kim Mens Marius Colacioiu Walter Cazzola 29 March 2013 Modularity AOSD 2013 UCLouvain . U. Milan Context Traits

Upload: kimmens

Post on 28-Nov-2014

410 views

Category:

Technology


2 download

DESCRIPTION

Presentation by Sebastián González of the paper "Context Traits: Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition" at the Modularity • AOSD 2013 conference.

TRANSCRIPT

Page 1: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Dynamic Behaviour AdaptationThrough Run-Time Trait Recomposition

Sebastián GonzálezKim Mens

Marius ColacioiuWalter Cazzola

29 March 2013

Modularity AOSD 2013

UCLouvain . U. Milan

Context Traits

Page 2: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Towards a Mindset Shift 2

programming in isolation programming with context

forward!

??

??

?

?

Page 3: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Towards a Mindset Shift 2

CautionDesign patterns

Plugin architecturesConditional statements

...

programming in isolation programming with context

forward!

??

??

?

?

Page 4: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

m(a) {

if ( ) { IE logic }! else if ( ) { Opera logic }

else if ( ) { Chrome logic }

else if ( ) { Safari logic }

else if ( ) { Firefox logic }

else { default logic }

}

Conditional Statements 3

Some variant of ...

Page 5: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

m(a) {

if ( ) { IE logic }! else if ( ) { Opera logic }

else if ( ) { Chrome logic }

else if ( ) { Safari logic }

else if ( ) { Firefox logic }

else { default logic }

}

Conditional Statements 3

Some variant of ...

Adaptable

Page 6: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

m(a) {

if ( ) { IE logic }! else if ( ) { Opera logic }

else if ( ) { Chrome logic }

else if ( ) { Safari logic }

else if ( ) { Firefox logic }

else { default logic }

}

Conditional Statements 3

Some variant of ...

Adaptable

TangledScatteredFixedNo reuseComplex logic

Page 7: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Design Patterns 4

m(a) { Firefox strategy }

m(a) { default strategy }

m(a) { strategy.m(a)}

m(a) { IE strategy }

m(a) { Opera strategy }

m(a) { Chrome strategy }

m(a) { Safari strategy }

Page 8: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Design Patterns 4

m(a) { Firefox strategy }

m(a) { default strategy }

m(a) { strategy.m(a)}

m(a) { IE strategy }

m(a) { Opera strategy }

m(a) { Chrome strategy }

m(a) { Safari strategy }

strategy

Page 9: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Design Patterns 4

m(a) { Firefox strategy }

m(a) { default strategy }

m(a) { strategy.m(a)}

m(a) { IE strategy }

m(a) { Opera strategy }

m(a) { Chrome strategy }

m(a) { Safari strategy }

strategy

Page 10: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Design Patterns 4

m(a) { Firefox strategy }

m(a) { default strategy }

m(a) { strategy.m(a)}

m(a) { IE strategy }

m(a) { Opera strategy }

m(a) { Chrome strategy }

m(a) { Safari strategy }

strategy

Page 11: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Design Patterns 4

m(a) { Firefox strategy }

m(a) { default strategy }

m(a) { strategy.m(a)}

m(a) { IE strategy }

m(a) { Opera strategy }

m(a) { Chrome strategy }

m(a) { Safari strategy }

strategy

ModularOpen

Page 12: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Design Patterns 4

m(a) { Firefox strategy }

m(a) { default strategy }

m(a) { strategy.m(a)}

m(a) { IE strategy }

m(a) { Opera strategy }

m(a) { Chrome strategy }

m(a) { Safari strategy }

strategy

Infrastructural burdenAnticipated adaptation points

ModularOpen

Page 13: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Layer-Based COP 5

Later on...

Page 14: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

In The Paper‣ Contexts‣ Traits‣ Context-Driven Trait Compositions‣ Composition Policies‣ Behaviour Extensibility‣ Context Traits in JavaScript‣ Implementation Notes‣ Case Studies‣ Related Work‣ Future Work

6

Page 15: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

‣ Contexts‣ Traits‣ Context-Driven Trait Compositions‣ Composition Policies‣ Behaviour Extensibility‣ Context Traits in JavaScript

In This Presentation 7

Page 16: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Contexts as Situation Reifiers 8

computationally accessible data

Battery charge = 220 mAh

Idle cycles = 100 MHz

User agent = “Mozilla/5.0...”

Z axis = 0.03

Page 17: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Contexts as Situation Reifiers 8

computationally accessible data

no semantics

Battery charge = 220 mAh

Idle cycles = 100 MHz

User agent = “Mozilla/5.0...”

Z axis = 0.03

Page 18: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Contexts as Situation Reifiers 8

computationally accessible data

no semantics

Battery charge = 220 mAh

Idle cycles = 100 MHz

User agent = “Mozilla/5.0...”

Z axis = 0.03

action can be taken

well-defined situations

Context Discovery

Low battery charge

High CPU load

Firefox

Landscape orientation

Page 19: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Contexts as Situation Reifiers 8

computationally accessible data

no semantics

Battery charge = 220 mAh

Idle cycles = 100 MHz

User agent = “Mozilla/5.0...”

Z axis = 0.03

action can be taken

well-defined situations

Context Discovery

contexts are reified situationsfor which adapted application behaviour can be defined

Low battery charge

High CPU load

Firefox

Landscape orientation

Page 20: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Contexts as Situation Reifiers 8

computationally accessible data

no semantics

Battery charge = 220 mAh

Idle cycles = 100 MHz

User agent = “Mozilla/5.0...”

Z axis = 0.03

action can be taken

well-defined situations

Context Discovery

contexts are reified situationsfor which adapted application behaviour can be defined

Low battery charge

High CPU load

Firefox

Landscape orientation

LowBattery = new Context();

window.addEventListener(‘batterystatus’,function (data) {

if (data.level < 30)LowBattery.activate();

elseLowBattery.deactivate(); });

... in JavaScript

Page 21: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

Traits as Basic Behavioural Units 9

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

Page 22: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

Traits as Basic Behavioural Units 9

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

providedmethods

Page 23: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

Traits as Basic Behavioural Units 9

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

requiredmethods

Page 24: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

Traits as Basic Behavioural Units 9

+

+

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

sumoperator

Page 25: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

XML.ElementXML.ElementtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttributecontentparentappendChildreplaceChildremoveChildwalkChildrenidelementsByTagNameelementsByAttribute

Traits as Basic Behavioural Units 9

+

+

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

=

Page 26: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

XML.ElementXML.ElementtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttributecontentparentappendChildreplaceChildremoveChildwalkChildrenidelementsByTagNameelementsByAttribute

Traits as Basic Behavioural Units 9

+

+

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

=

Page 27: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

XML.ElementXML.ElementtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttributecontentparentappendChildreplaceChildremoveChildwalkChildrenidelementsByTagNameelementsByAttribute

Traits as Basic Behavioural Units 9

+

+

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

T[“Element”] =Trait({

elementsByTagName: function(name) { ... },elementsByAttribute: function(attr) { ... },getAttribute: Trait.required,setAttribute: Trait.required,walkChildren: Trait.required });

... in JavaScript

=

Page 28: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

XML.ElementXML.ElementtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttributecontentparentappendChildreplaceChildremoveChildwalkChildrenidelementsByTagNameelementsByAttribute

Traits as Basic Behavioural Units 9

+

+

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

T[“Element”] =Trait({

elementsByTagName: function(name) { ... },elementsByAttribute: function(attr) { ... },getAttribute: Trait.required,setAttribute: Trait.required,walkChildren: Trait.required });

... in JavaScript

=

traits.js [ Van Cutsem & Miller 2011 ]

Page 29: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

XML.ElementXML.ElementtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttributecontentparentappendChildreplaceChildremoveChildwalkChildrenidelementsByTagNameelementsByAttribute

Traits as Basic Behavioural Units 9

+

+

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

T[“Element”] =Trait({

elementsByTagName: function(name) { ... },elementsByAttribute: function(attr) { ... },getAttribute: Trait.required,setAttribute: Trait.required,walkChildren: Trait.required });

... in JavaScript

=

Page 30: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.TagT.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodeT.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

XML.ElementXML.ElementtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttributecontentparentappendChildreplaceChildremoveChildwalkChildrenidelementsByTagNameelementsByAttribute

Traits as Basic Behavioural Units 9

+

+

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

T[“Element”] =Trait({

elementsByTagName: function(name) { ... },elementsByAttribute: function(attr) { ... },getAttribute: Trait.required,setAttribute: Trait.required,walkChildren: Trait.required });

... in JavaScript

=

Page 31: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Traits as Basic Behavioural Units 9

+

+

tag a1=”v1” a2=”v2”

T.ElementT.ElementelementsByTagNameelementsByAttribute

getAttributesetAttributewalkChildren

T[“Element”] =Trait({

elementsByTagName: function(name) { ... },elementsByAttribute: function(attr) { ... },getAttribute: Trait.required,setAttribute: Trait.required,walkChildren: Trait.required });

... in JavaScript

=

T.TagtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttribute

T.NodecontentparentappendChildreplaceChildremoveChildwalkChildren

XML.ElementtagNameaddAttributegetAttributesetAttributeremoveAttributeforEachAttributecontentparentappendChildreplaceChildremoveChildwalkChildrenidelementsByTagNameelementsByAttribute

Page 32: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Default Behaviour & Context 10

HTML.ElementaddAttributegetAttribute...styletitle

T.HTML.ElementT.HTML.Elementclassstyletitle

getAttributesetAttribute

= XML.Element +

Page 33: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

= HTML.Element +

HTML.AnchoraddAttribute...hreftypetarget

T.HTML.AnchorT.HTML.Anchorhreftypetarget

getAttributesetAttribute

Default Behaviour & Context 10

HTML.ElementaddAttributegetAttribute...styletitle

T.HTML.ElementT.HTML.Elementclassstyletitle

getAttributesetAttribute

= XML.Element +

Page 34: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

= HTML.Element +

HTML.AnchoraddAttribute...hreftypetarget

T.HTML.AnchorT.HTML.Anchorhreftypetarget

getAttributesetAttribute

Default Behaviour & Context 10

HTML.ElementaddAttributegetAttribute...styletitle

T.HTML.ElementT.HTML.Elementclassstyletitle

getAttributesetAttribute

= XML.Element +

HTML[“Element”] =Trait.compose(XML.Element, T.HTML.Element);

HTML[“Anchor”] =Trait.compose(HTML.Element, T.HTML.Anchor);

... in JavaScript

Page 35: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

= HTML.Element +

HTML.AnchoraddAttribute...hreftypetarget

T.HTML.AnchorT.HTML.Anchorhreftypetarget

getAttributesetAttribute

Default Behaviour & Context 10

Default

... for prototypical situations

Prototypical behaviour ...

HTML.ElementaddAttributegetAttribute...styletitle

T.HTML.ElementT.HTML.Elementclassstyletitle

getAttributesetAttribute

= XML.Element +

( unperturbed system )

HTML[“Element”] =Trait.compose(XML.Element, T.HTML.Element);

HTML[“Anchor”] =Trait.compose(HTML.Element, T.HTML.Anchor);

... in JavaScript

Page 36: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Context + Traits 11

... in JavaScriptContext Traits

let Default ∈ C Default = new Context();

Page 37: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Context + Traits 11

... in JavaScriptContext Traits

let Default ∈ C Default = new Context();

a = new HTML.Anchor();let ida ∈ L

Page 38: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Context + Traits 11

... in JavaScriptContext Traits

let Default ∈ C Default = new Context();

a = new HTML.Anchor();let ida ∈ L

constitution: L ⨉ C → T

Page 39: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

W3Clet W3C ∈ C W3C = new Context();

Context + Traits 11

... in JavaScriptContext Traits

let Default ∈ C Default = new Context();

a = new HTML.Anchor();let ida ∈ L

constitution: L ⨉ C → T

Page 40: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

W3Clet W3C ∈ C W3C = new Context();

Context + Traits 11

... in JavaScriptContext Traits

let Default ∈ C Default = new Context();

a = new HTML.Anchor();let ida ∈ L

constitution: L ⨉ C → T

Page 41: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

W3Clet W3C ∈ C W3C = new Context();

Context + Traits 11

... in JavaScriptContext Traits

let Default ∈ C Default = new Context();

a = new HTML.Anchor();let ida ∈ L

constitution: L ⨉ C → T

Page 42: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

W3Clet W3C ∈ C W3C = new Context();

Context + Traits 11

... in JavaScriptContext Traits

let Default ∈ C Default = new Context();

a = new HTML.Anchor();let ida ∈ L

constitution: L ⨉ C → T

constitution( ida, W3C ) = W3C.adapt(a, T.ValidAnchor);

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

Page 43: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

W3Clet W3C ∈ C W3C = new Context();

Context + Traits 11

... in JavaScriptContext Traits

Untrusted

let Default ∈ C Default = new Context();

a = new HTML.Anchor();let ida ∈ L

constitution: L ⨉ C → T

constitution( ida, W3C ) = W3C.adapt(a, T.ValidAnchor);

let Untrusted ∈ C Untrusted = new Context();

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

Page 44: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

W3C

constitution ( ida, Untrusted ) = Untrusted.adapt

(a, T.SecureAnchor);

let W3C ∈ C W3C = new Context();

Context + Traits 11

... in JavaScriptContext Traits

T.SecureAnchorT.SecureAnchorhrefparentvisible

manager...

Untrusted

let Default ∈ C Default = new Context();

a = new HTML.Anchor();let ida ∈ L

constitution: L ⨉ C → T

constitution( ida, W3C ) = W3C.adapt(a, T.ValidAnchor);

let Untrusted ∈ C Untrusted = new Context();

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

Page 45: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Run-Time Trait Recomposition 12

overloading of constitution: L ⨉ C → Tconstitution: L ⨉ 2C → 2T

constitution ( ida, { Default, Untrusted, W3C } )

= { HTML.Anchor, T.SecureAnchor, T.ValidAnchor }

Page 46: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Run-Time Trait Recomposition 12

overloading of constitution: L ⨉ C → Tconstitution: L ⨉ 2C → 2T

defined through composition policiescomposition: 2T → O

constitution ( ida, { Default, Untrusted, W3C } )

= { HTML.Anchor, T.SecureAnchor, T.ValidAnchor }

Page 47: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

o addAttribute setAttribute removeAttribute href parent visible type target

HTML.Anchor addAttribute setAttribute removeAttribute href parent visible type target

T.ValidAnchorT.ValidAnchor addAttribute setAttribute removeAttribute

parent

...

T.SecureAnchorT.SecureAnchor

href parent visible

manager...

Run-Time Trait Recomposition 12

overloading of constitution: L ⨉ C → Tconstitution: L ⨉ 2C → 2T

defined through composition policiescomposition: 2T → O

constitution ( ida, { Default, Untrusted, W3C } )

= { HTML.Anchor, T.SecureAnchor, T.ValidAnchor }

composition ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

▹ ▹

overriding operator

Page 48: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

o addAttribute setAttribute removeAttribute href parent visible type target

HTML.Anchor addAttribute setAttribute removeAttribute href parent visible type target

T.ValidAnchorT.ValidAnchor addAttribute setAttribute removeAttribute

parent

...

T.SecureAnchorT.SecureAnchor

href parent visible

manager...

Run-Time Trait Recomposition 12

overloading of constitution: L ⨉ C → Tconstitution: L ⨉ 2C → 2T

defined through composition policiescomposition: 2T → O

constitution ( ida, { Default, Untrusted, W3C } )

= { HTML.Anchor, T.SecureAnchor, T.ValidAnchor }

composition ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

▹ ▹ addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

Page 49: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

o addAttribute setAttribute removeAttribute href parent visible type target

Run-Time Trait Recomposition 12

overloading of constitution: L ⨉ C → Tconstitution: L ⨉ 2C → 2T

defined through composition policiescomposition: 2T → O

constitution ( ida, { Default, Untrusted, W3C } )

= { HTML.Anchor, T.SecureAnchor, T.ValidAnchor }

composition ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

Page 50: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

o addAttribute setAttribute removeAttribute href parent visible type target

Run-Time Trait Recomposition 12

overloading of constitution: L ⨉ C → Tconstitution: L ⨉ 2C → 2T

defined through composition policiescomposition: 2T → O

constitution ( ida, { Default, Untrusted, W3C } )

= { HTML.Anchor, T.SecureAnchor, T.ValidAnchor }

composition ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

object = composition · constitution

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

Page 51: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

o addAttribute setAttribute removeAttribute href parent visible type target

Run-Time Trait Recomposition 12

overloading of constitution: L ⨉ C → Tconstitution: L ⨉ 2C → 2T

defined through composition policiescomposition: 2T → O

constitution ( ida, { Default, Untrusted, W3C } )

= { HTML.Anchor, T.SecureAnchor, T.ValidAnchor }

composition ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

puts object composition in direct relationship to the context of executionobject: L ⨉ 2C → O

object = composition · constitution

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

Page 52: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

o addAttribute setAttribute removeAttribute href parent visible type target

Run-Time Trait Recomposition 12

overloading of constitution: L ⨉ C → Tconstitution: L ⨉ 2C → 2T

defined through composition policiescomposition: 2T → O

constitution ( ida, { Default, Untrusted, W3C } )

= { HTML.Anchor, T.SecureAnchor, T.ValidAnchor }

composition ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

o = TC1 · TC2 · ... · TCn

puts object composition in direct relationship to the context of executionobject: L ⨉ 2C → O

object = composition · constitution

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

Page 53: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

TD

Context-Driven Trait Composition

T1

T2

T3

T4T5

13

Page 54: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

TD

Context-Driven Trait Composition

T1

T2

T3

T4T5

13

Page 55: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

TD

Context-Driven Trait Composition

T1

T2

T3

T4

T5

13

Page 56: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

TD

Context-Driven Trait Composition

T1

T2

T3

T4

T5

13

Page 57: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

TD

Context-Driven Trait Composition

T1T2

T3

T4

T5

13

Page 58: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

=

Composition Policies 14

HTML.Anchor T.SecureAnchor T.ValidAnchor▹ ▹

Page 59: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

=

Composition Policies 14

HTML.Anchor T.SecureAnchor T.ValidAnchor▹ ▹

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent parent

addAttribute setAttribute removeAttribute

What if we want to bypass security of

visible?

Page 60: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

=

Composition Policies 14

HTML.Anchor T.SecureAnchor T.ValidAnchor▹ ▹

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent parent

addAttribute setAttribute removeAttribute

What if we want to bypass security of

visible?✗ Impossible with strict overriding semantics

(e.g. inheritance, mixins, COP layers)

Page 61: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

=

Composition Policies 14

HTML.Anchor T.SecureAnchor T.ValidAnchor▹ ▹

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent parent

addAttribute setAttribute removeAttribute

What if we want to bypass security of

visible?✗ Impossible with strict overriding semantics

(e.g. inheritance, mixins, COP layers)

Povr ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ }

Page 62: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Pbysec ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ HTML.Anchor, T.SecureAnchor – visible, T.ValidAnchor }

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

=

Composition Policies 14

HTML.Anchor T.SecureAnchor T.ValidAnchor▹ ▹

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent parent

addAttribute setAttribute removeAttribute

What if we want to bypass security of

visible?✗ Impossible with strict overriding semantics

(e.g. inheritance, mixins, COP layers)

Povr ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ }

Page 63: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Pbysec ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ HTML.Anchor, T.SecureAnchor – visible, T.ValidAnchor }

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

=

Composition Policies 14

HTML.Anchor T.SecureAnchor T.ValidAnchor▹ ▹

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent parent

addAttribute setAttribute removeAttribute

What if we want to bypass security of

visible?✗ Impossible with strict overriding semantics

(e.g. inheritance, mixins, COP layers)

exclusion operator

Povr ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ }

Page 64: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Pbysec ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ HTML.Anchor, T.SecureAnchor – visible, T.ValidAnchor }

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

=

Composition Policies 14

HTML.Anchor T.SecureAnchor T.ValidAnchor▹ ▹

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent parent

addAttribute setAttribute removeAttribute

What if we want to bypass security of

visible?✗ Impossible with strict overriding semantics

(e.g. inheritance, mixins, COP layers)

Povr ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ }

P : 2T → 2T

P = Povr · Pbysec

Page 65: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Pbysec ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ HTML.Anchor, T.SecureAnchor – visible, T.ValidAnchor }

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent visible

addAttribute setAttribute removeAttribute

parent

=

✓Arbitrary combinations

Composition Policies 14

HTML.Anchor T.SecureAnchor T.ValidAnchor▹ ▹

o addAttribute setAttribute removeAttribute href parent visible type target

addAttribute setAttribute removeAttribute href parent visible type target

href parent parent

addAttribute setAttribute removeAttribute

What if we want to bypass security of

visible?✗ Impossible with strict overriding semantics

(e.g. inheritance, mixins, COP layers)

Povr ( { HTML.Anchor, T.SecureAnchor, T.ValidAnchor } ) =

{ }

P : 2T → 2T

P = Povr · Pbysec

Page 66: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

Behaviour Extensibility Challenge 15

HTML.Anchor...setAttribute...

Page 67: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

Behaviour Extensibility Challenge 15

HTML.Anchor...setAttribute...

Page 68: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

how to invoke overridden behaviour?

Behaviour Extensibility Challenge 15

HTML.Anchor...setAttribute...

Page 69: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

how to invoke overridden behaviour?

Behaviour Extensibility Challenge 15

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

Page 70: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

how to invoke overridden behaviour?

Behaviour Extensibility Challenge 15

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

aliasing operator

Page 71: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

how to invoke overridden behaviour?

Behaviour Extensibility Challenge 15

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

Page 72: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

how to invoke overridden behaviour?

T.ValidAnchor.setAttribute = function(name, value) { ... return self.htmlSetAttribute(name, value);}

Behaviour Extensibility Challenge 15

T.ValidAnchor’T.ValidAnchor’addAttributesetAttributeremoveAttributeparent

htmlSetAttribute...

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

→ manual edition →

Page 73: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

how to invoke overridden behaviour?

T.ValidAnchor.setAttribute = function(name, value) { ... return self.htmlSetAttribute(name, value);}

Behaviour Extensibility Challenge 15

T.ValidAnchor’T.ValidAnchor’addAttributesetAttributeremoveAttributeparent

htmlSetAttribute...

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

→ manual edition →

...becomes requirement

Page 74: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

how to invoke overridden behaviour?

T.ValidAnchor.setAttribute = function(name, value) { ... return self.htmlSetAttribute(name, value);}

Behaviour Extensibility Challenge 15

T.ValidAnchor’T.ValidAnchor’addAttributesetAttributeremoveAttributeparent

htmlSetAttribute...

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

→ manual edition →

Page 75: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

T.ValidAnchor.setAttribute = function(name, value) { ... return self.htmlSetAttribute(name, value);}

Behaviour Extensibility Challenge 15

T.ValidAnchor’T.ValidAnchor’addAttributesetAttributeremoveAttributeparent

htmlSetAttribute...

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

→ manual edition →

Page 76: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

T.ValidAnchor.setAttribute = function(name, value) { ... return self.htmlSetAttribute(name, value);}

Behaviour Extensibility Challenge 15

T.ValidAnchor’T.ValidAnchor’addAttributesetAttributeremoveAttributeparent

htmlSetAttribute...

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

→ manual edition →

▹✗ bypassed T.SecureAnchor▹

Page 77: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

...

T.ValidAnchor.setAttribute = function(name, value) { ... return self.htmlSetAttribute(name, value);}

Behaviour Extensibility Challenge 15

T.ValidAnchor’T.ValidAnchor’addAttributesetAttributeremoveAttributeparent

htmlSetAttribute...

HTML.Anchor...setAttribute...

[ htmlSetAttribute ↦ setAttribute ] =

HTML.Anchor’...setAttributehtmlSetAttribute...

→ manual edition →

▹✗ bypassed T.SecureAnchor▹

✗ hard-coded choice of overridden behaviour

Page 78: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Extensibility Through proceed 16

HTML.Anchor...setAttribute...

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

how to invoke overridden behaviour?

Page 79: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchor = Trait({ setAttribute: function(name, value) { ... // validity check return self.proceed(); }, ...});

Extensibility Through proceed 16

HTML.Anchor...setAttribute...

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

how to invoke overridden behaviour?

proceed

Page 80: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchor = Trait({ setAttribute: function(name, value) { ... // validity check return self.proceed(); }, ...});

Extensibility Through proceed 16

HTML.Anchor...setAttribute...

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

becomes requirement

how to invoke overridden behaviour?

proceed

Page 81: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchor = Trait({ setAttribute: function(name, value) { ... // validity check return self.proceed(); }, ...});

Extensibility Through proceed 16

HTML.Anchor...setAttribute...

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

how to invoke overridden behaviour?

proceed

Page 82: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchor = Trait({ setAttribute: function(name, value) { ... // validity check return self.proceed(); }, ...});

Extensibility Through proceed 16

HTML.Anchor...setAttribute...

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

✓ open choice of overridden behaviour

how to invoke overridden behaviour?

proceed

Page 83: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchor = Trait({ setAttribute: function(name, value) { ... // validity check return self.proceed(); }, ...});

Extensibility Through proceed 16

HTML.Anchor...setAttribute...

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

how to invoke overridden behaviour?

proceed

▹T.SecureAnchorT.SecureAnchor

...setAttribute...parentvisible

manager...

Page 84: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.ValidAnchor = Trait({ setAttribute: function(name, value) { ... // validity check return self.proceed(); }, ...});

Extensibility Through proceed 16

HTML.Anchor...setAttribute...

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

how to invoke overridden behaviour?

proceed

▹T.SecureAnchorT.SecureAnchor

...setAttribute...parentvisible

manager...

Page 85: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

T.Extensibleproceed Dynamic

T.ValidAnchor = Trait({ setAttribute: function(name, value) { ... // validity check return self.proceed(); }, ...});

Extensibility Through proceed 16

HTML.Anchor...setAttribute...

T.ValidAnchorT.ValidAnchoraddAttributesetAttributeremoveAttributeparent

how to invoke overridden behaviour?

proceed

▹T.SecureAnchorT.SecureAnchor

...setAttribute...parentvisible

manager...

Page 86: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

‣ Contexts: frame of reference to define adaptations‣ Traits: convenient units of adaptation‣ Policies: flexible compositions (e.g. non-linear)‣ Extensibility: independent behaviour extensions‣ JavaScript: easy definition of contexts, traits, and

composition

Summary 17

Page 87: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

‣ Contexts: frame of reference to define adaptations‣ Traits: convenient units of adaptation‣ Policies: flexible compositions (e.g. non-linear)‣ Extensibility: independent behaviour extensions‣ JavaScript: easy definition of contexts, traits, and

composition

Summary 17

direct causal connectioncomposition of the computational system

situation in which the system executes⇋

Page 88: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

In The Paper

‣ Default composition policy‣ Resolution of proceed chains through policies‣ Implementation technique for proceed‣ Case Studies

18

Page 89: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Questions?

Context Traits

19

Page 90: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Additional Slides

Page 91: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution of proceed Through Policies 21

a bc d

T1

c gq

T2c() { ... self.proceed() ... }

c de f

c h

T3

· · ·

Page 92: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution of proceed Through Policies 21

a bc d

T1

c gq

T2c() { ... self.proceed() ... }

c de f

c h

T3

· · ·

Page 93: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution of proceed Through Policies 21

pairwise resolution: Pg ( { T2, T3 } ) = { TR }

a bc d

T1

c gq

T2c() { ... self.proceed() ... }

c de f

c h

T3

· · ·

Page 94: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution of proceed Through Policies 21

pairwise resolution: Pg ( { T2, T3 } ) = { TR }

a bc d

T1

c gq

T2

either TR ( c ) = or TR ( c ) = c c

( since policies resolve through +, ▹, ↦, – exclusively )

c() { ... self.proceed() ... }

c de f

c h

T3

· · ·

Page 95: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution of proceed Through Policies 21

pairwise resolution: Pg ( { T2, T3 } ) = { TR }

a bc d

T1

c gq

T2

either TR ( c ) = or TR ( c ) = c c

( since policies resolve through +, ▹, ↦, – exclusively )

c() { ... self.proceed() ... }

c de f

suppose TR ( c ) = ; then <c cc

c h

T3

· · ·

Page 96: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution of proceed Through Policies 22

Pg induces an order < < <c ccc

c() { ... self.proceed() ... }

current next

Page 97: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution of proceed Through Policies 22

Pg induces an order < < <c ccc

c() { ... self.proceed() ... }

current next

c<

Page 98: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution By Activation Age

Default policy Pa

23

Page 99: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution By Activation Age

C1 < C2 < ... < Cnyounger older

Default policy Pa

23

Page 100: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution By Activation Age

Pa ( { TC1, TC2, ... , TCn } ) = { TC1 ▹ TC2 ▹ ... ▹ TCn }

C1 < C2 < ... < Cnyounger older

Default policy Pa

23

Page 101: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

Resolution By Activation Age

Pa ( { TC1, TC2, ... , TCn } ) = { TC1 ▹ TC2 ▹ ... ▹ TCn }

C1 < C2 < ... < Cnyounger older

produces a sort of layering according to

contexts

a bc dc de fTC1

TC2

e fg h

TC3

Default policy Pa

23

Page 102: Context Traits Dynamic Behaviour Adaptation Through Run-Time Trait Recomposition

m nc d

TD

Resolution By Activation Age

Pa ( { TC1, TC2, ... , TCn } ) = { TC1 ▹ TC2 ▹ ... ▹ TCn }

C1 < C2 < ... < Cnyounger older

produces a sort of layering according to

contexts

a bc dc de fTC1

TC2

e fg h

TC3

Default policy Pa

23