Files
BUT2FICPOO/TP5/td5/exo1td5.plantuml
T

61 lines
1.1 KiB
Plaintext
Raw Normal View History

2025-12-17 14:57:42 +01:00
@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