analyse:diagrammes
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédente | |||
analyse:diagrammes [2024/08/06 22:18] – sgariepy | analyse:diagrammes [2024/08/06 22:20] (Version actuelle) – sgariepy | ||
---|---|---|---|
Ligne 213: | Ligne 213: | ||
===== Exemple d'un DFD ===== | ===== Exemple d'un DFD ===== | ||
{{: | {{: | ||
+ | |||
+ | |||
+ | |||
+ | ====== OCL ====== | ||
+ | |||
+ | |||
+ | ===== Invariants ===== | ||
+ | |||
+ | ==== Exemples avec club vidéo ==== | ||
+ | |||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | Une vidéo empruntée est nécessairement une vidéo de l’inventaire | ||
+ | < | ||
+ | context Succursale | ||
+ | inv: self.videos-> | ||
+ | </ | ||
+ | |||
+ | |||
+ | Deux clients distincts ne peuvent avoir des vidéos en commun. | ||
+ | < | ||
+ | context Succursale | ||
+ | inv: self.clients-> | ||
+ | </ | ||
+ | ===== Requêtes ===== | ||
+ | |||
+ | < | ||
+ | class Person | ||
+ | attributes | ||
+ | firstname: String | ||
+ | lastname: String | ||
+ | email: Set(String) | ||
+ | operations | ||
+ | fullname(prefix: | ||
+ | prefix.concat(' | ||
+ | end | ||
+ | prefix= ' | ||
+ | </ | ||
+ | ===== Opérations ===== | ||
+ | ==== Syntaxe ==== | ||
+ | |||
+ | < | ||
+ | context Typename:: | ||
+ | pre precondname1 : ...param1... ...self... | ||
+ | pre precondname2 : ...param1... ...self... | ||
+ | ... | ||
+ | post postcondname1 : ...result... ...param1... ...self... | ||
+ | post postcondname2 : ...result... ...param1... ...self... | ||
+ | </ | ||
+ | |||
+ | ==== Exemple 1 ==== | ||
+ | |||
+ | < | ||
+ | class Cours | ||
+ | attributes | ||
+ | titre: String | ||
+ | sigle: String | ||
+ | operations | ||
+ | addPreRequis(c : Cours) | ||
+ | end | ||
+ | |||
+ | class Etudiant < Personne | ||
+ | operations | ||
+ | abandonCours(c : Cours) | ||
+ | nouveauCode(n : String) | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | context Etudiant:: | ||
+ | pre Estinscrit: self.cours-> | ||
+ | post Plusinscrit: | ||
+ | </ | ||
+ | |||
+ | La partie '' | ||
+ | |||
+ | ==== Exemple 2 ==== | ||
+ | |||
+ | < | ||
+ | context A::sort(s : Sequence(Integer)) : Sequence(Integer) | ||
+ | post MemeTaille: | ||
+ | post MemesElements: | ||
+ | post EstTriee: Sequence{1..( result-> | ||
+ | </ | ||
+ | Notez l’utilisation d’une séquence ici pour imiter une boucle de 1 à '' | ||
+ | |||
+ | ==== Vérification des pre et post conditions ==== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Types primitifs ===== | ||
+ | |||
+ | {{: | ||
+ | ==== Real ==== | ||
+ | |||
+ | ^ Operations ^^^ | ||
+ | | + (r: Real): Real | abs(): Real | < (r: Real): Boolean | ||
+ | | - (r: Real): Real | floor(): Integer | ||
+ | | * (r: Real): Real | round(): Integer | ||
+ | | / (r: Real): Real | max(r: Real): Real | >= (r: Real): Boolean | ||
+ | | -: Real | min(r: Real): Real | | | ||
+ | |||
+ | |||
+ | ==== Integer ==== | ||
+ | |||
+ | ^ Operations | ||
+ | | −: Integer => Valeur négative de '' | ||
+ | | + (i: Integer): Integer | div(i: Integer): Integer => Le nombre de fois que '' | ||
+ | | - (i: Integer): Integer | mod(i: Integer): Integer => Modulo | ||
+ | | * (i: Integer): Integer | max (i: Integer): Integer | ||
+ | | / (i: Integer): Real | min(i: Integer): Integer | ||
+ | |||
+ | |||
+ | ==== String ==== | ||
+ | |||
+ | ^ Operations | ||
+ | | size(): Integer | ||
+ | | concat(s: String): String | ||
+ | | substring(lower: | ||
+ | | toInteger(): | ||
+ | | toReal(): Real | | ||
+ | |||
+ | ==== Boolean ==== | ||
+ | |||
+ | ^ Operations | ||
+ | | or (b: Boolean): Boolean | ||
+ | | xor (b: Boolean): Boolean | ||
+ | | and (b: Boolean): Boolean | ||
+ | | not: Boolean | ||
+ | | implies (b: Boolean): Boolean | ||
+ | |||
+ | ===== Types collections ===== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Collection ==== | ||
+ | |||
+ | ==== Set ==== | ||
+ | |||
+ | |||
+ | ==== Bag ==== | ||
+ | |||
+ | ==== Sequence ==== | ||
+ | |||
+ | ===== Outils ===== | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | ===== Sources ===== | ||
+ | |||
+ | * S. Benette, J. Skelton, K. Lunn, 2004. // | ||
+ | |||
analyse/diagrammes.1722975534.txt.gz · Dernière modification : 2024/08/06 22:18 de sgariepy