Ajout des td 5 exo
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
@startuml
|
||||
title TD5 - Patron Décorateur (Exercice 1) : Diagramme de classes
|
||||
|
||||
skinparam classAttributeIconSize 0
|
||||
|
||||
' ===== Interface =====
|
||||
interface Boisson {
|
||||
+getCost() : double
|
||||
+getIngredients() : String
|
||||
}
|
||||
|
||||
' ===== Boissons concrètes =====
|
||||
class Expresso {
|
||||
+getCost() : double
|
||||
+getIngredients() : String
|
||||
}
|
||||
|
||||
class The {
|
||||
+getCost() : double
|
||||
+getIngredients() : String
|
||||
}
|
||||
|
||||
Boisson <|.. Expresso
|
||||
Boisson <|.. The
|
||||
|
||||
' ===== Décorateur abstrait =====
|
||||
abstract class BoissonEtPlus {
|
||||
-aDecorer : Boisson
|
||||
+BoissonEtPlus(b : Boisson)
|
||||
+getCost() : double
|
||||
+getIngredients() : String
|
||||
}
|
||||
|
||||
Boisson <|.. BoissonEtPlus
|
||||
BoissonEtPlus o-- "1" Boisson : aDecorer
|
||||
|
||||
' ===== Décorateurs concrets =====
|
||||
class AvecLait {
|
||||
+AvecLait(b : Boisson)
|
||||
+getCost() : double
|
||||
+getIngredients() : String
|
||||
}
|
||||
|
||||
class Double {
|
||||
+Double(b : Boisson)
|
||||
+getCost() : double
|
||||
+getIngredients() : String
|
||||
}
|
||||
|
||||
class AvecGoutte {
|
||||
+AvecGoutte(b : Boisson)
|
||||
+getCost() : double
|
||||
+getIngredients() : String
|
||||
}
|
||||
|
||||
BoissonEtPlus <|-- AvecLait
|
||||
BoissonEtPlus <|-- Double
|
||||
BoissonEtPlus <|-- AvecGoutte
|
||||
|
||||
@enduml
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
Reference in New Issue
Block a user