evolve – advanced topics

28
ndrew McVeigh eff Magee eff Kramer mperial College, London eb 2010

Upload: reid

Post on 16-Jan-2016

56 views

Category:

Documents


0 download

DESCRIPTION

Evolve – Advanced Topics. Andrew McVeigh Jeff Magee Jeff Kramer Imperial College, London Feb 2010. Contents. Brief overview of the formal model structures Advanced extensibility features Port type inference Hyperports, factories, state machines The Evolve toolset Future work. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Evolve – Advanced Topics

Andrew McVeighJeff MageeJeff KramerImperial College, LondonFeb 2010

Page 2: Evolve – Advanced Topics

ContentsBrief overview of the formal model structures

Advanced extensibility featuresPort type inferenceHyperports, factories, state machines

The Evolve toolset

Future work

Page 3: Evolve – Advanced Topics
Page 4: Evolve – Advanced Topics

StructureModel is described in the Alloy logic language [Jac02]Built up in layers

Stratum, resemblance, replacement, deltas

Components & interfaces

Structural rules

Page 5: Evolve – Advanced Topics

Strata

sig Stratum{

dependsOn: set Stratum,nestedStrata: set Stratum,exportsStrata: set Stratum,ownedElements: set Element,...

B

C

D

A

Page 6: Evolve – Advanced Topics

CD

Desk̀(replaces :: desk 1.0 :: Desk)

combined

Desk̀(replaces :: desk 1.0 :: Desk)

desk 1.0

Desk

turntable

Desk̀(replaces :: desk 1.0 :: Desk)

Desk

Desk̀ (CD)

Desk̀ (combined)

Desk̀ (turntable)

abstract sig Element{

home: Stratum,replaces: lone Element,resembles: set Element,resembles_e: Element -> Stratum,

...

Elements and Resemblance

Page 7: Evolve – Advanced Topics

Components & Interfacessig Component extends Element {

parts: lone Parts/Deltas,ports: lone Ports/Deltas,connectors: lone Connectors/Deltas,attributes: lone Attributes/Deltas,implementation: lone Implementation/Deltas,

...

sig Interface extends Element {operations: lone Operations/Deltas,implementation: lone Implementation/Deltas,

...

Page 8: Evolve – Advanced Topics

• Port type inference• Hyperports• Factories• State Machines

Page 9: Evolve – Advanced Topics

Inferring port typesPorts of composites have their interfaces inferred

Propagates local changes globally without further deltasExposes interfaces on one port back to “surface”

IBaseIBase

B

C

: A : B

IMore

A

IMore

Page 10: Evolve – Advanced Topics

Cutting through the hierarchyHyperports are auto-connected down the hierarchyMore flexible & general singleton approach [Rum96]

Page 11: Evolve – Advanced Topics

Isomorphic factoriesComponents with lazily instantiated insides [MDEK95]

Use with resemblance and evolutionCan be nested arbitrarily

TransitionsWindowFactory

extension : String

: TransitionsWindow

extension = extension

IWindow

window

IActionListener IJCheckBoxMenuItem

bigFont

ICreate

creator

Page 12: Evolve – Advanced Topics

Executable state machinesComponent variant of state pattern

Big switch componentUse with resemblance and evolutionCombine with conventional components

Advantages over OO approachDon’t get me started!Explicit transitionsExtensible for states and transitionsRich context available for each state

Page 13: Evolve – Advanced Topics

Executable state machines (2)

RentalState

: Start

a : Available r : Rented

IRentalEvent

ITransition

in

stateEvents

purchased

return rental

rent

Page 14: Evolve – Advanced Topics

(+ current focus on Java)

Page 15: Evolve – Advanced Topics
Page 16: Evolve – Advanced Topics

Diagrams versus underlying models

Page 17: Evolve – Advanced Topics

Code generationLossless forward generation

Create bean setters and getters (ports too)Reverse generation

Import beans as full componentsNone of this is mandatory ;-)

Bean.java

Beans.jar

Page 18: Evolve – Advanced Topics

Importing beans as components

RentalCarDetails.java

IRentalCarDetails

RentalCarDetails

model : Stringpurchased : Date

IRenterDetails

renter

details

Page 19: Evolve – Advanced Topics

Running an Evolve application

OR

Generate backbone &run in BB interpreter...

Generate Java wiring code

Page 20: Evolve – Advanced Topics

Other featuresScales to very large models

Diagrams are updated lazilyLessons learnt from UML toolsUses Eclipse UML2/EMF metamodel

Support top-down and bottom-up design approachTolerant of errors in design phase

Team editionMultiple developers working on same model concurrentlyAdvanced object database

Page 21: Evolve – Advanced Topics

Capabilities and challenges

Page 22: Evolve – Advanced Topics

Extensible feature diagramsUsed to define requirements

Product line techniqueResemblance and replacement to extend feature graph

Page 23: Evolve – Advanced Topics

Extensible protocols & goalsBased on behavior protocols for components [PV02]

Aim: allow extension to enforce semantic guarantees

Sequence diagram, ports are actorsCurrently convert to labeled transition systemAnalyse via LTSA [MK06]Find a way to allow extension to “extend”Automatically assemble sequence diagram of composites

Page 24: Evolve – Advanced Topics

Extensible protocols (2)

Page 25: Evolve – Advanced Topics

Backwards compatibilityReverse dependencies

Compresses deltasOlder systems are now deltas against newer system

Page 26: Evolve – Advanced Topics

Replacement for plugin architectureBest of both worlds...

application

DeveloperUser

Page 27: Evolve – Advanced Topics

Some other areas...Reengineering a legacy application

Actually easier than it looks

Active components for concurrencyROOM actor model? [SGW94]

Apply to different environmentsAndroidC#? C++?Hierarchical grid workflows

Page 28: Evolve – Advanced Topics

References Jac02

Jackson, D.Alloy: A Lightweight Object Modelling NotationACM Transactions on Software Engineering and Methodology (TOSEM), ACM Press, 2002, 11, 256-290

Rum96Rumbaugh, J.OMT Insights: Perspectives on ModelingJournal of Object-Oriented Programming, Cambridge University Press, 1996, 123

MDEK9Magee, J.; Dulay, N.; Eisenbach, S. & Kramer, J.Specifying Distributed Software ArchitecturesEsec, 1995, 989, 137-153

MK06Concurrency (State Models and Java Programs)Magee, J. & Kramer, J.John Wiley and Sons Ltd, 2006

PV02Behavior Protocols for Software Components Plasil, F. & Visnovsky, S.IEEE Transactions on Software Engineering, IEEE Press, 2002

SGW94Real-Time Object-Oriented ModelingSelic, B.; Gullekson, G. & Ward, P.John Wiley & Sons, 1994