• Aucun résultat trouvé

slides

N/A
N/A
Protected

Academic year: 2022

Partager "slides"

Copied!
22
0
0

Texte intégral

(1)

UML’02 – 04/10/2002

The Specification of UML Collaborations as Interaction Components

Eric C´ ARIOU Antoine BEUGNARD

(2)

G OALS

➤ Collaboration diagrams: core feature of UML

➤ Define an interaction abstraction at specification level

➤ But how to have interaction abstractions at implementation level?

➥ Classicaly, no more trace of these abstractions at this level

➥ Communication only through “low-level” primitives (RPC)

➤ Our proposition:

➥ The reification of interaction abstractions as software compo- nents

(3)

O UTLINE

1. Study of a collaboration in a reservation application 2. A more interesting way to specify the collaboration 3. Introduction to interaction components

4. Methodology of interaction component specification in UML

(4)

A C AR P ARK M ANAGEMENT S YSTEM

➤ A car park with two accesses

➤ A display shows the number of available places

Information Display

Car

Access: accessOne

Access: accessTwo

Place CarPark

reserver observer

source reserver

Car Place Management

uses read

set uses

(5)

T HE C OLLABORATION U SED

/observer B.2 nbAvailablePlaces(availablePlaces)

A.2 nbAvailablePlaces(availablePlaces)

/source A.1 placeId = newCarEntering()

B.1 carLeaving(placeId)

*

* /reserver

➤ Simply shows messages sent among roles

(6)

R EUSE OF THE C OLLABORATION

➤ With minor changes:

➥ If the source is an airline company

➥ If reservers and observers are travel agencies reservation of places in a flight

➤ Warning: the data management system must be implemented by the source role

Why not putting this system into the collaboration?

(7)

N EW C OLLABORATION D ESIGN

/reserver

/observer

DataManager /source

ReserveId

A.2/B.2/ C.2nbAvailableId(availableId)

*

* *

dataSet B.1 cancelReservation(reserveId)

C.1 setIdentifiers(reserveId[]) A.1 reserveId = reserveIdentifier()

➤ Use of generic identifiers

➤ Identifier management done in the collaboration

(8)

NEW CAR PARK MANAGEMENT APPLICATION DESIGN

Information Display

CarPark Access: accessOne

Access: accessTwo

Car

reserver observer

source reserver

Management

uses read

uses

Reservation

➤ Place set has disappeared inside the collaboration

(9)

FLIGHT SEAT RESERVATION APPLICATION DESIGN

TravelAgency:A Agency

TravelAgency:T Travel Airline: ErnestAir

Reservation Management source

reserver

reserver

observer observer

➤ Reuse of the same collaboration the same interaction abstrac- tion

(10)

I NTERACTION A BSTRACTIONS

➤ Comparison of the second collaboration design with the first one:

➥ Does “more”, more abstract

➥ Independent, “self-content”, consistent Define a high-level interaction abstraction:

➥ Easily usable and reusable

➥ At the specification level

(11)

I NTERACTION A BSTRACTIONS

➤ High-level interaction abstractions are useful and interesting in application architecture

➥ At specification level: UML Collaborations are suitable

➥ At implementation level: often, only low-level communication primitives (RPC)

We propose to use interaction components

➥ For manipulation of high-level interaction abstractions, even at implementation level

➥ An interaction component is specified on the base of a UML

(12)

P ROPERTIES OF S OFTWARE C OMPONENTS

➤ An interaction component is first of all a software component :

➥ Independent and deployable software entity

➥ Specify offered and required services interfaces

➥ Subject to composition with other components

(13)

I NTERACTION C OMPONENTS ( OR M EDIUMS )

Software component integrating any communication (coordination, in- teraction) system or protocol

➤ Independently of its complexity: a consensus protocol, a multime- dia stream broadcast, a voting system...

➤ At specification level: a UML collaboration following specific de- sign rules

➤ At implementation and deployment levels: an instantiable compo- nent implementation of a UML collaboration

Reification of an interaction abstraction all along the software pro-

(14)

S PECIFICATION OF A M EDIUM : U SAGE C ONTRACT

➤ On the base of a UML collaboration:

➥ Depending on their needs, components using the medium play different roles

➥ For each role: interfaces of offered and required services

➤ OCL for specifying the services semantics

➤ Statecharts and messages on collaborations for dynamic behavior

➤ Generalization of OCL expressions to link all the views

