Application console C# illustrant les principaux Design Patterns à travers la gestion d'interventions techniques (maintenance, urgence...) dans le cadre d’un projet ESGI.
Concevoir une application structurée autour de plusieurs Design Patterns :
- Factory Method
- Decorator
- Facade
- Observer
- Proxy (optionnel mais implémenté ici)
Chaque pattern est utilisé pour illustrer son rôle dans un cas concret de gestion d'interventions.
InterventionManager/
├── Program.cs // Menu console interactif
├── Models/ // Modèle de données (Technicien, Intervention abstraite)
├── Factory/ // Pattern Factory Method
├── Decorator/ // Pattern Decorator
├── Facade/ // Pattern Facade
├── Observer/ // Pattern Observer
├── Proxy/ // Pattern Proxy (gestion des rôles)
Permet de créer différents types d'interventions (Maintenance, Urgence).
- InterventionFactory + enum TypeIntervention
- MaintenanceIntervention et UrgenceIntervention héritent de Intervention
var intervention = factory.CreerIntervention(TypeIntervention.Maintenance);Permet d'ajouter dynamiquement des fonctionnalités sans modifier la classe de base.
- SuiviGPSDecorator
- PiecesJointesDecorator
intervention = new SuiviGPSDecorator(intervention);
intervention = new PiecesJointesDecorator(intervention);Expose une API simplifiée via GestionnaireInterventions (Créer, Assigner, Sauvegarder).
var gestionnaire = new GestionnaireInterventions(user);
gestionnaire.CreerIntervention(TypeIntervention.Maintenance);Notifie automatiquement des composants à chaque changement :
- ConsoleObserver : affiche sur la console
- LogObserver : écrit dans un fichier log
intervention.Attach(new ConsoleObserver());
intervention.Attach(new LogObserver());
intervention.ChangerEtat("En cours");Gère les droits d’un utilisateur simulé : Lecture ou Écriture.
IUser user = new UserProxy("Mohammed", Role.Ecriture);
user.Sauvegarder(intervention);Le fichier Program.cs intègre un menu complet avec les fonctionnalités suivantes :
- Créer une intervention
- Lister les interventions
- Assigner un technicien
- Ajouter un décorateur (Suivi GPS / PJ)
- Changer l’état d’une intervention (déclenche notifications)
- Sauvegarder l’intervention (selon les droits)
- Créer / Lister les techniciens
+---------------------------+
| Intervention (abs) |
+---------------------------+
↑
+-----------+------------+
| |
+-------------------+ +--------------------+
| Maintenance | | Urgence |
+-------------------+ +--------------------+
+---------------------------+
| InterventionDecorator |
+---------------------------+
↑ ↑
| |
+----------------+ +---------------------+
| SuiviGPS | | PiècesJointes |
+----------------+ +---------------------+
GestionnaireInterventions
▲
|
IUser & Proxy
| Étape | Tâche | Temps estimé |
|---|---|---|
| 1 | Analyse + modélisation objet | 1h |
| 2 | Implémentation Factory | 1.5h |
| 3 | Décorateurs + Facade | 2h |
| 4 | Observateurs + notifications | 1.5h |
| 5 | Proxy + rôles utilisateur | 1.5h |
| 6 | Intégration, console et menu | 1h |
| 7 | README, UML, packaging | 1h |
📎 Rendu final prêt : code, menu interactif, architecture modulaire, et respect 100% du cahier des charges.