• Aucun résultat trouvé

Example: adding a Semaphore concept

N/A
N/A
Protected

Academic year: 2022

Partager "Example: adding a Semaphore concept"

Copied!
8
0
0

Texte intégral

(1)

UML Extensions

Excerpts from Bran Selic (IBM) tutorial

on UML & SysML (2007)

(2)

Customizing UML for a Domain

Heavyweight/extension

• Requires adding new concepts (classes) and

relationships (associations) to the UML metamodel using MOF

• Example: Adding a Petri-net behavioral formalism to UML

Lightweight/refinement

• Refinements must be formally consistent with base UML semantics and well-formedness rules!

• Specified using the built-in UML extension mechanisms:

Profiles

• Stereotypes

(3)

Example: adding a Semaphore concept

Semaphore semantics:

• A specialized object that limits the number of concurrent accesses in a multithreaded

environment. When that limit is reached,

subsequent accesses are suspended until one of the accessing threads releases the

semaphore, at which point the earliest suspended access is given access.

What is required is a special kind of object

• Has all the general characteristics of UML objects

• But includes additional refinements

(4)

The Semaphore stereotype

Refine the UML Class concept by

– “Associating” semaphore semantics

• Done informally as part of the stereotype definition

– Adding constraints that capture semaphore semantics

• E.g., when the maximum number of concurrent accesses is reached, subsequent access requests are queued in FIFO order

– Adding characteristic attributes using tags (e.g., concurrency limit)

– Adding characteristic operations (getSema(), releaseSema ())

Create a new “subclass” of the original metaclass with the above refinements

– For technical reasons this is done using special mechanisms instead of MOF Generalization

(5)

Graphical definition of the stereotype

(6)

Using the Stereotype

generateXMI( )

Object A class

« semaphore » limit = MAXlimit getSema = p p ( )

v ( )

« semaphore » DijkstraSem

« semaphore » limit = 1

getSema = get get ( )

release ( )

« semaphore »

BooleanSem SomeOther Class

A subclass stereotyped by

« semaphore »

(7)

Extending the scope of a stereotype

• It is common to associate a given stereotype

with different kinds of metamodel elements

(8)

UML profiles

Profile:

– A special kind of package containing stereotypes and model libraries that, in conjunction with the UML

metamodel, define a group of domain-specific concepts and relationships

– The profile mechanism is also available in MOF

where it can be used for other MOF-based languages

Profiles can be used for two different purposes:

– To define a domain-specific modeling language – To define a domain-specific viewpoint

Example: The UML profile for Modeling and

Analysis of Real-Time Embedded Systems

(MARTE)

Références

Documents relatifs

Comme je suis heureux ! Je suis chargé d'annoncer au peuple français la signature de l'Armistice ! Nous sommes en 1918, la guerre est terminée.. J’ai de nombreux surnoms, Certains

Imagerie géophysiqueSondages mécaniques -Reconnaissance non destructive -Informationsen continu -Durée de mise en œuvre courte -Coût faible.. -Reconnaissance

Restaurant “M” – near the Faïencerie Amenities: One bakery, two restaurants and small grocery shop Waterside services: There are moorings near the village with water

La recherche du ganglion sentinelle permet, lors du bloc opératoire programmé, une exérèse ganglionnaire sélective, afin d’éviter un curage ganglionnaire extensif qui

Pour en savoir plus : Conservatoire d’espaces naturels Languedoc Roussillon – Benjamin SIROT – 04.67.02.21.29 – life.lagnature@cenlr.org – http://www.lifelagnature.fr

• La première action correspond à une force parallèle à la vitesse et de sens contraire ; la seconde action correspond à une force perpendiculaire à la vitesse et peut

*sous condition d'acceptation de votre dossier par le SEFRI vous pouvez obtenir le remboursement de 50% de vos frais de formation menant au Brevet Fédéral.

L’abus d’alcool est dangereux pour l a santé, à consommer