SlideShare une entreprise Scribd logo
1  sur  15
J'ai mis du DDD et du BDD
dans ma marmite
Présentation
●

Florent Chardonnereau

●

Ingénieur Logiciel depuis 12 ans

●

Agile depuis 6 ans

●

DDD depuis 1,5 ans

●

Twitter : @fchardon
Domain Driven Design
●

Orienté sur le domaine

●

Ubuquitus Language

●

Entity = Identité + Etat + Comportement

●

Value Object = Immutable
Domain Driven Design :
Architecture en Oignon
Service

Domain

Test

e
ur
ct
ru
st
fra
In

Web
Domain Driven Design
Exemple : Projet eBiblio
●

User Stories :
–

●

En tant qu'adhérent, je veux louer un livre.

Identification des concepts
–
–

Adhérent, nom, prenom, numéroAdherent
Livre, auteur, titre, référence,etat
Domain Driven Design
Exemple : Entity
public class Adherent implements Entity {
private String nom;
private String prenom;
private NoAdherent noAdherent;
public Adherent(String nom, String prenom, NoAdherent noAdherent) {
super();
this.nom = nom;
this.prenom = prenom;
this.noAdherent = noAdherent;
}
Domain Driven Design
Exemple : ValueObject
// Le NoAdherent doit être du format [0-9]{3}
public class NoAdherent implements ValueObject {
private String numero;
public NoAdherent(String numero) {
if (new RegleValidationNoAdherent(numero).valider()) {
this.numero = numero;
}
}
}
Oui et maintenant !
Comment rendre mes spécifications
exécutables ?
Behavior Driven Developement
●

TDD Orienté sur le comportement

●

Utilise le DDD

●

Basé sur le principe du Given, When Then
BDD avec JBehave
Story :
Louer_un_livre.story
Story launcher :
eBiblioStoryEmbedder.java
Step :
GererLivreSteps.java
BDD :
Projet eBiblio
●

User Story :
–

●

En tant qu'adhérent, je veux louer un livre

Louer_un_livre.story
–
–
–
–
–

Etant donné que l'adhérent 123 existe.
Etant donné que le livre aaa est disponible.
Quand l'adhérent 123 loue le livre aaa
Alors le livre est en état LOUE.
Alors l'adhérent à loué 1 livre.
public class GererLivreSteps {

BDD et JBehave
Projet eBiblio

@Given("mon adhérent %noAdherent existe.")
@Pending
public void givenMonAdherentExiste(String noAdherent) {
}
@Given("mon livre référence %reference est disponible.")
@Pending
public void givenMonLivreReferenceEstDisponible(String reference) {
}
@When("l'adhérent loue le livre.")
@Pending
public void whenLadherentLoueLeLivre() {
}
@Then("le livre est loué.")
public void thenLeLivreEstLoue() {
}

}

@Then("l'adhérent a loué %nombre livre.")
public void thenLadherentALoueLivres(int nombre) {
}
DDD et BDD
Retour d'expérience
●

Les plus
●
●

Prise de conscience du métier de la complexité

●

Rapproche les devs du métiers

●

Test d'acceptance (test fonctionnels)

●

Robustesse vis à vis du changement

●

●

Facilité de mise en œuvre d'un métier complexe

Facilité du code à prendre en main

Les moins
●

Change la manière de coder (finit le CRUD)

●

Besoin de bons développeurs

●

On peut lâcher facilement

●

Besoin d'une organisation « Agile »
Références
●

Site
●
●

●

DDDSample : http://dddsample.sourceforge.net/
Projet eBiblio : https://github.com/fchardon/eBiblio

Livre
●
●

●

Domain Driven Design Quickly
Domain Driven Design : Tackling Complexity in the Heart of Software
(Eric Evans)
Implementing Domain-Driven Design (Vaughn Veron)
Et maintenant y a plus qu'a...

Contenu connexe

Dernier

La nouvelle femme . pptx Film français
La   nouvelle   femme  . pptx  Film françaisLa   nouvelle   femme  . pptx  Film français
La nouvelle femme . pptx Film françaisTxaruka
 
A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.Franck Apolis
 
gestion des conflits dans les entreprises
gestion des  conflits dans les entreprisesgestion des  conflits dans les entreprises
gestion des conflits dans les entreprisesMajdaKtiri2
 
Mécanique Automobile LE TURBOCOMPRESSEUR.ppt
Mécanique Automobile LE TURBOCOMPRESSEUR.pptMécanique Automobile LE TURBOCOMPRESSEUR.ppt
Mécanique Automobile LE TURBOCOMPRESSEUR.pptssusercbaa22
 
Sidonie au Japon . pptx Un film français
Sidonie    au   Japon  .  pptx  Un film françaisSidonie    au   Japon  .  pptx  Un film français
Sidonie au Japon . pptx Un film françaisTxaruka
 
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptxSAID MASHATE
 
Bolero. pptx . Film de A nnne Fontaine
Bolero. pptx . Film   de  A nnne FontaineBolero. pptx . Film   de  A nnne Fontaine
Bolero. pptx . Film de A nnne FontaineTxaruka
 
MaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptMaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptssusercbaa22
 
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...M2i Formation
 
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxApproche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxssusercbaa22
 
Cours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdfCours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdfachrafbrahimi1
 
Boléro. pptx Film français réalisé par une femme.
Boléro.  pptx   Film   français   réalisé  par une  femme.Boléro.  pptx   Film   français   réalisé  par une  femme.
Boléro. pptx Film français réalisé par une femme.Txaruka
 
presentation l'interactionnisme symbolique finale.pptx
presentation l'interactionnisme symbolique  finale.pptxpresentation l'interactionnisme symbolique  finale.pptx
presentation l'interactionnisme symbolique finale.pptxMalikaIdseaid1
 
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptxSUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptxssuserbd075f
 
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfCOURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfabatanebureau
 

Dernier (16)

La nouvelle femme . pptx Film français
La   nouvelle   femme  . pptx  Film françaisLa   nouvelle   femme  . pptx  Film français
La nouvelle femme . pptx Film français
 
A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.A3iFormations, organisme de formations certifié qualiopi.
A3iFormations, organisme de formations certifié qualiopi.
 
gestion des conflits dans les entreprises
gestion des  conflits dans les entreprisesgestion des  conflits dans les entreprises
gestion des conflits dans les entreprises
 
Mécanique Automobile LE TURBOCOMPRESSEUR.ppt
Mécanique Automobile LE TURBOCOMPRESSEUR.pptMécanique Automobile LE TURBOCOMPRESSEUR.ppt
Mécanique Automobile LE TURBOCOMPRESSEUR.ppt
 
Evaluación Alumnos de Ecole Victor Hugo
Evaluación Alumnos de Ecole  Victor HugoEvaluación Alumnos de Ecole  Victor Hugo
Evaluación Alumnos de Ecole Victor Hugo
 
Sidonie au Japon . pptx Un film français
Sidonie    au   Japon  .  pptx  Un film françaisSidonie    au   Japon  .  pptx  Un film français
Sidonie au Japon . pptx Un film français
 
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
666148532-Formation-Habilitation-ELECTRIQUE-ENTREPRISE-MARS-2017.pptx
 
Bolero. pptx . Film de A nnne Fontaine
Bolero. pptx . Film   de  A nnne FontaineBolero. pptx . Film   de  A nnne Fontaine
Bolero. pptx . Film de A nnne Fontaine
 
MaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.pptMaintenanceLa Maintenance Corrective.ppt
MaintenanceLa Maintenance Corrective.ppt
 
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
Formation M2i - Intelligence Artificielle Comment booster votre productivité ...
 
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptxApproche-des-risques-par-l’analyse-des-accidents-1.pptx
Approche-des-risques-par-l’analyse-des-accidents-1.pptx
 
Cours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdfCours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdf
 
Boléro. pptx Film français réalisé par une femme.
Boléro.  pptx   Film   français   réalisé  par une  femme.Boléro.  pptx   Film   français   réalisé  par une  femme.
Boléro. pptx Film français réalisé par une femme.
 
presentation l'interactionnisme symbolique finale.pptx
presentation l'interactionnisme symbolique  finale.pptxpresentation l'interactionnisme symbolique  finale.pptx
presentation l'interactionnisme symbolique finale.pptx
 
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptxSUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
SUPPORT DE SUR COURS_GOUVERNANCE_SI_M2.pptx
 
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdfCOURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
COURS SVT 3 EME ANNEE COLLEGE 2EME SEM.pdf
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

J'ai mis du DDD et du BDD dans ma marmite.

