Design applicatif avec symfony2
-
Upload
romainkuzniak -
Category
Presentations & Public Speaking
-
view
3.104 -
download
8
Transcript of Design applicatif avec symfony2
![Page 1: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/1.jpg)
DESIGN APPLICATIF AVEC SYMFONY2
Zoom sur la Clean Architecture
![Page 2: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/2.jpg)
Romain Kuzniak
Responsable Technique OpenClassrooms
@TurnItUpMethod (je débute !)
![Page 3: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/3.jpg)
QU’EST-CE QU’UNE BONNE APPLICATION ?
(Pour moi) Présentation complète
![Page 4: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/4.jpg)
GLOBAL
Projet
Changer le monde
Améliorer la vie des utilisateurs
Etre rentable
Etre fonctionnel
![Page 5: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/5.jpg)
TECHNIQUE
Dernier langage ?
Dernier Framework ?
Code parfait ?
Qu’est ce que du bon code ?
Agilité ?
Tests ?
Continuous Integration ?
Continuous Delivery ?
![Page 6: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/6.jpg)
TECHNIQUE
YAGNI (You Ain’t Gonna Need It)
KISS (Keep It Simple, Stupid)
DRY (Don’t Repeat Yourself)
S.O.L.I.D (SRP, OCP, LS, IS, DI)
TDD (Test Driven Development)
BDD (Behavior Driven Development)
DDD (Domain Driven Design) …
![Page 7: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/7.jpg)
CE SONT DES MOYENS PAS UNE FIN
![Page 8: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/8.jpg)
LA FIN C’EST
![Page 9: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/9.jpg)
FAVORISER LE CHANGEMENT
![Page 10: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/10.jpg)
FAVORISER LE CHANGEMENT
![Page 11: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/11.jpg)
QU’EST-CE QU’UN BON DESIGN ?
![Page 12: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/12.jpg)
UN DESIGN QUI FAVORISE LE CHANGEMENT
![Page 13: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/13.jpg)
CAS D’ÉTUDE
![Page 14: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/14.jpg)
CAS D’ÉTUDE
Application de gestion d’un tableau agile
Cas d’étude : fermeture d’un sprint
Manuelle par l’utilisateur via l’interface web ou une API
Automatique via un cron
![Page 15: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/15.jpg)
CAS D’UTILISATION
![Page 16: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/16.jpg)
FERMER LE SPRINT - UTILISATEUR
Input :
Opération explicite de l’utilisateur (web ou api)
Scénario :
1. Pour toutes les tâches dont le status est « Done » :
Fermer la tâche :
Passer le statut à « Close »
Ajouter la date de fermeture de la tâche
2. Ajouter la date de fermeture du sprint
3. Sortir toutes les autres tâches du sprint
4. Générer le rapport de sprint
Nombre de tâches fermées au cours du sprint
Nombre de tâches moyennes fermées au cours de tous les sprints
Output :
Rapport de sprint
![Page 17: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/17.jpg)
FERMER LE SPRINT - SYSTÈME
Input :
Opération automatique du système à la date de fin de sprint
Scénario :
1. Pour toutes les tâches dont le status est « Done » :
Fermer la tâche :
Passer le statut à « Close »
Ajouter la date de fermeture de la tâche
2. Ajouter la date de fermeture du sprint
3. Sortir toutes les autres tâches du sprint
Output :
Identifiant du sprint
![Page 18: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/18.jpg)
DOMAINE
![Page 19: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/19.jpg)
VOCABULAIRE
Règles métier : comportement lié à une entité à travers toute l’application
Règles applicatives : fonctionnalités du domaine, liées à une ou plusieurs entités, dans un contexte donné
![Page 20: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/20.jpg)
RÈGLES MÉTIER
Pour toutes les tâches du sprint dont le statut est « Done » :
Fermer la tâche :
Passer le status à « Close »
Ajouter la date de fermeture de la tâche
Ajouter la date de fermeture du sprint
Sortir toutes les autres tâches du sprint
![Page 21: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/21.jpg)
RÈGLES APPLICATIVES
Récupérer le sprint
Fermer le sprint
Récupérer les données nécessaires au rapport
![Page 22: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/22.jpg)
DESIGNS
![Page 23: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/23.jpg)
LES PRINCIPAUX TYPES DE DESIGN
MVC
Architecture 3-tiers
Domain Driven Design
Clean Architecture
![Page 25: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/25.jpg)
Trygve Reenskaug, Xerox Parc, 70’s
GUI pattern à l’origine
Etablir une séparation entre les éléments du domaine et les éléments de présentation
Principes :
Séparer les données, du traitement de la présentation
![Page 26: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/26.jpg)
Controller
Vue
Model
Pattern Original (UI)
![Page 27: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/27.jpg)
Model :
Contient les données (Entity)
Permet l’accès aux données (Repository)
Vue
Affiche les données
Gère l’interaction utilisateur
Controller :
Met à jour le model
Envoi les données du model à la vue
Effectue le traitement métier
![Page 28: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/28.jpg)
MODEL
![Page 29: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/29.jpg)
Entité = POPO
Sprint
![Page 30: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/30.jpg)
Sprint Repository
![Page 31: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/31.jpg)
WEB CONTROLLER
![Page 32: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/32.jpg)
Règles applicatives
Règles métier
Présentation
Accès aux données
![Page 33: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/33.jpg)
Accès aux données
Règles métier
Règles applicatives
![Page 34: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/34.jpg)
API CONTROLLER
![Page 35: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/35.jpg)
Règles applicatives
Règles métier
Présentation
Accès aux données
![Page 36: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/36.jpg)
COMMAND
![Page 37: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/37.jpg)
Règles applicatives
Règles métier
Présentation
Accès aux données
![Page 38: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/38.jpg)
MVC
• A l’origine, design pour GUI
• Ne propose pas de gestion du domaine
• Gestion des règles métier
• Gestion des règles applicatives
• => pas de réutilisabilité
• Pas de séparation de l’infrastructure
• Difficile à tester
• Indice de changement : BAD
• Simple
• Séparation Domaine / Présentation
• Out Of The Box avec Symfony2 Full Stack
Avantages Inconvénients
![Page 39: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/39.jpg)
ARCHITECTURE 3-TIERShttps://github.com/romainkuzniak/symfony-n-tiers
![Page 40: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/40.jpg)
John J. Donovan, Open Environment Corporation, 90’s
Grande popularité dans les applications de gestion
Objectifs :
Créer une application flexible
Indépendance entre la présentation, la logique du domaine et l’accès aux données
Principe :
Séparation en couches
Couche de présentation (Presentation Layer)
Couche de logique du domaine (Business Layer)
Couche d’accès aux données (Data Layer)
![Page 41: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/41.jpg)
Presentation
Controller VueData Business Service
![Page 42: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/42.jpg)
Data Layer (Accès aux données)
Contient les données (Entity)
Permet l’accès aux données (Repository)
Business Layer (métier)
Effectue le traitement
Règles métier
Règles applicatives
Presentation Layer
Controller
Vue
![Page 43: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/43.jpg)
DATA LAYER
![Page 44: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/44.jpg)
Entité = POPO
Sprint
![Page 45: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/45.jpg)
Sprint Repository
![Page 46: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/46.jpg)
BUSINESS LAYER
![Page 47: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/47.jpg)
Règles applicatives
Règles métier Sprint
Accès aux données
Règles métier Issue
Règles métier Sprint
Close Sprint
![Page 48: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/48.jpg)
Règles applicatives
Règles métier Sprint
Accès aux données
Règles métier Issue
Règles métier Sprint
Close Expected Sprint
![Page 49: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/49.jpg)
PRESENTATION LAYER
![Page 50: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/50.jpg)
Web Controller
![Page 51: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/51.jpg)
API Controller
![Page 52: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/52.jpg)
Command
![Page 53: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/53.jpg)
3-TIERS
• Ne propose pas de gestion séparée des règles métier et des règles applicatives
• => pas de réutilisabilité indépendante
• Pas de séparation de l’infrastructure
• Indice de changement : MEDIUM
• Séparation Data /Domaine / Présentation
• Out Of The Box avec Symfony2 Full Stack
Avantages Inconvénients
![Page 54: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/54.jpg)
DOMAIN DRIVEN DESIGNhttps://github.com/romainkuzniak/symfony-ddd
![Page 55: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/55.jpg)
Eric Evans, 2004
Objectifs :
Gérer des architectures complexes
Indépendance avec le framework
Indépendance avec l’UI
Indépendance avec la base de données
Testable
Principe :
Placer le domaine au centre de l’application
![Page 56: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/56.jpg)
Domain Layer
Application Layer
Presentation
Infrastructure
Entity Repository
Controller
Service
Repository Impl
View
Value Object Service
Service …
![Page 57: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/57.jpg)
Presentation Layer
Controller
Vue
Application Layer
Règles applicatives
Services
Domain Layer
Règles métiers :
Entity
Repository (Interface)
Infrastructure Layer
Service « technique »
Repository (Implémentation)
…
![Page 58: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/58.jpg)
CONCEPTS
Ubiquitous Language
Model Driven Design
Entities
Value Object
Aggregates
Services
Repositories
Cohabitation avec :
AOP
CQRS
![Page 59: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/59.jpg)
Les entités représentent les objets métiers et encapsulent les règles métiers
Les services (Application Layer) contiennent les règles applicatives (use cases …)
![Page 60: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/60.jpg)
DOMAIN LAYER
![Page 61: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/61.jpg)
Issue
![Page 62: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/62.jpg)
Sprint
![Page 63: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/63.jpg)
Repository
![Page 64: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/64.jpg)
APPLICATION LAYER
![Page 65: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/65.jpg)
Close SprintInjection de dépendances
AOP pour la gestion des transactions
![Page 66: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/66.jpg)
Close Expected Sprint
![Page 67: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/67.jpg)
PRESENTATION LAYER
![Page 68: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/68.jpg)
Web Controller
![Page 69: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/69.jpg)
Api Controller
![Page 70: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/70.jpg)
Command
![Page 71: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/71.jpg)
INFRASTRUCTURE LAYER
![Page 72: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/72.jpg)
Repository (Implémentation)
![Page 73: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/73.jpg)
DOMAIN DRIVEN DESIGN
• Beaucoup de classes
• Coût de développement
• Pas de SRP dans la couche application
• Indice de changement : GOOD
• Grande réutilisabilité
• Séparation métier /applicatif /présentation
• Séparation de l’infrastructure (Framework, DB …)
Avantages Inconvénients
![Page 74: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/74.jpg)
CLEAN ARCHITECTUREUSE CASE DRIVEN DESIGN / HEXAGONAL ARCHITECTURE /
PORTS AND ADAPTERShttps://github.com/romainkuzniak/symfony-clean-
architecture
![Page 75: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/75.jpg)
Robert C. Martin, 2008
Aggregation des travaux d’Ivar Jacobson (UseCase Driven Design, 1992) ou d’Alistair Cockburn (Hexagonal Architecture, Ports and Adapters, 2005)
Objectifs :
Gérer des architectures complexes
Indépendance avec le framework
Indépendance avec l’UI
Indépendance avec la base de données
Testable
Principes :
Placer le domaine au centre de l’application
Communication entre les couches à travers des abstractions
Application des principes S.O.L.I.D
Architecture révélant son intention
![Page 76: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/76.jpg)
Use Case
Controller
Presenter
View Model
View
Request Model
<I>Boundary
Response Model
<I>Boundary
<I>Entity Gateway
<A>Entity
Entity Implementation
Gateway Implementation
![Page 77: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/77.jpg)
PRINCIPES
Les entités représentent les objets métiers et encapsulent les règles métiers
Les Use Case contiennent les règles spécifiques à l’application
Les dépendances sont dans le sens opposé au flux de contrôle
Grande utilisation des abstractions et des mécanismes associés (Classes abstraites, Interfaces, Factories, Builder, DI …)
Seules des structures simples traversent les frontières
![Page 78: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/78.jpg)
ENTITÉ
![Page 79: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/79.jpg)
Sprint (Abstract)
![Page 80: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/80.jpg)
Sprint (Implémentation)
![Page 81: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/81.jpg)
GATEWAY
![Page 82: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/82.jpg)
Sprint Gateway
![Page 83: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/83.jpg)
Sprint Repository
![Page 84: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/84.jpg)
USE CASE
![Page 85: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/85.jpg)
Close Sprint
![Page 86: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/86.jpg)
Close Sprint Response
![Page 87: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/87.jpg)
Close Sprint Response DTO
![Page 88: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/88.jpg)
Close Expected Sprint
![Page 89: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/89.jpg)
CONTROLLER
![Page 90: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/90.jpg)
Web Controller
![Page 91: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/91.jpg)
Api Controller
![Page 92: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/92.jpg)
Command
![Page 93: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/93.jpg)
CLEAN ARCHITECTURE
• Encore plus de classes
• Coût de développement
• Peu de littérature
• Indice de changement : EXCELLENT
• Grande réutilisabilité
• Séparation data / métier /applicatif /présentation
• Séparation de l’infrastructure (Framework, DB …)
• Principes S.O.L.I.D
• Architecture montrant son intention
Avantages Inconvénients
![Page 94: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/94.jpg)
RETOUR D’EXPÉRIENCE SUR OPENCLASSROOMS
![Page 95: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/95.jpg)
CONTEXTE
Grosse application web
Grande complexité fonctionnelle
Agilité dans l’essence de l’entreprise
Mauvais design de base (hybride entre MVC et 3-tiers)
Tests très lents
Baisse constante de la qualité et de la productivité
![Page 96: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/96.jpg)
MISE EN OEUVRE
Mise en place progressive depuis un an
Passage du MVC, au 3-tiers, au DDD puis à la Clean Architecture
Difficultés suite à l’absence de documentation
Grande exigence demandée aux développeurs
![Page 97: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/97.jpg)
BILAN
Amélioration dans la confiance en l’application
Réussite dans la désormais constance de la productivité
Correspond à notre besoin
![Page 98: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/98.jpg)
DOIS-JE MIGRER VERS LA CLEAN ARCHITECTURE ?
Il faut être pragmatique :
Quelle taille d’application ?
Quelle durée de développement ?
Utiliser les principes du refactoring et la BoyScout Rule
![Page 99: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/99.jpg)
Evolution de la productivité
MVC n-tiers DDD Clean Architecture
![Page 100: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/100.jpg)
BIBLIOGRAPHIE
![Page 101: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/101.jpg)
Design :
Design Patterns:Elements of Reusable Object-Oriented Software. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Addison-Wesley. 1994.
http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf
Domain Driven Design
Domain-Driven Design: Tackling Complexity in the Heart of Software. Eric Evans. Addison-Wesley. 2004.
http://dddcommunity.org/
Clean Architecture
Object-Oriented software engineering: A use case driven approach. Ivar Jacobson Addison Wesley Professional (1992)
http://alistair.cockburn.us/Hexagonal+architecture
http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
https://www.youtube.com/watch?v=WpkDN78P884
Clean Code: A Handbook of Agile Software Craftsmanship. Robert C. Martin. Prentice Hall PTR. 2008.
![Page 102: Design applicatif avec symfony2](https://reader033.fdocument.pub/reader033/viewer/2022050922/55a64b751a28ab07038b45fa/html5/thumbnails/102.jpg)
MERCI