9
Plug & Play Adapters Adapter = “adapter” AdapterName “{“ <ground> CollabName <super> CollabName List(MemberDefinition) List(AdaptClause) ”}”. AdaptClause = <ground> ClassName “as” <super> ClassName AdaptationBody. AdaptationBody = List(MethodDefinition).

Plug & Play Adapters

  • Upload
    ulmer

  • View
    29

  • Download
    1

Embed Size (px)

DESCRIPTION

Plug & Play Adapters. Adapter = “adapter” AdapterName “{“ CollabName CollabName List(MemberDefinition) List(AdaptClause) ”}”. AdaptClause = ClassName “as” ClassName AdaptationBody. AdaptationBody = List(MethodDefinition). Plug & Play Adapters. - PowerPoint PPT Presentation

Citation preview

Page 1: Plug & Play Adapters

Plug & Play Adapters

Adapter = “adapter” AdapterName “{“

<ground> CollabName <super> CollabName

List(MemberDefinition)

List(AdaptClause) ”}”.

AdaptClause = <ground> ClassName “as”

<super> ClassName AdaptationBody.

AdaptationBody = List(MethodDefinition).

Page 2: Plug & Play Adapters

Plug & Play Adapters

supercollaboration

groundcollaboration

provides

requires

provides

requires

Adapter

Y

X

Page 3: Plug & Play Adapters

Plug & Play Adapters: they are partitioned

supercollaboration

groundcollaboration

Y1

provides

requires

provides

requires

X1

Adapter

Y

X

XY

Page 4: Plug & Play Adapters

Why partitioning?

• When we implement the required interface of Y, we might want to use the provided interface of X1 and Y1. Why is this not needed?

• Mira writes: in XY part of connector all public provided X and Y definitions are visible. Why cannot we use the provided X1 definitions? Why are they not needed?

Page 5: Plug & Play Adapters

Why partitioning?

• I argue that implementing the required interface of Y may require services of multiple participants of the ground collaboration. Example (in DJ):

• class Y {Z required() { return TraversalGraph.compute(cd, new Strategy(“from Y to Z”)).fetch();} may traverse through several participants.

Page 6: Plug & Play Adapters

Personalities

• By partitioning the adapters we say that X + XY is a personality that requires exactly what Y provides. Therefore Y personifies X + XY.

Page 7: Plug & Play Adapters

Subclasses

X as Y XY is equivalent to

class X extends Y

{ Xbody;XYbody}

• X gets the provided interface of Y

• The methods that Y requires are provided in subclass X.

Page 8: Plug & Play Adapters

Proposal

• In XY part of connector all public provided Y methods and all provided methods of ground collaboration are visible.

Page 9: Plug & Play Adapters

Collaboration Refinement

supercollaboration

subcollaboration

provides

requires

provides more

requires less

Y

X

May have more participants, includinghidden participants.