➤ And other UML features if needed

(15)

T HE R ESERVATION M EDIUM

/source

/reserver

/observer

setReserveIdSet(ReserveId[])

<< interface >>

ISourceMediumServices

ReserveId ReservationMedium

Boolean cancelerIsReserver Boolean usable = false

ReserveId reserve()

<< interface >>

IReserverMediumServices

<< interface >>

IObserverComponentServices nbAvailableId(Integer)

*

*

* reserved

available *

* originalSet

0..1 1

(16)

T HE R ESERVATION M EDIUM

setReserveIdSet(ReserveId[])

<< interface >>

ISourceMediumServices

ReserveId ReservationMedium

Boolean cancelerIsReserver Boolean usable = false

ReserveId reserve()

<< interface >>

IReserverMediumServices

<< interface >>

IObserverComponentServices nbAvailableId(Integer)

*

*

* reserved

available *

* originalSet

0..1

/source

/reserver 1

/observer

(17)

T HE R ESERVATION M EDIUM

/source

/reserver

/observer

ReserveId

*

*

* reserved

available *

* originalSet setReserveIdSet(ReserveId[])

<< interface >>

ISourceMediumServices

ReservationMedium

Boolean cancelerIsReserver Boolean usable = false

ReserveId reserve()

<< interface >>

IReserverMediumServices

<< interface >>

IObserverComponentServices nbAvailableId(Integer)

0..1 1

(18)

T HE R ESERVATION M EDIUM

/source

/reserver

/observer

setReserveIdSet(ReserveId[])

<< interface >>

ISourceMediumServices

ReservationMedium

Boolean cancelerIsReserver Boolean usable = false

ReserveId reserve()

<< interface >>

IReserverMediumServices

<< interface >>

IObserverComponentServices nbAvailableId(Integer)

*

*

* reserved

available *

* originalSet

0..1

ReserveId

1

(19)

D YNAMICAL V IEW OF THE C OLLABORATION

ReservationMedium /reserver

/source

/observer

*

*

A.1 setReserveIdSet(set)

B.1 id = reserve()

C.1 cancelReturn = cancel(id)

A.2 nbAvailableId(available −> size)

B.2 [id != null] nbAvailableId(available −> size)

(20)

OCL C ONSTRAINTS FOR S ERVICE S EMANTICS

context ReservationMedium::

setReserveIdSet(Set idSet, Boolean cancel) pre:

usable = false post:

originalSet = idSet and available = idSet and usable = true

and cancelerIsReserver = cancel and reserver – forAll( r

r.reserved – isEmpty )

(21)

C ONCLUSION

Interaction components: reification of interaction abstractions during all the software process

➤ Manipulation of high-level interaction abstraction, even at the im- plementation level

➤ Good usability and reusability of interaction abstractions

➤ A way to reify and implement a UML Collaboration

(22)

C ONCLUSION

➤ Other parts of the work on interaction components:

➥ Definition of a specification refinement process: from abstract specification to several implementations

➥ A Java framework (downloadable as free software) for imple- menting mediums and applications in a distributed context

➤ For more information:

➥ Web: http://www-info.enst-bretagne.fr/medium/

➥ E-mail: [email protected]

Références

Documents relatifs

1 estimer la probabilité qu’un bébé naisse avec un faible poids à partir des variables explicatives.. 2 estimer le poid du bébe à la naissance à partir des

plot_contours Plot the contours of the domain natural_neighbours Find the natural neighbours of a given point Bower_watson_Laplace Compute the value of the Laplace interpolant

Les mécanismes d’interaction ligand – récepteur : d’une façon générale, l’interaction ligand-récepteur génère une réponse cellulaire, c’est-à-dire des

The gluons can attach to the nucleon film at any point of the surface (these points are depicted by encircled dots in Figure 3b) including the quark lines on the boundary.

instrumental interaction with machine learning, we begin to create truly advanced human-computer partnerships, in which interactive systems both empower and serve their human

Because T lymphocytes implied in cancer and auto-immune diseases are near the Recognition Threshold, they are affected soon when exposure conditions inhibit transitions to state (CR)

During stage 2, the experimenter may perform analysis on the data traced during the experiment relatively to selected metrics and factors (e.g. inferential analysis as

Peter Ingwersen - Royal School of LIS Jaap Kamps - University of Amsterdam Mounia Lalmas - Yahoo Research Barcelona?. Joe Lamantia