  • 1. J'ai mis du DDD et du BDD dans ma marmite
  • 2. Présentation ● Florent Chardonnereau ● Ingénieur Logiciel depuis 12 ans ● Agile depuis 6 ans ● DDD depuis 1,5 ans ● Twitter : @fchardon
  • 3. Domain Driven Design ● Orienté sur le domaine ● Ubuquitus Language ● Entity = Identité + Etat + Comportement ● Value Object = Immutable
  • 4. Domain Driven Design : Architecture en Oignon Service Domain Test e ur ct ru st fra In Web
  • 5. Domain Driven Design Exemple : Projet eBiblio ● User Stories : – ● En tant qu'adhérent, je veux louer un livre. Identification des concepts – – Adhérent, nom, prenom, numéroAdherent Livre, auteur, titre, référence,etat
  • 6. Domain Driven Design Exemple : Entity public class Adherent implements Entity { private String nom; private String prenom; private NoAdherent noAdherent; public Adherent(String nom, String prenom, NoAdherent noAdherent) { super(); this.nom = nom; this.prenom = prenom; this.noAdherent = noAdherent; }
  • 7. Domain Driven Design Exemple : ValueObject // Le NoAdherent doit être du format [0-9]{3} public class NoAdherent implements ValueObject { private String numero; public NoAdherent(String numero) { if (new RegleValidationNoAdherent(numero).valider()) { this.numero = numero; } } }
  • 9. Comment rendre mes spécifications exécutables ? Behavior Driven Developement ● TDD Orienté sur le comportement ● Utilise le DDD ● Basé sur le principe du Given, When Then
  • 10. BDD avec JBehave Story : Louer_un_livre.story Story launcher : eBiblioStoryEmbedder.java Step : GererLivreSteps.java
  • 11. BDD : Projet eBiblio ● User Story : – ● En tant qu'adhérent, je veux louer un livre Louer_un_livre.story – – – – – Etant donné que l'adhérent 123 existe. Etant donné que le livre aaa est disponible. Quand l'adhérent 123 loue le livre aaa Alors le livre est en état LOUE. Alors l'adhérent à loué 1 livre.
  • 12. public class GererLivreSteps { BDD et JBehave Projet eBiblio @Given("mon adhérent %noAdherent existe.") @Pending public void givenMonAdherentExiste(String noAdherent) { } @Given("mon livre référence %reference est disponible.") @Pending public void givenMonLivreReferenceEstDisponible(String reference) { } @When("l'adhérent loue le livre.") @Pending public void whenLadherentLoueLeLivre() { } @Then("le livre est loué.") public void thenLeLivreEstLoue() { } } @Then("l'adhérent a loué %nombre livre.") public void thenLadherentALoueLivres(int nombre) { }
  • 13. DDD et BDD Retour d'expérience ● Les plus ● ● Prise de conscience du métier de la complexité ● Rapproche les devs du métiers ● Test d'acceptance (test fonctionnels) ● Robustesse vis à vis du changement ● ● Facilité de mise en œuvre d'un métier complexe Facilité du code à prendre en main Les moins ● Change la manière de coder (finit le CRUD) ● Besoin de bons développeurs ● On peut lâcher facilement ● Besoin d'une organisation « Agile »
  • 14. Références ● Site ● ● ● DDDSample : http://dddsample.sourceforge.net/ Projet eBiblio : https://github.com/fchardon/eBiblio Livre ● ● ● Domain Driven Design Quickly Domain Driven Design : Tackling Complexity in the Heart of Software (Eric Evans) Implementing Domain-Driven Design (Vaughn Veron)
  • 15. Et maintenant y a plus qu'a...