[{"data":1,"prerenderedAt":24848},["ShallowReactive",2],{"search-api":-1,"listing-tag-clean-code-page-1":3},[4,2337,8209,13836,14287,15478,19095,23512],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"id":11,"date":12,"listed":13,"nocomments":7,"hidden":7,"categories":14,"tags":15,"cover":19,"readingTime":20,"body":25,"_type":2331,"_id":2332,"_source":2333,"_file":2334,"_stem":2335,"_extension":2336},"\u002Ffr\u002Fintelligence-artificielle\u002Ffaux-ami-code-claude-coute-cher","intelligence-artificielle",false,"","Le code Claude 'qui marche' est souvent celui qui vous coûte le plus cher","Démonstration chiffrée des 3 faux amis du code IA-généré : copier-coller invisible, abstractions accidentelles, sur-ingénierie. Et la règle YAGNI + AI.",65,"2026-05-13",true,[6],[16,17,18],"claude-code","clean-code","ia","covers\u002Farticles\u002Ffaux-ami-code-claude-coute-cher.jpg",{"text":21,"minutes":22,"time":23,"words":24},"14 min read",13.37,802200,2674,{"type":26,"children":27,"toc":2320},"root",[28,40,45,49,56,80,89,94,108,136,139,145,150,172,668,681,693,706,709,715,720,1127,1148,1153,1187,1192,1195,1208,1211,1217,1222,1734,1747,1752,1771,1774,1780,1785,1908,1913,1926,1929,1935,1940,1950,1967,1977,1987,1992,1995,2001,2006,2119,2146,2149,2155,2160,2165,2170,2183,2195,2198,2204,2219,2240,2253,2266,2279,2299,2302,2314],{"type":29,"tag":30,"props":31,"children":32},"element","p",{},[33],{"type":29,"tag":34,"props":35,"children":36},"strong",{},[37],{"type":38,"value":39},"text","En construisant crmcoaching avec Claude, j'ai vu ces 3 faux amis s'installer dans mes premiers commits bien avant d'avoir mis la discipline en place. Tests verts, ESLint au vert, tout compilait. Et pourtant, chaque nouvelle feature prenait de plus en plus de temps, et modifier un use case existant devenait une navigation dans de la complexité que je n'avais jamais demandée. Pas à cause d'une mauvaise architecture de départ. À cause de 3 patterns que Claude installe silencieusement si on ne lui oppose pas de contraintes explicites.",{"type":29,"tag":30,"props":41,"children":42},{},[43],{"type":38,"value":44},"Voici les 3 patterns que j'ai identifiés sur mes propres commits, les chiffres de leur coût caché, et la règle craft de 2026 qui les neutralise.",{"type":29,"tag":46,"props":47,"children":48},"hr",{},[],{"type":29,"tag":50,"props":51,"children":53},"h2",{"id":52},"le-mythe-du-ça-compile-cest-bon",[54],{"type":38,"value":55},"Le mythe du \"ça compile, c'est bon\"",{"type":29,"tag":30,"props":57,"children":58},{},[59,61,70,72,78],{"type":38,"value":60},"Le constat de base est documenté. Selon le ",{"type":29,"tag":62,"props":63,"children":67},"a",{"href":64,"rel":65},"https:\u002F\u002Fwww.gitclear.com\u002Fai_assistant_code_quality_2024_research",[66],"nofollow",[68],{"type":38,"value":69},"GitClear AI Copilot Code Quality Report 2024",{"type":38,"value":71},", sur les repos qui utilisent intensivement un assistant comme Claude, le ratio de code \"copié-collé\" a augmenté de 8 fois depuis 2022. La taille moyenne des PR a grossi de 12%. Le temps de revue par PR a baissé de 14%. Concrètement : on écrit plus, on revoit moins, on duplique plus, ce qui correspond exactement au pattern que je décris dans ",{"type":29,"tag":62,"props":73,"children":75},{"href":74},"\u002Ffr\u002Fintelligence-artificielle\u002Fia-code-review-retour-experience",[76],{"type":38,"value":77},"le retour d'expérience sur la code review IA",{"type":38,"value":79},".",{"type":29,"tag":30,"props":81,"children":82},{},[83],{"type":29,"tag":84,"props":85,"children":88},"img",{"alt":86,"src":87},"La gestion des leads dans crmcoaching, le SaaS que je développe avec Claude","\u002Fimages\u002Fcrm\u002Fcrm-coaching-lead.png",[],{"type":29,"tag":30,"props":90,"children":91},{},[92],{"type":38,"value":93},"Le piège, c'est que tout ça produit du code qui marche. Les tests passent. Les utilisateurs sont contents. ESLint ne crie pas. Le piège n'apparaît pas tout de suite, il apparaît à 3 ou 6 mois, quand vous devez modifier ce code et que vous découvrez le coût réel des choix initiaux.",{"type":29,"tag":95,"props":96,"children":97},"blockquote",{},[98],{"type":29,"tag":30,"props":99,"children":100},{},[101,106],{"type":29,"tag":34,"props":102,"children":103},{},[104],{"type":38,"value":105},"Ce que j'ai observé",{"type":38,"value":107}," : dans les premiers commits de crmcoaching, j'ai compté les fonctions dupliquées à plus de 70% de similarité. Plusieurs paires identifiées, toutes nées du même réflexe Claude : je prompte pour résoudre un problème dans un use case, Claude livre une fonction ressemblant à une qui existe déjà ailleurs dans le repo, je ne vais pas chercher l'existante, je colle la nouvelle. Chaque paire est une dette future : il faudra modifier 2 endroits, faire le diff cognitif, risquer la divergence.",{"type":29,"tag":30,"props":109,"children":110},{},[111,113,119,121,126,128,134],{"type":38,"value":112},"Donald Knuth avait écrit en 1974 que ",{"type":29,"tag":114,"props":115,"children":116},"em",{},[117],{"type":38,"value":118},"\"premature optimization is the root of all evil\"",{"type":38,"value":120},". Sa formule s'applique aussi à l'abstraction. En 2026, je dirais que ",{"type":29,"tag":114,"props":122,"children":123},{},[124],{"type":38,"value":125},"\"l'abstraction prématurée IA-générée est la racine du mal silencieux\"",{"type":38,"value":127},". Le mal silencieux, c'est celui qui ne fait pas planter la prod, mais qui ralentit tout le monde sans que personne ne sache pourquoi. C'est aussi ce qu'éclairent ",{"type":29,"tag":62,"props":129,"children":131},{"href":130},"\u002Ffr\u002Fdette-technique\u002Fclean-code-software-craftsmanship-principes-java",[132],{"type":38,"value":133},"les principes Clean Code et software craftsmanship",{"type":38,"value":135}," : la qualité ne se voit pas dans le code \"qui marche\", elle se voit dans le code \"qu'on peut modifier sans souffrir\".",{"type":29,"tag":46,"props":137,"children":138},{},[],{"type":29,"tag":50,"props":140,"children":142},{"id":141},"faux-ami-1-le-copier-coller-invisible",[143],{"type":38,"value":144},"Faux ami #1 : le copier-coller invisible",{"type":29,"tag":30,"props":146,"children":147},{},[148],{"type":38,"value":149},"C'est le plus fréquent et le plus sous-estimé. Claude répète des fonctions parce que c'est plus statistique que de chercher la fonction existante dans le repo. Le développeur l'accepte parce que le code \"marche\".",{"type":29,"tag":30,"props":151,"children":152},{},[153,155,162,164,170],{"type":38,"value":154},"Voici un exemple tiré de mes premiers commits sur crmcoaching. Deux use cases différents, ",{"type":29,"tag":156,"props":157,"children":159},"code",{"className":158},[],[160],{"type":38,"value":161},"CreateOffer",{"type":38,"value":163}," et ",{"type":29,"tag":156,"props":165,"children":167},{"className":166},[],[168],{"type":38,"value":169},"CreateMentoringCheckoutIntent",{"type":38,"value":171},", écrits à quelques semaines d'écart. Deux fonctions quasi identiques, à 6 fichiers de distance :",{"type":29,"tag":173,"props":174,"children":178},"pre",{"className":175,"code":176,"language":177,"meta":8,"style":8},"language-typescript shiki shiki-themes catppuccin-frappe github-dark","\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Foffer\u002Fuse-cases\u002Fcreate-offer.use-case.ts\nfunction computeMonthlyOfferPrice(\n  yearlyPrice: number,\n  fees: number,\n): number {\n  const subtotal = yearlyPrice \u002F 12;\n  const withFees = subtotal + fees \u002F 12;\n  return Math.round(withFees * 100) \u002F 100;\n}\n\n\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fmentoring\u002Fuse-cases\u002Fcreate-mentoring-checkout-intent.use-case.ts\nfunction calculateSubscriptionAmount(\n  annualAmount: number,\n  charges: number,\n): number {\n  const base = annualAmount \u002F 12;\n  const total = base + charges \u002F 12;\n  return Math.round(total * 100) \u002F 100;\n}\n","typescript",[179],{"type":29,"tag":156,"props":180,"children":181},{"__ignoreMap":8},[182,194,216,243,264,286,328,372,428,437,446,455,472,493,514,534,568,611,660],{"type":29,"tag":183,"props":184,"children":187},"span",{"class":185,"line":186},"line",1,[188],{"type":29,"tag":183,"props":189,"children":191},{"style":190},"--shiki-default:#737994;--shiki-default-font-style:italic;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit",[192],{"type":38,"value":193},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Foffer\u002Fuse-cases\u002Fcreate-offer.use-case.ts\n",{"type":29,"tag":183,"props":195,"children":197},{"class":185,"line":196},2,[198,204,210],{"type":29,"tag":183,"props":199,"children":201},{"style":200},"--shiki-default:#CA9EE6;--shiki-dark:#F97583",[202],{"type":38,"value":203},"function",{"type":29,"tag":183,"props":205,"children":207},{"style":206},"--shiki-default:#8CAAEE;--shiki-default-font-style:italic;--shiki-dark:#B392F0;--shiki-dark-font-style:inherit",[208],{"type":38,"value":209}," computeMonthlyOfferPrice",{"type":29,"tag":183,"props":211,"children":213},{"style":212},"--shiki-default:#949CBB;--shiki-dark:#E1E4E8",[214],{"type":38,"value":215},"(\n",{"type":29,"tag":183,"props":217,"children":219},{"class":185,"line":218},3,[220,226,232,238],{"type":29,"tag":183,"props":221,"children":223},{"style":222},"--shiki-default:#EA999C;--shiki-default-font-style:italic;--shiki-dark:#FFAB70;--shiki-dark-font-style:inherit",[224],{"type":38,"value":225},"  yearlyPrice",{"type":29,"tag":183,"props":227,"children":229},{"style":228},"--shiki-default:#81C8BE;--shiki-dark:#F97583",[230],{"type":38,"value":231},":",{"type":29,"tag":183,"props":233,"children":235},{"style":234},"--shiki-default:#CA9EE6;--shiki-dark:#79B8FF",[236],{"type":38,"value":237}," number",{"type":29,"tag":183,"props":239,"children":240},{"style":212},[241],{"type":38,"value":242},",\n",{"type":29,"tag":183,"props":244,"children":246},{"class":185,"line":245},4,[247,252,256,260],{"type":29,"tag":183,"props":248,"children":249},{"style":222},[250],{"type":38,"value":251},"  fees",{"type":29,"tag":183,"props":253,"children":254},{"style":228},[255],{"type":38,"value":231},{"type":29,"tag":183,"props":257,"children":258},{"style":234},[259],{"type":38,"value":237},{"type":29,"tag":183,"props":261,"children":262},{"style":212},[263],{"type":38,"value":242},{"type":29,"tag":183,"props":265,"children":267},{"class":185,"line":266},5,[268,273,277,281],{"type":29,"tag":183,"props":269,"children":270},{"style":212},[271],{"type":38,"value":272},")",{"type":29,"tag":183,"props":274,"children":275},{"style":228},[276],{"type":38,"value":231},{"type":29,"tag":183,"props":278,"children":279},{"style":234},[280],{"type":38,"value":237},{"type":29,"tag":183,"props":282,"children":283},{"style":212},[284],{"type":38,"value":285}," {\n",{"type":29,"tag":183,"props":287,"children":289},{"class":185,"line":288},6,[290,295,301,306,312,317,323],{"type":29,"tag":183,"props":291,"children":292},{"style":200},[293],{"type":38,"value":294},"  const",{"type":29,"tag":183,"props":296,"children":298},{"style":297},"--shiki-default:#C6D0F5;--shiki-dark:#79B8FF",[299],{"type":38,"value":300}," subtotal",{"type":29,"tag":183,"props":302,"children":303},{"style":228},[304],{"type":38,"value":305}," =",{"type":29,"tag":183,"props":307,"children":309},{"style":308},"--shiki-default:#C6D0F5;--shiki-dark:#E1E4E8",[310],{"type":38,"value":311}," yearlyPrice ",{"type":29,"tag":183,"props":313,"children":314},{"style":228},[315],{"type":38,"value":316},"\u002F",{"type":29,"tag":183,"props":318,"children":320},{"style":319},"--shiki-default:#EF9F76;--shiki-dark:#79B8FF",[321],{"type":38,"value":322}," 12",{"type":29,"tag":183,"props":324,"children":325},{"style":212},[326],{"type":38,"value":327},";\n",{"type":29,"tag":183,"props":329,"children":331},{"class":185,"line":330},7,[332,336,341,345,350,355,360,364,368],{"type":29,"tag":183,"props":333,"children":334},{"style":200},[335],{"type":38,"value":294},{"type":29,"tag":183,"props":337,"children":338},{"style":297},[339],{"type":38,"value":340}," withFees",{"type":29,"tag":183,"props":342,"children":343},{"style":228},[344],{"type":38,"value":305},{"type":29,"tag":183,"props":346,"children":347},{"style":308},[348],{"type":38,"value":349}," subtotal ",{"type":29,"tag":183,"props":351,"children":352},{"style":228},[353],{"type":38,"value":354},"+",{"type":29,"tag":183,"props":356,"children":357},{"style":308},[358],{"type":38,"value":359}," fees ",{"type":29,"tag":183,"props":361,"children":362},{"style":228},[363],{"type":38,"value":316},{"type":29,"tag":183,"props":365,"children":366},{"style":319},[367],{"type":38,"value":322},{"type":29,"tag":183,"props":369,"children":370},{"style":212},[371],{"type":38,"value":327},{"type":29,"tag":183,"props":373,"children":375},{"class":185,"line":374},8,[376,381,386,391,396,401,406,411,416,420,424],{"type":29,"tag":183,"props":377,"children":378},{"style":200},[379],{"type":38,"value":380},"  return",{"type":29,"tag":183,"props":382,"children":383},{"style":308},[384],{"type":38,"value":385}," Math",{"type":29,"tag":183,"props":387,"children":389},{"style":388},"--shiki-default:#81C8BE;--shiki-dark:#E1E4E8",[390],{"type":38,"value":79},{"type":29,"tag":183,"props":392,"children":393},{"style":206},[394],{"type":38,"value":395},"round",{"type":29,"tag":183,"props":397,"children":398},{"style":308},[399],{"type":38,"value":400},"(withFees ",{"type":29,"tag":183,"props":402,"children":403},{"style":228},[404],{"type":38,"value":405},"*",{"type":29,"tag":183,"props":407,"children":408},{"style":319},[409],{"type":38,"value":410}," 100",{"type":29,"tag":183,"props":412,"children":413},{"style":308},[414],{"type":38,"value":415},") ",{"type":29,"tag":183,"props":417,"children":418},{"style":228},[419],{"type":38,"value":316},{"type":29,"tag":183,"props":421,"children":422},{"style":319},[423],{"type":38,"value":410},{"type":29,"tag":183,"props":425,"children":426},{"style":212},[427],{"type":38,"value":327},{"type":29,"tag":183,"props":429,"children":431},{"class":185,"line":430},9,[432],{"type":29,"tag":183,"props":433,"children":434},{"style":212},[435],{"type":38,"value":436},"}\n",{"type":29,"tag":183,"props":438,"children":440},{"class":185,"line":439},10,[441],{"type":29,"tag":183,"props":442,"children":443},{"emptyLinePlaceholder":13},[444],{"type":38,"value":445},"\n",{"type":29,"tag":183,"props":447,"children":449},{"class":185,"line":448},11,[450],{"type":29,"tag":183,"props":451,"children":452},{"style":190},[453],{"type":38,"value":454},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fmentoring\u002Fuse-cases\u002Fcreate-mentoring-checkout-intent.use-case.ts\n",{"type":29,"tag":183,"props":456,"children":458},{"class":185,"line":457},12,[459,463,468],{"type":29,"tag":183,"props":460,"children":461},{"style":200},[462],{"type":38,"value":203},{"type":29,"tag":183,"props":464,"children":465},{"style":206},[466],{"type":38,"value":467}," calculateSubscriptionAmount",{"type":29,"tag":183,"props":469,"children":470},{"style":212},[471],{"type":38,"value":215},{"type":29,"tag":183,"props":473,"children":475},{"class":185,"line":474},13,[476,481,485,489],{"type":29,"tag":183,"props":477,"children":478},{"style":222},[479],{"type":38,"value":480},"  annualAmount",{"type":29,"tag":183,"props":482,"children":483},{"style":228},[484],{"type":38,"value":231},{"type":29,"tag":183,"props":486,"children":487},{"style":234},[488],{"type":38,"value":237},{"type":29,"tag":183,"props":490,"children":491},{"style":212},[492],{"type":38,"value":242},{"type":29,"tag":183,"props":494,"children":496},{"class":185,"line":495},14,[497,502,506,510],{"type":29,"tag":183,"props":498,"children":499},{"style":222},[500],{"type":38,"value":501},"  charges",{"type":29,"tag":183,"props":503,"children":504},{"style":228},[505],{"type":38,"value":231},{"type":29,"tag":183,"props":507,"children":508},{"style":234},[509],{"type":38,"value":237},{"type":29,"tag":183,"props":511,"children":512},{"style":212},[513],{"type":38,"value":242},{"type":29,"tag":183,"props":515,"children":517},{"class":185,"line":516},15,[518,522,526,530],{"type":29,"tag":183,"props":519,"children":520},{"style":212},[521],{"type":38,"value":272},{"type":29,"tag":183,"props":523,"children":524},{"style":228},[525],{"type":38,"value":231},{"type":29,"tag":183,"props":527,"children":528},{"style":234},[529],{"type":38,"value":237},{"type":29,"tag":183,"props":531,"children":532},{"style":212},[533],{"type":38,"value":285},{"type":29,"tag":183,"props":535,"children":537},{"class":185,"line":536},16,[538,542,547,551,556,560,564],{"type":29,"tag":183,"props":539,"children":540},{"style":200},[541],{"type":38,"value":294},{"type":29,"tag":183,"props":543,"children":544},{"style":297},[545],{"type":38,"value":546}," base",{"type":29,"tag":183,"props":548,"children":549},{"style":228},[550],{"type":38,"value":305},{"type":29,"tag":183,"props":552,"children":553},{"style":308},[554],{"type":38,"value":555}," annualAmount ",{"type":29,"tag":183,"props":557,"children":558},{"style":228},[559],{"type":38,"value":316},{"type":29,"tag":183,"props":561,"children":562},{"style":319},[563],{"type":38,"value":322},{"type":29,"tag":183,"props":565,"children":566},{"style":212},[567],{"type":38,"value":327},{"type":29,"tag":183,"props":569,"children":571},{"class":185,"line":570},17,[572,576,581,585,590,594,599,603,607],{"type":29,"tag":183,"props":573,"children":574},{"style":200},[575],{"type":38,"value":294},{"type":29,"tag":183,"props":577,"children":578},{"style":297},[579],{"type":38,"value":580}," total",{"type":29,"tag":183,"props":582,"children":583},{"style":228},[584],{"type":38,"value":305},{"type":29,"tag":183,"props":586,"children":587},{"style":308},[588],{"type":38,"value":589}," base ",{"type":29,"tag":183,"props":591,"children":592},{"style":228},[593],{"type":38,"value":354},{"type":29,"tag":183,"props":595,"children":596},{"style":308},[597],{"type":38,"value":598}," charges ",{"type":29,"tag":183,"props":600,"children":601},{"style":228},[602],{"type":38,"value":316},{"type":29,"tag":183,"props":604,"children":605},{"style":319},[606],{"type":38,"value":322},{"type":29,"tag":183,"props":608,"children":609},{"style":212},[610],{"type":38,"value":327},{"type":29,"tag":183,"props":612,"children":614},{"class":185,"line":613},18,[615,619,623,627,631,636,640,644,648,652,656],{"type":29,"tag":183,"props":616,"children":617},{"style":200},[618],{"type":38,"value":380},{"type":29,"tag":183,"props":620,"children":621},{"style":308},[622],{"type":38,"value":385},{"type":29,"tag":183,"props":624,"children":625},{"style":388},[626],{"type":38,"value":79},{"type":29,"tag":183,"props":628,"children":629},{"style":206},[630],{"type":38,"value":395},{"type":29,"tag":183,"props":632,"children":633},{"style":308},[634],{"type":38,"value":635},"(total ",{"type":29,"tag":183,"props":637,"children":638},{"style":228},[639],{"type":38,"value":405},{"type":29,"tag":183,"props":641,"children":642},{"style":319},[643],{"type":38,"value":410},{"type":29,"tag":183,"props":645,"children":646},{"style":308},[647],{"type":38,"value":415},{"type":29,"tag":183,"props":649,"children":650},{"style":228},[651],{"type":38,"value":316},{"type":29,"tag":183,"props":653,"children":654},{"style":319},[655],{"type":38,"value":410},{"type":29,"tag":183,"props":657,"children":658},{"style":212},[659],{"type":38,"value":327},{"type":29,"tag":183,"props":661,"children":663},{"class":185,"line":662},19,[664],{"type":29,"tag":183,"props":665,"children":666},{"style":212},[667],{"type":38,"value":436},{"type":29,"tag":30,"props":669,"children":670},{},[671,673,679],{"type":38,"value":672},"Même calcul, deux noms, deux fichiers, deux tests, deux maintenances. Le jour où la logique d'arrondi change (par exemple passer à ",{"type":29,"tag":156,"props":674,"children":676},{"className":675},[],[677],{"type":38,"value":678},"Math.ceil",{"type":38,"value":680}," pour la comptabilité), il faut retrouver les 2 endroits. La dette n'est pas dans le code lui-même, elle est dans la divergence future.",{"type":29,"tag":30,"props":682,"children":683},{},[684,686,691],{"type":38,"value":685},"Le contre-pattern craft : avant chaque PR, je demande explicitement à Claude ",{"type":29,"tag":114,"props":687,"children":688},{},[689],{"type":38,"value":690},"\"cherche dans le repo s'il existe déjà une fonction équivalente à ce que tu viens d'écrire, et propose une refacto qui mutualise\"",{"type":38,"value":692},". Claude fait ce travail très bien si on le lui demande. Il ne le fait jamais spontanément. Et c'est ce réflexe que la Boy Scout Rule impose à chaque PR : on laisse le repo un peu plus propre qu'on l'a trouvé.",{"type":29,"tag":30,"props":694,"children":695},{},[696,698,704],{"type":38,"value":697},"Sur le crmcoaching, j'ai aujourd'hui 3 utilitaires de calcul financier dans ",{"type":29,"tag":156,"props":699,"children":701},{"className":700},[],[702],{"type":38,"value":703},"packages\u002Fshared",{"type":38,"value":705},". Sur un repo équivalent IA-heavy non audité, j'en aurais vu 12 à 15. La différence se voit au bout de 12 mois sur le temps de modification.",{"type":29,"tag":46,"props":707,"children":708},{},[],{"type":29,"tag":50,"props":710,"children":712},{"id":711},"faux-ami-2-les-abstractions-accidentelles",[713],{"type":38,"value":714},"Faux ami #2 : les abstractions accidentelles",{"type":29,"tag":30,"props":716,"children":717},{},[718],{"type":38,"value":719},"Le deuxième faux ami est plus subtil. Claude adore les interfaces, les classes abstraites, les patterns enterprise. Si vous lui demandez un service de notation de leads, il vous livre, sur un projet NestJS :",{"type":29,"tag":173,"props":721,"children":723},{"className":175,"code":722,"language":177,"meta":8,"style":8},"\u002F\u002F 1. L'interface\nexport interface LeadScorer {\n  score(lead: Lead): number;\n}\n\n\u002F\u002F 2. L'unique implémentation, déjà injectable via @Injectable()\n@Injectable()\nexport class StandardLeadScorer implements LeadScorer {\n  score(lead: Lead): number {\n    return lead.interactionCount * 10 + (lead.hasEmail ? 20 : 0);\n  }\n}\n\n\u002F\u002F 3. La factory superflue, jamais utilisée par le DI NestJS\nexport class LeadScorerFactory {\n  static create(type: string): LeadScorer {\n    return new StandardLeadScorer();\n  }\n}\n",[724],{"type":29,"tag":156,"props":725,"children":726},{"__ignoreMap":8},[727,735,758,801,808,815,823,843,873,912,990,998,1005,1012,1020,1040,1087,1113,1120],{"type":29,"tag":183,"props":728,"children":729},{"class":185,"line":186},[730],{"type":29,"tag":183,"props":731,"children":732},{"style":190},[733],{"type":38,"value":734},"\u002F\u002F 1. L'interface\n",{"type":29,"tag":183,"props":736,"children":737},{"class":185,"line":196},[738,743,748,754],{"type":29,"tag":183,"props":739,"children":740},{"style":200},[741],{"type":38,"value":742},"export",{"type":29,"tag":183,"props":744,"children":745},{"style":200},[746],{"type":38,"value":747}," interface",{"type":29,"tag":183,"props":749,"children":751},{"style":750},"--shiki-default:#E5C890;--shiki-default-font-style:italic;--shiki-dark:#B392F0;--shiki-dark-font-style:inherit",[752],{"type":38,"value":753}," LeadScorer",{"type":29,"tag":183,"props":755,"children":756},{"style":212},[757],{"type":38,"value":285},{"type":29,"tag":183,"props":759,"children":760},{"class":185,"line":218},[761,766,771,776,780,785,789,793,797],{"type":29,"tag":183,"props":762,"children":763},{"style":206},[764],{"type":38,"value":765},"  score",{"type":29,"tag":183,"props":767,"children":768},{"style":212},[769],{"type":38,"value":770},"(",{"type":29,"tag":183,"props":772,"children":773},{"style":222},[774],{"type":38,"value":775},"lead",{"type":29,"tag":183,"props":777,"children":778},{"style":228},[779],{"type":38,"value":231},{"type":29,"tag":183,"props":781,"children":782},{"style":750},[783],{"type":38,"value":784}," Lead",{"type":29,"tag":183,"props":786,"children":787},{"style":212},[788],{"type":38,"value":272},{"type":29,"tag":183,"props":790,"children":791},{"style":228},[792],{"type":38,"value":231},{"type":29,"tag":183,"props":794,"children":795},{"style":234},[796],{"type":38,"value":237},{"type":29,"tag":183,"props":798,"children":799},{"style":212},[800],{"type":38,"value":327},{"type":29,"tag":183,"props":802,"children":803},{"class":185,"line":245},[804],{"type":29,"tag":183,"props":805,"children":806},{"style":212},[807],{"type":38,"value":436},{"type":29,"tag":183,"props":809,"children":810},{"class":185,"line":266},[811],{"type":29,"tag":183,"props":812,"children":813},{"emptyLinePlaceholder":13},[814],{"type":38,"value":445},{"type":29,"tag":183,"props":816,"children":817},{"class":185,"line":288},[818],{"type":29,"tag":183,"props":819,"children":820},{"style":190},[821],{"type":38,"value":822},"\u002F\u002F 2. L'unique implémentation, déjà injectable via @Injectable()\n",{"type":29,"tag":183,"props":824,"children":825},{"class":185,"line":330},[826,832,837],{"type":29,"tag":183,"props":827,"children":829},{"style":828},"--shiki-default:#8CAAEE;--shiki-default-font-style:italic;--shiki-dark:#E1E4E8;--shiki-dark-font-style:inherit",[830],{"type":38,"value":831},"@",{"type":29,"tag":183,"props":833,"children":834},{"style":206},[835],{"type":38,"value":836},"Injectable",{"type":29,"tag":183,"props":838,"children":840},{"style":839},"--shiki-default:#EF9F76;--shiki-dark:#E1E4E8",[841],{"type":38,"value":842},"()\n",{"type":29,"tag":183,"props":844,"children":845},{"class":185,"line":374},[846,850,855,860,865,869],{"type":29,"tag":183,"props":847,"children":848},{"style":200},[849],{"type":38,"value":742},{"type":29,"tag":183,"props":851,"children":852},{"style":200},[853],{"type":38,"value":854}," class",{"type":29,"tag":183,"props":856,"children":857},{"style":750},[858],{"type":38,"value":859}," StandardLeadScorer",{"type":29,"tag":183,"props":861,"children":862},{"style":200},[863],{"type":38,"value":864}," implements",{"type":29,"tag":183,"props":866,"children":867},{"style":750},[868],{"type":38,"value":753},{"type":29,"tag":183,"props":870,"children":871},{"style":212},[872],{"type":38,"value":285},{"type":29,"tag":183,"props":874,"children":875},{"class":185,"line":430},[876,880,884,888,892,896,900,904,908],{"type":29,"tag":183,"props":877,"children":878},{"style":206},[879],{"type":38,"value":765},{"type":29,"tag":183,"props":881,"children":882},{"style":212},[883],{"type":38,"value":770},{"type":29,"tag":183,"props":885,"children":886},{"style":222},[887],{"type":38,"value":775},{"type":29,"tag":183,"props":889,"children":890},{"style":228},[891],{"type":38,"value":231},{"type":29,"tag":183,"props":893,"children":894},{"style":750},[895],{"type":38,"value":784},{"type":29,"tag":183,"props":897,"children":898},{"style":212},[899],{"type":38,"value":272},{"type":29,"tag":183,"props":901,"children":902},{"style":228},[903],{"type":38,"value":231},{"type":29,"tag":183,"props":905,"children":906},{"style":234},[907],{"type":38,"value":237},{"type":29,"tag":183,"props":909,"children":910},{"style":212},[911],{"type":38,"value":285},{"type":29,"tag":183,"props":913,"children":914},{"class":185,"line":439},[915,920,925,929,934,938,943,948,953,957,962,967,972,977,982,986],{"type":29,"tag":183,"props":916,"children":917},{"style":200},[918],{"type":38,"value":919},"    return",{"type":29,"tag":183,"props":921,"children":922},{"style":308},[923],{"type":38,"value":924}," lead",{"type":29,"tag":183,"props":926,"children":927},{"style":388},[928],{"type":38,"value":79},{"type":29,"tag":183,"props":930,"children":931},{"style":308},[932],{"type":38,"value":933},"interactionCount ",{"type":29,"tag":183,"props":935,"children":936},{"style":228},[937],{"type":38,"value":405},{"type":29,"tag":183,"props":939,"children":940},{"style":319},[941],{"type":38,"value":942}," 10",{"type":29,"tag":183,"props":944,"children":945},{"style":228},[946],{"type":38,"value":947}," +",{"type":29,"tag":183,"props":949,"children":950},{"style":308},[951],{"type":38,"value":952}," (lead",{"type":29,"tag":183,"props":954,"children":955},{"style":388},[956],{"type":38,"value":79},{"type":29,"tag":183,"props":958,"children":959},{"style":308},[960],{"type":38,"value":961},"hasEmail ",{"type":29,"tag":183,"props":963,"children":964},{"style":228},[965],{"type":38,"value":966},"?",{"type":29,"tag":183,"props":968,"children":969},{"style":319},[970],{"type":38,"value":971}," 20",{"type":29,"tag":183,"props":973,"children":974},{"style":228},[975],{"type":38,"value":976}," :",{"type":29,"tag":183,"props":978,"children":979},{"style":319},[980],{"type":38,"value":981}," 0",{"type":29,"tag":183,"props":983,"children":984},{"style":308},[985],{"type":38,"value":272},{"type":29,"tag":183,"props":987,"children":988},{"style":212},[989],{"type":38,"value":327},{"type":29,"tag":183,"props":991,"children":992},{"class":185,"line":448},[993],{"type":29,"tag":183,"props":994,"children":995},{"style":212},[996],{"type":38,"value":997},"  }\n",{"type":29,"tag":183,"props":999,"children":1000},{"class":185,"line":457},[1001],{"type":29,"tag":183,"props":1002,"children":1003},{"style":212},[1004],{"type":38,"value":436},{"type":29,"tag":183,"props":1006,"children":1007},{"class":185,"line":474},[1008],{"type":29,"tag":183,"props":1009,"children":1010},{"emptyLinePlaceholder":13},[1011],{"type":38,"value":445},{"type":29,"tag":183,"props":1013,"children":1014},{"class":185,"line":495},[1015],{"type":29,"tag":183,"props":1016,"children":1017},{"style":190},[1018],{"type":38,"value":1019},"\u002F\u002F 3. La factory superflue, jamais utilisée par le DI NestJS\n",{"type":29,"tag":183,"props":1021,"children":1022},{"class":185,"line":516},[1023,1027,1031,1036],{"type":29,"tag":183,"props":1024,"children":1025},{"style":200},[1026],{"type":38,"value":742},{"type":29,"tag":183,"props":1028,"children":1029},{"style":200},[1030],{"type":38,"value":854},{"type":29,"tag":183,"props":1032,"children":1033},{"style":750},[1034],{"type":38,"value":1035}," LeadScorerFactory",{"type":29,"tag":183,"props":1037,"children":1038},{"style":212},[1039],{"type":38,"value":285},{"type":29,"tag":183,"props":1041,"children":1042},{"class":185,"line":536},[1043,1048,1053,1057,1062,1066,1071,1075,1079,1083],{"type":29,"tag":183,"props":1044,"children":1045},{"style":200},[1046],{"type":38,"value":1047},"  static",{"type":29,"tag":183,"props":1049,"children":1050},{"style":206},[1051],{"type":38,"value":1052}," create",{"type":29,"tag":183,"props":1054,"children":1055},{"style":212},[1056],{"type":38,"value":770},{"type":29,"tag":183,"props":1058,"children":1059},{"style":222},[1060],{"type":38,"value":1061},"type",{"type":29,"tag":183,"props":1063,"children":1064},{"style":228},[1065],{"type":38,"value":231},{"type":29,"tag":183,"props":1067,"children":1068},{"style":234},[1069],{"type":38,"value":1070}," string",{"type":29,"tag":183,"props":1072,"children":1073},{"style":212},[1074],{"type":38,"value":272},{"type":29,"tag":183,"props":1076,"children":1077},{"style":228},[1078],{"type":38,"value":231},{"type":29,"tag":183,"props":1080,"children":1081},{"style":750},[1082],{"type":38,"value":753},{"type":29,"tag":183,"props":1084,"children":1085},{"style":212},[1086],{"type":38,"value":285},{"type":29,"tag":183,"props":1088,"children":1089},{"class":185,"line":570},[1090,1094,1100,1104,1109],{"type":29,"tag":183,"props":1091,"children":1092},{"style":200},[1093],{"type":38,"value":919},{"type":29,"tag":183,"props":1095,"children":1097},{"style":1096},"--shiki-default:#CA9EE6;--shiki-default-font-weight:bold;--shiki-dark:#F97583;--shiki-dark-font-weight:inherit",[1098],{"type":38,"value":1099}," new",{"type":29,"tag":183,"props":1101,"children":1102},{"style":206},[1103],{"type":38,"value":859},{"type":29,"tag":183,"props":1105,"children":1106},{"style":308},[1107],{"type":38,"value":1108},"()",{"type":29,"tag":183,"props":1110,"children":1111},{"style":212},[1112],{"type":38,"value":327},{"type":29,"tag":183,"props":1114,"children":1115},{"class":185,"line":613},[1116],{"type":29,"tag":183,"props":1117,"children":1118},{"style":212},[1119],{"type":38,"value":997},{"type":29,"tag":183,"props":1121,"children":1122},{"class":185,"line":662},[1123],{"type":29,"tag":183,"props":1124,"children":1125},{"style":212},[1126],{"type":38,"value":436},{"type":29,"tag":30,"props":1128,"children":1129},{},[1130,1132,1138,1140,1146],{"type":38,"value":1131},"Une interface, un ",{"type":29,"tag":156,"props":1133,"children":1135},{"className":1134},[],[1136],{"type":38,"value":1137},"@Injectable()",{"type":38,"value":1139},", une factory. Pour calculer un score avec 2 opérations. Une seule implémentation concrète. NestJS injecte directement ",{"type":29,"tag":156,"props":1141,"children":1143},{"className":1142},[],[1144],{"type":38,"value":1145},"StandardLeadScorer",{"type":38,"value":1147}," partout. La factory n'est appelée nulle part, sauf dans un test. Aucun besoin d'inversion réel.",{"type":29,"tag":30,"props":1149,"children":1150},{},[1151],{"type":38,"value":1152},"Cette sur-ingénierie a un coût concret. À chaque modification, vous passez par 3 fichiers au lieu d'un. Vous écrivez 2 fois plus de tests (le mock de l'interface + le test de l'implémentation). Vous augmentez la charge cognitive pour tout nouveau dev. Et le pire : si le métier demande un jour une vraie variation, vous ne la verrez pas dans le pattern existant parce que tout est déjà \"préparé\" pour des variations qui n'existent pas.",{"type":29,"tag":30,"props":1154,"children":1155},{},[1156,1158,1163,1165,1170,1172,1178,1180,1186],{"type":38,"value":1157},"Le contre-pattern craft, c'est ce que Martin Fowler appelait ",{"type":29,"tag":114,"props":1159,"children":1160},{},[1161],{"type":38,"value":1162},"\"Rule of Three\"",{"type":38,"value":1164}," dans ",{"type":29,"tag":114,"props":1166,"children":1167},{},[1168],{"type":38,"value":1169},"Refactoring",{"type":38,"value":1171}," (2018). Vous ne créez une abstraction qu'à partir du troisième cas concret. Si une fonction n'a qu'une implémentation, c'est une fonction. Pas une interface, pas une factory, pas une classe abstraite. Une fonction. C'est exactement la philosophie défendue dans ",{"type":29,"tag":62,"props":1173,"children":1175},{"href":1174},"\u002Ffr\u002Fdette-technique\u002Fyagni-ecrire-code-qualite-sans-fonctionnalites-inutiles",[1176],{"type":38,"value":1177},"YAGNI : écrire du code de qualité sans fonctionnalités inutiles",{"type":38,"value":1179}," et dans le ",{"type":29,"tag":62,"props":1181,"children":1183},{"href":1182},"\u002Ffr\u002Fdette-technique\u002Fprincipe-kiss-bonnes-pratiques-java",[1184],{"type":38,"value":1185},"principe KISS appliqué en Java",{"type":38,"value":79},{"type":29,"tag":30,"props":1188,"children":1189},{},[1190],{"type":38,"value":1191},"Sur le crmcoaching, j'ai 47 use cases sans aucune interface devant eux. Quand j'aurai une vraie variation à modéliser (typiquement après 6 mois de production), je créerai l'interface à partir des 3 cas réels. Pas avant.",{"type":29,"tag":46,"props":1193,"children":1194},{},[],{"type":29,"tag":1196,"props":1197,"children":1202},"cta",{"cta":1198,"href":1199,"title":1200,"type":1201},"Coder comme un senior →","https:\u002F\u002Fapp.kamanga.fr\u002Fforms\u002Fmentoring","Vous voulez repérer ces abstractions accidentelles dans vos PR Claude avant de les merger ?","call",[1203],{"type":29,"tag":30,"props":1204,"children":1205},{},[1206],{"type":38,"value":1207},"Refuser une interface inutile ou une factory qui ne sert à rien, ça ne s'apprend pas en lisant un article : ça se travaille sur votre propre code. En mentoring 1:1, je relis vos PR Claude avec vous, je vous montre où l'IA installe de la sur-ingénierie en silence, et vous repartez avec le réflexe YAGNI qui garde votre repo simple. C'est du face à face pour monter en niveau, pas un audit d'équipe.",{"type":29,"tag":46,"props":1209,"children":1210},{},[],{"type":29,"tag":50,"props":1212,"children":1214},{"id":1213},"faux-ami-3-la-sur-ingénierie-déguisée",[1215],{"type":38,"value":1216},"Faux ami #3 : la sur-ingénierie déguisée",{"type":29,"tag":30,"props":1218,"children":1219},{},[1220],{"type":38,"value":1221},"Le troisième faux ami est le plus visible mais le plus accepté. Claude adore livrer des architectures enterprise pour des problèmes triviaux. Vous demandez un handler pour récupérer un client par id, vous recevez :",{"type":29,"tag":173,"props":1223,"children":1225},{"className":175,"code":1224,"language":177,"meta":8,"style":8},"\u002F\u002F QueryHandler + ClientRepositoryPort + EventBusPort + MetricsPort + 2 adapters\n@Injectable()\nexport class GetClientQueryHandler {\n  constructor(\n    private readonly clientRepository: ClientRepositoryPort,\n    private readonly eventBus: EventBusPort,\n    private readonly metrics: MetricsPort,\n  ) {}\n\n  async handle(query: GetClientQuery): Promise\u003CGetClientResult> {\n    const client = await this.clientRepository.findById(query.clientId);\n    if (!client) {\n      throw new ClientNotFoundException(query.clientId);\n    }\n    await this.eventBus.publish(new ClientRetrievedEvent(query.clientId));\n    this.metrics.increment('client.retrieved');\n    return new GetClientResult(client);\n  }\n}\n",[1226],{"type":29,"tag":156,"props":1227,"children":1228},{"__ignoreMap":8},[1229,1237,1252,1272,1284,1315,1344,1373,1386,1393,1457,1521,1549,1582,1590,1651,1695,1720,1727],{"type":29,"tag":183,"props":1230,"children":1231},{"class":185,"line":186},[1232],{"type":29,"tag":183,"props":1233,"children":1234},{"style":190},[1235],{"type":38,"value":1236},"\u002F\u002F QueryHandler + ClientRepositoryPort + EventBusPort + MetricsPort + 2 adapters\n",{"type":29,"tag":183,"props":1238,"children":1239},{"class":185,"line":196},[1240,1244,1248],{"type":29,"tag":183,"props":1241,"children":1242},{"style":828},[1243],{"type":38,"value":831},{"type":29,"tag":183,"props":1245,"children":1246},{"style":206},[1247],{"type":38,"value":836},{"type":29,"tag":183,"props":1249,"children":1250},{"style":839},[1251],{"type":38,"value":842},{"type":29,"tag":183,"props":1253,"children":1254},{"class":185,"line":218},[1255,1259,1263,1268],{"type":29,"tag":183,"props":1256,"children":1257},{"style":200},[1258],{"type":38,"value":742},{"type":29,"tag":183,"props":1260,"children":1261},{"style":200},[1262],{"type":38,"value":854},{"type":29,"tag":183,"props":1264,"children":1265},{"style":750},[1266],{"type":38,"value":1267}," GetClientQueryHandler",{"type":29,"tag":183,"props":1269,"children":1270},{"style":212},[1271],{"type":38,"value":285},{"type":29,"tag":183,"props":1273,"children":1274},{"class":185,"line":245},[1275,1280],{"type":29,"tag":183,"props":1276,"children":1277},{"style":200},[1278],{"type":38,"value":1279},"  constructor",{"type":29,"tag":183,"props":1281,"children":1282},{"style":212},[1283],{"type":38,"value":215},{"type":29,"tag":183,"props":1285,"children":1286},{"class":185,"line":266},[1287,1292,1297,1302,1306,1311],{"type":29,"tag":183,"props":1288,"children":1289},{"style":200},[1290],{"type":38,"value":1291},"    private",{"type":29,"tag":183,"props":1293,"children":1294},{"style":200},[1295],{"type":38,"value":1296}," readonly",{"type":29,"tag":183,"props":1298,"children":1299},{"style":222},[1300],{"type":38,"value":1301}," clientRepository",{"type":29,"tag":183,"props":1303,"children":1304},{"style":228},[1305],{"type":38,"value":231},{"type":29,"tag":183,"props":1307,"children":1308},{"style":750},[1309],{"type":38,"value":1310}," ClientRepositoryPort",{"type":29,"tag":183,"props":1312,"children":1313},{"style":212},[1314],{"type":38,"value":242},{"type":29,"tag":183,"props":1316,"children":1317},{"class":185,"line":288},[1318,1322,1326,1331,1335,1340],{"type":29,"tag":183,"props":1319,"children":1320},{"style":200},[1321],{"type":38,"value":1291},{"type":29,"tag":183,"props":1323,"children":1324},{"style":200},[1325],{"type":38,"value":1296},{"type":29,"tag":183,"props":1327,"children":1328},{"style":222},[1329],{"type":38,"value":1330}," eventBus",{"type":29,"tag":183,"props":1332,"children":1333},{"style":228},[1334],{"type":38,"value":231},{"type":29,"tag":183,"props":1336,"children":1337},{"style":750},[1338],{"type":38,"value":1339}," EventBusPort",{"type":29,"tag":183,"props":1341,"children":1342},{"style":212},[1343],{"type":38,"value":242},{"type":29,"tag":183,"props":1345,"children":1346},{"class":185,"line":330},[1347,1351,1355,1360,1364,1369],{"type":29,"tag":183,"props":1348,"children":1349},{"style":200},[1350],{"type":38,"value":1291},{"type":29,"tag":183,"props":1352,"children":1353},{"style":200},[1354],{"type":38,"value":1296},{"type":29,"tag":183,"props":1356,"children":1357},{"style":222},[1358],{"type":38,"value":1359}," metrics",{"type":29,"tag":183,"props":1361,"children":1362},{"style":228},[1363],{"type":38,"value":231},{"type":29,"tag":183,"props":1365,"children":1366},{"style":750},[1367],{"type":38,"value":1368}," MetricsPort",{"type":29,"tag":183,"props":1370,"children":1371},{"style":212},[1372],{"type":38,"value":242},{"type":29,"tag":183,"props":1374,"children":1375},{"class":185,"line":374},[1376,1381],{"type":29,"tag":183,"props":1377,"children":1378},{"style":212},[1379],{"type":38,"value":1380},"  )",{"type":29,"tag":183,"props":1382,"children":1383},{"style":212},[1384],{"type":38,"value":1385}," {}\n",{"type":29,"tag":183,"props":1387,"children":1388},{"class":185,"line":430},[1389],{"type":29,"tag":183,"props":1390,"children":1391},{"emptyLinePlaceholder":13},[1392],{"type":38,"value":445},{"type":29,"tag":183,"props":1394,"children":1395},{"class":185,"line":439},[1396,1401,1406,1410,1415,1419,1424,1428,1432,1437,1443,1448,1453],{"type":29,"tag":183,"props":1397,"children":1398},{"style":200},[1399],{"type":38,"value":1400},"  async",{"type":29,"tag":183,"props":1402,"children":1403},{"style":206},[1404],{"type":38,"value":1405}," handle",{"type":29,"tag":183,"props":1407,"children":1408},{"style":212},[1409],{"type":38,"value":770},{"type":29,"tag":183,"props":1411,"children":1412},{"style":222},[1413],{"type":38,"value":1414},"query",{"type":29,"tag":183,"props":1416,"children":1417},{"style":228},[1418],{"type":38,"value":231},{"type":29,"tag":183,"props":1420,"children":1421},{"style":750},[1422],{"type":38,"value":1423}," GetClientQuery",{"type":29,"tag":183,"props":1425,"children":1426},{"style":212},[1427],{"type":38,"value":272},{"type":29,"tag":183,"props":1429,"children":1430},{"style":228},[1431],{"type":38,"value":231},{"type":29,"tag":183,"props":1433,"children":1434},{"style":750},[1435],{"type":38,"value":1436}," Promise",{"type":29,"tag":183,"props":1438,"children":1440},{"style":1439},"--shiki-default:#99D1DB;--shiki-dark:#E1E4E8",[1441],{"type":38,"value":1442},"\u003C",{"type":29,"tag":183,"props":1444,"children":1445},{"style":750},[1446],{"type":38,"value":1447},"GetClientResult",{"type":29,"tag":183,"props":1449,"children":1450},{"style":1439},[1451],{"type":38,"value":1452},">",{"type":29,"tag":183,"props":1454,"children":1455},{"style":212},[1456],{"type":38,"value":285},{"type":29,"tag":183,"props":1458,"children":1459},{"class":185,"line":448},[1460,1465,1470,1474,1479,1485,1489,1494,1498,1503,1508,1512,1517],{"type":29,"tag":183,"props":1461,"children":1462},{"style":200},[1463],{"type":38,"value":1464},"    const",{"type":29,"tag":183,"props":1466,"children":1467},{"style":297},[1468],{"type":38,"value":1469}," client",{"type":29,"tag":183,"props":1471,"children":1472},{"style":228},[1473],{"type":38,"value":305},{"type":29,"tag":183,"props":1475,"children":1476},{"style":200},[1477],{"type":38,"value":1478}," await",{"type":29,"tag":183,"props":1480,"children":1482},{"style":1481},"--shiki-default:#E78284;--shiki-dark:#79B8FF",[1483],{"type":38,"value":1484}," this",{"type":29,"tag":183,"props":1486,"children":1487},{"style":388},[1488],{"type":38,"value":79},{"type":29,"tag":183,"props":1490,"children":1491},{"style":308},[1492],{"type":38,"value":1493},"clientRepository",{"type":29,"tag":183,"props":1495,"children":1496},{"style":388},[1497],{"type":38,"value":79},{"type":29,"tag":183,"props":1499,"children":1500},{"style":206},[1501],{"type":38,"value":1502},"findById",{"type":29,"tag":183,"props":1504,"children":1505},{"style":308},[1506],{"type":38,"value":1507},"(query",{"type":29,"tag":183,"props":1509,"children":1510},{"style":388},[1511],{"type":38,"value":79},{"type":29,"tag":183,"props":1513,"children":1514},{"style":308},[1515],{"type":38,"value":1516},"clientId)",{"type":29,"tag":183,"props":1518,"children":1519},{"style":212},[1520],{"type":38,"value":327},{"type":29,"tag":183,"props":1522,"children":1523},{"class":185,"line":457},[1524,1529,1534,1539,1544],{"type":29,"tag":183,"props":1525,"children":1526},{"style":200},[1527],{"type":38,"value":1528},"    if",{"type":29,"tag":183,"props":1530,"children":1531},{"style":308},[1532],{"type":38,"value":1533}," (",{"type":29,"tag":183,"props":1535,"children":1536},{"style":228},[1537],{"type":38,"value":1538},"!",{"type":29,"tag":183,"props":1540,"children":1541},{"style":308},[1542],{"type":38,"value":1543},"client) ",{"type":29,"tag":183,"props":1545,"children":1546},{"style":212},[1547],{"type":38,"value":1548},"{\n",{"type":29,"tag":183,"props":1550,"children":1551},{"class":185,"line":474},[1552,1557,1561,1566,1570,1574,1578],{"type":29,"tag":183,"props":1553,"children":1554},{"style":200},[1555],{"type":38,"value":1556},"      throw",{"type":29,"tag":183,"props":1558,"children":1559},{"style":1096},[1560],{"type":38,"value":1099},{"type":29,"tag":183,"props":1562,"children":1563},{"style":206},[1564],{"type":38,"value":1565}," ClientNotFoundException",{"type":29,"tag":183,"props":1567,"children":1568},{"style":308},[1569],{"type":38,"value":1507},{"type":29,"tag":183,"props":1571,"children":1572},{"style":388},[1573],{"type":38,"value":79},{"type":29,"tag":183,"props":1575,"children":1576},{"style":308},[1577],{"type":38,"value":1516},{"type":29,"tag":183,"props":1579,"children":1580},{"style":212},[1581],{"type":38,"value":327},{"type":29,"tag":183,"props":1583,"children":1584},{"class":185,"line":495},[1585],{"type":29,"tag":183,"props":1586,"children":1587},{"style":212},[1588],{"type":38,"value":1589},"    }\n",{"type":29,"tag":183,"props":1591,"children":1592},{"class":185,"line":516},[1593,1598,1602,1606,1611,1615,1620,1624,1629,1634,1638,1642,1647],{"type":29,"tag":183,"props":1594,"children":1595},{"style":200},[1596],{"type":38,"value":1597},"    await",{"type":29,"tag":183,"props":1599,"children":1600},{"style":1481},[1601],{"type":38,"value":1484},{"type":29,"tag":183,"props":1603,"children":1604},{"style":388},[1605],{"type":38,"value":79},{"type":29,"tag":183,"props":1607,"children":1608},{"style":308},[1609],{"type":38,"value":1610},"eventBus",{"type":29,"tag":183,"props":1612,"children":1613},{"style":388},[1614],{"type":38,"value":79},{"type":29,"tag":183,"props":1616,"children":1617},{"style":206},[1618],{"type":38,"value":1619},"publish",{"type":29,"tag":183,"props":1621,"children":1622},{"style":308},[1623],{"type":38,"value":770},{"type":29,"tag":183,"props":1625,"children":1626},{"style":1096},[1627],{"type":38,"value":1628},"new",{"type":29,"tag":183,"props":1630,"children":1631},{"style":206},[1632],{"type":38,"value":1633}," ClientRetrievedEvent",{"type":29,"tag":183,"props":1635,"children":1636},{"style":308},[1637],{"type":38,"value":1507},{"type":29,"tag":183,"props":1639,"children":1640},{"style":388},[1641],{"type":38,"value":79},{"type":29,"tag":183,"props":1643,"children":1644},{"style":308},[1645],{"type":38,"value":1646},"clientId))",{"type":29,"tag":183,"props":1648,"children":1649},{"style":212},[1650],{"type":38,"value":327},{"type":29,"tag":183,"props":1652,"children":1653},{"class":185,"line":536},[1654,1659,1663,1668,1672,1677,1681,1687,1691],{"type":29,"tag":183,"props":1655,"children":1656},{"style":1481},[1657],{"type":38,"value":1658},"    this",{"type":29,"tag":183,"props":1660,"children":1661},{"style":388},[1662],{"type":38,"value":79},{"type":29,"tag":183,"props":1664,"children":1665},{"style":308},[1666],{"type":38,"value":1667},"metrics",{"type":29,"tag":183,"props":1669,"children":1670},{"style":388},[1671],{"type":38,"value":79},{"type":29,"tag":183,"props":1673,"children":1674},{"style":206},[1675],{"type":38,"value":1676},"increment",{"type":29,"tag":183,"props":1678,"children":1679},{"style":308},[1680],{"type":38,"value":770},{"type":29,"tag":183,"props":1682,"children":1684},{"style":1683},"--shiki-default:#A6D189;--shiki-dark:#9ECBFF",[1685],{"type":38,"value":1686},"'client.retrieved'",{"type":29,"tag":183,"props":1688,"children":1689},{"style":308},[1690],{"type":38,"value":272},{"type":29,"tag":183,"props":1692,"children":1693},{"style":212},[1694],{"type":38,"value":327},{"type":29,"tag":183,"props":1696,"children":1697},{"class":185,"line":570},[1698,1702,1706,1711,1716],{"type":29,"tag":183,"props":1699,"children":1700},{"style":200},[1701],{"type":38,"value":919},{"type":29,"tag":183,"props":1703,"children":1704},{"style":1096},[1705],{"type":38,"value":1099},{"type":29,"tag":183,"props":1707,"children":1708},{"style":206},[1709],{"type":38,"value":1710}," GetClientResult",{"type":29,"tag":183,"props":1712,"children":1713},{"style":308},[1714],{"type":38,"value":1715},"(client)",{"type":29,"tag":183,"props":1717,"children":1718},{"style":212},[1719],{"type":38,"value":327},{"type":29,"tag":183,"props":1721,"children":1722},{"class":185,"line":613},[1723],{"type":29,"tag":183,"props":1724,"children":1725},{"style":212},[1726],{"type":38,"value":997},{"type":29,"tag":183,"props":1728,"children":1729},{"class":185,"line":662},[1730],{"type":29,"tag":183,"props":1731,"children":1732},{"style":212},[1733],{"type":38,"value":436},{"type":29,"tag":30,"props":1735,"children":1736},{},[1737,1739,1745],{"type":38,"value":1738},"30 lignes, 4 fichiers, 3 ports, 1 event qui n'est lu par personne. Pour faire ",{"type":29,"tag":156,"props":1740,"children":1742},{"className":1741},[],[1743],{"type":38,"value":1744},"prisma.client.findUnique({ where: { id } })",{"type":38,"value":1746},". Le coût direct : 4x plus de code à lire pour un nouveau dev. Le coût indirect : la signature de tous les handlers du repo devient ce pattern, donc même les use cases qui justifieraient un découpage simple le portent.",{"type":29,"tag":30,"props":1748,"children":1749},{},[1750],{"type":38,"value":1751},"Le contre-pattern, c'est le principe de proportionnalité. Sur le crmcoaching, j'applique cette règle : si l'opération métier tient en une phrase (\"lire un client par id\"), le code tient en une fonction avec une query Prisma directe. Si elle nécessite 3 étapes coordonnées avec compensation possible, alors un handler peut se justifier. Sinon, c'est de la dette emballée en pattern.",{"type":29,"tag":30,"props":1753,"children":1754},{},[1755,1757,1762,1764,1769],{"type":38,"value":1756},"Robert C. Martin, dans ",{"type":29,"tag":114,"props":1758,"children":1759},{},[1760],{"type":38,"value":1761},"Clean Architecture",{"type":38,"value":1763}," (2017), insiste sur ce point : l'architecture doit ",{"type":29,"tag":114,"props":1765,"children":1766},{},[1767],{"type":38,"value":1768},"suivre",{"type":38,"value":1770}," la complexité du domaine, pas la précéder. Si vous précédez une complexité qui n'existe pas, vous payez aujourd'hui un coût pour des cas qui ne viendront jamais. C'est aussi ce que rappelle le guide du code lisible en software craftsmanship.",{"type":29,"tag":46,"props":1772,"children":1773},{},[],{"type":29,"tag":50,"props":1775,"children":1777},{"id":1776},"calcul-du-vrai-coût-caché",[1778],{"type":38,"value":1779},"Calcul du vrai coût caché",{"type":29,"tag":30,"props":1781,"children":1782},{},[1783],{"type":38,"value":1784},"J'ai mesuré le coût cumulé des 3 faux amis en comparant mes commits de début de projet (avant discipline) avec l'état actuel de crmcoaching. Voici les chiffres, comparés à un repo équivalent où la discipline craft est tenue depuis le début.",{"type":29,"tag":1786,"props":1787,"children":1788},"table",{},[1789,1813],{"type":29,"tag":1790,"props":1791,"children":1792},"thead",{},[1793],{"type":29,"tag":1794,"props":1795,"children":1796},"tr",{},[1797,1803,1808],{"type":29,"tag":1798,"props":1799,"children":1800},"th",{},[1801],{"type":38,"value":1802},"Métrique",{"type":29,"tag":1798,"props":1804,"children":1805},{},[1806],{"type":38,"value":1807},"Repo IA non audité",{"type":29,"tag":1798,"props":1809,"children":1810},{},[1811],{"type":38,"value":1812},"Repo IA + discipline craft",{"type":29,"tag":1814,"props":1815,"children":1816},"tbody",{},[1817,1836,1854,1872,1890],{"type":29,"tag":1794,"props":1818,"children":1819},{},[1820,1826,1831],{"type":29,"tag":1821,"props":1822,"children":1823},"td",{},[1824],{"type":38,"value":1825},"Temps moyen pour ajouter une feature simple",{"type":29,"tag":1821,"props":1827,"children":1828},{},[1829],{"type":38,"value":1830},"3,5 jours",{"type":29,"tag":1821,"props":1832,"children":1833},{},[1834],{"type":38,"value":1835},"1,2 jour",{"type":29,"tag":1794,"props":1837,"children":1838},{},[1839,1844,1849],{"type":29,"tag":1821,"props":1840,"children":1841},{},[1842],{"type":38,"value":1843},"Temps moyen pour modifier une feature existante",{"type":29,"tag":1821,"props":1845,"children":1846},{},[1847],{"type":38,"value":1848},"5 jours",{"type":29,"tag":1821,"props":1850,"children":1851},{},[1852],{"type":38,"value":1853},"1,8 jour",{"type":29,"tag":1794,"props":1855,"children":1856},{},[1857,1862,1867],{"type":29,"tag":1821,"props":1858,"children":1859},{},[1860],{"type":38,"value":1861},"Onboarding d'un nouveau dev (jusqu'à 1ère PR mergée)",{"type":29,"tag":1821,"props":1863,"children":1864},{},[1865],{"type":38,"value":1866},"7 semaines",{"type":29,"tag":1821,"props":1868,"children":1869},{},[1870],{"type":38,"value":1871},"3 semaines",{"type":29,"tag":1794,"props":1873,"children":1874},{},[1875,1880,1885],{"type":29,"tag":1821,"props":1876,"children":1877},{},[1878],{"type":38,"value":1879},"Bugs régression par release",{"type":29,"tag":1821,"props":1881,"children":1882},{},[1883],{"type":38,"value":1884},"4-6",{"type":29,"tag":1821,"props":1886,"children":1887},{},[1888],{"type":38,"value":1889},"0-1",{"type":29,"tag":1794,"props":1891,"children":1892},{},[1893,1898,1903],{"type":29,"tag":1821,"props":1894,"children":1895},{},[1896],{"type":38,"value":1897},"Lignes de code pour 1 use case métier",{"type":29,"tag":1821,"props":1899,"children":1900},{},[1901],{"type":38,"value":1902},"280 LOC en moyenne",{"type":29,"tag":1821,"props":1904,"children":1905},{},[1906],{"type":38,"value":1907},"95 LOC en moyenne",{"type":29,"tag":30,"props":1909,"children":1910},{},[1911],{"type":38,"value":1912},"Le ratio est de 1 à 3 sur la plupart des métriques. Concrètement, sans discipline craft, une équipe de 5 développeurs paie l'équivalent d'1,5 développeur de \"taxe complexité\" chaque mois, sans valeur ajoutée pour les utilisateurs. À 8 000 euros de coût total mensuel chargé par développeur, c'est 12 000 euros par mois. 144 000 euros par an. Sans qu'aucune feature ne s'ajoute en plus.",{"type":29,"tag":30,"props":1914,"children":1915},{},[1916,1918,1924],{"type":38,"value":1917},"C'est le coût silencieux dont je parle quand je dis qu'une codebase IA-heavy non auditée coûte cher, et c'est l'angle business que je détaille dans ",{"type":29,"tag":62,"props":1919,"children":1921},{"href":1920},"\u002Ffr\u002Fdette-technique\u002Fingenierie-logicielle-avantage-concurrentiel",[1922],{"type":38,"value":1923},"l'ingénierie logicielle comme avantage concurrentiel",{"type":38,"value":1925},". Personne ne le voit dans le P&L, parce que c'est de la vélocité non gagnée, pas une dépense identifiable. Mais il est là.",{"type":29,"tag":46,"props":1927,"children":1928},{},[],{"type":29,"tag":50,"props":1930,"children":1932},{"id":1931},"la-règle-2026-yagni-ai",[1933],{"type":38,"value":1934},"La règle 2026 : YAGNI + AI",{"type":29,"tag":30,"props":1936,"children":1937},{},[1938],{"type":38,"value":1939},"Voici la règle que j'applique sur crmcoaching et que je recommande à toutes les équipes IA-heavy.",{"type":29,"tag":30,"props":1941,"children":1942},{},[1943,1948],{"type":29,"tag":34,"props":1944,"children":1945},{},[1946],{"type":38,"value":1947},"Règle 1 : pas d'abstraction sans 3 implémentations réelles.",{"type":38,"value":1949}," Pas d'interface devant une seule classe. Pas de factory pour 1 type. Pas de port hexagonal devant un module qui ne peut pas être remplacé. La règle des 3 vient de Martin Fowler, elle date des années 2000, elle s'applique parfaitement à 2026.",{"type":29,"tag":30,"props":1951,"children":1952},{},[1953,1958,1960,1965],{"type":29,"tag":34,"props":1954,"children":1955},{},[1956],{"type":38,"value":1957},"Règle 2 : avant chaque PR Claude, prompter \"cherche les doublons\".",{"type":38,"value":1959}," ",{"type":29,"tag":114,"props":1961,"children":1962},{},[1963],{"type":38,"value":1964},"\"Avant de finaliser, vérifie dans le repo s'il existe déjà une fonction qui fait à 80% la même chose. Si oui, refactore pour mutualiser plutôt que dupliquer.\"",{"type":38,"value":1966}," Claude le fait très bien quand on lui demande. Il ne le fait jamais spontanément.",{"type":29,"tag":30,"props":1968,"children":1969},{},[1970,1975],{"type":29,"tag":34,"props":1971,"children":1972},{},[1973],{"type":38,"value":1974},"Règle 3 : proportionnalité code\u002Fdomaine.",{"type":38,"value":1976}," Une opération métier triviale = une fonction. Une opération métier coordonnée = un handler\u002Fservice. Une opération métier critique avec compensation = un saga ou un pattern de coordination explicite. Le code suit le domaine, pas l'inverse.",{"type":29,"tag":30,"props":1978,"children":1979},{},[1980,1985],{"type":29,"tag":34,"props":1981,"children":1982},{},[1983],{"type":38,"value":1984},"Règle 4 : audit des LOC par feature.",{"type":38,"value":1986}," Je mesure tous les 3 mois le nombre de lignes ajoutées par feature livrée. Si la métrique grimpe de plus de 30%, c'est un signal de sur-ingénierie qui s'installe. C'est la même logique qu'en clean code : on ne contrôle que ce qu'on mesure, et la Definition of Done doit inclure ce signal.",{"type":29,"tag":30,"props":1988,"children":1989},{},[1990],{"type":38,"value":1991},"Avec ces 4 règles, le repo crmcoaching tourne à environ 95 LOC par use case métier complet (avec tests + adapter + handler). C'est 3x moins que la moyenne IA-heavy que je vois sur des repos partagés. C'est aussi 3x plus rapide à modifier.",{"type":29,"tag":46,"props":1993,"children":1994},{},[],{"type":29,"tag":50,"props":1996,"children":1998},{"id":1997},"ce-que-ça-change-concrètement",[1999],{"type":38,"value":2000},"Ce que ça change concrètement",{"type":29,"tag":30,"props":2002,"children":2003},{},[2004],{"type":38,"value":2005},"Sur les 3 dernières missions où j'ai installé cette discipline (audit + refacto + grille de review), voici les chiffres avant\u002Faprès mesurés sur 6 mois.",{"type":29,"tag":1786,"props":2007,"children":2008},{},[2009,2029],{"type":29,"tag":1790,"props":2010,"children":2011},{},[2012],{"type":29,"tag":1794,"props":2013,"children":2014},{},[2015,2019,2024],{"type":29,"tag":1798,"props":2016,"children":2017},{},[2018],{"type":38,"value":1802},{"type":29,"tag":1798,"props":2020,"children":2021},{},[2022],{"type":38,"value":2023},"Avant audit",{"type":29,"tag":1798,"props":2025,"children":2026},{},[2027],{"type":38,"value":2028},"Après 6 mois",{"type":29,"tag":1814,"props":2030,"children":2031},{},[2032,2050,2068,2085,2101],{"type":29,"tag":1794,"props":2033,"children":2034},{},[2035,2040,2045],{"type":29,"tag":1821,"props":2036,"children":2037},{},[2038],{"type":38,"value":2039},"LOC moyennes par use case",{"type":29,"tag":1821,"props":2041,"children":2042},{},[2043],{"type":38,"value":2044},"280",{"type":29,"tag":1821,"props":2046,"children":2047},{},[2048],{"type":38,"value":2049},"110",{"type":29,"tag":1794,"props":2051,"children":2052},{},[2053,2058,2063],{"type":29,"tag":1821,"props":2054,"children":2055},{},[2056],{"type":38,"value":2057},"Fonctions dupliquées dans le repo",{"type":29,"tag":1821,"props":2059,"children":2060},{},[2061],{"type":38,"value":2062},"47",{"type":29,"tag":1821,"props":2064,"children":2065},{},[2066],{"type":38,"value":2067},"8",{"type":29,"tag":1794,"props":2069,"children":2070},{},[2071,2076,2080],{"type":29,"tag":1821,"props":2072,"children":2073},{},[2074],{"type":38,"value":2075},"Temps d'onboarding d'un nouveau dev",{"type":29,"tag":1821,"props":2077,"children":2078},{},[2079],{"type":38,"value":1866},{"type":29,"tag":1821,"props":2081,"children":2082},{},[2083],{"type":38,"value":2084},"4 semaines",{"type":29,"tag":1794,"props":2086,"children":2087},{},[2088,2093,2097],{"type":29,"tag":1821,"props":2089,"children":2090},{},[2091],{"type":38,"value":2092},"Bugs de régression par release",{"type":29,"tag":1821,"props":2094,"children":2095},{},[2096],{"type":38,"value":1884},{"type":29,"tag":1821,"props":2098,"children":2099},{},[2100],{"type":38,"value":1889},{"type":29,"tag":1794,"props":2102,"children":2103},{},[2104,2109,2114],{"type":29,"tag":1821,"props":2105,"children":2106},{},[2107],{"type":38,"value":2108},"Vélocité (story points\u002Fsprint)",{"type":29,"tag":1821,"props":2110,"children":2111},{},[2112],{"type":38,"value":2113},"stable",{"type":29,"tag":1821,"props":2115,"children":2116},{},[2117],{"type":38,"value":2118},"+28%",{"type":29,"tag":30,"props":2120,"children":2121},{},[2122,2124,2129,2131,2136,2138,2144],{"type":38,"value":2123},"Le gain n'est pas qu'esthétique. La vélocité augmente parce que les développeurs passent moins de temps à naviguer dans la complexité accidentelle, et plus de temps à livrer de la valeur métier. C'est ce que la DORA mesure quand elle parle de ",{"type":29,"tag":114,"props":2125,"children":2126},{},[2127],{"type":38,"value":2128},"throughput",{"type":38,"value":2130}," et de ",{"type":29,"tag":114,"props":2132,"children":2133},{},[2134],{"type":38,"value":2135},"stability",{"type":38,"value":2137}," combinés, et c'est précisément le levier qu'une ",{"type":29,"tag":62,"props":2139,"children":2141},{"href":2140},"\u002Ffr\u002Fdette-technique\u002Frevue-de-code-java-guide-exemples",[2142],{"type":38,"value":2143},"revue de code structurée",{"type":38,"value":2145}," permet d'enclencher.",{"type":29,"tag":46,"props":2147,"children":2148},{},[],{"type":29,"tag":50,"props":2150,"children":2152},{"id":2151},"conclusion",[2153],{"type":38,"value":2154},"Conclusion",{"type":29,"tag":30,"props":2156,"children":2157},{},[2158],{"type":38,"value":2159},"Ce que je veux que vous reteniez de cet article, c'est que le code Claude \"qui marche\" n'est pas une garantie de qualité, c'est une garantie de fonctionnement à T0. La qualité d'un code se mesure à 3 mois, à 6 mois, à 12 mois, sur le coût de modification et le temps d'onboarding. Les 3 faux amis que j'ai décrits (copier-coller, abstractions accidentelles, sur-ingénierie) sont les 3 mécanismes qui font diverger ce coût silencieusement.",{"type":29,"tag":30,"props":2161,"children":2162},{},[2163],{"type":38,"value":2164},"La règle YAGNI + AI, ce n'est pas du conservatisme. C'est une discipline économique. Vous économisez aujourd'hui sur du code que vous n'écrivez pas, ce qui réduit la complexité que vous porterez demain. Quand le besoin réel émerge (3 implémentations, vraie variation, vraie criticité), vous créez l'abstraction à ce moment-là, avec la connaissance que la pratique vous a donnée. Pas avant.",{"type":29,"tag":30,"props":2166,"children":2167},{},[2168],{"type":38,"value":2169},"Si en lisant ces lignes vous reconnaissez votre situation, vous avez deux choix. Vous pouvez continuer à accepter les PR Claude qui ajoutent 280 LOC pour un use case qui en demande 95. Ou vous pouvez commencer lundi matin, par une grille de 4 règles, et reprendre le contrôle du coût caché de votre codebase.",{"type":29,"tag":30,"props":2171,"children":2172},{},[2173,2175,2182],{"type":38,"value":2174},"Pour la suite des patterns craft que je documente chaque semaine sur crmcoaching, retrouvez-moi sur ",{"type":29,"tag":62,"props":2176,"children":2179},{"href":2177,"rel":2178},"https:\u002F\u002Fwww.instagram.com\u002Fkamangacode\u002F",[66],[2180],{"type":38,"value":2181},"mon profil Instagram kamangacode",{"type":38,"value":79},{"type":29,"tag":1196,"props":2184,"children":2189},{"cta":2185,"href":2186,"title":2187,"type":2188},"Les 100 pratiques que l'IA n'enseigne pas →","https:\u002F\u002Fkamanga.fr\u002Freferentiel-craft","La règle des 3 et le réflexe anti-doublons ne sont que 2 pratiques sur 100","product",[2190],{"type":29,"tag":30,"props":2191,"children":2192},{},[2193],{"type":38,"value":2194},"Cet article détaille une poignée de pratiques craft qui neutralisent la sur-ingénierie IA-générée. Le Craft Bundle réunit les 100 pratiques que j'applique pour garder un code simple et modifiable : le référentiel complet de ce que je vérifie sur chaque PR Claude. Ce sont celles que l'IA ne vous apprendra jamais, parce qu'elle ne les a jamais vues coûter cher en production.",{"type":29,"tag":46,"props":2196,"children":2197},{},[],{"type":29,"tag":50,"props":2199,"children":2201},{"id":2200},"faq-sur-les-faux-amis-claude-et-le-coût-caché",[2202],{"type":38,"value":2203},"FAQ sur les faux amis Claude et le coût caché",{"type":29,"tag":2205,"props":2206,"children":2207},"details",{},[2208,2214],{"type":29,"tag":2209,"props":2210,"children":2211},"summary",{},[2212],{"type":38,"value":2213},"1. Comment détecter les doublons dans un repo TypeScript de taille moyenne ?",{"type":29,"tag":30,"props":2215,"children":2216},{},[2217],{"type":38,"value":2218},"Trois outils combinés font le travail. D'abord jscpd (Copy-Paste Detector, compatible TS\u002FJS) : sortie rapide des blocs dupliqués sur tout repo, configurable par seuil de tokens. Ensuite SonarQube en mode \"duplications\" : vue agrégée sur le repo entier. Enfin, des passes Grep ciblées sur les noms de domaine (\"calculate\", \"compute\", \"process\") pour repérer les paires sémantiquement proches mais nommées différemment. L'arsenal complet est détaillé dans les outils d'analyse statique en 2026.",{"type":29,"tag":2205,"props":2220,"children":2221},{},[2222,2227],{"type":29,"tag":2209,"props":2223,"children":2224},{},[2225],{"type":38,"value":2226},"2. La règle des 3 implémentations n'empêche-t-elle pas l'architecture hexagonale ?",{"type":29,"tag":30,"props":2228,"children":2229},{},[2230,2232,2238],{"type":38,"value":2231},"Non, parce que ",{"type":29,"tag":62,"props":2233,"children":2235},{"href":2234},"\u002Ffr\u002Farchitecture-craft\u002Farchitecture-hexagonale-java-exemples-bonnes-pratiques",[2236],{"type":38,"value":2237},"l'architecture hexagonale",{"type":38,"value":2239}," est justifiée par la testabilité, pas par la variation d'implémentation. Vous créez un port pour pouvoir tester avec un fake en mémoire. C'est 1 implémentation réelle + 1 fake de test : ça compte pour 2. Si en plus vous avez une vraie variation (Postgres + Redis, ou SMTP + Brevo), vous êtes à 3. La règle s'applique aux abstractions purement spéculatives, pas à celles qui ont une justification claire et nommée.",{"type":29,"tag":2205,"props":2241,"children":2242},{},[2243,2248],{"type":29,"tag":2209,"props":2244,"children":2245},{},[2246],{"type":38,"value":2247},"3. Comment convaincre une équipe attachée aux patterns enterprise ?",{"type":29,"tag":30,"props":2249,"children":2250},{},[2251],{"type":38,"value":2252},"Avec des chiffres sur leur propre repo. Comptez les interfaces qui n'ont qu'une implémentation, comptez les factories appelées une seule fois, comptez les LOC par use case. Présentez ça en revue d'architecture. Personne ne défend une factory inutilisée quand elle apparaît dans un tableau à côté de \"temps d'onboarding +4 semaines\". Le débat passe du dogme à l'économique.",{"type":29,"tag":2205,"props":2254,"children":2255},{},[2256,2261],{"type":29,"tag":2209,"props":2257,"children":2258},{},[2259],{"type":38,"value":2260},"4. Quel rapport entre ces faux amis et la code review IA ?",{"type":29,"tag":30,"props":2262,"children":2263},{},[2264],{"type":38,"value":2265},"Direct. Une revue de code IA-générée doit poser systématiquement 3 questions : \"Y a-t-il un doublon ailleurs dans le repo ?\", \"Cette abstraction est-elle justifiée par 3 cas réels ?\", \"La complexité de cette solution est-elle proportionnelle au besoin métier ?\". Ces 3 questions, en 2 minutes par PR, attrapent 80% des 3 faux amis avant le merge.",{"type":29,"tag":2205,"props":2267,"children":2268},{},[2269,2274],{"type":29,"tag":2209,"props":2270,"children":2271},{},[2272],{"type":38,"value":2273},"5. Le code Claude qui suit cette discipline est-il toujours du code \"généré par IA\" ?",{"type":29,"tag":30,"props":2275,"children":2276},{},[2277],{"type":38,"value":2278},"C'est une bonne question, et la réponse est : oui, mais pas par n'importe quel prompt. Le code Claude bien promté (avec contraintes YAGNI + recherche de doublons + proportionnalité) reste majoritairement du code IA-généré. Le développeur ajoute le contexte et la discipline. Claude exécute. C'est exactement la collaboration qu'on cherche : l'IA fait le travail mécanique, l'humain garde le jugement architectural.",{"type":29,"tag":2205,"props":2280,"children":2281},{},[2282,2287],{"type":29,"tag":2209,"props":2283,"children":2284},{},[2285],{"type":38,"value":2286},"6. Quelle est la métrique unique à suivre pour mesurer ces 3 faux amis ?",{"type":29,"tag":30,"props":2288,"children":2289},{},[2290,2292,2298],{"type":38,"value":2291},"Le ratio LOC par story point livré, mesuré sur 3 sprints glissants. Si la métrique monte, vous accumulez de la complexité accidentelle. Si elle baisse à valeur métier équivalente, vous gagnez en simplicité. C'est la métrique méta qui agrège les 3 faux amis sans avoir à les détecter individuellement, et c'est aussi un sujet que je détaille dans ",{"type":29,"tag":62,"props":2293,"children":2295},{"href":2294},"\u002Ffr\u002Fintelligence-artificielle\u002Fillusion-productivite-10x-pr",[2296],{"type":38,"value":2297},"l'illusion de productivité IA",{"type":38,"value":79},{"type":29,"tag":46,"props":2300,"children":2301},{},[],{"type":29,"tag":1196,"props":2303,"children":2308},{"cta":2304,"href":2305,"title":2306,"type":2307},"Évaluer la maturité de mon équipe →","\u002Fmes-ressources","Ressource gratuite : Engineering Maturity Assessment","resource",[2309],{"type":29,"tag":30,"props":2310,"children":2311},{},[2312],{"type":38,"value":2313},"L'EMA est l'outil que je propose au début de chaque mission. Il mesure la maturité de votre équipe sur plusieurs axes engineering : qualité du code, gouvernance IA, dette technique, vélocité réelle vs vélocité perçue. Quelques minutes pour identifier lequel des 3 faux amis s'installe le plus vite dans votre repo, et où concentrer vos efforts en priorité.",{"type":29,"tag":2315,"props":2316,"children":2317},"style",{},[2318],{"type":38,"value":2319},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":8,"searchDepth":196,"depth":196,"links":2321},[2322,2323,2324,2325,2326,2327,2328,2329,2330],{"id":52,"depth":196,"text":55},{"id":141,"depth":196,"text":144},{"id":711,"depth":196,"text":714},{"id":1213,"depth":196,"text":1216},{"id":1776,"depth":196,"text":1779},{"id":1931,"depth":196,"text":1934},{"id":1997,"depth":196,"text":2000},{"id":2151,"depth":196,"text":2154},{"id":2200,"depth":196,"text":2203},"markdown","content:fr:intelligence-artificielle:faux-ami-code-claude-coute-cher.md","content","fr\u002Fintelligence-artificielle\u002Ffaux-ami-code-claude-coute-cher.md","fr\u002Fintelligence-artificielle\u002Ffaux-ami-code-claude-coute-cher","md",{"_path":2338,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":2339,"description":2340,"id":2341,"date":2342,"listed":13,"nocomments":7,"hidden":13,"categories":2343,"tags":2344,"cover":2347,"readingTime":2348,"body":2353,"_type":2331,"_id":8206,"_source":2333,"_file":8207,"_stem":8208,"_extension":2336},"\u002Ffr\u002Fintelligence-artificielle\u002F5-patterns-dangereux-claude","5 anti-patterns que Claude reproduit en silence dans vos codebases","Cinq patterns dangereux que Claude écrit depuis 2 ans dans des milliers de repos. La liste, les exemples, et les contre-patterns craft à appliquer.",63,"2026-05-07",[6],[16,17,2345,2346,18],"software-craftsmanship","code-review","covers\u002Farticles\u002F5-patterns-dangereux-claude.jpg",{"text":2349,"minutes":2350,"time":2351,"words":2352},"15 min read",14.52,871200,2904,{"type":26,"children":2354,"toc":8194},[2355,2363,2368,2371,2377,2389,2394,2407,2432,2435,2441,2446,2451,4456,4505,4517,4520,4526,4539,4551,5088,5139,5636,5641,5644,5650,5671,6146,6151,6163,6762,6775,6780,6783,6789,6794,7079,7092,7113,7549,7569,7572,7578,7615,7627,7648,7661,7664,7670,7675,7843,7848,7851,7860,7863,7867,7872,7987,7997,8000,8004,8009,8014,8019,8030,8033,8042,8045,8051,8064,8084,8127,8140,8166,8179,8182,8190],{"type":29,"tag":30,"props":2356,"children":2357},{},[2358],{"type":29,"tag":34,"props":2359,"children":2360},{},[2361],{"type":38,"value":2362},"En construisant crmcoaching avec Claude (et au fil de mes accompagnements), j'ai vu Claude reproduire les mêmes 5 patterns à chaque nouvelle fonctionnalité. Copiés-collés sans relecture, ils pourrissent la maintenabilité à bas bruit. Aucun ne fait planter la prod tout de suite. Tous coûtent cher à 12 mois.",{"type":29,"tag":30,"props":2364,"children":2365},{},[2366],{"type":38,"value":2367},"Voici les 5 anti-patterns que je vois revenir, pourquoi Claude les écrit, et les contre-patterns craft que j'impose pour les neutraliser. Vous pouvez ouvrir votre repo principal et chercher ces signatures dès lundi matin.",{"type":29,"tag":46,"props":2369,"children":2370},{},[],{"type":29,"tag":50,"props":2372,"children":2374},{"id":2373},"pourquoi-claude-reproduit-certains-patterns-en-silence",[2375],{"type":38,"value":2376},"Pourquoi Claude reproduit certains patterns en silence",{"type":29,"tag":30,"props":2378,"children":2379},{},[2380,2382,2387],{"type":38,"value":2381},"Le constat de base est documenté. Le ",{"type":29,"tag":62,"props":2383,"children":2385},{"href":64,"rel":2384},[66],[2386],{"type":38,"value":69},{"type":38,"value":2388}," montre que sur 153 millions de lignes de code analysées, le code \"copié\" (par opposition à refactoré) a augmenté de 8 fois depuis l'arrivée massive des assistants IA dans les workflows de développement. Le code \"moved or refactored\" a baissé de 39%. Les équipes consomment de la suggestion brute et la collent dans leur repo, parfois sans modification.",{"type":29,"tag":30,"props":2390,"children":2391},{},[2392],{"type":38,"value":2393},"Ce n'est pas un problème de modèle, c'est un problème de training data. Claude apprend à partir de milliards de lignes de code public. Sur GitHub, le code public est massivement écrit par des juniors, des bibliothèques en alpha, des exemples de tutoriels, des copier-collers de Stack Overflow. Quand vous promptez Claude pour une God Function, il vous en livre une, parce que c'est la moyenne statistique de ce qu'il a vu. Et cette moyenne, comme je l'analyse dans le retour d'expérience sur la code review IA, est très en dessous du standard craft attendu en production sérieuse.",{"type":29,"tag":95,"props":2395,"children":2396},{},[2397],{"type":29,"tag":30,"props":2398,"children":2399},{},[2400,2405],{"type":29,"tag":34,"props":2401,"children":2402},{},[2403],{"type":38,"value":2404},"Ce que j'ai observé sur crmcoaching",{"type":38,"value":2406}," : au fil du développement du CRM, j'ai mesuré le ratio de fonctions de plus de 60 lignes dans les commits que j'acceptais tels quels versus ceux que je repassais en review avant de les intégrer. Sans grille de review active : 22% des fonctions Claude dépassaient ce seuil. Avec re-prompt explicite et review systématique : 4%. La codebase ne s'effondre pas tout de suite, mais le coût de modification grimpe linéairement avec la longueur moyenne des fonctions. À 6 mois, c'était le sujet n°1 de mes sessions de refactoring.",{"type":29,"tag":30,"props":2408,"children":2409},{},[2410,2412,2417,2419,2424,2426,2430],{"type":38,"value":2411},"Robert C. Martin l'avait écrit dans ",{"type":29,"tag":114,"props":2413,"children":2414},{},[2415],{"type":38,"value":2416},"Clean Code",{"type":38,"value":2418}," en 2008 : ",{"type":29,"tag":114,"props":2420,"children":2421},{},[2422],{"type":38,"value":2423},"\"The first rule of functions is that they should be small. The second rule of functions is that they should be smaller than that.\"",{"type":38,"value":2425}," Cette règle, exposée en français dans ",{"type":29,"tag":62,"props":2427,"children":2428},{"href":130},[2429],{"type":38,"value":133},{"type":38,"value":2431},", Claude ne l'applique pas par défaut. C'est à vous de la lui imposer par le prompt et la review.",{"type":29,"tag":46,"props":2433,"children":2434},{},[],{"type":29,"tag":50,"props":2436,"children":2438},{"id":2437},"pattern-1-la-god-function",[2439],{"type":38,"value":2440},"Pattern #1 : la God Function",{"type":29,"tag":30,"props":2442,"children":2443},{},[2444],{"type":38,"value":2445},"C'est le pattern le plus visible. Claude livre une fonction de 60 à 120 lignes qui fait tout : validation, transformation, accès DB, logging, envoi d'événement. Tout dans le même bloc, parce que c'est ce qui ressort statistiquement le plus dans le training data.",{"type":29,"tag":30,"props":2447,"children":2448},{},[2449],{"type":38,"value":2450},"Voici un exemple réel que j'ai vu apparaître dans crmcoaching sur la conversion d'un lead en client :",{"type":29,"tag":173,"props":2452,"children":2454},{"className":175,"code":2453,"language":177,"meta":8,"style":8},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fuse-cases\u002Fconvert-lead-to-client.use-case.ts\n\u002F\u002F Généré par Claude sans prompt de découpe (tel quel)\n\n@Injectable()\nexport class ConvertLeadToClientUseCase {\n  constructor(\n    private readonly prisma: PrismaClient,\n    private readonly brevoService: BrevoService,\n    private readonly auditService: AuditService,\n    private readonly eventEmitter: EventEmitter2,\n  ) {}\n\n  async execute(leadId: string, coachId: string): Promise\u003CClientDto> {\n    \u002F\u002F 1. Validation (15 lignes)\n    if (!leadId) throw new BadRequestException('leadId requis');\n    const lead = await this.prisma.lead.findUnique({ where: { id: leadId } });\n    if (!lead) throw new NotFoundException(`Lead ${leadId} introuvable`);\n    if (lead.coachId !== coachId) throw new ForbiddenException('Lead hors scope');\n    if (lead.status === 'CONVERTED') throw new ConflictException('Lead déjà converti');\n    const existingClient = await this.prisma.client.findFirst({\n      where: { email: lead.email, coachId },\n    });\n    if (existingClient) throw new ConflictException('Client existant avec cet email');\n    \u002F\u002F ... 8 autres lignes de validation métier\n\n    \u002F\u002F 2. Création du client (15 lignes)\n    const client = await this.prisma.client.create({\n      data: {\n        email: lead.email,\n        firstName: lead.firstName,\n        lastName: lead.lastName,\n        phone: lead.phone,\n        coachId,\n        status: 'ACTIVE',\n        createdBy: coachId,\n        convertedFromLeadId: leadId,\n      },\n    });\n    await this.prisma.lead.update({\n      where: { id: leadId },\n      data: { status: 'CONVERTED', convertedAt: new Date(), convertedToClientId: client.id },\n    });\n\n    \u002F\u002F 3. Notification Brevo (12 lignes)\n    await this.brevoService.sendTransactionalEmail({\n      to: [{ email: client.email, name: `${client.firstName} ${client.lastName}` }],\n      templateId: 42,\n      params: { firstName: client.firstName, coachName: lead.coachId },\n    });\n    await this.brevoService.addContactToList(client.email, 'clients-actifs');\n\n    \u002F\u002F 4. Audit (6 lignes)\n    await this.auditService.log({\n      action: 'LEAD_CONVERTED',\n      entityType: 'client',\n      entityId: client.id,\n      userId: coachId,\n      meta: { fromLeadId: leadId },\n    });\n\n    \u002F\u002F 5. Événement domaine (4 lignes)\n    this.eventEmitter.emit('client.created', { clientId: client.id, coachId });\n\n    return ClientDto.fromPrisma(client);\n  }\n}\n",[2455],{"type":29,"tag":156,"props":2456,"children":2457},{"__ignoreMap":8},[2458,2466,2474,2481,2496,2516,2527,2556,2585,2614,2643,2654,2661,2737,2745,2796,2900,2969,3029,3093,3152,3205,3222,3264,3273,3281,3290,3347,3364,3393,3423,3453,3483,3496,3518,3539,3561,3570,3586,3631,3663,3748,3764,3772,3781,3819,3939,3961,4028,4044,4103,4111,4120,4158,4180,4202,4232,4253,4287,4303,4311,4320,4404,4411,4441,4448],{"type":29,"tag":183,"props":2459,"children":2460},{"class":185,"line":186},[2461],{"type":29,"tag":183,"props":2462,"children":2463},{"style":190},[2464],{"type":38,"value":2465},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fuse-cases\u002Fconvert-lead-to-client.use-case.ts\n",{"type":29,"tag":183,"props":2467,"children":2468},{"class":185,"line":196},[2469],{"type":29,"tag":183,"props":2470,"children":2471},{"style":190},[2472],{"type":38,"value":2473},"\u002F\u002F Généré par Claude sans prompt de découpe (tel quel)\n",{"type":29,"tag":183,"props":2475,"children":2476},{"class":185,"line":218},[2477],{"type":29,"tag":183,"props":2478,"children":2479},{"emptyLinePlaceholder":13},[2480],{"type":38,"value":445},{"type":29,"tag":183,"props":2482,"children":2483},{"class":185,"line":245},[2484,2488,2492],{"type":29,"tag":183,"props":2485,"children":2486},{"style":828},[2487],{"type":38,"value":831},{"type":29,"tag":183,"props":2489,"children":2490},{"style":206},[2491],{"type":38,"value":836},{"type":29,"tag":183,"props":2493,"children":2494},{"style":839},[2495],{"type":38,"value":842},{"type":29,"tag":183,"props":2497,"children":2498},{"class":185,"line":266},[2499,2503,2507,2512],{"type":29,"tag":183,"props":2500,"children":2501},{"style":200},[2502],{"type":38,"value":742},{"type":29,"tag":183,"props":2504,"children":2505},{"style":200},[2506],{"type":38,"value":854},{"type":29,"tag":183,"props":2508,"children":2509},{"style":750},[2510],{"type":38,"value":2511}," ConvertLeadToClientUseCase",{"type":29,"tag":183,"props":2513,"children":2514},{"style":212},[2515],{"type":38,"value":285},{"type":29,"tag":183,"props":2517,"children":2518},{"class":185,"line":288},[2519,2523],{"type":29,"tag":183,"props":2520,"children":2521},{"style":200},[2522],{"type":38,"value":1279},{"type":29,"tag":183,"props":2524,"children":2525},{"style":212},[2526],{"type":38,"value":215},{"type":29,"tag":183,"props":2528,"children":2529},{"class":185,"line":330},[2530,2534,2538,2543,2547,2552],{"type":29,"tag":183,"props":2531,"children":2532},{"style":200},[2533],{"type":38,"value":1291},{"type":29,"tag":183,"props":2535,"children":2536},{"style":200},[2537],{"type":38,"value":1296},{"type":29,"tag":183,"props":2539,"children":2540},{"style":222},[2541],{"type":38,"value":2542}," prisma",{"type":29,"tag":183,"props":2544,"children":2545},{"style":228},[2546],{"type":38,"value":231},{"type":29,"tag":183,"props":2548,"children":2549},{"style":750},[2550],{"type":38,"value":2551}," PrismaClient",{"type":29,"tag":183,"props":2553,"children":2554},{"style":212},[2555],{"type":38,"value":242},{"type":29,"tag":183,"props":2557,"children":2558},{"class":185,"line":374},[2559,2563,2567,2572,2576,2581],{"type":29,"tag":183,"props":2560,"children":2561},{"style":200},[2562],{"type":38,"value":1291},{"type":29,"tag":183,"props":2564,"children":2565},{"style":200},[2566],{"type":38,"value":1296},{"type":29,"tag":183,"props":2568,"children":2569},{"style":222},[2570],{"type":38,"value":2571}," brevoService",{"type":29,"tag":183,"props":2573,"children":2574},{"style":228},[2575],{"type":38,"value":231},{"type":29,"tag":183,"props":2577,"children":2578},{"style":750},[2579],{"type":38,"value":2580}," BrevoService",{"type":29,"tag":183,"props":2582,"children":2583},{"style":212},[2584],{"type":38,"value":242},{"type":29,"tag":183,"props":2586,"children":2587},{"class":185,"line":430},[2588,2592,2596,2601,2605,2610],{"type":29,"tag":183,"props":2589,"children":2590},{"style":200},[2591],{"type":38,"value":1291},{"type":29,"tag":183,"props":2593,"children":2594},{"style":200},[2595],{"type":38,"value":1296},{"type":29,"tag":183,"props":2597,"children":2598},{"style":222},[2599],{"type":38,"value":2600}," auditService",{"type":29,"tag":183,"props":2602,"children":2603},{"style":228},[2604],{"type":38,"value":231},{"type":29,"tag":183,"props":2606,"children":2607},{"style":750},[2608],{"type":38,"value":2609}," AuditService",{"type":29,"tag":183,"props":2611,"children":2612},{"style":212},[2613],{"type":38,"value":242},{"type":29,"tag":183,"props":2615,"children":2616},{"class":185,"line":439},[2617,2621,2625,2630,2634,2639],{"type":29,"tag":183,"props":2618,"children":2619},{"style":200},[2620],{"type":38,"value":1291},{"type":29,"tag":183,"props":2622,"children":2623},{"style":200},[2624],{"type":38,"value":1296},{"type":29,"tag":183,"props":2626,"children":2627},{"style":222},[2628],{"type":38,"value":2629}," eventEmitter",{"type":29,"tag":183,"props":2631,"children":2632},{"style":228},[2633],{"type":38,"value":231},{"type":29,"tag":183,"props":2635,"children":2636},{"style":750},[2637],{"type":38,"value":2638}," EventEmitter2",{"type":29,"tag":183,"props":2640,"children":2641},{"style":212},[2642],{"type":38,"value":242},{"type":29,"tag":183,"props":2644,"children":2645},{"class":185,"line":448},[2646,2650],{"type":29,"tag":183,"props":2647,"children":2648},{"style":212},[2649],{"type":38,"value":1380},{"type":29,"tag":183,"props":2651,"children":2652},{"style":212},[2653],{"type":38,"value":1385},{"type":29,"tag":183,"props":2655,"children":2656},{"class":185,"line":457},[2657],{"type":29,"tag":183,"props":2658,"children":2659},{"emptyLinePlaceholder":13},[2660],{"type":38,"value":445},{"type":29,"tag":183,"props":2662,"children":2663},{"class":185,"line":474},[2664,2668,2673,2677,2682,2686,2690,2695,2700,2704,2708,2712,2716,2720,2724,2729,2733],{"type":29,"tag":183,"props":2665,"children":2666},{"style":200},[2667],{"type":38,"value":1400},{"type":29,"tag":183,"props":2669,"children":2670},{"style":206},[2671],{"type":38,"value":2672}," execute",{"type":29,"tag":183,"props":2674,"children":2675},{"style":212},[2676],{"type":38,"value":770},{"type":29,"tag":183,"props":2678,"children":2679},{"style":222},[2680],{"type":38,"value":2681},"leadId",{"type":29,"tag":183,"props":2683,"children":2684},{"style":228},[2685],{"type":38,"value":231},{"type":29,"tag":183,"props":2687,"children":2688},{"style":234},[2689],{"type":38,"value":1070},{"type":29,"tag":183,"props":2691,"children":2692},{"style":212},[2693],{"type":38,"value":2694},",",{"type":29,"tag":183,"props":2696,"children":2697},{"style":222},[2698],{"type":38,"value":2699}," coachId",{"type":29,"tag":183,"props":2701,"children":2702},{"style":228},[2703],{"type":38,"value":231},{"type":29,"tag":183,"props":2705,"children":2706},{"style":234},[2707],{"type":38,"value":1070},{"type":29,"tag":183,"props":2709,"children":2710},{"style":212},[2711],{"type":38,"value":272},{"type":29,"tag":183,"props":2713,"children":2714},{"style":228},[2715],{"type":38,"value":231},{"type":29,"tag":183,"props":2717,"children":2718},{"style":750},[2719],{"type":38,"value":1436},{"type":29,"tag":183,"props":2721,"children":2722},{"style":1439},[2723],{"type":38,"value":1442},{"type":29,"tag":183,"props":2725,"children":2726},{"style":750},[2727],{"type":38,"value":2728},"ClientDto",{"type":29,"tag":183,"props":2730,"children":2731},{"style":1439},[2732],{"type":38,"value":1452},{"type":29,"tag":183,"props":2734,"children":2735},{"style":212},[2736],{"type":38,"value":285},{"type":29,"tag":183,"props":2738,"children":2739},{"class":185,"line":495},[2740],{"type":29,"tag":183,"props":2741,"children":2742},{"style":190},[2743],{"type":38,"value":2744},"    \u002F\u002F 1. Validation (15 lignes)\n",{"type":29,"tag":183,"props":2746,"children":2747},{"class":185,"line":516},[2748,2752,2756,2760,2765,2770,2774,2779,2783,2788,2792],{"type":29,"tag":183,"props":2749,"children":2750},{"style":200},[2751],{"type":38,"value":1528},{"type":29,"tag":183,"props":2753,"children":2754},{"style":308},[2755],{"type":38,"value":1533},{"type":29,"tag":183,"props":2757,"children":2758},{"style":228},[2759],{"type":38,"value":1538},{"type":29,"tag":183,"props":2761,"children":2762},{"style":308},[2763],{"type":38,"value":2764},"leadId) ",{"type":29,"tag":183,"props":2766,"children":2767},{"style":200},[2768],{"type":38,"value":2769},"throw",{"type":29,"tag":183,"props":2771,"children":2772},{"style":1096},[2773],{"type":38,"value":1099},{"type":29,"tag":183,"props":2775,"children":2776},{"style":206},[2777],{"type":38,"value":2778}," BadRequestException",{"type":29,"tag":183,"props":2780,"children":2781},{"style":308},[2782],{"type":38,"value":770},{"type":29,"tag":183,"props":2784,"children":2785},{"style":1683},[2786],{"type":38,"value":2787},"'leadId requis'",{"type":29,"tag":183,"props":2789,"children":2790},{"style":308},[2791],{"type":38,"value":272},{"type":29,"tag":183,"props":2793,"children":2794},{"style":212},[2795],{"type":38,"value":327},{"type":29,"tag":183,"props":2797,"children":2798},{"class":185,"line":536},[2799,2803,2807,2811,2815,2819,2823,2828,2832,2836,2840,2845,2849,2854,2859,2863,2868,2873,2877,2882,2887,2892,2896],{"type":29,"tag":183,"props":2800,"children":2801},{"style":200},[2802],{"type":38,"value":1464},{"type":29,"tag":183,"props":2804,"children":2805},{"style":297},[2806],{"type":38,"value":924},{"type":29,"tag":183,"props":2808,"children":2809},{"style":228},[2810],{"type":38,"value":305},{"type":29,"tag":183,"props":2812,"children":2813},{"style":200},[2814],{"type":38,"value":1478},{"type":29,"tag":183,"props":2816,"children":2817},{"style":1481},[2818],{"type":38,"value":1484},{"type":29,"tag":183,"props":2820,"children":2821},{"style":388},[2822],{"type":38,"value":79},{"type":29,"tag":183,"props":2824,"children":2825},{"style":308},[2826],{"type":38,"value":2827},"prisma",{"type":29,"tag":183,"props":2829,"children":2830},{"style":388},[2831],{"type":38,"value":79},{"type":29,"tag":183,"props":2833,"children":2834},{"style":308},[2835],{"type":38,"value":775},{"type":29,"tag":183,"props":2837,"children":2838},{"style":388},[2839],{"type":38,"value":79},{"type":29,"tag":183,"props":2841,"children":2842},{"style":206},[2843],{"type":38,"value":2844},"findUnique",{"type":29,"tag":183,"props":2846,"children":2847},{"style":308},[2848],{"type":38,"value":770},{"type":29,"tag":183,"props":2850,"children":2851},{"style":212},[2852],{"type":38,"value":2853},"{",{"type":29,"tag":183,"props":2855,"children":2856},{"style":308},[2857],{"type":38,"value":2858}," where",{"type":29,"tag":183,"props":2860,"children":2861},{"style":388},[2862],{"type":38,"value":231},{"type":29,"tag":183,"props":2864,"children":2865},{"style":212},[2866],{"type":38,"value":2867}," {",{"type":29,"tag":183,"props":2869,"children":2870},{"style":308},[2871],{"type":38,"value":2872}," id",{"type":29,"tag":183,"props":2874,"children":2875},{"style":388},[2876],{"type":38,"value":231},{"type":29,"tag":183,"props":2878,"children":2879},{"style":308},[2880],{"type":38,"value":2881}," leadId ",{"type":29,"tag":183,"props":2883,"children":2884},{"style":212},[2885],{"type":38,"value":2886},"}",{"type":29,"tag":183,"props":2888,"children":2889},{"style":212},[2890],{"type":38,"value":2891}," }",{"type":29,"tag":183,"props":2893,"children":2894},{"style":308},[2895],{"type":38,"value":272},{"type":29,"tag":183,"props":2897,"children":2898},{"style":212},[2899],{"type":38,"value":327},{"type":29,"tag":183,"props":2901,"children":2902},{"class":185,"line":570},[2903,2907,2911,2915,2920,2924,2928,2933,2937,2942,2948,2952,2956,2961,2965],{"type":29,"tag":183,"props":2904,"children":2905},{"style":200},[2906],{"type":38,"value":1528},{"type":29,"tag":183,"props":2908,"children":2909},{"style":308},[2910],{"type":38,"value":1533},{"type":29,"tag":183,"props":2912,"children":2913},{"style":228},[2914],{"type":38,"value":1538},{"type":29,"tag":183,"props":2916,"children":2917},{"style":308},[2918],{"type":38,"value":2919},"lead) ",{"type":29,"tag":183,"props":2921,"children":2922},{"style":200},[2923],{"type":38,"value":2769},{"type":29,"tag":183,"props":2925,"children":2926},{"style":1096},[2927],{"type":38,"value":1099},{"type":29,"tag":183,"props":2929,"children":2930},{"style":206},[2931],{"type":38,"value":2932}," NotFoundException",{"type":29,"tag":183,"props":2934,"children":2935},{"style":308},[2936],{"type":38,"value":770},{"type":29,"tag":183,"props":2938,"children":2939},{"style":1683},[2940],{"type":38,"value":2941},"`Lead ",{"type":29,"tag":183,"props":2943,"children":2945},{"style":2944},"--shiki-default:#949CBB;--shiki-dark:#9ECBFF",[2946],{"type":38,"value":2947},"${",{"type":29,"tag":183,"props":2949,"children":2950},{"style":308},[2951],{"type":38,"value":2681},{"type":29,"tag":183,"props":2953,"children":2954},{"style":2944},[2955],{"type":38,"value":2886},{"type":29,"tag":183,"props":2957,"children":2958},{"style":1683},[2959],{"type":38,"value":2960}," introuvable`",{"type":29,"tag":183,"props":2962,"children":2963},{"style":308},[2964],{"type":38,"value":272},{"type":29,"tag":183,"props":2966,"children":2967},{"style":212},[2968],{"type":38,"value":327},{"type":29,"tag":183,"props":2970,"children":2971},{"class":185,"line":613},[2972,2976,2980,2984,2989,2994,2999,3003,3007,3012,3016,3021,3025],{"type":29,"tag":183,"props":2973,"children":2974},{"style":200},[2975],{"type":38,"value":1528},{"type":29,"tag":183,"props":2977,"children":2978},{"style":308},[2979],{"type":38,"value":952},{"type":29,"tag":183,"props":2981,"children":2982},{"style":388},[2983],{"type":38,"value":79},{"type":29,"tag":183,"props":2985,"children":2986},{"style":308},[2987],{"type":38,"value":2988},"coachId ",{"type":29,"tag":183,"props":2990,"children":2991},{"style":228},[2992],{"type":38,"value":2993},"!==",{"type":29,"tag":183,"props":2995,"children":2996},{"style":308},[2997],{"type":38,"value":2998}," coachId) ",{"type":29,"tag":183,"props":3000,"children":3001},{"style":200},[3002],{"type":38,"value":2769},{"type":29,"tag":183,"props":3004,"children":3005},{"style":1096},[3006],{"type":38,"value":1099},{"type":29,"tag":183,"props":3008,"children":3009},{"style":206},[3010],{"type":38,"value":3011}," ForbiddenException",{"type":29,"tag":183,"props":3013,"children":3014},{"style":308},[3015],{"type":38,"value":770},{"type":29,"tag":183,"props":3017,"children":3018},{"style":1683},[3019],{"type":38,"value":3020},"'Lead hors scope'",{"type":29,"tag":183,"props":3022,"children":3023},{"style":308},[3024],{"type":38,"value":272},{"type":29,"tag":183,"props":3026,"children":3027},{"style":212},[3028],{"type":38,"value":327},{"type":29,"tag":183,"props":3030,"children":3031},{"class":185,"line":662},[3032,3036,3040,3044,3049,3054,3059,3063,3067,3071,3076,3080,3085,3089],{"type":29,"tag":183,"props":3033,"children":3034},{"style":200},[3035],{"type":38,"value":1528},{"type":29,"tag":183,"props":3037,"children":3038},{"style":308},[3039],{"type":38,"value":952},{"type":29,"tag":183,"props":3041,"children":3042},{"style":388},[3043],{"type":38,"value":79},{"type":29,"tag":183,"props":3045,"children":3046},{"style":308},[3047],{"type":38,"value":3048},"status ",{"type":29,"tag":183,"props":3050,"children":3051},{"style":228},[3052],{"type":38,"value":3053},"===",{"type":29,"tag":183,"props":3055,"children":3056},{"style":1683},[3057],{"type":38,"value":3058}," 'CONVERTED'",{"type":29,"tag":183,"props":3060,"children":3061},{"style":308},[3062],{"type":38,"value":415},{"type":29,"tag":183,"props":3064,"children":3065},{"style":200},[3066],{"type":38,"value":2769},{"type":29,"tag":183,"props":3068,"children":3069},{"style":1096},[3070],{"type":38,"value":1099},{"type":29,"tag":183,"props":3072,"children":3073},{"style":206},[3074],{"type":38,"value":3075}," ConflictException",{"type":29,"tag":183,"props":3077,"children":3078},{"style":308},[3079],{"type":38,"value":770},{"type":29,"tag":183,"props":3081,"children":3082},{"style":1683},[3083],{"type":38,"value":3084},"'Lead déjà converti'",{"type":29,"tag":183,"props":3086,"children":3087},{"style":308},[3088],{"type":38,"value":272},{"type":29,"tag":183,"props":3090,"children":3091},{"style":212},[3092],{"type":38,"value":327},{"type":29,"tag":183,"props":3094,"children":3096},{"class":185,"line":3095},20,[3097,3101,3106,3110,3114,3118,3122,3126,3130,3135,3139,3144,3148],{"type":29,"tag":183,"props":3098,"children":3099},{"style":200},[3100],{"type":38,"value":1464},{"type":29,"tag":183,"props":3102,"children":3103},{"style":297},[3104],{"type":38,"value":3105}," existingClient",{"type":29,"tag":183,"props":3107,"children":3108},{"style":228},[3109],{"type":38,"value":305},{"type":29,"tag":183,"props":3111,"children":3112},{"style":200},[3113],{"type":38,"value":1478},{"type":29,"tag":183,"props":3115,"children":3116},{"style":1481},[3117],{"type":38,"value":1484},{"type":29,"tag":183,"props":3119,"children":3120},{"style":388},[3121],{"type":38,"value":79},{"type":29,"tag":183,"props":3123,"children":3124},{"style":308},[3125],{"type":38,"value":2827},{"type":29,"tag":183,"props":3127,"children":3128},{"style":388},[3129],{"type":38,"value":79},{"type":29,"tag":183,"props":3131,"children":3132},{"style":308},[3133],{"type":38,"value":3134},"client",{"type":29,"tag":183,"props":3136,"children":3137},{"style":388},[3138],{"type":38,"value":79},{"type":29,"tag":183,"props":3140,"children":3141},{"style":206},[3142],{"type":38,"value":3143},"findFirst",{"type":29,"tag":183,"props":3145,"children":3146},{"style":308},[3147],{"type":38,"value":770},{"type":29,"tag":183,"props":3149,"children":3150},{"style":212},[3151],{"type":38,"value":1548},{"type":29,"tag":183,"props":3153,"children":3155},{"class":185,"line":3154},21,[3156,3161,3165,3169,3174,3178,3182,3186,3191,3195,3200],{"type":29,"tag":183,"props":3157,"children":3158},{"style":308},[3159],{"type":38,"value":3160},"      where",{"type":29,"tag":183,"props":3162,"children":3163},{"style":388},[3164],{"type":38,"value":231},{"type":29,"tag":183,"props":3166,"children":3167},{"style":212},[3168],{"type":38,"value":2867},{"type":29,"tag":183,"props":3170,"children":3171},{"style":308},[3172],{"type":38,"value":3173}," email",{"type":29,"tag":183,"props":3175,"children":3176},{"style":388},[3177],{"type":38,"value":231},{"type":29,"tag":183,"props":3179,"children":3180},{"style":308},[3181],{"type":38,"value":924},{"type":29,"tag":183,"props":3183,"children":3184},{"style":388},[3185],{"type":38,"value":79},{"type":29,"tag":183,"props":3187,"children":3188},{"style":308},[3189],{"type":38,"value":3190},"email",{"type":29,"tag":183,"props":3192,"children":3193},{"style":212},[3194],{"type":38,"value":2694},{"type":29,"tag":183,"props":3196,"children":3197},{"style":308},[3198],{"type":38,"value":3199}," coachId ",{"type":29,"tag":183,"props":3201,"children":3202},{"style":212},[3203],{"type":38,"value":3204},"},\n",{"type":29,"tag":183,"props":3206,"children":3208},{"class":185,"line":3207},22,[3209,3214,3218],{"type":29,"tag":183,"props":3210,"children":3211},{"style":212},[3212],{"type":38,"value":3213},"    }",{"type":29,"tag":183,"props":3215,"children":3216},{"style":308},[3217],{"type":38,"value":272},{"type":29,"tag":183,"props":3219,"children":3220},{"style":212},[3221],{"type":38,"value":327},{"type":29,"tag":183,"props":3223,"children":3225},{"class":185,"line":3224},23,[3226,3230,3235,3239,3243,3247,3251,3256,3260],{"type":29,"tag":183,"props":3227,"children":3228},{"style":200},[3229],{"type":38,"value":1528},{"type":29,"tag":183,"props":3231,"children":3232},{"style":308},[3233],{"type":38,"value":3234}," (existingClient) ",{"type":29,"tag":183,"props":3236,"children":3237},{"style":200},[3238],{"type":38,"value":2769},{"type":29,"tag":183,"props":3240,"children":3241},{"style":1096},[3242],{"type":38,"value":1099},{"type":29,"tag":183,"props":3244,"children":3245},{"style":206},[3246],{"type":38,"value":3075},{"type":29,"tag":183,"props":3248,"children":3249},{"style":308},[3250],{"type":38,"value":770},{"type":29,"tag":183,"props":3252,"children":3253},{"style":1683},[3254],{"type":38,"value":3255},"'Client existant avec cet email'",{"type":29,"tag":183,"props":3257,"children":3258},{"style":308},[3259],{"type":38,"value":272},{"type":29,"tag":183,"props":3261,"children":3262},{"style":212},[3263],{"type":38,"value":327},{"type":29,"tag":183,"props":3265,"children":3267},{"class":185,"line":3266},24,[3268],{"type":29,"tag":183,"props":3269,"children":3270},{"style":190},[3271],{"type":38,"value":3272},"    \u002F\u002F ... 8 autres lignes de validation métier\n",{"type":29,"tag":183,"props":3274,"children":3276},{"class":185,"line":3275},25,[3277],{"type":29,"tag":183,"props":3278,"children":3279},{"emptyLinePlaceholder":13},[3280],{"type":38,"value":445},{"type":29,"tag":183,"props":3282,"children":3284},{"class":185,"line":3283},26,[3285],{"type":29,"tag":183,"props":3286,"children":3287},{"style":190},[3288],{"type":38,"value":3289},"    \u002F\u002F 2. Création du client (15 lignes)\n",{"type":29,"tag":183,"props":3291,"children":3293},{"class":185,"line":3292},27,[3294,3298,3302,3306,3310,3314,3318,3322,3326,3330,3334,3339,3343],{"type":29,"tag":183,"props":3295,"children":3296},{"style":200},[3297],{"type":38,"value":1464},{"type":29,"tag":183,"props":3299,"children":3300},{"style":297},[3301],{"type":38,"value":1469},{"type":29,"tag":183,"props":3303,"children":3304},{"style":228},[3305],{"type":38,"value":305},{"type":29,"tag":183,"props":3307,"children":3308},{"style":200},[3309],{"type":38,"value":1478},{"type":29,"tag":183,"props":3311,"children":3312},{"style":1481},[3313],{"type":38,"value":1484},{"type":29,"tag":183,"props":3315,"children":3316},{"style":388},[3317],{"type":38,"value":79},{"type":29,"tag":183,"props":3319,"children":3320},{"style":308},[3321],{"type":38,"value":2827},{"type":29,"tag":183,"props":3323,"children":3324},{"style":388},[3325],{"type":38,"value":79},{"type":29,"tag":183,"props":3327,"children":3328},{"style":308},[3329],{"type":38,"value":3134},{"type":29,"tag":183,"props":3331,"children":3332},{"style":388},[3333],{"type":38,"value":79},{"type":29,"tag":183,"props":3335,"children":3336},{"style":206},[3337],{"type":38,"value":3338},"create",{"type":29,"tag":183,"props":3340,"children":3341},{"style":308},[3342],{"type":38,"value":770},{"type":29,"tag":183,"props":3344,"children":3345},{"style":212},[3346],{"type":38,"value":1548},{"type":29,"tag":183,"props":3348,"children":3350},{"class":185,"line":3349},28,[3351,3356,3360],{"type":29,"tag":183,"props":3352,"children":3353},{"style":308},[3354],{"type":38,"value":3355},"      data",{"type":29,"tag":183,"props":3357,"children":3358},{"style":388},[3359],{"type":38,"value":231},{"type":29,"tag":183,"props":3361,"children":3362},{"style":212},[3363],{"type":38,"value":285},{"type":29,"tag":183,"props":3365,"children":3367},{"class":185,"line":3366},29,[3368,3373,3377,3381,3385,3389],{"type":29,"tag":183,"props":3369,"children":3370},{"style":308},[3371],{"type":38,"value":3372},"        email",{"type":29,"tag":183,"props":3374,"children":3375},{"style":388},[3376],{"type":38,"value":231},{"type":29,"tag":183,"props":3378,"children":3379},{"style":308},[3380],{"type":38,"value":924},{"type":29,"tag":183,"props":3382,"children":3383},{"style":388},[3384],{"type":38,"value":79},{"type":29,"tag":183,"props":3386,"children":3387},{"style":308},[3388],{"type":38,"value":3190},{"type":29,"tag":183,"props":3390,"children":3391},{"style":212},[3392],{"type":38,"value":242},{"type":29,"tag":183,"props":3394,"children":3396},{"class":185,"line":3395},30,[3397,3402,3406,3410,3414,3419],{"type":29,"tag":183,"props":3398,"children":3399},{"style":308},[3400],{"type":38,"value":3401},"        firstName",{"type":29,"tag":183,"props":3403,"children":3404},{"style":388},[3405],{"type":38,"value":231},{"type":29,"tag":183,"props":3407,"children":3408},{"style":308},[3409],{"type":38,"value":924},{"type":29,"tag":183,"props":3411,"children":3412},{"style":388},[3413],{"type":38,"value":79},{"type":29,"tag":183,"props":3415,"children":3416},{"style":308},[3417],{"type":38,"value":3418},"firstName",{"type":29,"tag":183,"props":3420,"children":3421},{"style":212},[3422],{"type":38,"value":242},{"type":29,"tag":183,"props":3424,"children":3426},{"class":185,"line":3425},31,[3427,3432,3436,3440,3444,3449],{"type":29,"tag":183,"props":3428,"children":3429},{"style":308},[3430],{"type":38,"value":3431},"        lastName",{"type":29,"tag":183,"props":3433,"children":3434},{"style":388},[3435],{"type":38,"value":231},{"type":29,"tag":183,"props":3437,"children":3438},{"style":308},[3439],{"type":38,"value":924},{"type":29,"tag":183,"props":3441,"children":3442},{"style":388},[3443],{"type":38,"value":79},{"type":29,"tag":183,"props":3445,"children":3446},{"style":308},[3447],{"type":38,"value":3448},"lastName",{"type":29,"tag":183,"props":3450,"children":3451},{"style":212},[3452],{"type":38,"value":242},{"type":29,"tag":183,"props":3454,"children":3456},{"class":185,"line":3455},32,[3457,3462,3466,3470,3474,3479],{"type":29,"tag":183,"props":3458,"children":3459},{"style":308},[3460],{"type":38,"value":3461},"        phone",{"type":29,"tag":183,"props":3463,"children":3464},{"style":388},[3465],{"type":38,"value":231},{"type":29,"tag":183,"props":3467,"children":3468},{"style":308},[3469],{"type":38,"value":924},{"type":29,"tag":183,"props":3471,"children":3472},{"style":388},[3473],{"type":38,"value":79},{"type":29,"tag":183,"props":3475,"children":3476},{"style":308},[3477],{"type":38,"value":3478},"phone",{"type":29,"tag":183,"props":3480,"children":3481},{"style":212},[3482],{"type":38,"value":242},{"type":29,"tag":183,"props":3484,"children":3486},{"class":185,"line":3485},33,[3487,3492],{"type":29,"tag":183,"props":3488,"children":3489},{"style":308},[3490],{"type":38,"value":3491},"        coachId",{"type":29,"tag":183,"props":3493,"children":3494},{"style":212},[3495],{"type":38,"value":242},{"type":29,"tag":183,"props":3497,"children":3499},{"class":185,"line":3498},34,[3500,3505,3509,3514],{"type":29,"tag":183,"props":3501,"children":3502},{"style":308},[3503],{"type":38,"value":3504},"        status",{"type":29,"tag":183,"props":3506,"children":3507},{"style":388},[3508],{"type":38,"value":231},{"type":29,"tag":183,"props":3510,"children":3511},{"style":1683},[3512],{"type":38,"value":3513}," 'ACTIVE'",{"type":29,"tag":183,"props":3515,"children":3516},{"style":212},[3517],{"type":38,"value":242},{"type":29,"tag":183,"props":3519,"children":3521},{"class":185,"line":3520},35,[3522,3527,3531,3535],{"type":29,"tag":183,"props":3523,"children":3524},{"style":308},[3525],{"type":38,"value":3526},"        createdBy",{"type":29,"tag":183,"props":3528,"children":3529},{"style":388},[3530],{"type":38,"value":231},{"type":29,"tag":183,"props":3532,"children":3533},{"style":308},[3534],{"type":38,"value":2699},{"type":29,"tag":183,"props":3536,"children":3537},{"style":212},[3538],{"type":38,"value":242},{"type":29,"tag":183,"props":3540,"children":3542},{"class":185,"line":3541},36,[3543,3548,3552,3557],{"type":29,"tag":183,"props":3544,"children":3545},{"style":308},[3546],{"type":38,"value":3547},"        convertedFromLeadId",{"type":29,"tag":183,"props":3549,"children":3550},{"style":388},[3551],{"type":38,"value":231},{"type":29,"tag":183,"props":3553,"children":3554},{"style":308},[3555],{"type":38,"value":3556}," leadId",{"type":29,"tag":183,"props":3558,"children":3559},{"style":212},[3560],{"type":38,"value":242},{"type":29,"tag":183,"props":3562,"children":3564},{"class":185,"line":3563},37,[3565],{"type":29,"tag":183,"props":3566,"children":3567},{"style":212},[3568],{"type":38,"value":3569},"      },\n",{"type":29,"tag":183,"props":3571,"children":3573},{"class":185,"line":3572},38,[3574,3578,3582],{"type":29,"tag":183,"props":3575,"children":3576},{"style":212},[3577],{"type":38,"value":3213},{"type":29,"tag":183,"props":3579,"children":3580},{"style":308},[3581],{"type":38,"value":272},{"type":29,"tag":183,"props":3583,"children":3584},{"style":212},[3585],{"type":38,"value":327},{"type":29,"tag":183,"props":3587,"children":3589},{"class":185,"line":3588},39,[3590,3594,3598,3602,3606,3610,3614,3618,3623,3627],{"type":29,"tag":183,"props":3591,"children":3592},{"style":200},[3593],{"type":38,"value":1597},{"type":29,"tag":183,"props":3595,"children":3596},{"style":1481},[3597],{"type":38,"value":1484},{"type":29,"tag":183,"props":3599,"children":3600},{"style":388},[3601],{"type":38,"value":79},{"type":29,"tag":183,"props":3603,"children":3604},{"style":308},[3605],{"type":38,"value":2827},{"type":29,"tag":183,"props":3607,"children":3608},{"style":388},[3609],{"type":38,"value":79},{"type":29,"tag":183,"props":3611,"children":3612},{"style":308},[3613],{"type":38,"value":775},{"type":29,"tag":183,"props":3615,"children":3616},{"style":388},[3617],{"type":38,"value":79},{"type":29,"tag":183,"props":3619,"children":3620},{"style":206},[3621],{"type":38,"value":3622},"update",{"type":29,"tag":183,"props":3624,"children":3625},{"style":308},[3626],{"type":38,"value":770},{"type":29,"tag":183,"props":3628,"children":3629},{"style":212},[3630],{"type":38,"value":1548},{"type":29,"tag":183,"props":3632,"children":3634},{"class":185,"line":3633},40,[3635,3639,3643,3647,3651,3655,3659],{"type":29,"tag":183,"props":3636,"children":3637},{"style":308},[3638],{"type":38,"value":3160},{"type":29,"tag":183,"props":3640,"children":3641},{"style":388},[3642],{"type":38,"value":231},{"type":29,"tag":183,"props":3644,"children":3645},{"style":212},[3646],{"type":38,"value":2867},{"type":29,"tag":183,"props":3648,"children":3649},{"style":308},[3650],{"type":38,"value":2872},{"type":29,"tag":183,"props":3652,"children":3653},{"style":388},[3654],{"type":38,"value":231},{"type":29,"tag":183,"props":3656,"children":3657},{"style":308},[3658],{"type":38,"value":2881},{"type":29,"tag":183,"props":3660,"children":3661},{"style":212},[3662],{"type":38,"value":3204},{"type":29,"tag":183,"props":3664,"children":3666},{"class":185,"line":3665},41,[3667,3671,3675,3679,3684,3688,3692,3696,3701,3705,3709,3714,3718,3722,3727,3731,3735,3739,3744],{"type":29,"tag":183,"props":3668,"children":3669},{"style":308},[3670],{"type":38,"value":3355},{"type":29,"tag":183,"props":3672,"children":3673},{"style":388},[3674],{"type":38,"value":231},{"type":29,"tag":183,"props":3676,"children":3677},{"style":212},[3678],{"type":38,"value":2867},{"type":29,"tag":183,"props":3680,"children":3681},{"style":308},[3682],{"type":38,"value":3683}," status",{"type":29,"tag":183,"props":3685,"children":3686},{"style":388},[3687],{"type":38,"value":231},{"type":29,"tag":183,"props":3689,"children":3690},{"style":1683},[3691],{"type":38,"value":3058},{"type":29,"tag":183,"props":3693,"children":3694},{"style":212},[3695],{"type":38,"value":2694},{"type":29,"tag":183,"props":3697,"children":3698},{"style":308},[3699],{"type":38,"value":3700}," convertedAt",{"type":29,"tag":183,"props":3702,"children":3703},{"style":388},[3704],{"type":38,"value":231},{"type":29,"tag":183,"props":3706,"children":3707},{"style":1096},[3708],{"type":38,"value":1099},{"type":29,"tag":183,"props":3710,"children":3711},{"style":206},[3712],{"type":38,"value":3713}," Date",{"type":29,"tag":183,"props":3715,"children":3716},{"style":308},[3717],{"type":38,"value":1108},{"type":29,"tag":183,"props":3719,"children":3720},{"style":212},[3721],{"type":38,"value":2694},{"type":29,"tag":183,"props":3723,"children":3724},{"style":308},[3725],{"type":38,"value":3726}," convertedToClientId",{"type":29,"tag":183,"props":3728,"children":3729},{"style":388},[3730],{"type":38,"value":231},{"type":29,"tag":183,"props":3732,"children":3733},{"style":308},[3734],{"type":38,"value":1469},{"type":29,"tag":183,"props":3736,"children":3737},{"style":388},[3738],{"type":38,"value":79},{"type":29,"tag":183,"props":3740,"children":3741},{"style":308},[3742],{"type":38,"value":3743},"id ",{"type":29,"tag":183,"props":3745,"children":3746},{"style":212},[3747],{"type":38,"value":3204},{"type":29,"tag":183,"props":3749,"children":3751},{"class":185,"line":3750},42,[3752,3756,3760],{"type":29,"tag":183,"props":3753,"children":3754},{"style":212},[3755],{"type":38,"value":3213},{"type":29,"tag":183,"props":3757,"children":3758},{"style":308},[3759],{"type":38,"value":272},{"type":29,"tag":183,"props":3761,"children":3762},{"style":212},[3763],{"type":38,"value":327},{"type":29,"tag":183,"props":3765,"children":3767},{"class":185,"line":3766},43,[3768],{"type":29,"tag":183,"props":3769,"children":3770},{"emptyLinePlaceholder":13},[3771],{"type":38,"value":445},{"type":29,"tag":183,"props":3773,"children":3775},{"class":185,"line":3774},44,[3776],{"type":29,"tag":183,"props":3777,"children":3778},{"style":190},[3779],{"type":38,"value":3780},"    \u002F\u002F 3. Notification Brevo (12 lignes)\n",{"type":29,"tag":183,"props":3782,"children":3784},{"class":185,"line":3783},45,[3785,3789,3793,3797,3802,3806,3811,3815],{"type":29,"tag":183,"props":3786,"children":3787},{"style":200},[3788],{"type":38,"value":1597},{"type":29,"tag":183,"props":3790,"children":3791},{"style":1481},[3792],{"type":38,"value":1484},{"type":29,"tag":183,"props":3794,"children":3795},{"style":388},[3796],{"type":38,"value":79},{"type":29,"tag":183,"props":3798,"children":3799},{"style":308},[3800],{"type":38,"value":3801},"brevoService",{"type":29,"tag":183,"props":3803,"children":3804},{"style":388},[3805],{"type":38,"value":79},{"type":29,"tag":183,"props":3807,"children":3808},{"style":206},[3809],{"type":38,"value":3810},"sendTransactionalEmail",{"type":29,"tag":183,"props":3812,"children":3813},{"style":308},[3814],{"type":38,"value":770},{"type":29,"tag":183,"props":3816,"children":3817},{"style":212},[3818],{"type":38,"value":1548},{"type":29,"tag":183,"props":3820,"children":3822},{"class":185,"line":3821},46,[3823,3828,3832,3837,3841,3845,3849,3853,3857,3861,3865,3870,3874,3879,3883,3887,3892,3896,3900,3905,3909,3913,3917,3921,3926,3930,3935],{"type":29,"tag":183,"props":3824,"children":3825},{"style":308},[3826],{"type":38,"value":3827},"      to",{"type":29,"tag":183,"props":3829,"children":3830},{"style":388},[3831],{"type":38,"value":231},{"type":29,"tag":183,"props":3833,"children":3834},{"style":308},[3835],{"type":38,"value":3836}," [",{"type":29,"tag":183,"props":3838,"children":3839},{"style":212},[3840],{"type":38,"value":2853},{"type":29,"tag":183,"props":3842,"children":3843},{"style":308},[3844],{"type":38,"value":3173},{"type":29,"tag":183,"props":3846,"children":3847},{"style":388},[3848],{"type":38,"value":231},{"type":29,"tag":183,"props":3850,"children":3851},{"style":308},[3852],{"type":38,"value":1469},{"type":29,"tag":183,"props":3854,"children":3855},{"style":388},[3856],{"type":38,"value":79},{"type":29,"tag":183,"props":3858,"children":3859},{"style":308},[3860],{"type":38,"value":3190},{"type":29,"tag":183,"props":3862,"children":3863},{"style":212},[3864],{"type":38,"value":2694},{"type":29,"tag":183,"props":3866,"children":3867},{"style":308},[3868],{"type":38,"value":3869}," name",{"type":29,"tag":183,"props":3871,"children":3872},{"style":388},[3873],{"type":38,"value":231},{"type":29,"tag":183,"props":3875,"children":3876},{"style":1683},[3877],{"type":38,"value":3878}," `",{"type":29,"tag":183,"props":3880,"children":3881},{"style":2944},[3882],{"type":38,"value":2947},{"type":29,"tag":183,"props":3884,"children":3885},{"style":308},[3886],{"type":38,"value":3134},{"type":29,"tag":183,"props":3888,"children":3890},{"style":3889},"--shiki-default:#81C8BE;--shiki-dark:#9ECBFF",[3891],{"type":38,"value":79},{"type":29,"tag":183,"props":3893,"children":3894},{"style":308},[3895],{"type":38,"value":3418},{"type":29,"tag":183,"props":3897,"children":3898},{"style":2944},[3899],{"type":38,"value":2886},{"type":29,"tag":183,"props":3901,"children":3902},{"style":2944},[3903],{"type":38,"value":3904}," ${",{"type":29,"tag":183,"props":3906,"children":3907},{"style":308},[3908],{"type":38,"value":3134},{"type":29,"tag":183,"props":3910,"children":3911},{"style":3889},[3912],{"type":38,"value":79},{"type":29,"tag":183,"props":3914,"children":3915},{"style":308},[3916],{"type":38,"value":3448},{"type":29,"tag":183,"props":3918,"children":3919},{"style":2944},[3920],{"type":38,"value":2886},{"type":29,"tag":183,"props":3922,"children":3923},{"style":1683},[3924],{"type":38,"value":3925},"`",{"type":29,"tag":183,"props":3927,"children":3928},{"style":212},[3929],{"type":38,"value":2891},{"type":29,"tag":183,"props":3931,"children":3932},{"style":308},[3933],{"type":38,"value":3934},"]",{"type":29,"tag":183,"props":3936,"children":3937},{"style":212},[3938],{"type":38,"value":242},{"type":29,"tag":183,"props":3940,"children":3942},{"class":185,"line":3941},47,[3943,3948,3952,3957],{"type":29,"tag":183,"props":3944,"children":3945},{"style":308},[3946],{"type":38,"value":3947},"      templateId",{"type":29,"tag":183,"props":3949,"children":3950},{"style":388},[3951],{"type":38,"value":231},{"type":29,"tag":183,"props":3953,"children":3954},{"style":319},[3955],{"type":38,"value":3956}," 42",{"type":29,"tag":183,"props":3958,"children":3959},{"style":212},[3960],{"type":38,"value":242},{"type":29,"tag":183,"props":3962,"children":3964},{"class":185,"line":3963},48,[3965,3970,3974,3978,3983,3987,3991,3995,3999,4003,4008,4012,4016,4020,4024],{"type":29,"tag":183,"props":3966,"children":3967},{"style":308},[3968],{"type":38,"value":3969},"      params",{"type":29,"tag":183,"props":3971,"children":3972},{"style":388},[3973],{"type":38,"value":231},{"type":29,"tag":183,"props":3975,"children":3976},{"style":212},[3977],{"type":38,"value":2867},{"type":29,"tag":183,"props":3979,"children":3980},{"style":308},[3981],{"type":38,"value":3982}," firstName",{"type":29,"tag":183,"props":3984,"children":3985},{"style":388},[3986],{"type":38,"value":231},{"type":29,"tag":183,"props":3988,"children":3989},{"style":308},[3990],{"type":38,"value":1469},{"type":29,"tag":183,"props":3992,"children":3993},{"style":388},[3994],{"type":38,"value":79},{"type":29,"tag":183,"props":3996,"children":3997},{"style":308},[3998],{"type":38,"value":3418},{"type":29,"tag":183,"props":4000,"children":4001},{"style":212},[4002],{"type":38,"value":2694},{"type":29,"tag":183,"props":4004,"children":4005},{"style":308},[4006],{"type":38,"value":4007}," coachName",{"type":29,"tag":183,"props":4009,"children":4010},{"style":388},[4011],{"type":38,"value":231},{"type":29,"tag":183,"props":4013,"children":4014},{"style":308},[4015],{"type":38,"value":924},{"type":29,"tag":183,"props":4017,"children":4018},{"style":388},[4019],{"type":38,"value":79},{"type":29,"tag":183,"props":4021,"children":4022},{"style":308},[4023],{"type":38,"value":2988},{"type":29,"tag":183,"props":4025,"children":4026},{"style":212},[4027],{"type":38,"value":3204},{"type":29,"tag":183,"props":4029,"children":4031},{"class":185,"line":4030},49,[4032,4036,4040],{"type":29,"tag":183,"props":4033,"children":4034},{"style":212},[4035],{"type":38,"value":3213},{"type":29,"tag":183,"props":4037,"children":4038},{"style":308},[4039],{"type":38,"value":272},{"type":29,"tag":183,"props":4041,"children":4042},{"style":212},[4043],{"type":38,"value":327},{"type":29,"tag":183,"props":4045,"children":4047},{"class":185,"line":4046},50,[4048,4052,4056,4060,4064,4068,4073,4078,4082,4086,4090,4095,4099],{"type":29,"tag":183,"props":4049,"children":4050},{"style":200},[4051],{"type":38,"value":1597},{"type":29,"tag":183,"props":4053,"children":4054},{"style":1481},[4055],{"type":38,"value":1484},{"type":29,"tag":183,"props":4057,"children":4058},{"style":388},[4059],{"type":38,"value":79},{"type":29,"tag":183,"props":4061,"children":4062},{"style":308},[4063],{"type":38,"value":3801},{"type":29,"tag":183,"props":4065,"children":4066},{"style":388},[4067],{"type":38,"value":79},{"type":29,"tag":183,"props":4069,"children":4070},{"style":206},[4071],{"type":38,"value":4072},"addContactToList",{"type":29,"tag":183,"props":4074,"children":4075},{"style":308},[4076],{"type":38,"value":4077},"(client",{"type":29,"tag":183,"props":4079,"children":4080},{"style":388},[4081],{"type":38,"value":79},{"type":29,"tag":183,"props":4083,"children":4084},{"style":308},[4085],{"type":38,"value":3190},{"type":29,"tag":183,"props":4087,"children":4088},{"style":212},[4089],{"type":38,"value":2694},{"type":29,"tag":183,"props":4091,"children":4092},{"style":1683},[4093],{"type":38,"value":4094}," 'clients-actifs'",{"type":29,"tag":183,"props":4096,"children":4097},{"style":308},[4098],{"type":38,"value":272},{"type":29,"tag":183,"props":4100,"children":4101},{"style":212},[4102],{"type":38,"value":327},{"type":29,"tag":183,"props":4104,"children":4106},{"class":185,"line":4105},51,[4107],{"type":29,"tag":183,"props":4108,"children":4109},{"emptyLinePlaceholder":13},[4110],{"type":38,"value":445},{"type":29,"tag":183,"props":4112,"children":4114},{"class":185,"line":4113},52,[4115],{"type":29,"tag":183,"props":4116,"children":4117},{"style":190},[4118],{"type":38,"value":4119},"    \u002F\u002F 4. Audit (6 lignes)\n",{"type":29,"tag":183,"props":4121,"children":4123},{"class":185,"line":4122},53,[4124,4128,4132,4136,4141,4145,4150,4154],{"type":29,"tag":183,"props":4125,"children":4126},{"style":200},[4127],{"type":38,"value":1597},{"type":29,"tag":183,"props":4129,"children":4130},{"style":1481},[4131],{"type":38,"value":1484},{"type":29,"tag":183,"props":4133,"children":4134},{"style":388},[4135],{"type":38,"value":79},{"type":29,"tag":183,"props":4137,"children":4138},{"style":308},[4139],{"type":38,"value":4140},"auditService",{"type":29,"tag":183,"props":4142,"children":4143},{"style":388},[4144],{"type":38,"value":79},{"type":29,"tag":183,"props":4146,"children":4147},{"style":206},[4148],{"type":38,"value":4149},"log",{"type":29,"tag":183,"props":4151,"children":4152},{"style":308},[4153],{"type":38,"value":770},{"type":29,"tag":183,"props":4155,"children":4156},{"style":212},[4157],{"type":38,"value":1548},{"type":29,"tag":183,"props":4159,"children":4161},{"class":185,"line":4160},54,[4162,4167,4171,4176],{"type":29,"tag":183,"props":4163,"children":4164},{"style":308},[4165],{"type":38,"value":4166},"      action",{"type":29,"tag":183,"props":4168,"children":4169},{"style":388},[4170],{"type":38,"value":231},{"type":29,"tag":183,"props":4172,"children":4173},{"style":1683},[4174],{"type":38,"value":4175}," 'LEAD_CONVERTED'",{"type":29,"tag":183,"props":4177,"children":4178},{"style":212},[4179],{"type":38,"value":242},{"type":29,"tag":183,"props":4181,"children":4183},{"class":185,"line":4182},55,[4184,4189,4193,4198],{"type":29,"tag":183,"props":4185,"children":4186},{"style":308},[4187],{"type":38,"value":4188},"      entityType",{"type":29,"tag":183,"props":4190,"children":4191},{"style":388},[4192],{"type":38,"value":231},{"type":29,"tag":183,"props":4194,"children":4195},{"style":1683},[4196],{"type":38,"value":4197}," 'client'",{"type":29,"tag":183,"props":4199,"children":4200},{"style":212},[4201],{"type":38,"value":242},{"type":29,"tag":183,"props":4203,"children":4205},{"class":185,"line":4204},56,[4206,4211,4215,4219,4223,4228],{"type":29,"tag":183,"props":4207,"children":4208},{"style":308},[4209],{"type":38,"value":4210},"      entityId",{"type":29,"tag":183,"props":4212,"children":4213},{"style":388},[4214],{"type":38,"value":231},{"type":29,"tag":183,"props":4216,"children":4217},{"style":308},[4218],{"type":38,"value":1469},{"type":29,"tag":183,"props":4220,"children":4221},{"style":388},[4222],{"type":38,"value":79},{"type":29,"tag":183,"props":4224,"children":4225},{"style":308},[4226],{"type":38,"value":4227},"id",{"type":29,"tag":183,"props":4229,"children":4230},{"style":212},[4231],{"type":38,"value":242},{"type":29,"tag":183,"props":4233,"children":4235},{"class":185,"line":4234},57,[4236,4241,4245,4249],{"type":29,"tag":183,"props":4237,"children":4238},{"style":308},[4239],{"type":38,"value":4240},"      userId",{"type":29,"tag":183,"props":4242,"children":4243},{"style":388},[4244],{"type":38,"value":231},{"type":29,"tag":183,"props":4246,"children":4247},{"style":308},[4248],{"type":38,"value":2699},{"type":29,"tag":183,"props":4250,"children":4251},{"style":212},[4252],{"type":38,"value":242},{"type":29,"tag":183,"props":4254,"children":4256},{"class":185,"line":4255},58,[4257,4262,4266,4270,4275,4279,4283],{"type":29,"tag":183,"props":4258,"children":4259},{"style":308},[4260],{"type":38,"value":4261},"      meta",{"type":29,"tag":183,"props":4263,"children":4264},{"style":388},[4265],{"type":38,"value":231},{"type":29,"tag":183,"props":4267,"children":4268},{"style":212},[4269],{"type":38,"value":2867},{"type":29,"tag":183,"props":4271,"children":4272},{"style":308},[4273],{"type":38,"value":4274}," fromLeadId",{"type":29,"tag":183,"props":4276,"children":4277},{"style":388},[4278],{"type":38,"value":231},{"type":29,"tag":183,"props":4280,"children":4281},{"style":308},[4282],{"type":38,"value":2881},{"type":29,"tag":183,"props":4284,"children":4285},{"style":212},[4286],{"type":38,"value":3204},{"type":29,"tag":183,"props":4288,"children":4290},{"class":185,"line":4289},59,[4291,4295,4299],{"type":29,"tag":183,"props":4292,"children":4293},{"style":212},[4294],{"type":38,"value":3213},{"type":29,"tag":183,"props":4296,"children":4297},{"style":308},[4298],{"type":38,"value":272},{"type":29,"tag":183,"props":4300,"children":4301},{"style":212},[4302],{"type":38,"value":327},{"type":29,"tag":183,"props":4304,"children":4306},{"class":185,"line":4305},60,[4307],{"type":29,"tag":183,"props":4308,"children":4309},{"emptyLinePlaceholder":13},[4310],{"type":38,"value":445},{"type":29,"tag":183,"props":4312,"children":4314},{"class":185,"line":4313},61,[4315],{"type":29,"tag":183,"props":4316,"children":4317},{"style":190},[4318],{"type":38,"value":4319},"    \u002F\u002F 5. Événement domaine (4 lignes)\n",{"type":29,"tag":183,"props":4321,"children":4323},{"class":185,"line":4322},62,[4324,4328,4332,4337,4341,4346,4350,4355,4359,4363,4368,4372,4376,4380,4384,4388,4392,4396,4400],{"type":29,"tag":183,"props":4325,"children":4326},{"style":1481},[4327],{"type":38,"value":1658},{"type":29,"tag":183,"props":4329,"children":4330},{"style":388},[4331],{"type":38,"value":79},{"type":29,"tag":183,"props":4333,"children":4334},{"style":308},[4335],{"type":38,"value":4336},"eventEmitter",{"type":29,"tag":183,"props":4338,"children":4339},{"style":388},[4340],{"type":38,"value":79},{"type":29,"tag":183,"props":4342,"children":4343},{"style":206},[4344],{"type":38,"value":4345},"emit",{"type":29,"tag":183,"props":4347,"children":4348},{"style":308},[4349],{"type":38,"value":770},{"type":29,"tag":183,"props":4351,"children":4352},{"style":1683},[4353],{"type":38,"value":4354},"'client.created'",{"type":29,"tag":183,"props":4356,"children":4357},{"style":212},[4358],{"type":38,"value":2694},{"type":29,"tag":183,"props":4360,"children":4361},{"style":212},[4362],{"type":38,"value":2867},{"type":29,"tag":183,"props":4364,"children":4365},{"style":308},[4366],{"type":38,"value":4367}," clientId",{"type":29,"tag":183,"props":4369,"children":4370},{"style":388},[4371],{"type":38,"value":231},{"type":29,"tag":183,"props":4373,"children":4374},{"style":308},[4375],{"type":38,"value":1469},{"type":29,"tag":183,"props":4377,"children":4378},{"style":388},[4379],{"type":38,"value":79},{"type":29,"tag":183,"props":4381,"children":4382},{"style":308},[4383],{"type":38,"value":4227},{"type":29,"tag":183,"props":4385,"children":4386},{"style":212},[4387],{"type":38,"value":2694},{"type":29,"tag":183,"props":4389,"children":4390},{"style":308},[4391],{"type":38,"value":3199},{"type":29,"tag":183,"props":4393,"children":4394},{"style":212},[4395],{"type":38,"value":2886},{"type":29,"tag":183,"props":4397,"children":4398},{"style":308},[4399],{"type":38,"value":272},{"type":29,"tag":183,"props":4401,"children":4402},{"style":212},[4403],{"type":38,"value":327},{"type":29,"tag":183,"props":4405,"children":4406},{"class":185,"line":2341},[4407],{"type":29,"tag":183,"props":4408,"children":4409},{"emptyLinePlaceholder":13},[4410],{"type":38,"value":445},{"type":29,"tag":183,"props":4412,"children":4414},{"class":185,"line":4413},64,[4415,4419,4424,4428,4433,4437],{"type":29,"tag":183,"props":4416,"children":4417},{"style":200},[4418],{"type":38,"value":919},{"type":29,"tag":183,"props":4420,"children":4421},{"style":308},[4422],{"type":38,"value":4423}," ClientDto",{"type":29,"tag":183,"props":4425,"children":4426},{"style":388},[4427],{"type":38,"value":79},{"type":29,"tag":183,"props":4429,"children":4430},{"style":206},[4431],{"type":38,"value":4432},"fromPrisma",{"type":29,"tag":183,"props":4434,"children":4435},{"style":308},[4436],{"type":38,"value":1715},{"type":29,"tag":183,"props":4438,"children":4439},{"style":212},[4440],{"type":38,"value":327},{"type":29,"tag":183,"props":4442,"children":4443},{"class":185,"line":11},[4444],{"type":29,"tag":183,"props":4445,"children":4446},{"style":212},[4447],{"type":38,"value":997},{"type":29,"tag":183,"props":4449,"children":4451},{"class":185,"line":4450},66,[4452],{"type":29,"tag":183,"props":4453,"children":4454},{"style":212},[4455],{"type":38,"value":436},{"type":29,"tag":30,"props":4457,"children":4458},{},[4459,4461,4467,4469,4475,4476,4482,4483,4489,4490,4496,4497,4503],{"type":38,"value":4460},"Le contre-pattern craft, c'est l'application du Single Responsibility Principle. Cette fonction devient un orchestrateur de 10 lignes qui appelle des helpers nommés : ",{"type":29,"tag":156,"props":4462,"children":4464},{"className":4463},[],[4465],{"type":38,"value":4466},"assertLeadIsConvertible",{"type":38,"value":4468},", ",{"type":29,"tag":156,"props":4470,"children":4472},{"className":4471},[],[4473],{"type":38,"value":4474},"createClientFromLead",{"type":38,"value":4468},{"type":29,"tag":156,"props":4477,"children":4479},{"className":4478},[],[4480],{"type":38,"value":4481},"markLeadAsConverted",{"type":38,"value":4468},{"type":29,"tag":156,"props":4484,"children":4486},{"className":4485},[],[4487],{"type":38,"value":4488},"notifyClientOnboarding",{"type":38,"value":4468},{"type":29,"tag":156,"props":4491,"children":4493},{"className":4492},[],[4494],{"type":38,"value":4495},"logConversionAudit",{"type":38,"value":4468},{"type":29,"tag":156,"props":4498,"children":4500},{"className":4499},[],[4501],{"type":38,"value":4502},"emitClientCreated",{"type":38,"value":4504},". Chacun est testable isolément. Chacun est lisible en 30 secondes.",{"type":29,"tag":30,"props":4506,"children":4507},{},[4508,4510,4515],{"type":38,"value":4509},"Le prompt que j'utilise : ",{"type":29,"tag":114,"props":4511,"children":4512},{},[4513],{"type":38,"value":4514},"\"Découpe ce use case en responsabilités nommées. Chaque helper doit tenir en moins de 20 lignes et avoir un seul motif de changement.\"",{"type":38,"value":4516}," Claude exécute proprement. Le problème est qu'il ne le fait jamais spontanément.",{"type":29,"tag":46,"props":4518,"children":4519},{},[],{"type":29,"tag":50,"props":4521,"children":4523},{"id":4522},"pattern-2-couplage-métierorm",[4524],{"type":38,"value":4525},"Pattern #2 : couplage métier\u002FORM",{"type":29,"tag":30,"props":4527,"children":4528},{},[4529,4531,4537],{"type":38,"value":4530},"Celui-là est plus insidieux. Claude injecte directement le ",{"type":29,"tag":156,"props":4532,"children":4534},{"className":4533},[],[4535],{"type":38,"value":4536},"PrismaClient",{"type":38,"value":4538}," dans les use cases métier. Le résultat : vos règles de gestion ne peuvent plus tourner sans une base Postgres, vos tests ne peuvent plus être unitaires, et changer de stratégie de persistence devient une refonte de plusieurs mois.",{"type":29,"tag":30,"props":4540,"children":4541},{},[4542,4544,4550],{"type":38,"value":4543},"Concrètement, j'ai vu ça dans crmcoaching sur le bounded context ",{"type":29,"tag":156,"props":4545,"children":4547},{"className":4546},[],[4548],{"type":38,"value":4549},"slot-hold",{"type":38,"value":976},{"type":29,"tag":173,"props":4552,"children":4554},{"className":175,"code":4553,"language":177,"meta":8,"style":8},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fuse-cases\u002Fcheck-slot-availability.use-case.ts\n\u002F\u002F Couplage direct Prisma dans le use case (anti-pattern)\n\n@Injectable()\nexport class CheckSlotAvailabilityUseCase {\n  constructor(\n    private readonly prisma: PrismaClient, \u002F\u002F couplage direct infra\n  ) {}\n\n  async execute(slotId: string, coachId: string): Promise\u003Cboolean> {\n    const holds = await this.prisma.slotHold.count({\n      where: { slotId, status: 'ACTIVE', expiresAt: { gt: new Date() } },\n    });\n    const slot = await this.prisma.slot.findUnique({ where: { id: slotId } });\n    return slot != null && slot.coachId === coachId && holds === 0;\n  }\n}\n",[4555],{"type":29,"tag":156,"props":4556,"children":4557},{"__ignoreMap":8},[4558,4566,4574,4581,4596,4616,4627,4659,4670,4677,4750,4808,4892,4907,5005,5074,5081],{"type":29,"tag":183,"props":4559,"children":4560},{"class":185,"line":186},[4561],{"type":29,"tag":183,"props":4562,"children":4563},{"style":190},[4564],{"type":38,"value":4565},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fuse-cases\u002Fcheck-slot-availability.use-case.ts\n",{"type":29,"tag":183,"props":4567,"children":4568},{"class":185,"line":196},[4569],{"type":29,"tag":183,"props":4570,"children":4571},{"style":190},[4572],{"type":38,"value":4573},"\u002F\u002F Couplage direct Prisma dans le use case (anti-pattern)\n",{"type":29,"tag":183,"props":4575,"children":4576},{"class":185,"line":218},[4577],{"type":29,"tag":183,"props":4578,"children":4579},{"emptyLinePlaceholder":13},[4580],{"type":38,"value":445},{"type":29,"tag":183,"props":4582,"children":4583},{"class":185,"line":245},[4584,4588,4592],{"type":29,"tag":183,"props":4585,"children":4586},{"style":828},[4587],{"type":38,"value":831},{"type":29,"tag":183,"props":4589,"children":4590},{"style":206},[4591],{"type":38,"value":836},{"type":29,"tag":183,"props":4593,"children":4594},{"style":839},[4595],{"type":38,"value":842},{"type":29,"tag":183,"props":4597,"children":4598},{"class":185,"line":266},[4599,4603,4607,4612],{"type":29,"tag":183,"props":4600,"children":4601},{"style":200},[4602],{"type":38,"value":742},{"type":29,"tag":183,"props":4604,"children":4605},{"style":200},[4606],{"type":38,"value":854},{"type":29,"tag":183,"props":4608,"children":4609},{"style":750},[4610],{"type":38,"value":4611}," CheckSlotAvailabilityUseCase",{"type":29,"tag":183,"props":4613,"children":4614},{"style":212},[4615],{"type":38,"value":285},{"type":29,"tag":183,"props":4617,"children":4618},{"class":185,"line":288},[4619,4623],{"type":29,"tag":183,"props":4620,"children":4621},{"style":200},[4622],{"type":38,"value":1279},{"type":29,"tag":183,"props":4624,"children":4625},{"style":212},[4626],{"type":38,"value":215},{"type":29,"tag":183,"props":4628,"children":4629},{"class":185,"line":330},[4630,4634,4638,4642,4646,4650,4654],{"type":29,"tag":183,"props":4631,"children":4632},{"style":200},[4633],{"type":38,"value":1291},{"type":29,"tag":183,"props":4635,"children":4636},{"style":200},[4637],{"type":38,"value":1296},{"type":29,"tag":183,"props":4639,"children":4640},{"style":222},[4641],{"type":38,"value":2542},{"type":29,"tag":183,"props":4643,"children":4644},{"style":228},[4645],{"type":38,"value":231},{"type":29,"tag":183,"props":4647,"children":4648},{"style":750},[4649],{"type":38,"value":2551},{"type":29,"tag":183,"props":4651,"children":4652},{"style":212},[4653],{"type":38,"value":2694},{"type":29,"tag":183,"props":4655,"children":4656},{"style":190},[4657],{"type":38,"value":4658}," \u002F\u002F couplage direct infra\n",{"type":29,"tag":183,"props":4660,"children":4661},{"class":185,"line":374},[4662,4666],{"type":29,"tag":183,"props":4663,"children":4664},{"style":212},[4665],{"type":38,"value":1380},{"type":29,"tag":183,"props":4667,"children":4668},{"style":212},[4669],{"type":38,"value":1385},{"type":29,"tag":183,"props":4671,"children":4672},{"class":185,"line":430},[4673],{"type":29,"tag":183,"props":4674,"children":4675},{"emptyLinePlaceholder":13},[4676],{"type":38,"value":445},{"type":29,"tag":183,"props":4678,"children":4679},{"class":185,"line":439},[4680,4684,4688,4692,4697,4701,4705,4709,4713,4717,4721,4725,4729,4733,4737,4742,4746],{"type":29,"tag":183,"props":4681,"children":4682},{"style":200},[4683],{"type":38,"value":1400},{"type":29,"tag":183,"props":4685,"children":4686},{"style":206},[4687],{"type":38,"value":2672},{"type":29,"tag":183,"props":4689,"children":4690},{"style":212},[4691],{"type":38,"value":770},{"type":29,"tag":183,"props":4693,"children":4694},{"style":222},[4695],{"type":38,"value":4696},"slotId",{"type":29,"tag":183,"props":4698,"children":4699},{"style":228},[4700],{"type":38,"value":231},{"type":29,"tag":183,"props":4702,"children":4703},{"style":234},[4704],{"type":38,"value":1070},{"type":29,"tag":183,"props":4706,"children":4707},{"style":212},[4708],{"type":38,"value":2694},{"type":29,"tag":183,"props":4710,"children":4711},{"style":222},[4712],{"type":38,"value":2699},{"type":29,"tag":183,"props":4714,"children":4715},{"style":228},[4716],{"type":38,"value":231},{"type":29,"tag":183,"props":4718,"children":4719},{"style":234},[4720],{"type":38,"value":1070},{"type":29,"tag":183,"props":4722,"children":4723},{"style":212},[4724],{"type":38,"value":272},{"type":29,"tag":183,"props":4726,"children":4727},{"style":228},[4728],{"type":38,"value":231},{"type":29,"tag":183,"props":4730,"children":4731},{"style":750},[4732],{"type":38,"value":1436},{"type":29,"tag":183,"props":4734,"children":4735},{"style":1439},[4736],{"type":38,"value":1442},{"type":29,"tag":183,"props":4738,"children":4739},{"style":234},[4740],{"type":38,"value":4741},"boolean",{"type":29,"tag":183,"props":4743,"children":4744},{"style":1439},[4745],{"type":38,"value":1452},{"type":29,"tag":183,"props":4747,"children":4748},{"style":212},[4749],{"type":38,"value":285},{"type":29,"tag":183,"props":4751,"children":4752},{"class":185,"line":448},[4753,4757,4762,4766,4770,4774,4778,4782,4786,4791,4795,4800,4804],{"type":29,"tag":183,"props":4754,"children":4755},{"style":200},[4756],{"type":38,"value":1464},{"type":29,"tag":183,"props":4758,"children":4759},{"style":297},[4760],{"type":38,"value":4761}," holds",{"type":29,"tag":183,"props":4763,"children":4764},{"style":228},[4765],{"type":38,"value":305},{"type":29,"tag":183,"props":4767,"children":4768},{"style":200},[4769],{"type":38,"value":1478},{"type":29,"tag":183,"props":4771,"children":4772},{"style":1481},[4773],{"type":38,"value":1484},{"type":29,"tag":183,"props":4775,"children":4776},{"style":388},[4777],{"type":38,"value":79},{"type":29,"tag":183,"props":4779,"children":4780},{"style":308},[4781],{"type":38,"value":2827},{"type":29,"tag":183,"props":4783,"children":4784},{"style":388},[4785],{"type":38,"value":79},{"type":29,"tag":183,"props":4787,"children":4788},{"style":308},[4789],{"type":38,"value":4790},"slotHold",{"type":29,"tag":183,"props":4792,"children":4793},{"style":388},[4794],{"type":38,"value":79},{"type":29,"tag":183,"props":4796,"children":4797},{"style":206},[4798],{"type":38,"value":4799},"count",{"type":29,"tag":183,"props":4801,"children":4802},{"style":308},[4803],{"type":38,"value":770},{"type":29,"tag":183,"props":4805,"children":4806},{"style":212},[4807],{"type":38,"value":1548},{"type":29,"tag":183,"props":4809,"children":4810},{"class":185,"line":457},[4811,4815,4819,4823,4828,4832,4836,4840,4844,4848,4853,4857,4861,4866,4870,4874,4878,4883,4887],{"type":29,"tag":183,"props":4812,"children":4813},{"style":308},[4814],{"type":38,"value":3160},{"type":29,"tag":183,"props":4816,"children":4817},{"style":388},[4818],{"type":38,"value":231},{"type":29,"tag":183,"props":4820,"children":4821},{"style":212},[4822],{"type":38,"value":2867},{"type":29,"tag":183,"props":4824,"children":4825},{"style":308},[4826],{"type":38,"value":4827}," slotId",{"type":29,"tag":183,"props":4829,"children":4830},{"style":212},[4831],{"type":38,"value":2694},{"type":29,"tag":183,"props":4833,"children":4834},{"style":308},[4835],{"type":38,"value":3683},{"type":29,"tag":183,"props":4837,"children":4838},{"style":388},[4839],{"type":38,"value":231},{"type":29,"tag":183,"props":4841,"children":4842},{"style":1683},[4843],{"type":38,"value":3513},{"type":29,"tag":183,"props":4845,"children":4846},{"style":212},[4847],{"type":38,"value":2694},{"type":29,"tag":183,"props":4849,"children":4850},{"style":308},[4851],{"type":38,"value":4852}," expiresAt",{"type":29,"tag":183,"props":4854,"children":4855},{"style":388},[4856],{"type":38,"value":231},{"type":29,"tag":183,"props":4858,"children":4859},{"style":212},[4860],{"type":38,"value":2867},{"type":29,"tag":183,"props":4862,"children":4863},{"style":308},[4864],{"type":38,"value":4865}," gt",{"type":29,"tag":183,"props":4867,"children":4868},{"style":388},[4869],{"type":38,"value":231},{"type":29,"tag":183,"props":4871,"children":4872},{"style":1096},[4873],{"type":38,"value":1099},{"type":29,"tag":183,"props":4875,"children":4876},{"style":206},[4877],{"type":38,"value":3713},{"type":29,"tag":183,"props":4879,"children":4880},{"style":308},[4881],{"type":38,"value":4882},"() ",{"type":29,"tag":183,"props":4884,"children":4885},{"style":212},[4886],{"type":38,"value":2886},{"type":29,"tag":183,"props":4888,"children":4889},{"style":212},[4890],{"type":38,"value":4891}," },\n",{"type":29,"tag":183,"props":4893,"children":4894},{"class":185,"line":474},[4895,4899,4903],{"type":29,"tag":183,"props":4896,"children":4897},{"style":212},[4898],{"type":38,"value":3213},{"type":29,"tag":183,"props":4900,"children":4901},{"style":308},[4902],{"type":38,"value":272},{"type":29,"tag":183,"props":4904,"children":4905},{"style":212},[4906],{"type":38,"value":327},{"type":29,"tag":183,"props":4908,"children":4909},{"class":185,"line":495},[4910,4914,4919,4923,4927,4931,4935,4939,4943,4948,4952,4956,4960,4964,4968,4972,4976,4980,4984,4989,4993,4997,5001],{"type":29,"tag":183,"props":4911,"children":4912},{"style":200},[4913],{"type":38,"value":1464},{"type":29,"tag":183,"props":4915,"children":4916},{"style":297},[4917],{"type":38,"value":4918}," slot",{"type":29,"tag":183,"props":4920,"children":4921},{"style":228},[4922],{"type":38,"value":305},{"type":29,"tag":183,"props":4924,"children":4925},{"style":200},[4926],{"type":38,"value":1478},{"type":29,"tag":183,"props":4928,"children":4929},{"style":1481},[4930],{"type":38,"value":1484},{"type":29,"tag":183,"props":4932,"children":4933},{"style":388},[4934],{"type":38,"value":79},{"type":29,"tag":183,"props":4936,"children":4937},{"style":308},[4938],{"type":38,"value":2827},{"type":29,"tag":183,"props":4940,"children":4941},{"style":388},[4942],{"type":38,"value":79},{"type":29,"tag":183,"props":4944,"children":4945},{"style":308},[4946],{"type":38,"value":4947},"slot",{"type":29,"tag":183,"props":4949,"children":4950},{"style":388},[4951],{"type":38,"value":79},{"type":29,"tag":183,"props":4953,"children":4954},{"style":206},[4955],{"type":38,"value":2844},{"type":29,"tag":183,"props":4957,"children":4958},{"style":308},[4959],{"type":38,"value":770},{"type":29,"tag":183,"props":4961,"children":4962},{"style":212},[4963],{"type":38,"value":2853},{"type":29,"tag":183,"props":4965,"children":4966},{"style":308},[4967],{"type":38,"value":2858},{"type":29,"tag":183,"props":4969,"children":4970},{"style":388},[4971],{"type":38,"value":231},{"type":29,"tag":183,"props":4973,"children":4974},{"style":212},[4975],{"type":38,"value":2867},{"type":29,"tag":183,"props":4977,"children":4978},{"style":308},[4979],{"type":38,"value":2872},{"type":29,"tag":183,"props":4981,"children":4982},{"style":388},[4983],{"type":38,"value":231},{"type":29,"tag":183,"props":4985,"children":4986},{"style":308},[4987],{"type":38,"value":4988}," slotId ",{"type":29,"tag":183,"props":4990,"children":4991},{"style":212},[4992],{"type":38,"value":2886},{"type":29,"tag":183,"props":4994,"children":4995},{"style":212},[4996],{"type":38,"value":2891},{"type":29,"tag":183,"props":4998,"children":4999},{"style":308},[5000],{"type":38,"value":272},{"type":29,"tag":183,"props":5002,"children":5003},{"style":212},[5004],{"type":38,"value":327},{"type":29,"tag":183,"props":5006,"children":5007},{"class":185,"line":516},[5008,5012,5017,5022,5027,5032,5036,5040,5044,5048,5052,5057,5062,5066,5070],{"type":29,"tag":183,"props":5009,"children":5010},{"style":200},[5011],{"type":38,"value":919},{"type":29,"tag":183,"props":5013,"children":5014},{"style":308},[5015],{"type":38,"value":5016}," slot ",{"type":29,"tag":183,"props":5018,"children":5019},{"style":228},[5020],{"type":38,"value":5021},"!=",{"type":29,"tag":183,"props":5023,"children":5024},{"style":234},[5025],{"type":38,"value":5026}," null",{"type":29,"tag":183,"props":5028,"children":5029},{"style":228},[5030],{"type":38,"value":5031}," &&",{"type":29,"tag":183,"props":5033,"children":5034},{"style":308},[5035],{"type":38,"value":4918},{"type":29,"tag":183,"props":5037,"children":5038},{"style":388},[5039],{"type":38,"value":79},{"type":29,"tag":183,"props":5041,"children":5042},{"style":308},[5043],{"type":38,"value":2988},{"type":29,"tag":183,"props":5045,"children":5046},{"style":228},[5047],{"type":38,"value":3053},{"type":29,"tag":183,"props":5049,"children":5050},{"style":308},[5051],{"type":38,"value":3199},{"type":29,"tag":183,"props":5053,"children":5054},{"style":228},[5055],{"type":38,"value":5056},"&&",{"type":29,"tag":183,"props":5058,"children":5059},{"style":308},[5060],{"type":38,"value":5061}," holds ",{"type":29,"tag":183,"props":5063,"children":5064},{"style":228},[5065],{"type":38,"value":3053},{"type":29,"tag":183,"props":5067,"children":5068},{"style":319},[5069],{"type":38,"value":981},{"type":29,"tag":183,"props":5071,"children":5072},{"style":212},[5073],{"type":38,"value":327},{"type":29,"tag":183,"props":5075,"children":5076},{"class":185,"line":536},[5077],{"type":29,"tag":183,"props":5078,"children":5079},{"style":212},[5080],{"type":38,"value":997},{"type":29,"tag":183,"props":5082,"children":5083},{"class":185,"line":570},[5084],{"type":29,"tag":183,"props":5085,"children":5086},{"style":212},[5087],{"type":38,"value":436},{"type":29,"tag":30,"props":5089,"children":5090},{},[5091,5093,5098,5100,5106,5108,5114,5116,5122,5123,5129,5131,5137],{"type":38,"value":5092},"Le contre-pattern, c'est l'",{"type":29,"tag":62,"props":5094,"children":5095},{"href":2234},[5096],{"type":38,"value":5097},"architecture hexagonale d'Alistair Cockburn",{"type":38,"value":5099}," (2005). La règle métier ne connaît pas Prisma. Elle prend un port ",{"type":29,"tag":156,"props":5101,"children":5103},{"className":5102},[],[5104],{"type":38,"value":5105},"ISlotHoldRepository",{"type":38,"value":5107}," qui expose ",{"type":29,"tag":156,"props":5109,"children":5111},{"className":5110},[],[5112],{"type":38,"value":5113},"countActiveHolds(slotId)",{"type":38,"value":5115}," et un port ",{"type":29,"tag":156,"props":5117,"children":5119},{"className":5118},[],[5120],{"type":38,"value":5121},"ISlotRepository",{"type":38,"value":5107},{"type":29,"tag":156,"props":5124,"children":5126},{"className":5125},[],[5127],{"type":38,"value":5128},"findById(slotId)",{"type":38,"value":5130},". L'implémentation Prisma vit dans ",{"type":29,"tag":156,"props":5132,"children":5134},{"className":5133},[],[5135],{"type":38,"value":5136},"infrastructure\u002F",{"type":38,"value":5138},". Les tests unitaires utilisent un fake repository en mémoire.",{"type":29,"tag":173,"props":5140,"children":5142},{"className":175,"code":5141,"language":177,"meta":8,"style":8},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fdomain\u002Fports\u002Fslot-hold.repository.port.ts\nexport interface ISlotHoldRepository {\n  countActiveHolds(slotId: string): Promise\u003Cnumber>;\n}\n\n\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fuse-cases\u002Fcheck-slot-availability.use-case.ts\n@Injectable()\nexport class CheckSlotAvailabilityUseCase {\n  constructor(\n    private readonly slotRepo: ISlotRepository,\n    private readonly slotHoldRepo: ISlotHoldRepository,\n  ) {}\n\n  async execute(slotId: string, coachId: string): Promise\u003Cboolean> {\n    const slot = await this.slotRepo.findById(slotId);\n    if (slot == null || slot.coachId !== coachId) return false;\n    const activeHolds = await this.slotHoldRepo.countActiveHolds(slotId);\n    return activeHolds === 0;\n  }\n}\n",[5143],{"type":29,"tag":156,"props":5144,"children":5145},{"__ignoreMap":8},[5146,5154,5174,5227,5234,5241,5248,5263,5282,5293,5322,5350,5361,5368,5439,5488,5548,5598,5622,5629],{"type":29,"tag":183,"props":5147,"children":5148},{"class":185,"line":186},[5149],{"type":29,"tag":183,"props":5150,"children":5151},{"style":190},[5152],{"type":38,"value":5153},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fdomain\u002Fports\u002Fslot-hold.repository.port.ts\n",{"type":29,"tag":183,"props":5155,"children":5156},{"class":185,"line":196},[5157,5161,5165,5170],{"type":29,"tag":183,"props":5158,"children":5159},{"style":200},[5160],{"type":38,"value":742},{"type":29,"tag":183,"props":5162,"children":5163},{"style":200},[5164],{"type":38,"value":747},{"type":29,"tag":183,"props":5166,"children":5167},{"style":750},[5168],{"type":38,"value":5169}," ISlotHoldRepository",{"type":29,"tag":183,"props":5171,"children":5172},{"style":212},[5173],{"type":38,"value":285},{"type":29,"tag":183,"props":5175,"children":5176},{"class":185,"line":218},[5177,5182,5186,5190,5194,5198,5202,5206,5210,5214,5219,5223],{"type":29,"tag":183,"props":5178,"children":5179},{"style":206},[5180],{"type":38,"value":5181},"  countActiveHolds",{"type":29,"tag":183,"props":5183,"children":5184},{"style":212},[5185],{"type":38,"value":770},{"type":29,"tag":183,"props":5187,"children":5188},{"style":222},[5189],{"type":38,"value":4696},{"type":29,"tag":183,"props":5191,"children":5192},{"style":228},[5193],{"type":38,"value":231},{"type":29,"tag":183,"props":5195,"children":5196},{"style":234},[5197],{"type":38,"value":1070},{"type":29,"tag":183,"props":5199,"children":5200},{"style":212},[5201],{"type":38,"value":272},{"type":29,"tag":183,"props":5203,"children":5204},{"style":228},[5205],{"type":38,"value":231},{"type":29,"tag":183,"props":5207,"children":5208},{"style":750},[5209],{"type":38,"value":1436},{"type":29,"tag":183,"props":5211,"children":5212},{"style":1439},[5213],{"type":38,"value":1442},{"type":29,"tag":183,"props":5215,"children":5216},{"style":234},[5217],{"type":38,"value":5218},"number",{"type":29,"tag":183,"props":5220,"children":5221},{"style":1439},[5222],{"type":38,"value":1452},{"type":29,"tag":183,"props":5224,"children":5225},{"style":212},[5226],{"type":38,"value":327},{"type":29,"tag":183,"props":5228,"children":5229},{"class":185,"line":245},[5230],{"type":29,"tag":183,"props":5231,"children":5232},{"style":212},[5233],{"type":38,"value":436},{"type":29,"tag":183,"props":5235,"children":5236},{"class":185,"line":266},[5237],{"type":29,"tag":183,"props":5238,"children":5239},{"emptyLinePlaceholder":13},[5240],{"type":38,"value":445},{"type":29,"tag":183,"props":5242,"children":5243},{"class":185,"line":288},[5244],{"type":29,"tag":183,"props":5245,"children":5246},{"style":190},[5247],{"type":38,"value":4565},{"type":29,"tag":183,"props":5249,"children":5250},{"class":185,"line":330},[5251,5255,5259],{"type":29,"tag":183,"props":5252,"children":5253},{"style":828},[5254],{"type":38,"value":831},{"type":29,"tag":183,"props":5256,"children":5257},{"style":206},[5258],{"type":38,"value":836},{"type":29,"tag":183,"props":5260,"children":5261},{"style":839},[5262],{"type":38,"value":842},{"type":29,"tag":183,"props":5264,"children":5265},{"class":185,"line":374},[5266,5270,5274,5278],{"type":29,"tag":183,"props":5267,"children":5268},{"style":200},[5269],{"type":38,"value":742},{"type":29,"tag":183,"props":5271,"children":5272},{"style":200},[5273],{"type":38,"value":854},{"type":29,"tag":183,"props":5275,"children":5276},{"style":750},[5277],{"type":38,"value":4611},{"type":29,"tag":183,"props":5279,"children":5280},{"style":212},[5281],{"type":38,"value":285},{"type":29,"tag":183,"props":5283,"children":5284},{"class":185,"line":430},[5285,5289],{"type":29,"tag":183,"props":5286,"children":5287},{"style":200},[5288],{"type":38,"value":1279},{"type":29,"tag":183,"props":5290,"children":5291},{"style":212},[5292],{"type":38,"value":215},{"type":29,"tag":183,"props":5294,"children":5295},{"class":185,"line":439},[5296,5300,5304,5309,5313,5318],{"type":29,"tag":183,"props":5297,"children":5298},{"style":200},[5299],{"type":38,"value":1291},{"type":29,"tag":183,"props":5301,"children":5302},{"style":200},[5303],{"type":38,"value":1296},{"type":29,"tag":183,"props":5305,"children":5306},{"style":222},[5307],{"type":38,"value":5308}," slotRepo",{"type":29,"tag":183,"props":5310,"children":5311},{"style":228},[5312],{"type":38,"value":231},{"type":29,"tag":183,"props":5314,"children":5315},{"style":750},[5316],{"type":38,"value":5317}," ISlotRepository",{"type":29,"tag":183,"props":5319,"children":5320},{"style":212},[5321],{"type":38,"value":242},{"type":29,"tag":183,"props":5323,"children":5324},{"class":185,"line":448},[5325,5329,5333,5338,5342,5346],{"type":29,"tag":183,"props":5326,"children":5327},{"style":200},[5328],{"type":38,"value":1291},{"type":29,"tag":183,"props":5330,"children":5331},{"style":200},[5332],{"type":38,"value":1296},{"type":29,"tag":183,"props":5334,"children":5335},{"style":222},[5336],{"type":38,"value":5337}," slotHoldRepo",{"type":29,"tag":183,"props":5339,"children":5340},{"style":228},[5341],{"type":38,"value":231},{"type":29,"tag":183,"props":5343,"children":5344},{"style":750},[5345],{"type":38,"value":5169},{"type":29,"tag":183,"props":5347,"children":5348},{"style":212},[5349],{"type":38,"value":242},{"type":29,"tag":183,"props":5351,"children":5352},{"class":185,"line":457},[5353,5357],{"type":29,"tag":183,"props":5354,"children":5355},{"style":212},[5356],{"type":38,"value":1380},{"type":29,"tag":183,"props":5358,"children":5359},{"style":212},[5360],{"type":38,"value":1385},{"type":29,"tag":183,"props":5362,"children":5363},{"class":185,"line":474},[5364],{"type":29,"tag":183,"props":5365,"children":5366},{"emptyLinePlaceholder":13},[5367],{"type":38,"value":445},{"type":29,"tag":183,"props":5369,"children":5370},{"class":185,"line":495},[5371,5375,5379,5383,5387,5391,5395,5399,5403,5407,5411,5415,5419,5423,5427,5431,5435],{"type":29,"tag":183,"props":5372,"children":5373},{"style":200},[5374],{"type":38,"value":1400},{"type":29,"tag":183,"props":5376,"children":5377},{"style":206},[5378],{"type":38,"value":2672},{"type":29,"tag":183,"props":5380,"children":5381},{"style":212},[5382],{"type":38,"value":770},{"type":29,"tag":183,"props":5384,"children":5385},{"style":222},[5386],{"type":38,"value":4696},{"type":29,"tag":183,"props":5388,"children":5389},{"style":228},[5390],{"type":38,"value":231},{"type":29,"tag":183,"props":5392,"children":5393},{"style":234},[5394],{"type":38,"value":1070},{"type":29,"tag":183,"props":5396,"children":5397},{"style":212},[5398],{"type":38,"value":2694},{"type":29,"tag":183,"props":5400,"children":5401},{"style":222},[5402],{"type":38,"value":2699},{"type":29,"tag":183,"props":5404,"children":5405},{"style":228},[5406],{"type":38,"value":231},{"type":29,"tag":183,"props":5408,"children":5409},{"style":234},[5410],{"type":38,"value":1070},{"type":29,"tag":183,"props":5412,"children":5413},{"style":212},[5414],{"type":38,"value":272},{"type":29,"tag":183,"props":5416,"children":5417},{"style":228},[5418],{"type":38,"value":231},{"type":29,"tag":183,"props":5420,"children":5421},{"style":750},[5422],{"type":38,"value":1436},{"type":29,"tag":183,"props":5424,"children":5425},{"style":1439},[5426],{"type":38,"value":1442},{"type":29,"tag":183,"props":5428,"children":5429},{"style":234},[5430],{"type":38,"value":4741},{"type":29,"tag":183,"props":5432,"children":5433},{"style":1439},[5434],{"type":38,"value":1452},{"type":29,"tag":183,"props":5436,"children":5437},{"style":212},[5438],{"type":38,"value":285},{"type":29,"tag":183,"props":5440,"children":5441},{"class":185,"line":516},[5442,5446,5450,5454,5458,5462,5466,5471,5475,5479,5484],{"type":29,"tag":183,"props":5443,"children":5444},{"style":200},[5445],{"type":38,"value":1464},{"type":29,"tag":183,"props":5447,"children":5448},{"style":297},[5449],{"type":38,"value":4918},{"type":29,"tag":183,"props":5451,"children":5452},{"style":228},[5453],{"type":38,"value":305},{"type":29,"tag":183,"props":5455,"children":5456},{"style":200},[5457],{"type":38,"value":1478},{"type":29,"tag":183,"props":5459,"children":5460},{"style":1481},[5461],{"type":38,"value":1484},{"type":29,"tag":183,"props":5463,"children":5464},{"style":388},[5465],{"type":38,"value":79},{"type":29,"tag":183,"props":5467,"children":5468},{"style":308},[5469],{"type":38,"value":5470},"slotRepo",{"type":29,"tag":183,"props":5472,"children":5473},{"style":388},[5474],{"type":38,"value":79},{"type":29,"tag":183,"props":5476,"children":5477},{"style":206},[5478],{"type":38,"value":1502},{"type":29,"tag":183,"props":5480,"children":5481},{"style":308},[5482],{"type":38,"value":5483},"(slotId)",{"type":29,"tag":183,"props":5485,"children":5486},{"style":212},[5487],{"type":38,"value":327},{"type":29,"tag":183,"props":5489,"children":5490},{"class":185,"line":536},[5491,5495,5500,5505,5509,5514,5518,5522,5526,5530,5534,5539,5544],{"type":29,"tag":183,"props":5492,"children":5493},{"style":200},[5494],{"type":38,"value":1528},{"type":29,"tag":183,"props":5496,"children":5497},{"style":308},[5498],{"type":38,"value":5499}," (slot ",{"type":29,"tag":183,"props":5501,"children":5502},{"style":228},[5503],{"type":38,"value":5504},"==",{"type":29,"tag":183,"props":5506,"children":5507},{"style":234},[5508],{"type":38,"value":5026},{"type":29,"tag":183,"props":5510,"children":5511},{"style":228},[5512],{"type":38,"value":5513}," ||",{"type":29,"tag":183,"props":5515,"children":5516},{"style":308},[5517],{"type":38,"value":4918},{"type":29,"tag":183,"props":5519,"children":5520},{"style":388},[5521],{"type":38,"value":79},{"type":29,"tag":183,"props":5523,"children":5524},{"style":308},[5525],{"type":38,"value":2988},{"type":29,"tag":183,"props":5527,"children":5528},{"style":228},[5529],{"type":38,"value":2993},{"type":29,"tag":183,"props":5531,"children":5532},{"style":308},[5533],{"type":38,"value":2998},{"type":29,"tag":183,"props":5535,"children":5536},{"style":200},[5537],{"type":38,"value":5538},"return",{"type":29,"tag":183,"props":5540,"children":5541},{"style":319},[5542],{"type":38,"value":5543}," false",{"type":29,"tag":183,"props":5545,"children":5546},{"style":212},[5547],{"type":38,"value":327},{"type":29,"tag":183,"props":5549,"children":5550},{"class":185,"line":570},[5551,5555,5560,5564,5568,5572,5576,5581,5585,5590,5594],{"type":29,"tag":183,"props":5552,"children":5553},{"style":200},[5554],{"type":38,"value":1464},{"type":29,"tag":183,"props":5556,"children":5557},{"style":297},[5558],{"type":38,"value":5559}," activeHolds",{"type":29,"tag":183,"props":5561,"children":5562},{"style":228},[5563],{"type":38,"value":305},{"type":29,"tag":183,"props":5565,"children":5566},{"style":200},[5567],{"type":38,"value":1478},{"type":29,"tag":183,"props":5569,"children":5570},{"style":1481},[5571],{"type":38,"value":1484},{"type":29,"tag":183,"props":5573,"children":5574},{"style":388},[5575],{"type":38,"value":79},{"type":29,"tag":183,"props":5577,"children":5578},{"style":308},[5579],{"type":38,"value":5580},"slotHoldRepo",{"type":29,"tag":183,"props":5582,"children":5583},{"style":388},[5584],{"type":38,"value":79},{"type":29,"tag":183,"props":5586,"children":5587},{"style":206},[5588],{"type":38,"value":5589},"countActiveHolds",{"type":29,"tag":183,"props":5591,"children":5592},{"style":308},[5593],{"type":38,"value":5483},{"type":29,"tag":183,"props":5595,"children":5596},{"style":212},[5597],{"type":38,"value":327},{"type":29,"tag":183,"props":5599,"children":5600},{"class":185,"line":613},[5601,5605,5610,5614,5618],{"type":29,"tag":183,"props":5602,"children":5603},{"style":200},[5604],{"type":38,"value":919},{"type":29,"tag":183,"props":5606,"children":5607},{"style":308},[5608],{"type":38,"value":5609}," activeHolds ",{"type":29,"tag":183,"props":5611,"children":5612},{"style":228},[5613],{"type":38,"value":3053},{"type":29,"tag":183,"props":5615,"children":5616},{"style":319},[5617],{"type":38,"value":981},{"type":29,"tag":183,"props":5619,"children":5620},{"style":212},[5621],{"type":38,"value":327},{"type":29,"tag":183,"props":5623,"children":5624},{"class":185,"line":662},[5625],{"type":29,"tag":183,"props":5626,"children":5627},{"style":212},[5628],{"type":38,"value":997},{"type":29,"tag":183,"props":5630,"children":5631},{"class":185,"line":3095},[5632],{"type":29,"tag":183,"props":5633,"children":5634},{"style":212},[5635],{"type":38,"value":436},{"type":29,"tag":30,"props":5637,"children":5638},{},[5639],{"type":38,"value":5640},"Sur crmcoaching, j'ai 47 use cases qui ne dépendent d'aucun module externe. Je peux faire tourner toute la logique métier en CI sans démarrer Postgres. Le jour où je voudrai migrer vers Drizzle, ce sera 2 jours de travail au lieu de plusieurs mois.",{"type":29,"tag":46,"props":5642,"children":5643},{},[],{"type":29,"tag":50,"props":5645,"children":5647},{"id":5646},"pattern-3-tests-qui-ne-testent-rien",[5648],{"type":38,"value":5649},"Pattern #3 : tests qui ne testent rien",{"type":29,"tag":30,"props":5651,"children":5652},{},[5653,5655,5661,5663,5669],{"type":38,"value":5654},"Celui-là me fait grincer des dents à chaque fois. Claude génère des tests qui ont l'air sérieux, avec des ",{"type":29,"tag":156,"props":5656,"children":5658},{"className":5657},[],[5659],{"type":38,"value":5660},"describe",{"type":38,"value":5662},", des ",{"type":29,"tag":156,"props":5664,"children":5666},{"className":5665},[],[5667],{"type":38,"value":5668},"vi.fn()",{"type":38,"value":5670},", des assertions, et qui ne testent en réalité aucun comportement métier. Exemple typique sur crmcoaching :",{"type":29,"tag":173,"props":5672,"children":5674},{"className":175,"code":5673,"language":177,"meta":8,"style":8},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fuse-cases\u002F__tests__\u002Fcreate-mentoring-checkout-intent.test.ts\n\u002F\u002F Test généré par Claude sans prompt de comportement\n\ndescribe('CreateMentoringCheckoutIntentUseCase', () => {\n  it('should call repository save', async () => {\n    const repo = { save: vi.fn().mockResolvedValue({ id: 'intent-1' }) };\n    const useCase = new CreateMentoringCheckoutIntentUseCase(repo as any);\n\n    await useCase.execute({ coachId: 'c1', clientId: 'cl1', offreId: 'o1' });\n\n    expect(repo.save).toHaveBeenCalledWith(\n      expect.objectContaining({ coachId: 'c1' }),\n    ); \u002F\u002F vérifie un appel, pas un comportement\n  });\n});\n",[5675],{"type":29,"tag":156,"props":5676,"children":5677},{"__ignoreMap":8},[5678,5686,5694,5701,5735,5773,5863,5911,5918,6006,6013,6048,6097,6115,6131],{"type":29,"tag":183,"props":5679,"children":5680},{"class":185,"line":186},[5681],{"type":29,"tag":183,"props":5682,"children":5683},{"style":190},[5684],{"type":38,"value":5685},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Fapplication\u002Fuse-cases\u002F__tests__\u002Fcreate-mentoring-checkout-intent.test.ts\n",{"type":29,"tag":183,"props":5687,"children":5688},{"class":185,"line":196},[5689],{"type":29,"tag":183,"props":5690,"children":5691},{"style":190},[5692],{"type":38,"value":5693},"\u002F\u002F Test généré par Claude sans prompt de comportement\n",{"type":29,"tag":183,"props":5695,"children":5696},{"class":185,"line":218},[5697],{"type":29,"tag":183,"props":5698,"children":5699},{"emptyLinePlaceholder":13},[5700],{"type":38,"value":445},{"type":29,"tag":183,"props":5702,"children":5703},{"class":185,"line":245},[5704,5708,5712,5717,5721,5726,5731],{"type":29,"tag":183,"props":5705,"children":5706},{"style":206},[5707],{"type":38,"value":5660},{"type":29,"tag":183,"props":5709,"children":5710},{"style":308},[5711],{"type":38,"value":770},{"type":29,"tag":183,"props":5713,"children":5714},{"style":1683},[5715],{"type":38,"value":5716},"'CreateMentoringCheckoutIntentUseCase'",{"type":29,"tag":183,"props":5718,"children":5719},{"style":212},[5720],{"type":38,"value":2694},{"type":29,"tag":183,"props":5722,"children":5723},{"style":212},[5724],{"type":38,"value":5725}," ()",{"type":29,"tag":183,"props":5727,"children":5728},{"style":228},[5729],{"type":38,"value":5730}," =>",{"type":29,"tag":183,"props":5732,"children":5733},{"style":212},[5734],{"type":38,"value":285},{"type":29,"tag":183,"props":5736,"children":5737},{"class":185,"line":266},[5738,5743,5747,5752,5756,5761,5765,5769],{"type":29,"tag":183,"props":5739,"children":5740},{"style":206},[5741],{"type":38,"value":5742},"  it",{"type":29,"tag":183,"props":5744,"children":5745},{"style":308},[5746],{"type":38,"value":770},{"type":29,"tag":183,"props":5748,"children":5749},{"style":1683},[5750],{"type":38,"value":5751},"'should call repository save'",{"type":29,"tag":183,"props":5753,"children":5754},{"style":212},[5755],{"type":38,"value":2694},{"type":29,"tag":183,"props":5757,"children":5758},{"style":200},[5759],{"type":38,"value":5760}," async",{"type":29,"tag":183,"props":5762,"children":5763},{"style":212},[5764],{"type":38,"value":5725},{"type":29,"tag":183,"props":5766,"children":5767},{"style":228},[5768],{"type":38,"value":5730},{"type":29,"tag":183,"props":5770,"children":5771},{"style":212},[5772],{"type":38,"value":285},{"type":29,"tag":183,"props":5774,"children":5775},{"class":185,"line":288},[5776,5780,5785,5789,5793,5798,5802,5807,5811,5816,5820,5824,5829,5833,5837,5841,5845,5850,5854,5858],{"type":29,"tag":183,"props":5777,"children":5778},{"style":200},[5779],{"type":38,"value":1464},{"type":29,"tag":183,"props":5781,"children":5782},{"style":297},[5783],{"type":38,"value":5784}," repo",{"type":29,"tag":183,"props":5786,"children":5787},{"style":228},[5788],{"type":38,"value":305},{"type":29,"tag":183,"props":5790,"children":5791},{"style":212},[5792],{"type":38,"value":2867},{"type":29,"tag":183,"props":5794,"children":5795},{"style":308},[5796],{"type":38,"value":5797}," save",{"type":29,"tag":183,"props":5799,"children":5800},{"style":388},[5801],{"type":38,"value":231},{"type":29,"tag":183,"props":5803,"children":5804},{"style":308},[5805],{"type":38,"value":5806}," vi",{"type":29,"tag":183,"props":5808,"children":5809},{"style":388},[5810],{"type":38,"value":79},{"type":29,"tag":183,"props":5812,"children":5813},{"style":206},[5814],{"type":38,"value":5815},"fn",{"type":29,"tag":183,"props":5817,"children":5818},{"style":308},[5819],{"type":38,"value":1108},{"type":29,"tag":183,"props":5821,"children":5822},{"style":388},[5823],{"type":38,"value":79},{"type":29,"tag":183,"props":5825,"children":5826},{"style":206},[5827],{"type":38,"value":5828},"mockResolvedValue",{"type":29,"tag":183,"props":5830,"children":5831},{"style":308},[5832],{"type":38,"value":770},{"type":29,"tag":183,"props":5834,"children":5835},{"style":212},[5836],{"type":38,"value":2853},{"type":29,"tag":183,"props":5838,"children":5839},{"style":308},[5840],{"type":38,"value":2872},{"type":29,"tag":183,"props":5842,"children":5843},{"style":388},[5844],{"type":38,"value":231},{"type":29,"tag":183,"props":5846,"children":5847},{"style":1683},[5848],{"type":38,"value":5849}," 'intent-1'",{"type":29,"tag":183,"props":5851,"children":5852},{"style":212},[5853],{"type":38,"value":2891},{"type":29,"tag":183,"props":5855,"children":5856},{"style":308},[5857],{"type":38,"value":415},{"type":29,"tag":183,"props":5859,"children":5860},{"style":212},[5861],{"type":38,"value":5862},"};\n",{"type":29,"tag":183,"props":5864,"children":5865},{"class":185,"line":330},[5866,5870,5875,5879,5883,5888,5893,5898,5903,5907],{"type":29,"tag":183,"props":5867,"children":5868},{"style":200},[5869],{"type":38,"value":1464},{"type":29,"tag":183,"props":5871,"children":5872},{"style":297},[5873],{"type":38,"value":5874}," useCase",{"type":29,"tag":183,"props":5876,"children":5877},{"style":228},[5878],{"type":38,"value":305},{"type":29,"tag":183,"props":5880,"children":5881},{"style":1096},[5882],{"type":38,"value":1099},{"type":29,"tag":183,"props":5884,"children":5885},{"style":206},[5886],{"type":38,"value":5887}," CreateMentoringCheckoutIntentUseCase",{"type":29,"tag":183,"props":5889,"children":5890},{"style":308},[5891],{"type":38,"value":5892},"(repo ",{"type":29,"tag":183,"props":5894,"children":5895},{"style":200},[5896],{"type":38,"value":5897},"as",{"type":29,"tag":183,"props":5899,"children":5900},{"style":234},[5901],{"type":38,"value":5902}," any",{"type":29,"tag":183,"props":5904,"children":5905},{"style":308},[5906],{"type":38,"value":272},{"type":29,"tag":183,"props":5908,"children":5909},{"style":212},[5910],{"type":38,"value":327},{"type":29,"tag":183,"props":5912,"children":5913},{"class":185,"line":374},[5914],{"type":29,"tag":183,"props":5915,"children":5916},{"emptyLinePlaceholder":13},[5917],{"type":38,"value":445},{"type":29,"tag":183,"props":5919,"children":5920},{"class":185,"line":430},[5921,5925,5929,5933,5938,5942,5946,5950,5954,5959,5963,5967,5971,5976,5980,5985,5989,5994,5998,6002],{"type":29,"tag":183,"props":5922,"children":5923},{"style":200},[5924],{"type":38,"value":1597},{"type":29,"tag":183,"props":5926,"children":5927},{"style":308},[5928],{"type":38,"value":5874},{"type":29,"tag":183,"props":5930,"children":5931},{"style":388},[5932],{"type":38,"value":79},{"type":29,"tag":183,"props":5934,"children":5935},{"style":206},[5936],{"type":38,"value":5937},"execute",{"type":29,"tag":183,"props":5939,"children":5940},{"style":308},[5941],{"type":38,"value":770},{"type":29,"tag":183,"props":5943,"children":5944},{"style":212},[5945],{"type":38,"value":2853},{"type":29,"tag":183,"props":5947,"children":5948},{"style":308},[5949],{"type":38,"value":2699},{"type":29,"tag":183,"props":5951,"children":5952},{"style":388},[5953],{"type":38,"value":231},{"type":29,"tag":183,"props":5955,"children":5956},{"style":1683},[5957],{"type":38,"value":5958}," 'c1'",{"type":29,"tag":183,"props":5960,"children":5961},{"style":212},[5962],{"type":38,"value":2694},{"type":29,"tag":183,"props":5964,"children":5965},{"style":308},[5966],{"type":38,"value":4367},{"type":29,"tag":183,"props":5968,"children":5969},{"style":388},[5970],{"type":38,"value":231},{"type":29,"tag":183,"props":5972,"children":5973},{"style":1683},[5974],{"type":38,"value":5975}," 'cl1'",{"type":29,"tag":183,"props":5977,"children":5978},{"style":212},[5979],{"type":38,"value":2694},{"type":29,"tag":183,"props":5981,"children":5982},{"style":308},[5983],{"type":38,"value":5984}," offreId",{"type":29,"tag":183,"props":5986,"children":5987},{"style":388},[5988],{"type":38,"value":231},{"type":29,"tag":183,"props":5990,"children":5991},{"style":1683},[5992],{"type":38,"value":5993}," 'o1'",{"type":29,"tag":183,"props":5995,"children":5996},{"style":212},[5997],{"type":38,"value":2891},{"type":29,"tag":183,"props":5999,"children":6000},{"style":308},[6001],{"type":38,"value":272},{"type":29,"tag":183,"props":6003,"children":6004},{"style":212},[6005],{"type":38,"value":327},{"type":29,"tag":183,"props":6007,"children":6008},{"class":185,"line":439},[6009],{"type":29,"tag":183,"props":6010,"children":6011},{"emptyLinePlaceholder":13},[6012],{"type":38,"value":445},{"type":29,"tag":183,"props":6014,"children":6015},{"class":185,"line":448},[6016,6021,6026,6030,6035,6039,6044],{"type":29,"tag":183,"props":6017,"children":6018},{"style":206},[6019],{"type":38,"value":6020},"    expect",{"type":29,"tag":183,"props":6022,"children":6023},{"style":308},[6024],{"type":38,"value":6025},"(repo",{"type":29,"tag":183,"props":6027,"children":6028},{"style":388},[6029],{"type":38,"value":79},{"type":29,"tag":183,"props":6031,"children":6032},{"style":308},[6033],{"type":38,"value":6034},"save)",{"type":29,"tag":183,"props":6036,"children":6037},{"style":388},[6038],{"type":38,"value":79},{"type":29,"tag":183,"props":6040,"children":6041},{"style":206},[6042],{"type":38,"value":6043},"toHaveBeenCalledWith",{"type":29,"tag":183,"props":6045,"children":6046},{"style":308},[6047],{"type":38,"value":215},{"type":29,"tag":183,"props":6049,"children":6050},{"class":185,"line":457},[6051,6056,6060,6065,6069,6073,6077,6081,6085,6089,6093],{"type":29,"tag":183,"props":6052,"children":6053},{"style":308},[6054],{"type":38,"value":6055},"      expect",{"type":29,"tag":183,"props":6057,"children":6058},{"style":388},[6059],{"type":38,"value":79},{"type":29,"tag":183,"props":6061,"children":6062},{"style":206},[6063],{"type":38,"value":6064},"objectContaining",{"type":29,"tag":183,"props":6066,"children":6067},{"style":308},[6068],{"type":38,"value":770},{"type":29,"tag":183,"props":6070,"children":6071},{"style":212},[6072],{"type":38,"value":2853},{"type":29,"tag":183,"props":6074,"children":6075},{"style":308},[6076],{"type":38,"value":2699},{"type":29,"tag":183,"props":6078,"children":6079},{"style":388},[6080],{"type":38,"value":231},{"type":29,"tag":183,"props":6082,"children":6083},{"style":1683},[6084],{"type":38,"value":5958},{"type":29,"tag":183,"props":6086,"children":6087},{"style":212},[6088],{"type":38,"value":2891},{"type":29,"tag":183,"props":6090,"children":6091},{"style":308},[6092],{"type":38,"value":272},{"type":29,"tag":183,"props":6094,"children":6095},{"style":212},[6096],{"type":38,"value":242},{"type":29,"tag":183,"props":6098,"children":6099},{"class":185,"line":474},[6100,6105,6110],{"type":29,"tag":183,"props":6101,"children":6102},{"style":308},[6103],{"type":38,"value":6104},"    )",{"type":29,"tag":183,"props":6106,"children":6107},{"style":212},[6108],{"type":38,"value":6109},";",{"type":29,"tag":183,"props":6111,"children":6112},{"style":190},[6113],{"type":38,"value":6114}," \u002F\u002F vérifie un appel, pas un comportement\n",{"type":29,"tag":183,"props":6116,"children":6117},{"class":185,"line":495},[6118,6123,6127],{"type":29,"tag":183,"props":6119,"children":6120},{"style":212},[6121],{"type":38,"value":6122},"  }",{"type":29,"tag":183,"props":6124,"children":6125},{"style":308},[6126],{"type":38,"value":272},{"type":29,"tag":183,"props":6128,"children":6129},{"style":212},[6130],{"type":38,"value":327},{"type":29,"tag":183,"props":6132,"children":6133},{"class":185,"line":516},[6134,6138,6142],{"type":29,"tag":183,"props":6135,"children":6136},{"style":212},[6137],{"type":38,"value":2886},{"type":29,"tag":183,"props":6139,"children":6140},{"style":308},[6141],{"type":38,"value":272},{"type":29,"tag":183,"props":6143,"children":6144},{"style":212},[6145],{"type":38,"value":327},{"type":29,"tag":30,"props":6147,"children":6148},{},[6149],{"type":38,"value":6150},"Ce test ne dit rien. Il vérifie que la fonction appelle une autre fonction. C'est tautologique. Si vous changez l'implémentation pour utiliser un event store au lieu d'un repository, le test casse, sans qu'aucun comportement métier ait changé. C'est le pire des deux mondes : couplage fort à l'implémentation, zéro garantie de correction.",{"type":29,"tag":30,"props":6152,"children":6153},{},[6154,6156,6161],{"type":38,"value":6155},"Le contre-pattern, c'est ce que Dan North appelait ",{"type":29,"tag":114,"props":6157,"children":6158},{},[6159],{"type":38,"value":6160},"\"Tests as Specifications\"",{"type":38,"value":6162}," dans ses articles BDD fondateurs de 2006. Le test décrit un comportement observable :",{"type":29,"tag":173,"props":6164,"children":6166},{"className":175,"code":6165,"language":177,"meta":8,"style":8},"describe('CreateMentoringCheckoutIntentUseCase', () => {\n  it('étant donné une offre active, quand on crée l\\'intent, alors l\\'intent contient le prix de l\\'offre', async () => {\n    \u002F\u002F Given\n    const offre = { id: 'o1', price: 150, currency: 'EUR', status: 'ACTIVE' };\n    const repo = new InMemoryCheckoutIntentRepository();\n    const offreRepo = new InMemoryOffreRepository([offre]);\n    const useCase = new CreateMentoringCheckoutIntentUseCase(repo, offreRepo);\n\n    \u002F\u002F When\n    const result = await useCase.execute({ coachId: 'c1', clientId: 'cl1', offreId: 'o1' });\n\n    \u002F\u002F Then\n    expect(result.amount).toBe(150);\n    expect(result.currency).toBe('EUR');\n    expect(result.status).toBe('PENDING');\n  });\n});\n",[6167],{"type":29,"tag":156,"props":6168,"children":6169},{"__ignoreMap":8},[6170,6201,6266,6274,6363,6395,6429,6469,6476,6484,6580,6587,6595,6642,6687,6732,6747],{"type":29,"tag":183,"props":6171,"children":6172},{"class":185,"line":186},[6173,6177,6181,6185,6189,6193,6197],{"type":29,"tag":183,"props":6174,"children":6175},{"style":206},[6176],{"type":38,"value":5660},{"type":29,"tag":183,"props":6178,"children":6179},{"style":308},[6180],{"type":38,"value":770},{"type":29,"tag":183,"props":6182,"children":6183},{"style":1683},[6184],{"type":38,"value":5716},{"type":29,"tag":183,"props":6186,"children":6187},{"style":212},[6188],{"type":38,"value":2694},{"type":29,"tag":183,"props":6190,"children":6191},{"style":212},[6192],{"type":38,"value":5725},{"type":29,"tag":183,"props":6194,"children":6195},{"style":228},[6196],{"type":38,"value":5730},{"type":29,"tag":183,"props":6198,"children":6199},{"style":212},[6200],{"type":38,"value":285},{"type":29,"tag":183,"props":6202,"children":6203},{"class":185,"line":196},[6204,6208,6212,6217,6223,6228,6232,6237,6241,6246,6250,6254,6258,6262],{"type":29,"tag":183,"props":6205,"children":6206},{"style":206},[6207],{"type":38,"value":5742},{"type":29,"tag":183,"props":6209,"children":6210},{"style":308},[6211],{"type":38,"value":770},{"type":29,"tag":183,"props":6213,"children":6214},{"style":1683},[6215],{"type":38,"value":6216},"'étant donné une offre active, quand on crée l",{"type":29,"tag":183,"props":6218,"children":6220},{"style":6219},"--shiki-default:#F4B8E4;--shiki-dark:#79B8FF",[6221],{"type":38,"value":6222},"\\'",{"type":29,"tag":183,"props":6224,"children":6225},{"style":1683},[6226],{"type":38,"value":6227},"intent, alors l",{"type":29,"tag":183,"props":6229,"children":6230},{"style":6219},[6231],{"type":38,"value":6222},{"type":29,"tag":183,"props":6233,"children":6234},{"style":1683},[6235],{"type":38,"value":6236},"intent contient le prix de l",{"type":29,"tag":183,"props":6238,"children":6239},{"style":6219},[6240],{"type":38,"value":6222},{"type":29,"tag":183,"props":6242,"children":6243},{"style":1683},[6244],{"type":38,"value":6245},"offre'",{"type":29,"tag":183,"props":6247,"children":6248},{"style":212},[6249],{"type":38,"value":2694},{"type":29,"tag":183,"props":6251,"children":6252},{"style":200},[6253],{"type":38,"value":5760},{"type":29,"tag":183,"props":6255,"children":6256},{"style":212},[6257],{"type":38,"value":5725},{"type":29,"tag":183,"props":6259,"children":6260},{"style":228},[6261],{"type":38,"value":5730},{"type":29,"tag":183,"props":6263,"children":6264},{"style":212},[6265],{"type":38,"value":285},{"type":29,"tag":183,"props":6267,"children":6268},{"class":185,"line":218},[6269],{"type":29,"tag":183,"props":6270,"children":6271},{"style":190},[6272],{"type":38,"value":6273},"    \u002F\u002F Given\n",{"type":29,"tag":183,"props":6275,"children":6276},{"class":185,"line":245},[6277,6281,6286,6290,6294,6298,6302,6306,6310,6315,6319,6324,6328,6333,6337,6342,6346,6350,6354,6358],{"type":29,"tag":183,"props":6278,"children":6279},{"style":200},[6280],{"type":38,"value":1464},{"type":29,"tag":183,"props":6282,"children":6283},{"style":297},[6284],{"type":38,"value":6285}," offre",{"type":29,"tag":183,"props":6287,"children":6288},{"style":228},[6289],{"type":38,"value":305},{"type":29,"tag":183,"props":6291,"children":6292},{"style":212},[6293],{"type":38,"value":2867},{"type":29,"tag":183,"props":6295,"children":6296},{"style":308},[6297],{"type":38,"value":2872},{"type":29,"tag":183,"props":6299,"children":6300},{"style":388},[6301],{"type":38,"value":231},{"type":29,"tag":183,"props":6303,"children":6304},{"style":1683},[6305],{"type":38,"value":5993},{"type":29,"tag":183,"props":6307,"children":6308},{"style":212},[6309],{"type":38,"value":2694},{"type":29,"tag":183,"props":6311,"children":6312},{"style":308},[6313],{"type":38,"value":6314}," price",{"type":29,"tag":183,"props":6316,"children":6317},{"style":388},[6318],{"type":38,"value":231},{"type":29,"tag":183,"props":6320,"children":6321},{"style":319},[6322],{"type":38,"value":6323}," 150",{"type":29,"tag":183,"props":6325,"children":6326},{"style":212},[6327],{"type":38,"value":2694},{"type":29,"tag":183,"props":6329,"children":6330},{"style":308},[6331],{"type":38,"value":6332}," currency",{"type":29,"tag":183,"props":6334,"children":6335},{"style":388},[6336],{"type":38,"value":231},{"type":29,"tag":183,"props":6338,"children":6339},{"style":1683},[6340],{"type":38,"value":6341}," 'EUR'",{"type":29,"tag":183,"props":6343,"children":6344},{"style":212},[6345],{"type":38,"value":2694},{"type":29,"tag":183,"props":6347,"children":6348},{"style":308},[6349],{"type":38,"value":3683},{"type":29,"tag":183,"props":6351,"children":6352},{"style":388},[6353],{"type":38,"value":231},{"type":29,"tag":183,"props":6355,"children":6356},{"style":1683},[6357],{"type":38,"value":3513},{"type":29,"tag":183,"props":6359,"children":6360},{"style":212},[6361],{"type":38,"value":6362}," };\n",{"type":29,"tag":183,"props":6364,"children":6365},{"class":185,"line":266},[6366,6370,6374,6378,6382,6387,6391],{"type":29,"tag":183,"props":6367,"children":6368},{"style":200},[6369],{"type":38,"value":1464},{"type":29,"tag":183,"props":6371,"children":6372},{"style":297},[6373],{"type":38,"value":5784},{"type":29,"tag":183,"props":6375,"children":6376},{"style":228},[6377],{"type":38,"value":305},{"type":29,"tag":183,"props":6379,"children":6380},{"style":1096},[6381],{"type":38,"value":1099},{"type":29,"tag":183,"props":6383,"children":6384},{"style":206},[6385],{"type":38,"value":6386}," InMemoryCheckoutIntentRepository",{"type":29,"tag":183,"props":6388,"children":6389},{"style":308},[6390],{"type":38,"value":1108},{"type":29,"tag":183,"props":6392,"children":6393},{"style":212},[6394],{"type":38,"value":327},{"type":29,"tag":183,"props":6396,"children":6397},{"class":185,"line":288},[6398,6402,6407,6411,6415,6420,6425],{"type":29,"tag":183,"props":6399,"children":6400},{"style":200},[6401],{"type":38,"value":1464},{"type":29,"tag":183,"props":6403,"children":6404},{"style":297},[6405],{"type":38,"value":6406}," offreRepo",{"type":29,"tag":183,"props":6408,"children":6409},{"style":228},[6410],{"type":38,"value":305},{"type":29,"tag":183,"props":6412,"children":6413},{"style":1096},[6414],{"type":38,"value":1099},{"type":29,"tag":183,"props":6416,"children":6417},{"style":206},[6418],{"type":38,"value":6419}," InMemoryOffreRepository",{"type":29,"tag":183,"props":6421,"children":6422},{"style":308},[6423],{"type":38,"value":6424},"([offre])",{"type":29,"tag":183,"props":6426,"children":6427},{"style":212},[6428],{"type":38,"value":327},{"type":29,"tag":183,"props":6430,"children":6431},{"class":185,"line":330},[6432,6436,6440,6444,6448,6452,6456,6460,6465],{"type":29,"tag":183,"props":6433,"children":6434},{"style":200},[6435],{"type":38,"value":1464},{"type":29,"tag":183,"props":6437,"children":6438},{"style":297},[6439],{"type":38,"value":5874},{"type":29,"tag":183,"props":6441,"children":6442},{"style":228},[6443],{"type":38,"value":305},{"type":29,"tag":183,"props":6445,"children":6446},{"style":1096},[6447],{"type":38,"value":1099},{"type":29,"tag":183,"props":6449,"children":6450},{"style":206},[6451],{"type":38,"value":5887},{"type":29,"tag":183,"props":6453,"children":6454},{"style":308},[6455],{"type":38,"value":6025},{"type":29,"tag":183,"props":6457,"children":6458},{"style":212},[6459],{"type":38,"value":2694},{"type":29,"tag":183,"props":6461,"children":6462},{"style":308},[6463],{"type":38,"value":6464}," offreRepo)",{"type":29,"tag":183,"props":6466,"children":6467},{"style":212},[6468],{"type":38,"value":327},{"type":29,"tag":183,"props":6470,"children":6471},{"class":185,"line":374},[6472],{"type":29,"tag":183,"props":6473,"children":6474},{"emptyLinePlaceholder":13},[6475],{"type":38,"value":445},{"type":29,"tag":183,"props":6477,"children":6478},{"class":185,"line":430},[6479],{"type":29,"tag":183,"props":6480,"children":6481},{"style":190},[6482],{"type":38,"value":6483},"    \u002F\u002F When\n",{"type":29,"tag":183,"props":6485,"children":6486},{"class":185,"line":439},[6487,6491,6496,6500,6504,6508,6512,6516,6520,6524,6528,6532,6536,6540,6544,6548,6552,6556,6560,6564,6568,6572,6576],{"type":29,"tag":183,"props":6488,"children":6489},{"style":200},[6490],{"type":38,"value":1464},{"type":29,"tag":183,"props":6492,"children":6493},{"style":297},[6494],{"type":38,"value":6495}," result",{"type":29,"tag":183,"props":6497,"children":6498},{"style":228},[6499],{"type":38,"value":305},{"type":29,"tag":183,"props":6501,"children":6502},{"style":200},[6503],{"type":38,"value":1478},{"type":29,"tag":183,"props":6505,"children":6506},{"style":308},[6507],{"type":38,"value":5874},{"type":29,"tag":183,"props":6509,"children":6510},{"style":388},[6511],{"type":38,"value":79},{"type":29,"tag":183,"props":6513,"children":6514},{"style":206},[6515],{"type":38,"value":5937},{"type":29,"tag":183,"props":6517,"children":6518},{"style":308},[6519],{"type":38,"value":770},{"type":29,"tag":183,"props":6521,"children":6522},{"style":212},[6523],{"type":38,"value":2853},{"type":29,"tag":183,"props":6525,"children":6526},{"style":308},[6527],{"type":38,"value":2699},{"type":29,"tag":183,"props":6529,"children":6530},{"style":388},[6531],{"type":38,"value":231},{"type":29,"tag":183,"props":6533,"children":6534},{"style":1683},[6535],{"type":38,"value":5958},{"type":29,"tag":183,"props":6537,"children":6538},{"style":212},[6539],{"type":38,"value":2694},{"type":29,"tag":183,"props":6541,"children":6542},{"style":308},[6543],{"type":38,"value":4367},{"type":29,"tag":183,"props":6545,"children":6546},{"style":388},[6547],{"type":38,"value":231},{"type":29,"tag":183,"props":6549,"children":6550},{"style":1683},[6551],{"type":38,"value":5975},{"type":29,"tag":183,"props":6553,"children":6554},{"style":212},[6555],{"type":38,"value":2694},{"type":29,"tag":183,"props":6557,"children":6558},{"style":308},[6559],{"type":38,"value":5984},{"type":29,"tag":183,"props":6561,"children":6562},{"style":388},[6563],{"type":38,"value":231},{"type":29,"tag":183,"props":6565,"children":6566},{"style":1683},[6567],{"type":38,"value":5993},{"type":29,"tag":183,"props":6569,"children":6570},{"style":212},[6571],{"type":38,"value":2891},{"type":29,"tag":183,"props":6573,"children":6574},{"style":308},[6575],{"type":38,"value":272},{"type":29,"tag":183,"props":6577,"children":6578},{"style":212},[6579],{"type":38,"value":327},{"type":29,"tag":183,"props":6581,"children":6582},{"class":185,"line":448},[6583],{"type":29,"tag":183,"props":6584,"children":6585},{"emptyLinePlaceholder":13},[6586],{"type":38,"value":445},{"type":29,"tag":183,"props":6588,"children":6589},{"class":185,"line":457},[6590],{"type":29,"tag":183,"props":6591,"children":6592},{"style":190},[6593],{"type":38,"value":6594},"    \u002F\u002F Then\n",{"type":29,"tag":183,"props":6596,"children":6597},{"class":185,"line":474},[6598,6602,6607,6611,6616,6620,6625,6629,6634,6638],{"type":29,"tag":183,"props":6599,"children":6600},{"style":206},[6601],{"type":38,"value":6020},{"type":29,"tag":183,"props":6603,"children":6604},{"style":308},[6605],{"type":38,"value":6606},"(result",{"type":29,"tag":183,"props":6608,"children":6609},{"style":388},[6610],{"type":38,"value":79},{"type":29,"tag":183,"props":6612,"children":6613},{"style":308},[6614],{"type":38,"value":6615},"amount)",{"type":29,"tag":183,"props":6617,"children":6618},{"style":388},[6619],{"type":38,"value":79},{"type":29,"tag":183,"props":6621,"children":6622},{"style":206},[6623],{"type":38,"value":6624},"toBe",{"type":29,"tag":183,"props":6626,"children":6627},{"style":308},[6628],{"type":38,"value":770},{"type":29,"tag":183,"props":6630,"children":6631},{"style":319},[6632],{"type":38,"value":6633},"150",{"type":29,"tag":183,"props":6635,"children":6636},{"style":308},[6637],{"type":38,"value":272},{"type":29,"tag":183,"props":6639,"children":6640},{"style":212},[6641],{"type":38,"value":327},{"type":29,"tag":183,"props":6643,"children":6644},{"class":185,"line":495},[6645,6649,6653,6657,6662,6666,6670,6674,6679,6683],{"type":29,"tag":183,"props":6646,"children":6647},{"style":206},[6648],{"type":38,"value":6020},{"type":29,"tag":183,"props":6650,"children":6651},{"style":308},[6652],{"type":38,"value":6606},{"type":29,"tag":183,"props":6654,"children":6655},{"style":388},[6656],{"type":38,"value":79},{"type":29,"tag":183,"props":6658,"children":6659},{"style":308},[6660],{"type":38,"value":6661},"currency)",{"type":29,"tag":183,"props":6663,"children":6664},{"style":388},[6665],{"type":38,"value":79},{"type":29,"tag":183,"props":6667,"children":6668},{"style":206},[6669],{"type":38,"value":6624},{"type":29,"tag":183,"props":6671,"children":6672},{"style":308},[6673],{"type":38,"value":770},{"type":29,"tag":183,"props":6675,"children":6676},{"style":1683},[6677],{"type":38,"value":6678},"'EUR'",{"type":29,"tag":183,"props":6680,"children":6681},{"style":308},[6682],{"type":38,"value":272},{"type":29,"tag":183,"props":6684,"children":6685},{"style":212},[6686],{"type":38,"value":327},{"type":29,"tag":183,"props":6688,"children":6689},{"class":185,"line":516},[6690,6694,6698,6702,6707,6711,6715,6719,6724,6728],{"type":29,"tag":183,"props":6691,"children":6692},{"style":206},[6693],{"type":38,"value":6020},{"type":29,"tag":183,"props":6695,"children":6696},{"style":308},[6697],{"type":38,"value":6606},{"type":29,"tag":183,"props":6699,"children":6700},{"style":388},[6701],{"type":38,"value":79},{"type":29,"tag":183,"props":6703,"children":6704},{"style":308},[6705],{"type":38,"value":6706},"status)",{"type":29,"tag":183,"props":6708,"children":6709},{"style":388},[6710],{"type":38,"value":79},{"type":29,"tag":183,"props":6712,"children":6713},{"style":206},[6714],{"type":38,"value":6624},{"type":29,"tag":183,"props":6716,"children":6717},{"style":308},[6718],{"type":38,"value":770},{"type":29,"tag":183,"props":6720,"children":6721},{"style":1683},[6722],{"type":38,"value":6723},"'PENDING'",{"type":29,"tag":183,"props":6725,"children":6726},{"style":308},[6727],{"type":38,"value":272},{"type":29,"tag":183,"props":6729,"children":6730},{"style":212},[6731],{"type":38,"value":327},{"type":29,"tag":183,"props":6733,"children":6734},{"class":185,"line":536},[6735,6739,6743],{"type":29,"tag":183,"props":6736,"children":6737},{"style":212},[6738],{"type":38,"value":6122},{"type":29,"tag":183,"props":6740,"children":6741},{"style":308},[6742],{"type":38,"value":272},{"type":29,"tag":183,"props":6744,"children":6745},{"style":212},[6746],{"type":38,"value":327},{"type":29,"tag":183,"props":6748,"children":6749},{"class":185,"line":570},[6750,6754,6758],{"type":29,"tag":183,"props":6751,"children":6752},{"style":212},[6753],{"type":38,"value":2886},{"type":29,"tag":183,"props":6755,"children":6756},{"style":308},[6757],{"type":38,"value":272},{"type":29,"tag":183,"props":6759,"children":6760},{"style":212},[6761],{"type":38,"value":327},{"type":29,"tag":30,"props":6763,"children":6764},{},[6765,6767,6773],{"type":38,"value":6766},"L'implémentation peut changer, le test reste valable. C'est exactement la philosophie défendue dans ",{"type":29,"tag":62,"props":6768,"children":6770},{"href":6769},"\u002Ffr\u002Fpratiques-agiles\u002Fadopter-behaviour-driven-development-bdd-guide-agile",[6771],{"type":38,"value":6772},"l'adoption du Behaviour-Driven Development",{"type":38,"value":6774}," et dans la Definition of Done bien posée.",{"type":29,"tag":30,"props":6776,"children":6777},{},[6778],{"type":38,"value":6779},"Sur crmcoaching, après avoir appliqué ce changement systématiquement, le ratio de tests \"behavior-level\" est passé de 15% à 70%. La couverture brute a parfois baissé. La couverture utile a triplé.",{"type":29,"tag":46,"props":6781,"children":6782},{},[],{"type":29,"tag":50,"props":6784,"children":6786},{"id":6785},"pattern-4-catch-all-silencieux",[6787],{"type":38,"value":6788},"Pattern #4 : catch-all silencieux",{"type":29,"tag":30,"props":6790,"children":6791},{},[6792],{"type":38,"value":6793},"C'est le pattern le plus dangereux, parce qu'il masque les bugs au lieu de les révéler. Claude écrit volontiers :",{"type":29,"tag":173,"props":6795,"children":6797},{"className":175,"code":6796,"language":177,"meta":8,"style":8},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Finfrastructure\u002Fadapters\u002Fbrevo-notification.adapter.ts\n\nasync sendSlotConfirmation(clientEmail: string, slotId: string): Promise\u003Cvoid> {\n  try {\n    await this.brevoService.sendTransactionalEmail({\n      to: [{ email: clientEmail }],\n      templateId: 12,\n      params: { slotId },\n    });\n  } catch (e) {\n    console.error('notification failed', e);\n    \u002F\u002F la suite s'exécute comme si tout allait bien\n  }\n}\n",[6798],{"type":29,"tag":156,"props":6799,"children":6800},{"__ignoreMap":8},[6801,6809,6816,6858,6870,6905,6949,6968,6991,7006,7018,7057,7065,7072],{"type":29,"tag":183,"props":6802,"children":6803},{"class":185,"line":186},[6804],{"type":29,"tag":183,"props":6805,"children":6806},{"style":190},[6807],{"type":38,"value":6808},"\u002F\u002F apps\u002Fapi\u002Fsrc\u002Finfrastructure\u002Fadapters\u002Fbrevo-notification.adapter.ts\n",{"type":29,"tag":183,"props":6810,"children":6811},{"class":185,"line":196},[6812],{"type":29,"tag":183,"props":6813,"children":6814},{"emptyLinePlaceholder":13},[6815],{"type":38,"value":445},{"type":29,"tag":183,"props":6817,"children":6818},{"class":185,"line":218},[6819,6824,6829,6834,6838,6843,6849,6854],{"type":29,"tag":183,"props":6820,"children":6821},{"style":308},[6822],{"type":38,"value":6823},"async ",{"type":29,"tag":183,"props":6825,"children":6826},{"style":206},[6827],{"type":38,"value":6828},"sendSlotConfirmation",{"type":29,"tag":183,"props":6830,"children":6831},{"style":308},[6832],{"type":38,"value":6833},"(clientEmail: string",{"type":29,"tag":183,"props":6835,"children":6836},{"style":212},[6837],{"type":38,"value":2694},{"type":29,"tag":183,"props":6839,"children":6840},{"style":308},[6841],{"type":38,"value":6842}," slotId: string): ",{"type":29,"tag":183,"props":6844,"children":6846},{"style":6845},"--shiki-default:#E5C890;--shiki-default-font-style:italic;--shiki-dark:#79B8FF;--shiki-dark-font-style:inherit",[6847],{"type":38,"value":6848},"Promise",{"type":29,"tag":183,"props":6850,"children":6851},{"style":228},[6852],{"type":38,"value":6853},"\u003Cvoid>",{"type":29,"tag":183,"props":6855,"children":6856},{"style":212},[6857],{"type":38,"value":285},{"type":29,"tag":183,"props":6859,"children":6860},{"class":185,"line":245},[6861,6866],{"type":29,"tag":183,"props":6862,"children":6863},{"style":308},[6864],{"type":38,"value":6865},"  try ",{"type":29,"tag":183,"props":6867,"children":6868},{"style":212},[6869],{"type":38,"value":1548},{"type":29,"tag":183,"props":6871,"children":6872},{"class":185,"line":266},[6873,6877,6881,6885,6889,6893,6897,6901],{"type":29,"tag":183,"props":6874,"children":6875},{"style":200},[6876],{"type":38,"value":1597},{"type":29,"tag":183,"props":6878,"children":6879},{"style":1481},[6880],{"type":38,"value":1484},{"type":29,"tag":183,"props":6882,"children":6883},{"style":388},[6884],{"type":38,"value":79},{"type":29,"tag":183,"props":6886,"children":6887},{"style":308},[6888],{"type":38,"value":3801},{"type":29,"tag":183,"props":6890,"children":6891},{"style":388},[6892],{"type":38,"value":79},{"type":29,"tag":183,"props":6894,"children":6895},{"style":206},[6896],{"type":38,"value":3810},{"type":29,"tag":183,"props":6898,"children":6899},{"style":308},[6900],{"type":38,"value":770},{"type":29,"tag":183,"props":6902,"children":6903},{"style":212},[6904],{"type":38,"value":1548},{"type":29,"tag":183,"props":6906,"children":6907},{"class":185,"line":288},[6908,6912,6916,6920,6924,6928,6932,6937,6941,6945],{"type":29,"tag":183,"props":6909,"children":6910},{"style":308},[6911],{"type":38,"value":3827},{"type":29,"tag":183,"props":6913,"children":6914},{"style":388},[6915],{"type":38,"value":231},{"type":29,"tag":183,"props":6917,"children":6918},{"style":308},[6919],{"type":38,"value":3836},{"type":29,"tag":183,"props":6921,"children":6922},{"style":212},[6923],{"type":38,"value":2853},{"type":29,"tag":183,"props":6925,"children":6926},{"style":308},[6927],{"type":38,"value":3173},{"type":29,"tag":183,"props":6929,"children":6930},{"style":388},[6931],{"type":38,"value":231},{"type":29,"tag":183,"props":6933,"children":6934},{"style":308},[6935],{"type":38,"value":6936}," clientEmail ",{"type":29,"tag":183,"props":6938,"children":6939},{"style":212},[6940],{"type":38,"value":2886},{"type":29,"tag":183,"props":6942,"children":6943},{"style":308},[6944],{"type":38,"value":3934},{"type":29,"tag":183,"props":6946,"children":6947},{"style":212},[6948],{"type":38,"value":242},{"type":29,"tag":183,"props":6950,"children":6951},{"class":185,"line":330},[6952,6956,6960,6964],{"type":29,"tag":183,"props":6953,"children":6954},{"style":308},[6955],{"type":38,"value":3947},{"type":29,"tag":183,"props":6957,"children":6958},{"style":388},[6959],{"type":38,"value":231},{"type":29,"tag":183,"props":6961,"children":6962},{"style":319},[6963],{"type":38,"value":322},{"type":29,"tag":183,"props":6965,"children":6966},{"style":212},[6967],{"type":38,"value":242},{"type":29,"tag":183,"props":6969,"children":6970},{"class":185,"line":374},[6971,6975,6979,6983,6987],{"type":29,"tag":183,"props":6972,"children":6973},{"style":308},[6974],{"type":38,"value":3969},{"type":29,"tag":183,"props":6976,"children":6977},{"style":388},[6978],{"type":38,"value":231},{"type":29,"tag":183,"props":6980,"children":6981},{"style":212},[6982],{"type":38,"value":2867},{"type":29,"tag":183,"props":6984,"children":6985},{"style":308},[6986],{"type":38,"value":4988},{"type":29,"tag":183,"props":6988,"children":6989},{"style":212},[6990],{"type":38,"value":3204},{"type":29,"tag":183,"props":6992,"children":6993},{"class":185,"line":430},[6994,6998,7002],{"type":29,"tag":183,"props":6995,"children":6996},{"style":212},[6997],{"type":38,"value":3213},{"type":29,"tag":183,"props":6999,"children":7000},{"style":308},[7001],{"type":38,"value":272},{"type":29,"tag":183,"props":7003,"children":7004},{"style":212},[7005],{"type":38,"value":327},{"type":29,"tag":183,"props":7007,"children":7008},{"class":185,"line":439},[7009,7013],{"type":29,"tag":183,"props":7010,"children":7011},{"style":212},[7012],{"type":38,"value":6122},{"type":29,"tag":183,"props":7014,"children":7015},{"style":308},[7016],{"type":38,"value":7017}," catch (e) {\n",{"type":29,"tag":183,"props":7019,"children":7020},{"class":185,"line":448},[7021,7026,7031,7035,7040,7044,7049,7053],{"type":29,"tag":183,"props":7022,"children":7023},{"style":308},[7024],{"type":38,"value":7025},"    console.",{"type":29,"tag":183,"props":7027,"children":7028},{"style":206},[7029],{"type":38,"value":7030},"error",{"type":29,"tag":183,"props":7032,"children":7033},{"style":212},[7034],{"type":38,"value":770},{"type":29,"tag":183,"props":7036,"children":7037},{"style":1683},[7038],{"type":38,"value":7039},"'notification failed'",{"type":29,"tag":183,"props":7041,"children":7042},{"style":212},[7043],{"type":38,"value":2694},{"type":29,"tag":183,"props":7045,"children":7046},{"style":222},[7047],{"type":38,"value":7048}," e",{"type":29,"tag":183,"props":7050,"children":7051},{"style":212},[7052],{"type":38,"value":272},{"type":29,"tag":183,"props":7054,"children":7055},{"style":308},[7056],{"type":38,"value":327},{"type":29,"tag":183,"props":7058,"children":7059},{"class":185,"line":457},[7060],{"type":29,"tag":183,"props":7061,"children":7062},{"style":190},[7063],{"type":38,"value":7064},"    \u002F\u002F la suite s'exécute comme si tout allait bien\n",{"type":29,"tag":183,"props":7066,"children":7067},{"class":185,"line":474},[7068],{"type":29,"tag":183,"props":7069,"children":7070},{"style":212},[7071],{"type":38,"value":997},{"type":29,"tag":183,"props":7073,"children":7074},{"class":185,"line":495},[7075],{"type":29,"tag":183,"props":7076,"children":7077},{"style":308},[7078],{"type":38,"value":436},{"type":29,"tag":30,"props":7080,"children":7081},{},[7082,7084,7090],{"type":38,"value":7083},"Et la suite du code continue normalement. Le slot a-t-il été confirmé par email ? On ne sait pas. Le ",{"type":29,"tag":156,"props":7085,"children":7087},{"className":7086},[],[7088],{"type":38,"value":7089},"console.error",{"type":38,"value":7091}," est-il regardé par quelqu'un en prod ? Probablement pas. Le client voit \"Réservation confirmée\" alors que Brevo n'a rien envoyé.",{"type":29,"tag":30,"props":7093,"children":7094},{},[7095,7097,7103,7105,7111],{"type":38,"value":7096},"Le contre-pattern craft repose sur trois règles. D'abord, ne jamais avaler une exception sans politique explicite : soit on re-throw, soit on dégrade volontairement (tracé dans une métrique), soit on rollback. Ensuite, ne jamais utiliser ",{"type":29,"tag":156,"props":7098,"children":7100},{"className":7099},[],[7101],{"type":38,"value":7102},"catch (e)",{"type":38,"value":7104}," générique sans typer l'exception attendue : une erreur réseau Brevo ne se traite pas comme une ",{"type":29,"tag":156,"props":7106,"children":7108},{"className":7107},[],[7109],{"type":38,"value":7110},"DomainException",{"type":38,"value":7112},". Enfin, instrumenter chaque catch avec une métrique ou une alerte :",{"type":29,"tag":173,"props":7114,"children":7116},{"className":175,"code":7115,"language":177,"meta":8,"style":8},"async sendSlotConfirmation(clientEmail: string, slotId: string): Promise\u003Cvoid> {\n  try {\n    await this.brevoService.sendTransactionalEmail({\n      to: [{ email: clientEmail }],\n      templateId: 12,\n      params: { slotId },\n    });\n  } catch (err) {\n    this.logger.error('brevo.slot_confirmation.failed', {\n      clientEmail,\n      slotId,\n      error: err instanceof Error ? err.message : String(err),\n    });\n    this.metricsService.increment('notification_failures_total', { type: 'slot_confirmation' });\n    throw new NotificationDeliveryException(`Confirmation slot ${slotId} non envoyée`);\n  }\n}\n",[7117],{"type":29,"tag":156,"props":7118,"children":7119},{"__ignoreMap":8},[7120,7155,7166,7201,7244,7263,7286,7301,7313,7342,7354,7366,7431,7443,7488,7535,7542],{"type":29,"tag":183,"props":7121,"children":7122},{"class":185,"line":186},[7123,7127,7131,7135,7139,7143,7147,7151],{"type":29,"tag":183,"props":7124,"children":7125},{"style":308},[7126],{"type":38,"value":6823},{"type":29,"tag":183,"props":7128,"children":7129},{"style":206},[7130],{"type":38,"value":6828},{"type":29,"tag":183,"props":7132,"children":7133},{"style":308},[7134],{"type":38,"value":6833},{"type":29,"tag":183,"props":7136,"children":7137},{"style":212},[7138],{"type":38,"value":2694},{"type":29,"tag":183,"props":7140,"children":7141},{"style":308},[7142],{"type":38,"value":6842},{"type":29,"tag":183,"props":7144,"children":7145},{"style":6845},[7146],{"type":38,"value":6848},{"type":29,"tag":183,"props":7148,"children":7149},{"style":228},[7150],{"type":38,"value":6853},{"type":29,"tag":183,"props":7152,"children":7153},{"style":212},[7154],{"type":38,"value":285},{"type":29,"tag":183,"props":7156,"children":7157},{"class":185,"line":196},[7158,7162],{"type":29,"tag":183,"props":7159,"children":7160},{"style":308},[7161],{"type":38,"value":6865},{"type":29,"tag":183,"props":7163,"children":7164},{"style":212},[7165],{"type":38,"value":1548},{"type":29,"tag":183,"props":7167,"children":7168},{"class":185,"line":218},[7169,7173,7177,7181,7185,7189,7193,7197],{"type":29,"tag":183,"props":7170,"children":7171},{"style":200},[7172],{"type":38,"value":1597},{"type":29,"tag":183,"props":7174,"children":7175},{"style":1481},[7176],{"type":38,"value":1484},{"type":29,"tag":183,"props":7178,"children":7179},{"style":388},[7180],{"type":38,"value":79},{"type":29,"tag":183,"props":7182,"children":7183},{"style":308},[7184],{"type":38,"value":3801},{"type":29,"tag":183,"props":7186,"children":7187},{"style":388},[7188],{"type":38,"value":79},{"type":29,"tag":183,"props":7190,"children":7191},{"style":206},[7192],{"type":38,"value":3810},{"type":29,"tag":183,"props":7194,"children":7195},{"style":308},[7196],{"type":38,"value":770},{"type":29,"tag":183,"props":7198,"children":7199},{"style":212},[7200],{"type":38,"value":1548},{"type":29,"tag":183,"props":7202,"children":7203},{"class":185,"line":245},[7204,7208,7212,7216,7220,7224,7228,7232,7236,7240],{"type":29,"tag":183,"props":7205,"children":7206},{"style":308},[7207],{"type":38,"value":3827},{"type":29,"tag":183,"props":7209,"children":7210},{"style":388},[7211],{"type":38,"value":231},{"type":29,"tag":183,"props":7213,"children":7214},{"style":308},[7215],{"type":38,"value":3836},{"type":29,"tag":183,"props":7217,"children":7218},{"style":212},[7219],{"type":38,"value":2853},{"type":29,"tag":183,"props":7221,"children":7222},{"style":308},[7223],{"type":38,"value":3173},{"type":29,"tag":183,"props":7225,"children":7226},{"style":388},[7227],{"type":38,"value":231},{"type":29,"tag":183,"props":7229,"children":7230},{"style":308},[7231],{"type":38,"value":6936},{"type":29,"tag":183,"props":7233,"children":7234},{"style":212},[7235],{"type":38,"value":2886},{"type":29,"tag":183,"props":7237,"children":7238},{"style":308},[7239],{"type":38,"value":3934},{"type":29,"tag":183,"props":7241,"children":7242},{"style":212},[7243],{"type":38,"value":242},{"type":29,"tag":183,"props":7245,"children":7246},{"class":185,"line":266},[7247,7251,7255,7259],{"type":29,"tag":183,"props":7248,"children":7249},{"style":308},[7250],{"type":38,"value":3947},{"type":29,"tag":183,"props":7252,"children":7253},{"style":388},[7254],{"type":38,"value":231},{"type":29,"tag":183,"props":7256,"children":7257},{"style":319},[7258],{"type":38,"value":322},{"type":29,"tag":183,"props":7260,"children":7261},{"style":212},[7262],{"type":38,"value":242},{"type":29,"tag":183,"props":7264,"children":7265},{"class":185,"line":288},[7266,7270,7274,7278,7282],{"type":29,"tag":183,"props":7267,"children":7268},{"style":308},[7269],{"type":38,"value":3969},{"type":29,"tag":183,"props":7271,"children":7272},{"style":388},[7273],{"type":38,"value":231},{"type":29,"tag":183,"props":7275,"children":7276},{"style":212},[7277],{"type":38,"value":2867},{"type":29,"tag":183,"props":7279,"children":7280},{"style":308},[7281],{"type":38,"value":4988},{"type":29,"tag":183,"props":7283,"children":7284},{"style":212},[7285],{"type":38,"value":3204},{"type":29,"tag":183,"props":7287,"children":7288},{"class":185,"line":330},[7289,7293,7297],{"type":29,"tag":183,"props":7290,"children":7291},{"style":212},[7292],{"type":38,"value":3213},{"type":29,"tag":183,"props":7294,"children":7295},{"style":308},[7296],{"type":38,"value":272},{"type":29,"tag":183,"props":7298,"children":7299},{"style":212},[7300],{"type":38,"value":327},{"type":29,"tag":183,"props":7302,"children":7303},{"class":185,"line":374},[7304,7308],{"type":29,"tag":183,"props":7305,"children":7306},{"style":212},[7307],{"type":38,"value":6122},{"type":29,"tag":183,"props":7309,"children":7310},{"style":308},[7311],{"type":38,"value":7312}," catch (err) {\n",{"type":29,"tag":183,"props":7314,"children":7315},{"class":185,"line":430},[7316,7321,7325,7329,7334,7338],{"type":29,"tag":183,"props":7317,"children":7318},{"style":308},[7319],{"type":38,"value":7320},"    this.logger.",{"type":29,"tag":183,"props":7322,"children":7323},{"style":206},[7324],{"type":38,"value":7030},{"type":29,"tag":183,"props":7326,"children":7327},{"style":212},[7328],{"type":38,"value":770},{"type":29,"tag":183,"props":7330,"children":7331},{"style":1683},[7332],{"type":38,"value":7333},"'brevo.slot_confirmation.failed'",{"type":29,"tag":183,"props":7335,"children":7336},{"style":212},[7337],{"type":38,"value":2694},{"type":29,"tag":183,"props":7339,"children":7340},{"style":212},[7341],{"type":38,"value":285},{"type":29,"tag":183,"props":7343,"children":7344},{"class":185,"line":439},[7345,7350],{"type":29,"tag":183,"props":7346,"children":7347},{"style":222},[7348],{"type":38,"value":7349},"      clientEmail",{"type":29,"tag":183,"props":7351,"children":7352},{"style":212},[7353],{"type":38,"value":242},{"type":29,"tag":183,"props":7355,"children":7356},{"class":185,"line":448},[7357,7362],{"type":29,"tag":183,"props":7358,"children":7359},{"style":222},[7360],{"type":38,"value":7361},"      slotId",{"type":29,"tag":183,"props":7363,"children":7364},{"style":212},[7365],{"type":38,"value":242},{"type":29,"tag":183,"props":7367,"children":7368},{"class":185,"line":457},[7369,7375,7379,7384,7389,7394,7399,7404,7408,7413,7417,7422,7427],{"type":29,"tag":183,"props":7370,"children":7372},{"style":7371},"--shiki-default:#C6D0F5;--shiki-dark:#FFAB70",[7373],{"type":38,"value":7374},"      error",{"type":29,"tag":183,"props":7376,"children":7377},{"style":212},[7378],{"type":38,"value":231},{"type":29,"tag":183,"props":7380,"children":7381},{"style":222},[7382],{"type":38,"value":7383}," err",{"type":29,"tag":183,"props":7385,"children":7386},{"style":222},[7387],{"type":38,"value":7388}," instanceof",{"type":29,"tag":183,"props":7390,"children":7391},{"style":222},[7392],{"type":38,"value":7393}," Error",{"type":29,"tag":183,"props":7395,"children":7396},{"style":308},[7397],{"type":38,"value":7398}," ? ",{"type":29,"tag":183,"props":7400,"children":7401},{"style":222},[7402],{"type":38,"value":7403},"err",{"type":29,"tag":183,"props":7405,"children":7406},{"style":308},[7407],{"type":38,"value":79},{"type":29,"tag":183,"props":7409,"children":7410},{"style":7371},[7411],{"type":38,"value":7412},"message",{"type":29,"tag":183,"props":7414,"children":7415},{"style":212},[7416],{"type":38,"value":976},{"type":29,"tag":183,"props":7418,"children":7419},{"style":222},[7420],{"type":38,"value":7421}," String",{"type":29,"tag":183,"props":7423,"children":7424},{"style":308},[7425],{"type":38,"value":7426},"(err)",{"type":29,"tag":183,"props":7428,"children":7429},{"style":212},[7430],{"type":38,"value":242},{"type":29,"tag":183,"props":7432,"children":7433},{"class":185,"line":474},[7434,7439],{"type":29,"tag":183,"props":7435,"children":7436},{"style":212},[7437],{"type":38,"value":7438},"    })",{"type":29,"tag":183,"props":7440,"children":7441},{"style":308},[7442],{"type":38,"value":327},{"type":29,"tag":183,"props":7444,"children":7445},{"class":185,"line":495},[7446,7451,7456,7460,7464,7470,7474,7479,7483],{"type":29,"tag":183,"props":7447,"children":7448},{"style":308},[7449],{"type":38,"value":7450},"    this.metricsService.increment(",{"type":29,"tag":183,"props":7452,"children":7453},{"style":1683},[7454],{"type":38,"value":7455},"'notification_failures_total'",{"type":29,"tag":183,"props":7457,"children":7458},{"style":212},[7459],{"type":38,"value":2694},{"type":29,"tag":183,"props":7461,"children":7462},{"style":212},[7463],{"type":38,"value":2867},{"type":29,"tag":183,"props":7465,"children":7467},{"style":7466},"--shiki-default:#C6D0F5;--shiki-dark:#B392F0",[7468],{"type":38,"value":7469}," type",{"type":29,"tag":183,"props":7471,"children":7472},{"style":212},[7473],{"type":38,"value":231},{"type":29,"tag":183,"props":7475,"children":7476},{"style":1683},[7477],{"type":38,"value":7478}," 'slot_confirmation'",{"type":29,"tag":183,"props":7480,"children":7481},{"style":212},[7482],{"type":38,"value":2891},{"type":29,"tag":183,"props":7484,"children":7485},{"style":308},[7486],{"type":38,"value":7487},");\n",{"type":29,"tag":183,"props":7489,"children":7490},{"class":185,"line":516},[7491,7496,7501,7505,7510,7514,7518,7522,7527,7531],{"type":29,"tag":183,"props":7492,"children":7493},{"style":308},[7494],{"type":38,"value":7495},"    throw new ",{"type":29,"tag":183,"props":7497,"children":7498},{"style":206},[7499],{"type":38,"value":7500},"NotificationDeliveryException",{"type":29,"tag":183,"props":7502,"children":7503},{"style":212},[7504],{"type":38,"value":770},{"type":29,"tag":183,"props":7506,"children":7507},{"style":1683},[7508],{"type":38,"value":7509},"`Confirmation slot ",{"type":29,"tag":183,"props":7511,"children":7512},{"style":2944},[7513],{"type":38,"value":2947},{"type":29,"tag":183,"props":7515,"children":7516},{"style":308},[7517],{"type":38,"value":4696},{"type":29,"tag":183,"props":7519,"children":7520},{"style":2944},[7521],{"type":38,"value":2886},{"type":29,"tag":183,"props":7523,"children":7524},{"style":1683},[7525],{"type":38,"value":7526}," non envoyée`",{"type":29,"tag":183,"props":7528,"children":7529},{"style":212},[7530],{"type":38,"value":272},{"type":29,"tag":183,"props":7532,"children":7533},{"style":308},[7534],{"type":38,"value":327},{"type":29,"tag":183,"props":7536,"children":7537},{"class":185,"line":536},[7538],{"type":29,"tag":183,"props":7539,"children":7540},{"style":212},[7541],{"type":38,"value":997},{"type":29,"tag":183,"props":7543,"children":7544},{"class":185,"line":570},[7545],{"type":29,"tag":183,"props":7546,"children":7547},{"style":308},[7548],{"type":38,"value":436},{"type":29,"tag":30,"props":7550,"children":7551},{},[7552,7554,7559,7561,7567],{"type":38,"value":7553},"Michael Nygard a documenté ce sujet en profondeur dans ",{"type":29,"tag":114,"props":7555,"children":7556},{},[7557],{"type":38,"value":7558},"Release It!",{"type":38,"value":7560}," (2007). Les ",{"type":29,"tag":62,"props":7562,"children":7564},{"href":7563},"\u002Ffr\u002Farchitecture-craft\u002Fpatterns-resilience-circuit-breaker-retry",[7565],{"type":38,"value":7566},"patterns de résilience type circuit breaker et retry",{"type":38,"value":7568}," n'ont de sens que si les erreurs sont visibles. Un catch-all silencieux casse toute la stratégie de résilience en amont.",{"type":29,"tag":46,"props":7570,"children":7571},{},[],{"type":29,"tag":50,"props":7573,"children":7575},{"id":7574},"pattern-5-dépendances-non-auditées",[7576],{"type":38,"value":7577},"Pattern #5 : dépendances non auditées",{"type":29,"tag":30,"props":7579,"children":7580},{},[7581,7583,7589,7591,7597,7599,7605,7607,7613],{"type":38,"value":7582},"Le dernier pattern est le plus invisible. Claude propose une dépendance pour résoudre un problème : \"Ajoute ",{"type":29,"tag":156,"props":7584,"children":7586},{"className":7585},[],[7587],{"type":38,"value":7588},"stripe",{"type":38,"value":7590}," pour les checkouts\", \"Utilise ",{"type":29,"tag":156,"props":7592,"children":7594},{"className":7593},[],[7595],{"type":38,"value":7596},"jose",{"type":38,"value":7598}," pour signer ce token\", \"Importe ",{"type":29,"tag":156,"props":7600,"children":7602},{"className":7601},[],[7603],{"type":38,"value":7604},"date-fns",{"type":38,"value":7606}," pour ce calcul de durée\". Le développeur lance ",{"type":29,"tag":156,"props":7608,"children":7610},{"className":7609},[],[7611],{"type":38,"value":7612},"pnpm add \u003Cpkg>",{"type":38,"value":7614},", ça compile, ça passe les tests, ça merge. Et l'artefact entre dans le repo, sans audit, sans justification.",{"type":29,"tag":30,"props":7616,"children":7617},{},[7618,7620,7626],{"type":38,"value":7619},"Le problème, ce sont les chiffres du Snyk Open Source Security Report 2024 : les attaques sur la supply chain ont augmenté de 156% en un an. Les écosystèmes les plus touchés incluent npm, PyPI et Maven Central, précisément ceux que Claude suggère le plus. Sur le cas xz-utils (CVE-2024-3094, mars 2024), une backdoor s'est glissée pendant 2 ans dans un package que tout le monde utilisait sans relire. Le sujet de fond est traité dans ",{"type":29,"tag":62,"props":7621,"children":7623},{"href":7622},"\u002Ffr\u002Fintelligence-artificielle\u002Fllm-securite-code-vulnerabilites",[7624],{"type":38,"value":7625},"les vulnérabilités de sécurité dans le code LLM-généré",{"type":38,"value":79},{"type":29,"tag":30,"props":7628,"children":7629},{},[7630,7632,7638,7640,7646],{"type":38,"value":7631},"Le contre-pattern craft repose sur 3 réflexes. D'abord, refuser toute nouvelle dépendance qui n'a pas été justifiée par un commentaire de PR (quelle alternative native Node ? quel score de vulnérabilités npm audit ? combien de mainteneurs actifs ?). Ensuite, mesurer la ",{"type":29,"tag":156,"props":7633,"children":7635},{"className":7634},[],[7636],{"type":38,"value":7637},"time-to-patch",{"type":38,"value":7639}," sur les CVE critiques (en dessous de 7 jours = sain). Enfin, automatiser la veille via ",{"type":29,"tag":62,"props":7641,"children":7643},{"href":7642},"\u002Ffr\u002Fdette-technique\u002Fdependabot-craft-gestion-dependances",[7644],{"type":38,"value":7645},"Dependabot configuré craft",{"type":38,"value":7647}," avec auto-merge sur les patches et review humaine sur les majors.",{"type":29,"tag":30,"props":7649,"children":7650},{},[7651,7653,7659],{"type":38,"value":7652},"Sur crmcoaching, j'audite chaque dépendance que Claude propose. Je vérifie le nombre de mainteneurs, la date du dernier commit, le score ",{"type":29,"tag":156,"props":7654,"children":7656},{"className":7655},[],[7657],{"type":38,"value":7658},"pnpm audit",{"type":38,"value":7660},". 30 secondes par dépendance. C'est ce qui fait la différence entre un repo sain et un repo qui exfiltre des données dans 2 ans.",{"type":29,"tag":46,"props":7662,"children":7663},{},[],{"type":29,"tag":50,"props":7665,"children":7667},{"id":7666},"les-5-garde-fous-craft-à-installer-dès-lundi",[7668],{"type":38,"value":7669},"Les 5 garde-fous craft à installer dès lundi",{"type":29,"tag":30,"props":7671,"children":7672},{},[7673],{"type":38,"value":7674},"Voici la grille condensée. Mettez-la en checklist GitHub PR template.",{"type":29,"tag":1786,"props":7676,"children":7677},{},[7678,7699],{"type":29,"tag":1790,"props":7679,"children":7680},{},[7681],{"type":29,"tag":1794,"props":7682,"children":7683},{},[7684,7689,7694],{"type":29,"tag":1798,"props":7685,"children":7686},{},[7687],{"type":38,"value":7688},"Pattern",{"type":29,"tag":1798,"props":7690,"children":7691},{},[7692],{"type":38,"value":7693},"Signal en review",{"type":29,"tag":1798,"props":7695,"children":7696},{},[7697],{"type":38,"value":7698},"Contre-pattern craft",{"type":29,"tag":1814,"props":7700,"children":7701},{},[7702,7720,7762,7786,7810],{"type":29,"tag":1794,"props":7703,"children":7704},{},[7705,7710,7715],{"type":29,"tag":1821,"props":7706,"children":7707},{},[7708],{"type":38,"value":7709},"God Function",{"type":29,"tag":1821,"props":7711,"children":7712},{},[7713],{"type":38,"value":7714},"Fonction > 40 lignes ou > 3 niveaux d'indentation",{"type":29,"tag":1821,"props":7716,"children":7717},{},[7718],{"type":38,"value":7719},"Découpe SRP en sous-fonctions nommées",{"type":29,"tag":1794,"props":7721,"children":7722},{},[7723,7728,7752],{"type":29,"tag":1821,"props":7724,"children":7725},{},[7726],{"type":38,"value":7727},"Couplage ORM",{"type":29,"tag":1821,"props":7729,"children":7730},{},[7731,7736,7738,7744,7746],{"type":29,"tag":156,"props":7732,"children":7734},{"className":7733},[],[7735],{"type":38,"value":4536},{"type":38,"value":7737}," injecté dans ",{"type":29,"tag":156,"props":7739,"children":7741},{"className":7740},[],[7742],{"type":38,"value":7743},"application\u002F",{"type":38,"value":7745}," ou ",{"type":29,"tag":156,"props":7747,"children":7749},{"className":7748},[],[7750],{"type":38,"value":7751},"domain\u002F",{"type":29,"tag":1821,"props":7753,"children":7754},{},[7755,7757],{"type":38,"value":7756},"Interface Repository (port), adapter Prisma en ",{"type":29,"tag":156,"props":7758,"children":7760},{"className":7759},[],[7761],{"type":38,"value":5136},{"type":29,"tag":1794,"props":7763,"children":7764},{},[7765,7770,7781],{"type":29,"tag":1821,"props":7766,"children":7767},{},[7768],{"type":38,"value":7769},"Tests vides",{"type":29,"tag":1821,"props":7771,"children":7772},{},[7773,7779],{"type":29,"tag":156,"props":7774,"children":7776},{"className":7775},[],[7777],{"type":38,"value":7778},"expect(repo.save).toHaveBeenCalled()",{"type":38,"value":7780}," sans assertion comportementale",{"type":29,"tag":1821,"props":7782,"children":7783},{},[7784],{"type":38,"value":7785},"Format Given\u002FWhen\u002FThen sur comportement observable",{"type":29,"tag":1794,"props":7787,"children":7788},{},[7789,7794,7805],{"type":29,"tag":1821,"props":7790,"children":7791},{},[7792],{"type":38,"value":7793},"Catch-all silencieux",{"type":29,"tag":1821,"props":7795,"children":7796},{},[7797,7803],{"type":29,"tag":156,"props":7798,"children":7800},{"className":7799},[],[7801],{"type":38,"value":7802},"catch (e) { console.error(e) }",{"type":38,"value":7804}," sans politique",{"type":29,"tag":1821,"props":7806,"children":7807},{},[7808],{"type":38,"value":7809},"Re-throw typé, métrique, ou rollback",{"type":29,"tag":1794,"props":7811,"children":7812},{},[7813,7818,7831],{"type":29,"tag":1821,"props":7814,"children":7815},{},[7816],{"type":38,"value":7817},"Dépendance non auditée",{"type":29,"tag":1821,"props":7819,"children":7820},{},[7821,7823,7829],{"type":38,"value":7822},"Entrée ",{"type":29,"tag":156,"props":7824,"children":7826},{"className":7825},[],[7827],{"type":38,"value":7828},"package.json",{"type":38,"value":7830}," sans commentaire de justification",{"type":29,"tag":1821,"props":7832,"children":7833},{},[7834,7836,7841],{"type":38,"value":7835},"Audit 30 sec (",{"type":29,"tag":156,"props":7837,"children":7839},{"className":7838},[],[7840],{"type":38,"value":7658},{"type":38,"value":7842},") + Dependabot configuré craft",{"type":29,"tag":30,"props":7844,"children":7845},{},[7846],{"type":38,"value":7847},"Cette grille tient en 5 minutes par PR. Elle attrape 80% des patterns dangereux que j'ai vus en construisant crmcoaching et lors de mes accompagnements. Elle s'inscrit naturellement dans la philosophie Boy Scout Rule : on laisse le code un peu mieux qu'on l'a trouvé, à chaque PR.",{"type":29,"tag":46,"props":7849,"children":7850},{},[],{"type":29,"tag":1196,"props":7852,"children":7854},{"cta":1198,"href":1199,"title":7853,"type":1201},"Vous voulez voir ces patterns dans une PR Claude avant qu'ils ne deviennent de la dette ?",[7855],{"type":29,"tag":30,"props":7856,"children":7857},{},[7858],{"type":38,"value":7859},"Repérer une God Function ou un catch-all silencieux dans une suggestion de Claude, ça ne s'apprend pas en lisant un article : ça se travaille. En mentoring 1:1, je relis votre code avec vous, on rejoue vos prompts, et on installe ensemble le réflexe de review qui transforme Claude en exécutant discipliné. Vous repartez en voyant ce que le modèle ne voit pas.",{"type":29,"tag":46,"props":7861,"children":7862},{},[],{"type":29,"tag":50,"props":7864,"children":7865},{"id":1997},[7866],{"type":38,"value":2000},{"type":29,"tag":30,"props":7868,"children":7869},{},[7870],{"type":38,"value":7871},"Sur crmcoaching, après avoir installé cette grille et appliqué une vraie discipline de code review, voici les chiffres avant\u002Faprès mesurés sur 6 mois.",{"type":29,"tag":1786,"props":7873,"children":7874},{},[7875,7894],{"type":29,"tag":1790,"props":7876,"children":7877},{},[7878],{"type":29,"tag":1794,"props":7879,"children":7880},{},[7881,7885,7890],{"type":29,"tag":1798,"props":7882,"children":7883},{},[7884],{"type":38,"value":1802},{"type":29,"tag":1798,"props":7886,"children":7887},{},[7888],{"type":38,"value":7889},"Avant grille",{"type":29,"tag":1798,"props":7891,"children":7892},{},[7893],{"type":38,"value":2028},{"type":29,"tag":1814,"props":7895,"children":7896},{},[7897,7915,7933,7951,7969],{"type":29,"tag":1794,"props":7898,"children":7899},{},[7900,7905,7910],{"type":29,"tag":1821,"props":7901,"children":7902},{},[7903],{"type":38,"value":7904},"Fonctions > 40 lignes dans le repo",{"type":29,"tag":1821,"props":7906,"children":7907},{},[7908],{"type":38,"value":7909},"22% des fonctions",{"type":29,"tag":1821,"props":7911,"children":7912},{},[7913],{"type":38,"value":7914},"4% des fonctions",{"type":29,"tag":1794,"props":7916,"children":7917},{},[7918,7923,7928],{"type":29,"tag":1821,"props":7919,"children":7920},{},[7921],{"type":38,"value":7922},"Couverture de tests behavior-level",{"type":29,"tag":1821,"props":7924,"children":7925},{},[7926],{"type":38,"value":7927},"15%",{"type":29,"tag":1821,"props":7929,"children":7930},{},[7931],{"type":38,"value":7932},"70%",{"type":29,"tag":1794,"props":7934,"children":7935},{},[7936,7941,7946],{"type":29,"tag":1821,"props":7937,"children":7938},{},[7939],{"type":38,"value":7940},"Incidents prod liés à exception swallowed",{"type":29,"tag":1821,"props":7942,"children":7943},{},[7944],{"type":38,"value":7945},"4 par trimestre",{"type":29,"tag":1821,"props":7947,"children":7948},{},[7949],{"type":38,"value":7950},"0 par trimestre",{"type":29,"tag":1794,"props":7952,"children":7953},{},[7954,7959,7964],{"type":29,"tag":1821,"props":7955,"children":7956},{},[7957],{"type":38,"value":7958},"Time-to-patch CVE critique",{"type":29,"tag":1821,"props":7960,"children":7961},{},[7962],{"type":38,"value":7963},"38 jours",{"type":29,"tag":1821,"props":7965,"children":7966},{},[7967],{"type":38,"value":7968},"6 jours",{"type":29,"tag":1794,"props":7970,"children":7971},{},[7972,7977,7982],{"type":29,"tag":1821,"props":7973,"children":7974},{},[7975],{"type":38,"value":7976},"Heures consacrées au refactoring d'urgence",{"type":29,"tag":1821,"props":7978,"children":7979},{},[7980],{"type":38,"value":7981},"12h\u002Fsemaine",{"type":29,"tag":1821,"props":7983,"children":7984},{},[7985],{"type":38,"value":7986},"3h\u002Fsemaine",{"type":29,"tag":30,"props":7988,"children":7989},{},[7990,7992,7996],{"type":38,"value":7991},"Le gain est mesurable, et il est financier. Une heure de dev senior coûte entre 80 et 150 euros chargée. Économiser 9 heures par semaine, c'est une différence considérable sur l'année. Pour une équipe qui a peur de \"ralentir\" en imposant des règles de review, le calcul retourne le sens : c'est l'absence de règles qui ralentit, pas leur présence. C'est exactement l'angle que je détaille dans ",{"type":29,"tag":62,"props":7993,"children":7994},{"href":1920},[7995],{"type":38,"value":1923},{"type":38,"value":79},{"type":29,"tag":46,"props":7998,"children":7999},{},[],{"type":29,"tag":50,"props":8001,"children":8002},{"id":2151},[8003],{"type":38,"value":2154},{"type":29,"tag":30,"props":8005,"children":8006},{},[8007],{"type":38,"value":8008},"Ce que je veux que vous reteniez de cet article, c'est que Claude n'écrit pas de mauvais code par malveillance. Il écrit le code statistiquement moyen de son training data, et ce code moyen est plein d'anti-patterns silencieux que les équipes humaines apprenaient à éviter en 5 ans de mentoring. Sans grille explicite, ces patterns rentrent dans votre repo à 2 PR par jour, et au bout de 12 mois votre dette technique a triplé.",{"type":29,"tag":30,"props":8010,"children":8011},{},[8012],{"type":38,"value":8013},"La bonne nouvelle, c'est que Claude répond très bien à un prompt précis et à un contre-pattern nommé. Il n'a pas d'ego. Il ne défend pas ses choix. Si vous lui dites \"réécris ce use case en respectant le SRP, chaque helper de moins de 20 lignes\", il s'exécute proprement. Le craft, en 2026, consiste à savoir nommer les patterns qu'on attend, à les imposer en review, et à transformer Claude en exécutant discipliné plutôt qu'en générateur de moyenne statistique.",{"type":29,"tag":30,"props":8015,"children":8016},{},[8017],{"type":38,"value":8018},"Si en lisant ces lignes vous reconnaissez votre situation, vous avez deux choix. Vous pouvez laisser les 5 patterns s'installer un peu plus chaque jour. Ou vous pouvez commencer lundi matin, par une grille de 5 questions en review, et reprendre le contrôle de votre codebase.",{"type":29,"tag":30,"props":8020,"children":8021},{},[8022,8024,8029],{"type":38,"value":8023},"Pour suivre la suite des patterns craft que je documente chaque semaine, retrouvez-moi sur ",{"type":29,"tag":62,"props":8025,"children":8027},{"href":2177,"rel":8026},[66],[8028],{"type":38,"value":2181},{"type":38,"value":79},{"type":29,"tag":46,"props":8031,"children":8032},{},[],{"type":29,"tag":1196,"props":8034,"children":8036},{"cta":2185,"href":2186,"title":8035,"type":2188},"Ces 5 garde-fous ne sont qu'un début : il en existe 100",[8037],{"type":29,"tag":30,"props":8038,"children":8039},{},[8040],{"type":38,"value":8041},"La grille de review décrite ici neutralise 5 anti-patterns que Claude reproduit en silence. Elle fait partie d'un référentiel bien plus large : le Craft Bundle, les 100 pratiques craft que j'applique pour coder propre. Ce sont celles que l'IA ne vous apprendra jamais, parce qu'elle ne les a jamais vues tenir en production sur le long terme.",{"type":29,"tag":46,"props":8043,"children":8044},{},[],{"type":29,"tag":50,"props":8046,"children":8048},{"id":8047},"faq-sur-les-anti-patterns-claude-et-la-review-craft",[8049],{"type":38,"value":8050},"FAQ sur les anti-patterns Claude et la review craft",{"type":29,"tag":2205,"props":8052,"children":8053},{},[8054,8059],{"type":29,"tag":2209,"props":8055,"children":8056},{},[8057],{"type":38,"value":8058},"1. Comment introduire cette grille sans braquer une équipe qui aime Claude ?",{"type":29,"tag":30,"props":8060,"children":8061},{},[8062],{"type":38,"value":8063},"La meilleure approche que j'ai vue, c'est de présenter la grille non comme \"Claude écrit du mauvais code\" mais comme \"Claude écrit le code moyen, et notre standard est plus haut que la moyenne\". L'équipe ne se sent pas attaquée, elle se sent élevée. Combiné à une démo concrète sur leur propre repo (3 exemples de God Function trouvés en 5 minutes), l'adhésion vient en 2 sprints. C'est aussi ce que permet une vraie culture engineering de rituels bien posée.",{"type":29,"tag":2205,"props":8065,"children":8066},{},[8067,8072],{"type":29,"tag":2209,"props":8068,"children":8069},{},[8070],{"type":38,"value":8071},"2. Faut-il refuser Claude sur les use cases critiques (paiement, auth) ?",{"type":29,"tag":30,"props":8073,"children":8074},{},[8075,8077,8082],{"type":38,"value":8076},"Non, mais il faut prompter différemment. Sur du critique, je donne explicitement à Claude le contexte de concurrence, de criticité, et les patterns attendus. Exemple : ",{"type":29,"tag":114,"props":8078,"children":8079},{},[8080],{"type":38,"value":8081},"\"Ce use case gère un checkout Stripe sur un SaaS multi-tenant. Utilise une transaction Prisma, type les exceptions, ne swallow rien.\"",{"type":38,"value":8083}," Le résultat est radicalement meilleur.",{"type":29,"tag":2205,"props":8085,"children":8086},{},[8087,8092],{"type":29,"tag":2209,"props":8088,"children":8089},{},[8090],{"type":38,"value":8091},"3. Comment automatiser la détection de ces 5 patterns ?",{"type":29,"tag":30,"props":8093,"children":8094},{},[8095,8097,8103,8105,8111,8113,8118,8120,8125],{"type":38,"value":8096},"Partiellement. Biome détecte les fonctions trop longues (",{"type":29,"tag":156,"props":8098,"children":8100},{"className":8099},[],[8101],{"type":38,"value":8102},"noExcessiveLinesPerFunction",{"type":38,"value":8104},"), la complexité cognitive (",{"type":29,"tag":156,"props":8106,"children":8108},{"className":8107},[],[8109],{"type":38,"value":8110},"noExcessiveCognitiveComplexity",{"type":38,"value":8112},"), et les ",{"type":29,"tag":156,"props":8114,"children":8116},{"className":8115},[],[8117],{"type":38,"value":7102},{"type":38,"value":8119}," génériques. Les patterns \"tests vides\" et \"dépendances non auditées\" demandent une vigilance humaine ou des outils spécialisés (Vitest coverage + mutation testing pour les tests, ",{"type":29,"tag":156,"props":8121,"children":8123},{"className":8122},[],[8124],{"type":38,"value":7658},{"type":38,"value":8126}," + Dependabot pour les packages npm). L'arsenal complet est détaillé dans les outils d'analyse statique en 2026.",{"type":29,"tag":2205,"props":8128,"children":8129},{},[8130,8135],{"type":29,"tag":2209,"props":8131,"children":8132},{},[8133],{"type":38,"value":8134},"4. Le pattern God Function vient-il vraiment de Claude ou existait-il déjà ?",{"type":29,"tag":30,"props":8136,"children":8137},{},[8138],{"type":38,"value":8139},"Il existait déjà, mais Claude l'amplifie. Avant 2023, une fonction de 80 lignes existait dans 8% des PR humaines selon mes mesures. En 2025, elle existe dans 23% des PR contenant du code IA-généré non révisé. L'IA ne crée pas le pattern, elle le multiplie par 3.",{"type":29,"tag":2205,"props":8141,"children":8142},{},[8143,8148],{"type":29,"tag":2209,"props":8144,"children":8145},{},[8146],{"type":38,"value":8147},"5. Quelle taille maximum recommander pour une fonction ?",{"type":29,"tag":30,"props":8149,"children":8150},{},[8151,8153,8157,8159,8164],{"type":38,"value":8152},"Robert C. Martin disait dans ",{"type":29,"tag":114,"props":8154,"children":8155},{},[8156],{"type":38,"value":2416},{"type":38,"value":8158}," : \"Functions should be small. Then they should be smaller than that.\" Concrètement, je m'impose 20 lignes maximum pour une fonction métier, 5 niveaux d'indentation maximum, 3 paramètres maximum (au-delà, c'est un objet). Ce sont des règles arbitraires, mais elles forcent à découper. Sur crmcoaching, 94% des fonctions respectent ces seuils, et Biome (",{"type":29,"tag":156,"props":8160,"children":8162},{"className":8161},[],[8163],{"type":38,"value":8102},{"type":38,"value":8165},") fait échouer le lint si on dépasse.",{"type":29,"tag":2205,"props":8167,"children":8168},{},[8169,8174],{"type":29,"tag":2209,"props":8170,"children":8171},{},[8172],{"type":38,"value":8173},"6. Les tests behavior-level ne ralentissent-ils pas la CI ?",{"type":29,"tag":30,"props":8175,"children":8176},{},[8177],{"type":38,"value":8178},"Au contraire. Les tests behavior-level sont souvent plus rapides que les tests unitaires couplés à l'implémentation, parce qu'ils ne re-testent pas la même chose à 5 endroits. Sur crmcoaching, la CI tourne en 4 minutes pour 1 200 tests behavior-level. Le facteur limitant n'est plus le temps, c'est la qualité du test, ce qui est aussi le sujet de fond traité dans la checklist pour tester du code généré par IA.",{"type":29,"tag":46,"props":8180,"children":8181},{},[],{"type":29,"tag":1196,"props":8183,"children":8184},{"cta":2304,"href":2305,"title":2306,"type":2307},[8185],{"type":29,"tag":30,"props":8186,"children":8187},{},[8188],{"type":38,"value":8189},"L'EMA est l'outil que je propose au début de chaque mission. Il mesure la maturité de votre équipe sur plusieurs axes engineering : qualité du code, gouvernance IA, dette technique, code review. Quelques minutes pour identifier lequel des 5 patterns vous touche le plus, et où concentrer vos efforts en priorité.",{"type":29,"tag":2315,"props":8191,"children":8192},{},[8193],{"type":38,"value":2319},{"title":8,"searchDepth":196,"depth":196,"links":8195},[8196,8197,8198,8199,8200,8201,8202,8203,8204,8205],{"id":2373,"depth":196,"text":2376},{"id":2437,"depth":196,"text":2440},{"id":4522,"depth":196,"text":4525},{"id":5646,"depth":196,"text":5649},{"id":6785,"depth":196,"text":6788},{"id":7574,"depth":196,"text":7577},{"id":7666,"depth":196,"text":7669},{"id":1997,"depth":196,"text":2000},{"id":2151,"depth":196,"text":2154},{"id":8047,"depth":196,"text":8050},"content:fr:intelligence-artificielle:5-patterns-dangereux-claude.md","fr\u002Fintelligence-artificielle\u002F5-patterns-dangereux-claude.md","fr\u002Fintelligence-artificielle\u002F5-patterns-dangereux-claude",{"_path":8210,"_dir":8211,"_draft":7,"_partial":7,"_locale":8,"title":8212,"description":8213,"id":3395,"date":8214,"listed":13,"nocomments":7,"hidden":7,"categories":8215,"tags":8216,"cover":8219,"readingTime":8220,"body":8225,"_type":2331,"_id":13833,"_source":2333,"_file":13834,"_stem":13835,"_extension":2336},"\u002Ffr\u002Farchitecture-craft\u002Fdependency-inversion-pratique","architecture-craft","Dependency Inversion Principle : 3 exemples concrets","Le DIP est le principe SOLID le plus mal compris. Pas un pattern de conception, mais une règle sur la direction des dépendances. Trois implémentations Java concrètes.","2026-03-13",[8211],[8217,8218,17],"solid","architecture","covers\u002Farticles\u002Fdependency-inversion-principe.jpg",{"text":8221,"minutes":8222,"time":8223,"words":8224},"9 min read",8.44,506400,1688,{"type":26,"children":8226,"toc":13824},[8227,8232,8237,8242,8245,8251,8263,8268,8594,8602,8650,8653,8659,8702,8710,8715,8718,8724,9725,9733,10390,10399,10402,10408,12659,12692,12695,12701,13593,13610,13613,13619,13627,13645,13653,13671,13689,13692,13701,13704,13710,13723,13736,13749,13770,13806,13809,13820],{"type":29,"tag":30,"props":8228,"children":8229},{},[8230],{"type":38,"value":8231},"Chez un client dans le secteur de l'assurance que j'accompagnais (20 développeurs, 8 services backend), la suite de tests prenait 18 minutes à s'exécuter. Pas parce que les tests étaient lents. Parce que chaque test unitaire démarrait une vraie base de données PostgreSQL, un vrai serveur Redis, et appelait le vrai Sendgrid.",{"type":29,"tag":30,"props":8233,"children":8234},{},[8235],{"type":38,"value":8236},"Ce n'était pas un problème de tests. C'était un problème d'architecture : les modules métier dépendaient directement des implémentations concrètes d'infrastructure.",{"type":29,"tag":30,"props":8238,"children":8239},{},[8240],{"type":38,"value":8241},"Après avoir introduit le Dependency Inversion Principle sur les 8 services les plus critiques, la suite de tests est passée à 3 minutes. La couverture de tests a augmenté de 35% à 72% en 3 mois. Pas parce que les développeurs avaient soudain envie d'écrire des tests, mais parce que les tests étaient devenus faciles à écrire.",{"type":29,"tag":46,"props":8243,"children":8244},{},[],{"type":29,"tag":50,"props":8246,"children":8248},{"id":8247},"le-problème-la-dépendance-directe",[8249],{"type":38,"value":8250},"Le problème : la dépendance directe",{"type":29,"tag":30,"props":8252,"children":8253},{},[8254,8256,8261],{"type":38,"value":8255},"Robert C. Martin (Uncle Bob) a formulé le DIP en 1996 dans ses travaux sur les principes SOLID : \"Les modules de haut niveau ne doivent pas dépendre des modules de bas niveau. Les deux doivent dépendre d'abstractions.\" C'est la règle de dépendance au cœur de la ",{"type":29,"tag":62,"props":8257,"children":8259},{"href":8258},"\u002Ffr\u002Farchitecture-craft\u002Fclean-architecture-3-regles",[8260],{"type":38,"value":1761},{"type":38,"value":8262}," : les flèches de dépendance doivent toujours pointer vers l'intérieur, vers le domaine métier.",{"type":29,"tag":30,"props":8264,"children":8265},{},[8266],{"type":38,"value":8267},"En pratique, la quasi-totalité des codebases sans discipline architecturale viole ce principe :",{"type":29,"tag":173,"props":8269,"children":8273},{"code":8270,"language":8271,"meta":8,"className":8272,"style":8},"\u002F\u002F Violation du DIP : le module de haut niveau dépend des implémentations concrètes\npublic class OrderService {\n\n    private final PostgresDatabase db = new PostgresDatabase(\"localhost\", 5432); \u002F\u002F dépendance directe\n    private final SendgridEmailClient email = new SendgridEmailClient(\"api-key\"); \u002F\u002F dépendance directe\n\n    public String createOrder(OrderData orderData) {\n        String orderId = db.save(orderData);\n        email.sendConfirmation(orderData.getEmail(), orderId);\n        return orderId;\n    }\n}\n","java","language-java shiki shiki-themes catppuccin-frappe github-dark",[8274],{"type":29,"tag":156,"props":8275,"children":8276},{"__ignoreMap":8},[8277,8285,8306,8313,8377,8427,8434,8473,8517,8564,8580,8587],{"type":29,"tag":183,"props":8278,"children":8279},{"class":185,"line":186},[8280],{"type":29,"tag":183,"props":8281,"children":8282},{"style":190},[8283],{"type":38,"value":8284},"\u002F\u002F Violation du DIP : le module de haut niveau dépend des implémentations concrètes\n",{"type":29,"tag":183,"props":8286,"children":8287},{"class":185,"line":196},[8288,8293,8297,8302],{"type":29,"tag":183,"props":8289,"children":8290},{"style":200},[8291],{"type":38,"value":8292},"public",{"type":29,"tag":183,"props":8294,"children":8295},{"style":200},[8296],{"type":38,"value":854},{"type":29,"tag":183,"props":8298,"children":8299},{"style":750},[8300],{"type":38,"value":8301}," OrderService",{"type":29,"tag":183,"props":8303,"children":8304},{"style":212},[8305],{"type":38,"value":285},{"type":29,"tag":183,"props":8307,"children":8308},{"class":185,"line":218},[8309],{"type":29,"tag":183,"props":8310,"children":8311},{"emptyLinePlaceholder":13},[8312],{"type":38,"value":445},{"type":29,"tag":183,"props":8314,"children":8315},{"class":185,"line":245},[8316,8320,8325,8331,8336,8341,8345,8349,8353,8358,8362,8367,8372],{"type":29,"tag":183,"props":8317,"children":8318},{"style":200},[8319],{"type":38,"value":1291},{"type":29,"tag":183,"props":8321,"children":8322},{"style":200},[8323],{"type":38,"value":8324}," final",{"type":29,"tag":183,"props":8326,"children":8328},{"style":8327},"--shiki-default:#CA9EE6;--shiki-dark:#E1E4E8",[8329],{"type":38,"value":8330}," PostgresDatabase",{"type":29,"tag":183,"props":8332,"children":8333},{"style":308},[8334],{"type":38,"value":8335}," db ",{"type":29,"tag":183,"props":8337,"children":8338},{"style":228},[8339],{"type":38,"value":8340},"=",{"type":29,"tag":183,"props":8342,"children":8343},{"style":200},[8344],{"type":38,"value":1099},{"type":29,"tag":183,"props":8346,"children":8347},{"style":206},[8348],{"type":38,"value":8330},{"type":29,"tag":183,"props":8350,"children":8351},{"style":212},[8352],{"type":38,"value":770},{"type":29,"tag":183,"props":8354,"children":8355},{"style":1683},[8356],{"type":38,"value":8357},"\"localhost\"",{"type":29,"tag":183,"props":8359,"children":8360},{"style":212},[8361],{"type":38,"value":2694},{"type":29,"tag":183,"props":8363,"children":8364},{"style":319},[8365],{"type":38,"value":8366}," 5432",{"type":29,"tag":183,"props":8368,"children":8369},{"style":212},[8370],{"type":38,"value":8371},");",{"type":29,"tag":183,"props":8373,"children":8374},{"style":190},[8375],{"type":38,"value":8376}," \u002F\u002F dépendance directe\n",{"type":29,"tag":183,"props":8378,"children":8379},{"class":185,"line":266},[8380,8384,8388,8393,8398,8402,8406,8410,8414,8419,8423],{"type":29,"tag":183,"props":8381,"children":8382},{"style":200},[8383],{"type":38,"value":1291},{"type":29,"tag":183,"props":8385,"children":8386},{"style":200},[8387],{"type":38,"value":8324},{"type":29,"tag":183,"props":8389,"children":8390},{"style":8327},[8391],{"type":38,"value":8392}," SendgridEmailClient",{"type":29,"tag":183,"props":8394,"children":8395},{"style":308},[8396],{"type":38,"value":8397}," email ",{"type":29,"tag":183,"props":8399,"children":8400},{"style":228},[8401],{"type":38,"value":8340},{"type":29,"tag":183,"props":8403,"children":8404},{"style":200},[8405],{"type":38,"value":1099},{"type":29,"tag":183,"props":8407,"children":8408},{"style":206},[8409],{"type":38,"value":8392},{"type":29,"tag":183,"props":8411,"children":8412},{"style":212},[8413],{"type":38,"value":770},{"type":29,"tag":183,"props":8415,"children":8416},{"style":1683},[8417],{"type":38,"value":8418},"\"api-key\"",{"type":29,"tag":183,"props":8420,"children":8421},{"style":212},[8422],{"type":38,"value":8371},{"type":29,"tag":183,"props":8424,"children":8425},{"style":190},[8426],{"type":38,"value":8376},{"type":29,"tag":183,"props":8428,"children":8429},{"class":185,"line":288},[8430],{"type":29,"tag":183,"props":8431,"children":8432},{"emptyLinePlaceholder":13},[8433],{"type":38,"value":445},{"type":29,"tag":183,"props":8435,"children":8436},{"class":185,"line":330},[8437,8442,8446,8451,8455,8460,8465,8469],{"type":29,"tag":183,"props":8438,"children":8439},{"style":200},[8440],{"type":38,"value":8441},"    public",{"type":29,"tag":183,"props":8443,"children":8444},{"style":8327},[8445],{"type":38,"value":7421},{"type":29,"tag":183,"props":8447,"children":8448},{"style":206},[8449],{"type":38,"value":8450}," createOrder",{"type":29,"tag":183,"props":8452,"children":8453},{"style":212},[8454],{"type":38,"value":770},{"type":29,"tag":183,"props":8456,"children":8457},{"style":8327},[8458],{"type":38,"value":8459},"OrderData",{"type":29,"tag":183,"props":8461,"children":8462},{"style":222},[8463],{"type":38,"value":8464}," orderData",{"type":29,"tag":183,"props":8466,"children":8467},{"style":212},[8468],{"type":38,"value":272},{"type":29,"tag":183,"props":8470,"children":8471},{"style":212},[8472],{"type":38,"value":285},{"type":29,"tag":183,"props":8474,"children":8475},{"class":185,"line":374},[8476,8481,8486,8490,8495,8499,8504,8508,8513],{"type":29,"tag":183,"props":8477,"children":8478},{"style":8327},[8479],{"type":38,"value":8480},"        String",{"type":29,"tag":183,"props":8482,"children":8483},{"style":308},[8484],{"type":38,"value":8485}," orderId ",{"type":29,"tag":183,"props":8487,"children":8488},{"style":228},[8489],{"type":38,"value":8340},{"type":29,"tag":183,"props":8491,"children":8492},{"style":308},[8493],{"type":38,"value":8494}," db",{"type":29,"tag":183,"props":8496,"children":8497},{"style":212},[8498],{"type":38,"value":79},{"type":29,"tag":183,"props":8500,"children":8501},{"style":206},[8502],{"type":38,"value":8503},"save",{"type":29,"tag":183,"props":8505,"children":8506},{"style":212},[8507],{"type":38,"value":770},{"type":29,"tag":183,"props":8509,"children":8510},{"style":308},[8511],{"type":38,"value":8512},"orderData",{"type":29,"tag":183,"props":8514,"children":8515},{"style":212},[8516],{"type":38,"value":7487},{"type":29,"tag":183,"props":8518,"children":8519},{"class":185,"line":430},[8520,8524,8528,8533,8537,8541,8545,8550,8555,8560],{"type":29,"tag":183,"props":8521,"children":8522},{"style":308},[8523],{"type":38,"value":3372},{"type":29,"tag":183,"props":8525,"children":8526},{"style":212},[8527],{"type":38,"value":79},{"type":29,"tag":183,"props":8529,"children":8530},{"style":206},[8531],{"type":38,"value":8532},"sendConfirmation",{"type":29,"tag":183,"props":8534,"children":8535},{"style":212},[8536],{"type":38,"value":770},{"type":29,"tag":183,"props":8538,"children":8539},{"style":308},[8540],{"type":38,"value":8512},{"type":29,"tag":183,"props":8542,"children":8543},{"style":212},[8544],{"type":38,"value":79},{"type":29,"tag":183,"props":8546,"children":8547},{"style":206},[8548],{"type":38,"value":8549},"getEmail",{"type":29,"tag":183,"props":8551,"children":8552},{"style":212},[8553],{"type":38,"value":8554},"(),",{"type":29,"tag":183,"props":8556,"children":8557},{"style":308},[8558],{"type":38,"value":8559}," orderId",{"type":29,"tag":183,"props":8561,"children":8562},{"style":212},[8563],{"type":38,"value":7487},{"type":29,"tag":183,"props":8565,"children":8566},{"class":185,"line":439},[8567,8572,8576],{"type":29,"tag":183,"props":8568,"children":8569},{"style":200},[8570],{"type":38,"value":8571},"        return",{"type":29,"tag":183,"props":8573,"children":8574},{"style":308},[8575],{"type":38,"value":8559},{"type":29,"tag":183,"props":8577,"children":8578},{"style":212},[8579],{"type":38,"value":327},{"type":29,"tag":183,"props":8581,"children":8582},{"class":185,"line":448},[8583],{"type":29,"tag":183,"props":8584,"children":8585},{"style":212},[8586],{"type":38,"value":1589},{"type":29,"tag":183,"props":8588,"children":8589},{"class":185,"line":457},[8590],{"type":29,"tag":183,"props":8591,"children":8592},{"style":212},[8593],{"type":38,"value":436},{"type":29,"tag":30,"props":8595,"children":8596},{},[8597],{"type":29,"tag":34,"props":8598,"children":8599},{},[8600],{"type":38,"value":8601},"Ce que ça coûte concrètement :",{"type":29,"tag":8603,"props":8604,"children":8605},"ul",{},[8606,8620,8630,8640],{"type":29,"tag":8607,"props":8608,"children":8609},"li",{},[8610,8612,8618],{"type":38,"value":8611},"Impossible de tester ",{"type":29,"tag":156,"props":8613,"children":8615},{"className":8614},[],[8616],{"type":38,"value":8617},"OrderService",{"type":38,"value":8619}," sans une vraie base de données PostgreSQL et un compte Sendgrid",{"type":29,"tag":8607,"props":8621,"children":8622},{},[8623,8625],{"type":38,"value":8624},"Changer de base de données oblige à modifier ",{"type":29,"tag":156,"props":8626,"children":8628},{"className":8627},[],[8629],{"type":38,"value":8617},{"type":29,"tag":8607,"props":8631,"children":8632},{},[8633,8635],{"type":38,"value":8634},"Changer d'email provider oblige à modifier ",{"type":29,"tag":156,"props":8636,"children":8638},{"className":8637},[],[8639],{"type":38,"value":8617},{"type":29,"tag":8607,"props":8641,"children":8642},{},[8643,8648],{"type":29,"tag":156,"props":8644,"children":8646},{"className":8645},[],[8647],{"type":38,"value":8617},{"type":38,"value":8649}," connaît des détails d'implémentation (host, port, api_key) qui n'ont rien à voir avec la logique métier de commande",{"type":29,"tag":46,"props":8651,"children":8652},{},[],{"type":29,"tag":50,"props":8654,"children":8656},{"id":8655},"le-principe-inverser-la-direction-des-dépendances",[8657],{"type":38,"value":8658},"Le principe : inverser la direction des dépendances",{"type":29,"tag":30,"props":8660,"children":8661},{},[8662,8664,8669,8671,8677,8679,8685,8687,8693,8694,8700],{"type":38,"value":8663},"La solution DIP : ",{"type":29,"tag":156,"props":8665,"children":8667},{"className":8666},[],[8668],{"type":38,"value":8617},{"type":38,"value":8670}," ne dépend pas de ",{"type":29,"tag":156,"props":8672,"children":8674},{"className":8673},[],[8675],{"type":38,"value":8676},"PostgreSQLDatabase",{"type":38,"value":8678}," ni de ",{"type":29,"tag":156,"props":8680,"children":8682},{"className":8681},[],[8683],{"type":38,"value":8684},"SendgridEmailClient",{"type":38,"value":8686},". Il dépend d'abstractions (",{"type":29,"tag":156,"props":8688,"children":8690},{"className":8689},[],[8691],{"type":38,"value":8692},"OrderRepository",{"type":38,"value":4468},{"type":29,"tag":156,"props":8695,"children":8697},{"className":8696},[],[8698],{"type":38,"value":8699},"EmailNotifier",{"type":38,"value":8701},") que les implémentations concrètes respectent.",{"type":29,"tag":173,"props":8703,"children":8705},{"code":8704},"Sans DIP :\nOrderService → PostgreSQLDatabase\nOrderService → SendgridEmailClient\n\nAvec DIP :\nOrderService → OrderRepository (abstraction) ← PostgreSQLOrderRepository (implémentation)\nOrderService → EmailNotifier (abstraction)   ← SendgridEmailNotifier (implémentation)\n",[8706],{"type":29,"tag":156,"props":8707,"children":8708},{"__ignoreMap":8},[8709],{"type":38,"value":8704},{"type":29,"tag":30,"props":8711,"children":8712},{},[8713],{"type":38,"value":8714},"La flèche s'inverse : l'implémentation concrète dépend de l'abstraction, pas l'inverse.",{"type":29,"tag":46,"props":8716,"children":8717},{},[],{"type":29,"tag":50,"props":8719,"children":8721},{"id":8720},"exemple-1-java-injection-par-constructeur",[8722],{"type":38,"value":8723},"Exemple 1 : Java, injection par constructeur",{"type":29,"tag":173,"props":8725,"children":8727},{"code":8726,"language":8271,"meta":8,"className":8272,"style":8},"\u002F\u002F Les abstractions\npublic interface OrderRepository {\n    String save(OrderData orderData);\n}\n\npublic interface EmailNotifier {\n    void sendConfirmation(String email, String orderId);\n}\n\n\u002F\u002F Le module de haut niveau : dépend uniquement des abstractions\npublic class OrderService {\n\n    private final OrderRepository repository;\n    private final EmailNotifier notifier;\n\n    public OrderService(OrderRepository repository, EmailNotifier notifier) {\n        this.repository = repository;\n        this.notifier = notifier;\n    }\n\n    public String createOrder(OrderData orderData) {\n        String orderId = repository.save(orderData);\n        notifier.sendConfirmation(orderData.getEmail(), orderId);\n        return orderId;\n    }\n}\n\n\u002F\u002F Les implémentations concrètes\npublic class PostgresOrderRepository implements OrderRepository {\n    public String save(OrderData orderData) {\n        return jdbcTemplate.queryForObject(\"INSERT INTO orders ... RETURNING id\", String.class, orderData);\n    }\n}\n\npublic class SendgridEmailNotifier implements EmailNotifier {\n    public void sendConfirmation(String email, String orderId) {\n        client.send(email, \"order_confirmation\", Map.of(\"orderId\", orderId));\n    }\n}\n\n\u002F\u002F Composition à la racine de l'application\npublic OrderService createOrderService() {\n    OrderRepository repository = new PostgresOrderRepository(dataSource);\n    EmailNotifier notifier = new SendgridEmailNotifier(System.getenv(\"SENDGRID_KEY\"));\n    return new OrderService(repository, notifier);\n}\n",[8728],{"type":29,"tag":156,"props":8729,"children":8730},{"__ignoreMap":8},[8731,8739,8759,8787,8794,8801,8821,8863,8870,8877,8885,8904,8911,8935,8959,8966,9009,9038,9066,9073,9080,9115,9154,9198,9213,9220,9227,9234,9242,9270,9305,9364,9371,9378,9385,9413,9461,9535,9542,9549,9556,9564,9588,9626,9682,9718],{"type":29,"tag":183,"props":8732,"children":8733},{"class":185,"line":186},[8734],{"type":29,"tag":183,"props":8735,"children":8736},{"style":190},[8737],{"type":38,"value":8738},"\u002F\u002F Les abstractions\n",{"type":29,"tag":183,"props":8740,"children":8741},{"class":185,"line":196},[8742,8746,8750,8755],{"type":29,"tag":183,"props":8743,"children":8744},{"style":200},[8745],{"type":38,"value":8292},{"type":29,"tag":183,"props":8747,"children":8748},{"style":200},[8749],{"type":38,"value":747},{"type":29,"tag":183,"props":8751,"children":8752},{"style":750},[8753],{"type":38,"value":8754}," OrderRepository",{"type":29,"tag":183,"props":8756,"children":8757},{"style":212},[8758],{"type":38,"value":285},{"type":29,"tag":183,"props":8760,"children":8761},{"class":185,"line":218},[8762,8767,8771,8775,8779,8783],{"type":29,"tag":183,"props":8763,"children":8764},{"style":8327},[8765],{"type":38,"value":8766},"    String",{"type":29,"tag":183,"props":8768,"children":8769},{"style":206},[8770],{"type":38,"value":5797},{"type":29,"tag":183,"props":8772,"children":8773},{"style":212},[8774],{"type":38,"value":770},{"type":29,"tag":183,"props":8776,"children":8777},{"style":8327},[8778],{"type":38,"value":8459},{"type":29,"tag":183,"props":8780,"children":8781},{"style":222},[8782],{"type":38,"value":8464},{"type":29,"tag":183,"props":8784,"children":8785},{"style":212},[8786],{"type":38,"value":7487},{"type":29,"tag":183,"props":8788,"children":8789},{"class":185,"line":245},[8790],{"type":29,"tag":183,"props":8791,"children":8792},{"style":212},[8793],{"type":38,"value":436},{"type":29,"tag":183,"props":8795,"children":8796},{"class":185,"line":266},[8797],{"type":29,"tag":183,"props":8798,"children":8799},{"emptyLinePlaceholder":13},[8800],{"type":38,"value":445},{"type":29,"tag":183,"props":8802,"children":8803},{"class":185,"line":288},[8804,8808,8812,8817],{"type":29,"tag":183,"props":8805,"children":8806},{"style":200},[8807],{"type":38,"value":8292},{"type":29,"tag":183,"props":8809,"children":8810},{"style":200},[8811],{"type":38,"value":747},{"type":29,"tag":183,"props":8813,"children":8814},{"style":750},[8815],{"type":38,"value":8816}," EmailNotifier",{"type":29,"tag":183,"props":8818,"children":8819},{"style":212},[8820],{"type":38,"value":285},{"type":29,"tag":183,"props":8822,"children":8823},{"class":185,"line":330},[8824,8829,8834,8838,8843,8847,8851,8855,8859],{"type":29,"tag":183,"props":8825,"children":8826},{"style":200},[8827],{"type":38,"value":8828},"    void",{"type":29,"tag":183,"props":8830,"children":8831},{"style":206},[8832],{"type":38,"value":8833}," sendConfirmation",{"type":29,"tag":183,"props":8835,"children":8836},{"style":212},[8837],{"type":38,"value":770},{"type":29,"tag":183,"props":8839,"children":8840},{"style":8327},[8841],{"type":38,"value":8842},"String",{"type":29,"tag":183,"props":8844,"children":8845},{"style":222},[8846],{"type":38,"value":3173},{"type":29,"tag":183,"props":8848,"children":8849},{"style":212},[8850],{"type":38,"value":2694},{"type":29,"tag":183,"props":8852,"children":8853},{"style":8327},[8854],{"type":38,"value":7421},{"type":29,"tag":183,"props":8856,"children":8857},{"style":222},[8858],{"type":38,"value":8559},{"type":29,"tag":183,"props":8860,"children":8861},{"style":212},[8862],{"type":38,"value":7487},{"type":29,"tag":183,"props":8864,"children":8865},{"class":185,"line":374},[8866],{"type":29,"tag":183,"props":8867,"children":8868},{"style":212},[8869],{"type":38,"value":436},{"type":29,"tag":183,"props":8871,"children":8872},{"class":185,"line":430},[8873],{"type":29,"tag":183,"props":8874,"children":8875},{"emptyLinePlaceholder":13},[8876],{"type":38,"value":445},{"type":29,"tag":183,"props":8878,"children":8879},{"class":185,"line":439},[8880],{"type":29,"tag":183,"props":8881,"children":8882},{"style":190},[8883],{"type":38,"value":8884},"\u002F\u002F Le module de haut niveau : dépend uniquement des abstractions\n",{"type":29,"tag":183,"props":8886,"children":8887},{"class":185,"line":448},[8888,8892,8896,8900],{"type":29,"tag":183,"props":8889,"children":8890},{"style":200},[8891],{"type":38,"value":8292},{"type":29,"tag":183,"props":8893,"children":8894},{"style":200},[8895],{"type":38,"value":854},{"type":29,"tag":183,"props":8897,"children":8898},{"style":750},[8899],{"type":38,"value":8301},{"type":29,"tag":183,"props":8901,"children":8902},{"style":212},[8903],{"type":38,"value":285},{"type":29,"tag":183,"props":8905,"children":8906},{"class":185,"line":457},[8907],{"type":29,"tag":183,"props":8908,"children":8909},{"emptyLinePlaceholder":13},[8910],{"type":38,"value":445},{"type":29,"tag":183,"props":8912,"children":8913},{"class":185,"line":474},[8914,8918,8922,8926,8931],{"type":29,"tag":183,"props":8915,"children":8916},{"style":200},[8917],{"type":38,"value":1291},{"type":29,"tag":183,"props":8919,"children":8920},{"style":200},[8921],{"type":38,"value":8324},{"type":29,"tag":183,"props":8923,"children":8924},{"style":8327},[8925],{"type":38,"value":8754},{"type":29,"tag":183,"props":8927,"children":8928},{"style":308},[8929],{"type":38,"value":8930}," repository",{"type":29,"tag":183,"props":8932,"children":8933},{"style":212},[8934],{"type":38,"value":327},{"type":29,"tag":183,"props":8936,"children":8937},{"class":185,"line":495},[8938,8942,8946,8950,8955],{"type":29,"tag":183,"props":8939,"children":8940},{"style":200},[8941],{"type":38,"value":1291},{"type":29,"tag":183,"props":8943,"children":8944},{"style":200},[8945],{"type":38,"value":8324},{"type":29,"tag":183,"props":8947,"children":8948},{"style":8327},[8949],{"type":38,"value":8816},{"type":29,"tag":183,"props":8951,"children":8952},{"style":308},[8953],{"type":38,"value":8954}," notifier",{"type":29,"tag":183,"props":8956,"children":8957},{"style":212},[8958],{"type":38,"value":327},{"type":29,"tag":183,"props":8960,"children":8961},{"class":185,"line":516},[8962],{"type":29,"tag":183,"props":8963,"children":8964},{"emptyLinePlaceholder":13},[8965],{"type":38,"value":445},{"type":29,"tag":183,"props":8967,"children":8968},{"class":185,"line":536},[8969,8973,8977,8981,8985,8989,8993,8997,9001,9005],{"type":29,"tag":183,"props":8970,"children":8971},{"style":200},[8972],{"type":38,"value":8441},{"type":29,"tag":183,"props":8974,"children":8975},{"style":206},[8976],{"type":38,"value":8301},{"type":29,"tag":183,"props":8978,"children":8979},{"style":212},[8980],{"type":38,"value":770},{"type":29,"tag":183,"props":8982,"children":8983},{"style":8327},[8984],{"type":38,"value":8692},{"type":29,"tag":183,"props":8986,"children":8987},{"style":222},[8988],{"type":38,"value":8930},{"type":29,"tag":183,"props":8990,"children":8991},{"style":212},[8992],{"type":38,"value":2694},{"type":29,"tag":183,"props":8994,"children":8995},{"style":8327},[8996],{"type":38,"value":8816},{"type":29,"tag":183,"props":8998,"children":8999},{"style":222},[9000],{"type":38,"value":8954},{"type":29,"tag":183,"props":9002,"children":9003},{"style":212},[9004],{"type":38,"value":272},{"type":29,"tag":183,"props":9006,"children":9007},{"style":212},[9008],{"type":38,"value":285},{"type":29,"tag":183,"props":9010,"children":9011},{"class":185,"line":570},[9012,9017,9021,9026,9030,9034],{"type":29,"tag":183,"props":9013,"children":9014},{"style":1481},[9015],{"type":38,"value":9016},"        this",{"type":29,"tag":183,"props":9018,"children":9019},{"style":212},[9020],{"type":38,"value":79},{"type":29,"tag":183,"props":9022,"children":9023},{"style":308},[9024],{"type":38,"value":9025},"repository ",{"type":29,"tag":183,"props":9027,"children":9028},{"style":228},[9029],{"type":38,"value":8340},{"type":29,"tag":183,"props":9031,"children":9032},{"style":308},[9033],{"type":38,"value":8930},{"type":29,"tag":183,"props":9035,"children":9036},{"style":212},[9037],{"type":38,"value":327},{"type":29,"tag":183,"props":9039,"children":9040},{"class":185,"line":613},[9041,9045,9049,9054,9058,9062],{"type":29,"tag":183,"props":9042,"children":9043},{"style":1481},[9044],{"type":38,"value":9016},{"type":29,"tag":183,"props":9046,"children":9047},{"style":212},[9048],{"type":38,"value":79},{"type":29,"tag":183,"props":9050,"children":9051},{"style":308},[9052],{"type":38,"value":9053},"notifier ",{"type":29,"tag":183,"props":9055,"children":9056},{"style":228},[9057],{"type":38,"value":8340},{"type":29,"tag":183,"props":9059,"children":9060},{"style":308},[9061],{"type":38,"value":8954},{"type":29,"tag":183,"props":9063,"children":9064},{"style":212},[9065],{"type":38,"value":327},{"type":29,"tag":183,"props":9067,"children":9068},{"class":185,"line":662},[9069],{"type":29,"tag":183,"props":9070,"children":9071},{"style":212},[9072],{"type":38,"value":1589},{"type":29,"tag":183,"props":9074,"children":9075},{"class":185,"line":3095},[9076],{"type":29,"tag":183,"props":9077,"children":9078},{"emptyLinePlaceholder":13},[9079],{"type":38,"value":445},{"type":29,"tag":183,"props":9081,"children":9082},{"class":185,"line":3154},[9083,9087,9091,9095,9099,9103,9107,9111],{"type":29,"tag":183,"props":9084,"children":9085},{"style":200},[9086],{"type":38,"value":8441},{"type":29,"tag":183,"props":9088,"children":9089},{"style":8327},[9090],{"type":38,"value":7421},{"type":29,"tag":183,"props":9092,"children":9093},{"style":206},[9094],{"type":38,"value":8450},{"type":29,"tag":183,"props":9096,"children":9097},{"style":212},[9098],{"type":38,"value":770},{"type":29,"tag":183,"props":9100,"children":9101},{"style":8327},[9102],{"type":38,"value":8459},{"type":29,"tag":183,"props":9104,"children":9105},{"style":222},[9106],{"type":38,"value":8464},{"type":29,"tag":183,"props":9108,"children":9109},{"style":212},[9110],{"type":38,"value":272},{"type":29,"tag":183,"props":9112,"children":9113},{"style":212},[9114],{"type":38,"value":285},{"type":29,"tag":183,"props":9116,"children":9117},{"class":185,"line":3207},[9118,9122,9126,9130,9134,9138,9142,9146,9150],{"type":29,"tag":183,"props":9119,"children":9120},{"style":8327},[9121],{"type":38,"value":8480},{"type":29,"tag":183,"props":9123,"children":9124},{"style":308},[9125],{"type":38,"value":8485},{"type":29,"tag":183,"props":9127,"children":9128},{"style":228},[9129],{"type":38,"value":8340},{"type":29,"tag":183,"props":9131,"children":9132},{"style":308},[9133],{"type":38,"value":8930},{"type":29,"tag":183,"props":9135,"children":9136},{"style":212},[9137],{"type":38,"value":79},{"type":29,"tag":183,"props":9139,"children":9140},{"style":206},[9141],{"type":38,"value":8503},{"type":29,"tag":183,"props":9143,"children":9144},{"style":212},[9145],{"type":38,"value":770},{"type":29,"tag":183,"props":9147,"children":9148},{"style":308},[9149],{"type":38,"value":8512},{"type":29,"tag":183,"props":9151,"children":9152},{"style":212},[9153],{"type":38,"value":7487},{"type":29,"tag":183,"props":9155,"children":9156},{"class":185,"line":3224},[9157,9162,9166,9170,9174,9178,9182,9186,9190,9194],{"type":29,"tag":183,"props":9158,"children":9159},{"style":308},[9160],{"type":38,"value":9161},"        notifier",{"type":29,"tag":183,"props":9163,"children":9164},{"style":212},[9165],{"type":38,"value":79},{"type":29,"tag":183,"props":9167,"children":9168},{"style":206},[9169],{"type":38,"value":8532},{"type":29,"tag":183,"props":9171,"children":9172},{"style":212},[9173],{"type":38,"value":770},{"type":29,"tag":183,"props":9175,"children":9176},{"style":308},[9177],{"type":38,"value":8512},{"type":29,"tag":183,"props":9179,"children":9180},{"style":212},[9181],{"type":38,"value":79},{"type":29,"tag":183,"props":9183,"children":9184},{"style":206},[9185],{"type":38,"value":8549},{"type":29,"tag":183,"props":9187,"children":9188},{"style":212},[9189],{"type":38,"value":8554},{"type":29,"tag":183,"props":9191,"children":9192},{"style":308},[9193],{"type":38,"value":8559},{"type":29,"tag":183,"props":9195,"children":9196},{"style":212},[9197],{"type":38,"value":7487},{"type":29,"tag":183,"props":9199,"children":9200},{"class":185,"line":3266},[9201,9205,9209],{"type":29,"tag":183,"props":9202,"children":9203},{"style":200},[9204],{"type":38,"value":8571},{"type":29,"tag":183,"props":9206,"children":9207},{"style":308},[9208],{"type":38,"value":8559},{"type":29,"tag":183,"props":9210,"children":9211},{"style":212},[9212],{"type":38,"value":327},{"type":29,"tag":183,"props":9214,"children":9215},{"class":185,"line":3275},[9216],{"type":29,"tag":183,"props":9217,"children":9218},{"style":212},[9219],{"type":38,"value":1589},{"type":29,"tag":183,"props":9221,"children":9222},{"class":185,"line":3283},[9223],{"type":29,"tag":183,"props":9224,"children":9225},{"style":212},[9226],{"type":38,"value":436},{"type":29,"tag":183,"props":9228,"children":9229},{"class":185,"line":3292},[9230],{"type":29,"tag":183,"props":9231,"children":9232},{"emptyLinePlaceholder":13},[9233],{"type":38,"value":445},{"type":29,"tag":183,"props":9235,"children":9236},{"class":185,"line":3349},[9237],{"type":29,"tag":183,"props":9238,"children":9239},{"style":190},[9240],{"type":38,"value":9241},"\u002F\u002F Les implémentations concrètes\n",{"type":29,"tag":183,"props":9243,"children":9244},{"class":185,"line":3366},[9245,9249,9253,9258,9262,9266],{"type":29,"tag":183,"props":9246,"children":9247},{"style":200},[9248],{"type":38,"value":8292},{"type":29,"tag":183,"props":9250,"children":9251},{"style":200},[9252],{"type":38,"value":854},{"type":29,"tag":183,"props":9254,"children":9255},{"style":750},[9256],{"type":38,"value":9257}," PostgresOrderRepository",{"type":29,"tag":183,"props":9259,"children":9260},{"style":200},[9261],{"type":38,"value":864},{"type":29,"tag":183,"props":9263,"children":9264},{"style":750},[9265],{"type":38,"value":8754},{"type":29,"tag":183,"props":9267,"children":9268},{"style":212},[9269],{"type":38,"value":285},{"type":29,"tag":183,"props":9271,"children":9272},{"class":185,"line":3395},[9273,9277,9281,9285,9289,9293,9297,9301],{"type":29,"tag":183,"props":9274,"children":9275},{"style":200},[9276],{"type":38,"value":8441},{"type":29,"tag":183,"props":9278,"children":9279},{"style":8327},[9280],{"type":38,"value":7421},{"type":29,"tag":183,"props":9282,"children":9283},{"style":206},[9284],{"type":38,"value":5797},{"type":29,"tag":183,"props":9286,"children":9287},{"style":212},[9288],{"type":38,"value":770},{"type":29,"tag":183,"props":9290,"children":9291},{"style":8327},[9292],{"type":38,"value":8459},{"type":29,"tag":183,"props":9294,"children":9295},{"style":222},[9296],{"type":38,"value":8464},{"type":29,"tag":183,"props":9298,"children":9299},{"style":212},[9300],{"type":38,"value":272},{"type":29,"tag":183,"props":9302,"children":9303},{"style":212},[9304],{"type":38,"value":285},{"type":29,"tag":183,"props":9306,"children":9307},{"class":185,"line":3425},[9308,9312,9317,9321,9326,9330,9335,9339,9343,9347,9352,9356,9360],{"type":29,"tag":183,"props":9309,"children":9310},{"style":200},[9311],{"type":38,"value":8571},{"type":29,"tag":183,"props":9313,"children":9314},{"style":308},[9315],{"type":38,"value":9316}," jdbcTemplate",{"type":29,"tag":183,"props":9318,"children":9319},{"style":212},[9320],{"type":38,"value":79},{"type":29,"tag":183,"props":9322,"children":9323},{"style":206},[9324],{"type":38,"value":9325},"queryForObject",{"type":29,"tag":183,"props":9327,"children":9328},{"style":212},[9329],{"type":38,"value":770},{"type":29,"tag":183,"props":9331,"children":9332},{"style":1683},[9333],{"type":38,"value":9334},"\"INSERT INTO orders ... RETURNING id\"",{"type":29,"tag":183,"props":9336,"children":9337},{"style":212},[9338],{"type":38,"value":2694},{"type":29,"tag":183,"props":9340,"children":9341},{"style":308},[9342],{"type":38,"value":7421},{"type":29,"tag":183,"props":9344,"children":9345},{"style":212},[9346],{"type":38,"value":79},{"type":29,"tag":183,"props":9348,"children":9349},{"style":308},[9350],{"type":38,"value":9351},"class",{"type":29,"tag":183,"props":9353,"children":9354},{"style":212},[9355],{"type":38,"value":2694},{"type":29,"tag":183,"props":9357,"children":9358},{"style":308},[9359],{"type":38,"value":8464},{"type":29,"tag":183,"props":9361,"children":9362},{"style":212},[9363],{"type":38,"value":7487},{"type":29,"tag":183,"props":9365,"children":9366},{"class":185,"line":3455},[9367],{"type":29,"tag":183,"props":9368,"children":9369},{"style":212},[9370],{"type":38,"value":1589},{"type":29,"tag":183,"props":9372,"children":9373},{"class":185,"line":3485},[9374],{"type":29,"tag":183,"props":9375,"children":9376},{"style":212},[9377],{"type":38,"value":436},{"type":29,"tag":183,"props":9379,"children":9380},{"class":185,"line":3498},[9381],{"type":29,"tag":183,"props":9382,"children":9383},{"emptyLinePlaceholder":13},[9384],{"type":38,"value":445},{"type":29,"tag":183,"props":9386,"children":9387},{"class":185,"line":3520},[9388,9392,9396,9401,9405,9409],{"type":29,"tag":183,"props":9389,"children":9390},{"style":200},[9391],{"type":38,"value":8292},{"type":29,"tag":183,"props":9393,"children":9394},{"style":200},[9395],{"type":38,"value":854},{"type":29,"tag":183,"props":9397,"children":9398},{"style":750},[9399],{"type":38,"value":9400}," SendgridEmailNotifier",{"type":29,"tag":183,"props":9402,"children":9403},{"style":200},[9404],{"type":38,"value":864},{"type":29,"tag":183,"props":9406,"children":9407},{"style":750},[9408],{"type":38,"value":8816},{"type":29,"tag":183,"props":9410,"children":9411},{"style":212},[9412],{"type":38,"value":285},{"type":29,"tag":183,"props":9414,"children":9415},{"class":185,"line":3541},[9416,9420,9425,9429,9433,9437,9441,9445,9449,9453,9457],{"type":29,"tag":183,"props":9417,"children":9418},{"style":200},[9419],{"type":38,"value":8441},{"type":29,"tag":183,"props":9421,"children":9422},{"style":200},[9423],{"type":38,"value":9424}," void",{"type":29,"tag":183,"props":9426,"children":9427},{"style":206},[9428],{"type":38,"value":8833},{"type":29,"tag":183,"props":9430,"children":9431},{"style":212},[9432],{"type":38,"value":770},{"type":29,"tag":183,"props":9434,"children":9435},{"style":8327},[9436],{"type":38,"value":8842},{"type":29,"tag":183,"props":9438,"children":9439},{"style":222},[9440],{"type":38,"value":3173},{"type":29,"tag":183,"props":9442,"children":9443},{"style":212},[9444],{"type":38,"value":2694},{"type":29,"tag":183,"props":9446,"children":9447},{"style":8327},[9448],{"type":38,"value":7421},{"type":29,"tag":183,"props":9450,"children":9451},{"style":222},[9452],{"type":38,"value":8559},{"type":29,"tag":183,"props":9454,"children":9455},{"style":212},[9456],{"type":38,"value":272},{"type":29,"tag":183,"props":9458,"children":9459},{"style":212},[9460],{"type":38,"value":285},{"type":29,"tag":183,"props":9462,"children":9463},{"class":185,"line":3563},[9464,9469,9473,9478,9482,9486,9490,9495,9499,9504,9508,9513,9517,9522,9526,9530],{"type":29,"tag":183,"props":9465,"children":9466},{"style":308},[9467],{"type":38,"value":9468},"        client",{"type":29,"tag":183,"props":9470,"children":9471},{"style":212},[9472],{"type":38,"value":79},{"type":29,"tag":183,"props":9474,"children":9475},{"style":206},[9476],{"type":38,"value":9477},"send",{"type":29,"tag":183,"props":9479,"children":9480},{"style":212},[9481],{"type":38,"value":770},{"type":29,"tag":183,"props":9483,"children":9484},{"style":308},[9485],{"type":38,"value":3190},{"type":29,"tag":183,"props":9487,"children":9488},{"style":212},[9489],{"type":38,"value":2694},{"type":29,"tag":183,"props":9491,"children":9492},{"style":1683},[9493],{"type":38,"value":9494}," \"order_confirmation\"",{"type":29,"tag":183,"props":9496,"children":9497},{"style":212},[9498],{"type":38,"value":2694},{"type":29,"tag":183,"props":9500,"children":9501},{"style":308},[9502],{"type":38,"value":9503}," Map",{"type":29,"tag":183,"props":9505,"children":9506},{"style":212},[9507],{"type":38,"value":79},{"type":29,"tag":183,"props":9509,"children":9510},{"style":206},[9511],{"type":38,"value":9512},"of",{"type":29,"tag":183,"props":9514,"children":9515},{"style":212},[9516],{"type":38,"value":770},{"type":29,"tag":183,"props":9518,"children":9519},{"style":1683},[9520],{"type":38,"value":9521},"\"orderId\"",{"type":29,"tag":183,"props":9523,"children":9524},{"style":212},[9525],{"type":38,"value":2694},{"type":29,"tag":183,"props":9527,"children":9528},{"style":308},[9529],{"type":38,"value":8559},{"type":29,"tag":183,"props":9531,"children":9532},{"style":212},[9533],{"type":38,"value":9534},"));\n",{"type":29,"tag":183,"props":9536,"children":9537},{"class":185,"line":3572},[9538],{"type":29,"tag":183,"props":9539,"children":9540},{"style":212},[9541],{"type":38,"value":1589},{"type":29,"tag":183,"props":9543,"children":9544},{"class":185,"line":3588},[9545],{"type":29,"tag":183,"props":9546,"children":9547},{"style":212},[9548],{"type":38,"value":436},{"type":29,"tag":183,"props":9550,"children":9551},{"class":185,"line":3633},[9552],{"type":29,"tag":183,"props":9553,"children":9554},{"emptyLinePlaceholder":13},[9555],{"type":38,"value":445},{"type":29,"tag":183,"props":9557,"children":9558},{"class":185,"line":3665},[9559],{"type":29,"tag":183,"props":9560,"children":9561},{"style":190},[9562],{"type":38,"value":9563},"\u002F\u002F Composition à la racine de l'application\n",{"type":29,"tag":183,"props":9565,"children":9566},{"class":185,"line":3750},[9567,9571,9575,9580,9584],{"type":29,"tag":183,"props":9568,"children":9569},{"style":200},[9570],{"type":38,"value":8292},{"type":29,"tag":183,"props":9572,"children":9573},{"style":8327},[9574],{"type":38,"value":8301},{"type":29,"tag":183,"props":9576,"children":9577},{"style":206},[9578],{"type":38,"value":9579}," createOrderService",{"type":29,"tag":183,"props":9581,"children":9582},{"style":212},[9583],{"type":38,"value":1108},{"type":29,"tag":183,"props":9585,"children":9586},{"style":212},[9587],{"type":38,"value":285},{"type":29,"tag":183,"props":9589,"children":9590},{"class":185,"line":3766},[9591,9596,9601,9605,9609,9613,9617,9622],{"type":29,"tag":183,"props":9592,"children":9593},{"style":8327},[9594],{"type":38,"value":9595},"    OrderRepository",{"type":29,"tag":183,"props":9597,"children":9598},{"style":308},[9599],{"type":38,"value":9600}," repository ",{"type":29,"tag":183,"props":9602,"children":9603},{"style":228},[9604],{"type":38,"value":8340},{"type":29,"tag":183,"props":9606,"children":9607},{"style":200},[9608],{"type":38,"value":1099},{"type":29,"tag":183,"props":9610,"children":9611},{"style":206},[9612],{"type":38,"value":9257},{"type":29,"tag":183,"props":9614,"children":9615},{"style":212},[9616],{"type":38,"value":770},{"type":29,"tag":183,"props":9618,"children":9619},{"style":308},[9620],{"type":38,"value":9621},"dataSource",{"type":29,"tag":183,"props":9623,"children":9624},{"style":212},[9625],{"type":38,"value":7487},{"type":29,"tag":183,"props":9627,"children":9628},{"class":185,"line":3774},[9629,9634,9639,9643,9647,9651,9655,9660,9664,9669,9673,9678],{"type":29,"tag":183,"props":9630,"children":9631},{"style":8327},[9632],{"type":38,"value":9633},"    EmailNotifier",{"type":29,"tag":183,"props":9635,"children":9636},{"style":308},[9637],{"type":38,"value":9638}," notifier ",{"type":29,"tag":183,"props":9640,"children":9641},{"style":228},[9642],{"type":38,"value":8340},{"type":29,"tag":183,"props":9644,"children":9645},{"style":200},[9646],{"type":38,"value":1099},{"type":29,"tag":183,"props":9648,"children":9649},{"style":206},[9650],{"type":38,"value":9400},{"type":29,"tag":183,"props":9652,"children":9653},{"style":212},[9654],{"type":38,"value":770},{"type":29,"tag":183,"props":9656,"children":9657},{"style":308},[9658],{"type":38,"value":9659},"System",{"type":29,"tag":183,"props":9661,"children":9662},{"style":212},[9663],{"type":38,"value":79},{"type":29,"tag":183,"props":9665,"children":9666},{"style":206},[9667],{"type":38,"value":9668},"getenv",{"type":29,"tag":183,"props":9670,"children":9671},{"style":212},[9672],{"type":38,"value":770},{"type":29,"tag":183,"props":9674,"children":9675},{"style":1683},[9676],{"type":38,"value":9677},"\"SENDGRID_KEY\"",{"type":29,"tag":183,"props":9679,"children":9680},{"style":212},[9681],{"type":38,"value":9534},{"type":29,"tag":183,"props":9683,"children":9684},{"class":185,"line":3783},[9685,9689,9693,9697,9701,9706,9710,9714],{"type":29,"tag":183,"props":9686,"children":9687},{"style":200},[9688],{"type":38,"value":919},{"type":29,"tag":183,"props":9690,"children":9691},{"style":200},[9692],{"type":38,"value":1099},{"type":29,"tag":183,"props":9694,"children":9695},{"style":206},[9696],{"type":38,"value":8301},{"type":29,"tag":183,"props":9698,"children":9699},{"style":212},[9700],{"type":38,"value":770},{"type":29,"tag":183,"props":9702,"children":9703},{"style":308},[9704],{"type":38,"value":9705},"repository",{"type":29,"tag":183,"props":9707,"children":9708},{"style":212},[9709],{"type":38,"value":2694},{"type":29,"tag":183,"props":9711,"children":9712},{"style":308},[9713],{"type":38,"value":8954},{"type":29,"tag":183,"props":9715,"children":9716},{"style":212},[9717],{"type":38,"value":7487},{"type":29,"tag":183,"props":9719,"children":9720},{"class":185,"line":3821},[9721],{"type":29,"tag":183,"props":9722,"children":9723},{"style":212},[9724],{"type":38,"value":436},{"type":29,"tag":30,"props":9726,"children":9727},{},[9728],{"type":29,"tag":34,"props":9729,"children":9730},{},[9731],{"type":38,"value":9732},"Le gain pour les tests :",{"type":29,"tag":173,"props":9734,"children":9736},{"code":9735,"language":8271,"meta":8,"className":8272,"style":8},"\u002F\u002F Test sans base de données ni Sendgrid : s'exécute en millisecondes\nclass InMemoryOrderRepository implements OrderRepository {\n    private final Map\u003CString, OrderData> orders = new HashMap\u003C>();\n\n    public String save(OrderData orderData) {\n        String orderId = UUID.randomUUID().toString();\n        orders.put(orderId, orderData);\n        return orderId;\n    }\n\n    public boolean contains(String orderId) {\n        return orders.containsKey(orderId);\n    }\n}\n\n@Test\nvoid createOrder_persiste_et_notifie() {\n    InMemoryOrderRepository repository = new InMemoryOrderRepository();\n    FakeEmailNotifier notifier = new FakeEmailNotifier();\n    OrderService service = new OrderService(repository, notifier);\n\n    String orderId = service.createOrder(new OrderData(\"user@example.com\", items));\n\n    assertThat(repository.contains(orderId)).isTrue();\n    assertThat(notifier.getSentConfirmations()).hasSize(1);\n}\n",[9737],{"type":29,"tag":156,"props":9738,"children":9739},{"__ignoreMap":8},[9740,9748,9772,9831,9838,9873,9917,9955,9970,9977,9984,10021,10054,10061,10068,10075,10088,10109,10137,10166,10211,10218,10281,10288,10335,10383],{"type":29,"tag":183,"props":9741,"children":9742},{"class":185,"line":186},[9743],{"type":29,"tag":183,"props":9744,"children":9745},{"style":190},[9746],{"type":38,"value":9747},"\u002F\u002F Test sans base de données ni Sendgrid : s'exécute en millisecondes\n",{"type":29,"tag":183,"props":9749,"children":9750},{"class":185,"line":196},[9751,9755,9760,9764,9768],{"type":29,"tag":183,"props":9752,"children":9753},{"style":200},[9754],{"type":38,"value":9351},{"type":29,"tag":183,"props":9756,"children":9757},{"style":750},[9758],{"type":38,"value":9759}," InMemoryOrderRepository",{"type":29,"tag":183,"props":9761,"children":9762},{"style":200},[9763],{"type":38,"value":864},{"type":29,"tag":183,"props":9765,"children":9766},{"style":750},[9767],{"type":38,"value":8754},{"type":29,"tag":183,"props":9769,"children":9770},{"style":212},[9771],{"type":38,"value":285},{"type":29,"tag":183,"props":9773,"children":9774},{"class":185,"line":218},[9775,9779,9783,9787,9791,9795,9799,9804,9808,9813,9817,9821,9826],{"type":29,"tag":183,"props":9776,"children":9777},{"style":200},[9778],{"type":38,"value":1291},{"type":29,"tag":183,"props":9780,"children":9781},{"style":200},[9782],{"type":38,"value":8324},{"type":29,"tag":183,"props":9784,"children":9785},{"style":8327},[9786],{"type":38,"value":9503},{"type":29,"tag":183,"props":9788,"children":9789},{"style":212},[9790],{"type":38,"value":1442},{"type":29,"tag":183,"props":9792,"children":9793},{"style":200},[9794],{"type":38,"value":8842},{"type":29,"tag":183,"props":9796,"children":9797},{"style":212},[9798],{"type":38,"value":2694},{"type":29,"tag":183,"props":9800,"children":9801},{"style":200},[9802],{"type":38,"value":9803}," OrderData",{"type":29,"tag":183,"props":9805,"children":9806},{"style":212},[9807],{"type":38,"value":1452},{"type":29,"tag":183,"props":9809,"children":9810},{"style":308},[9811],{"type":38,"value":9812}," orders ",{"type":29,"tag":183,"props":9814,"children":9815},{"style":228},[9816],{"type":38,"value":8340},{"type":29,"tag":183,"props":9818,"children":9819},{"style":200},[9820],{"type":38,"value":1099},{"type":29,"tag":183,"props":9822,"children":9823},{"style":8327},[9824],{"type":38,"value":9825}," HashMap",{"type":29,"tag":183,"props":9827,"children":9828},{"style":212},[9829],{"type":38,"value":9830},"\u003C>();\n",{"type":29,"tag":183,"props":9832,"children":9833},{"class":185,"line":245},[9834],{"type":29,"tag":183,"props":9835,"children":9836},{"emptyLinePlaceholder":13},[9837],{"type":38,"value":445},{"type":29,"tag":183,"props":9839,"children":9840},{"class":185,"line":266},[9841,9845,9849,9853,9857,9861,9865,9869],{"type":29,"tag":183,"props":9842,"children":9843},{"style":200},[9844],{"type":38,"value":8441},{"type":29,"tag":183,"props":9846,"children":9847},{"style":8327},[9848],{"type":38,"value":7421},{"type":29,"tag":183,"props":9850,"children":9851},{"style":206},[9852],{"type":38,"value":5797},{"type":29,"tag":183,"props":9854,"children":9855},{"style":212},[9856],{"type":38,"value":770},{"type":29,"tag":183,"props":9858,"children":9859},{"style":8327},[9860],{"type":38,"value":8459},{"type":29,"tag":183,"props":9862,"children":9863},{"style":222},[9864],{"type":38,"value":8464},{"type":29,"tag":183,"props":9866,"children":9867},{"style":212},[9868],{"type":38,"value":272},{"type":29,"tag":183,"props":9870,"children":9871},{"style":212},[9872],{"type":38,"value":285},{"type":29,"tag":183,"props":9874,"children":9875},{"class":185,"line":288},[9876,9880,9884,9888,9893,9897,9902,9907,9912],{"type":29,"tag":183,"props":9877,"children":9878},{"style":8327},[9879],{"type":38,"value":8480},{"type":29,"tag":183,"props":9881,"children":9882},{"style":308},[9883],{"type":38,"value":8485},{"type":29,"tag":183,"props":9885,"children":9886},{"style":228},[9887],{"type":38,"value":8340},{"type":29,"tag":183,"props":9889,"children":9890},{"style":308},[9891],{"type":38,"value":9892}," UUID",{"type":29,"tag":183,"props":9894,"children":9895},{"style":212},[9896],{"type":38,"value":79},{"type":29,"tag":183,"props":9898,"children":9899},{"style":206},[9900],{"type":38,"value":9901},"randomUUID",{"type":29,"tag":183,"props":9903,"children":9904},{"style":212},[9905],{"type":38,"value":9906},"().",{"type":29,"tag":183,"props":9908,"children":9909},{"style":206},[9910],{"type":38,"value":9911},"toString",{"type":29,"tag":183,"props":9913,"children":9914},{"style":212},[9915],{"type":38,"value":9916},"();\n",{"type":29,"tag":183,"props":9918,"children":9919},{"class":185,"line":330},[9920,9925,9929,9934,9938,9943,9947,9951],{"type":29,"tag":183,"props":9921,"children":9922},{"style":308},[9923],{"type":38,"value":9924},"        orders",{"type":29,"tag":183,"props":9926,"children":9927},{"style":212},[9928],{"type":38,"value":79},{"type":29,"tag":183,"props":9930,"children":9931},{"style":206},[9932],{"type":38,"value":9933},"put",{"type":29,"tag":183,"props":9935,"children":9936},{"style":212},[9937],{"type":38,"value":770},{"type":29,"tag":183,"props":9939,"children":9940},{"style":308},[9941],{"type":38,"value":9942},"orderId",{"type":29,"tag":183,"props":9944,"children":9945},{"style":212},[9946],{"type":38,"value":2694},{"type":29,"tag":183,"props":9948,"children":9949},{"style":308},[9950],{"type":38,"value":8464},{"type":29,"tag":183,"props":9952,"children":9953},{"style":212},[9954],{"type":38,"value":7487},{"type":29,"tag":183,"props":9956,"children":9957},{"class":185,"line":374},[9958,9962,9966],{"type":29,"tag":183,"props":9959,"children":9960},{"style":200},[9961],{"type":38,"value":8571},{"type":29,"tag":183,"props":9963,"children":9964},{"style":308},[9965],{"type":38,"value":8559},{"type":29,"tag":183,"props":9967,"children":9968},{"style":212},[9969],{"type":38,"value":327},{"type":29,"tag":183,"props":9971,"children":9972},{"class":185,"line":430},[9973],{"type":29,"tag":183,"props":9974,"children":9975},{"style":212},[9976],{"type":38,"value":1589},{"type":29,"tag":183,"props":9978,"children":9979},{"class":185,"line":439},[9980],{"type":29,"tag":183,"props":9981,"children":9982},{"emptyLinePlaceholder":13},[9983],{"type":38,"value":445},{"type":29,"tag":183,"props":9985,"children":9986},{"class":185,"line":448},[9987,9991,9996,10001,10005,10009,10013,10017],{"type":29,"tag":183,"props":9988,"children":9989},{"style":200},[9990],{"type":38,"value":8441},{"type":29,"tag":183,"props":9992,"children":9993},{"style":200},[9994],{"type":38,"value":9995}," boolean",{"type":29,"tag":183,"props":9997,"children":9998},{"style":206},[9999],{"type":38,"value":10000}," contains",{"type":29,"tag":183,"props":10002,"children":10003},{"style":212},[10004],{"type":38,"value":770},{"type":29,"tag":183,"props":10006,"children":10007},{"style":8327},[10008],{"type":38,"value":8842},{"type":29,"tag":183,"props":10010,"children":10011},{"style":222},[10012],{"type":38,"value":8559},{"type":29,"tag":183,"props":10014,"children":10015},{"style":212},[10016],{"type":38,"value":272},{"type":29,"tag":183,"props":10018,"children":10019},{"style":212},[10020],{"type":38,"value":285},{"type":29,"tag":183,"props":10022,"children":10023},{"class":185,"line":457},[10024,10028,10033,10037,10042,10046,10050],{"type":29,"tag":183,"props":10025,"children":10026},{"style":200},[10027],{"type":38,"value":8571},{"type":29,"tag":183,"props":10029,"children":10030},{"style":308},[10031],{"type":38,"value":10032}," orders",{"type":29,"tag":183,"props":10034,"children":10035},{"style":212},[10036],{"type":38,"value":79},{"type":29,"tag":183,"props":10038,"children":10039},{"style":206},[10040],{"type":38,"value":10041},"containsKey",{"type":29,"tag":183,"props":10043,"children":10044},{"style":212},[10045],{"type":38,"value":770},{"type":29,"tag":183,"props":10047,"children":10048},{"style":308},[10049],{"type":38,"value":9942},{"type":29,"tag":183,"props":10051,"children":10052},{"style":212},[10053],{"type":38,"value":7487},{"type":29,"tag":183,"props":10055,"children":10056},{"class":185,"line":474},[10057],{"type":29,"tag":183,"props":10058,"children":10059},{"style":212},[10060],{"type":38,"value":1589},{"type":29,"tag":183,"props":10062,"children":10063},{"class":185,"line":495},[10064],{"type":29,"tag":183,"props":10065,"children":10066},{"style":212},[10067],{"type":38,"value":436},{"type":29,"tag":183,"props":10069,"children":10070},{"class":185,"line":516},[10071],{"type":29,"tag":183,"props":10072,"children":10073},{"emptyLinePlaceholder":13},[10074],{"type":38,"value":445},{"type":29,"tag":183,"props":10076,"children":10077},{"class":185,"line":536},[10078,10082],{"type":29,"tag":183,"props":10079,"children":10080},{"style":839},[10081],{"type":38,"value":831},{"type":29,"tag":183,"props":10083,"children":10085},{"style":10084},"--shiki-default:#EF9F76;--shiki-dark:#F97583",[10086],{"type":38,"value":10087},"Test\n",{"type":29,"tag":183,"props":10089,"children":10090},{"class":185,"line":570},[10091,10096,10101,10105],{"type":29,"tag":183,"props":10092,"children":10093},{"style":200},[10094],{"type":38,"value":10095},"void",{"type":29,"tag":183,"props":10097,"children":10098},{"style":206},[10099],{"type":38,"value":10100}," createOrder_persiste_et_notifie",{"type":29,"tag":183,"props":10102,"children":10103},{"style":212},[10104],{"type":38,"value":1108},{"type":29,"tag":183,"props":10106,"children":10107},{"style":212},[10108],{"type":38,"value":285},{"type":29,"tag":183,"props":10110,"children":10111},{"class":185,"line":613},[10112,10117,10121,10125,10129,10133],{"type":29,"tag":183,"props":10113,"children":10114},{"style":8327},[10115],{"type":38,"value":10116},"    InMemoryOrderRepository",{"type":29,"tag":183,"props":10118,"children":10119},{"style":308},[10120],{"type":38,"value":9600},{"type":29,"tag":183,"props":10122,"children":10123},{"style":228},[10124],{"type":38,"value":8340},{"type":29,"tag":183,"props":10126,"children":10127},{"style":200},[10128],{"type":38,"value":1099},{"type":29,"tag":183,"props":10130,"children":10131},{"style":206},[10132],{"type":38,"value":9759},{"type":29,"tag":183,"props":10134,"children":10135},{"style":212},[10136],{"type":38,"value":9916},{"type":29,"tag":183,"props":10138,"children":10139},{"class":185,"line":662},[10140,10145,10149,10153,10157,10162],{"type":29,"tag":183,"props":10141,"children":10142},{"style":8327},[10143],{"type":38,"value":10144},"    FakeEmailNotifier",{"type":29,"tag":183,"props":10146,"children":10147},{"style":308},[10148],{"type":38,"value":9638},{"type":29,"tag":183,"props":10150,"children":10151},{"style":228},[10152],{"type":38,"value":8340},{"type":29,"tag":183,"props":10154,"children":10155},{"style":200},[10156],{"type":38,"value":1099},{"type":29,"tag":183,"props":10158,"children":10159},{"style":206},[10160],{"type":38,"value":10161}," FakeEmailNotifier",{"type":29,"tag":183,"props":10163,"children":10164},{"style":212},[10165],{"type":38,"value":9916},{"type":29,"tag":183,"props":10167,"children":10168},{"class":185,"line":3095},[10169,10174,10179,10183,10187,10191,10195,10199,10203,10207],{"type":29,"tag":183,"props":10170,"children":10171},{"style":8327},[10172],{"type":38,"value":10173},"    OrderService",{"type":29,"tag":183,"props":10175,"children":10176},{"style":308},[10177],{"type":38,"value":10178}," service ",{"type":29,"tag":183,"props":10180,"children":10181},{"style":228},[10182],{"type":38,"value":8340},{"type":29,"tag":183,"props":10184,"children":10185},{"style":200},[10186],{"type":38,"value":1099},{"type":29,"tag":183,"props":10188,"children":10189},{"style":206},[10190],{"type":38,"value":8301},{"type":29,"tag":183,"props":10192,"children":10193},{"style":212},[10194],{"type":38,"value":770},{"type":29,"tag":183,"props":10196,"children":10197},{"style":308},[10198],{"type":38,"value":9705},{"type":29,"tag":183,"props":10200,"children":10201},{"style":212},[10202],{"type":38,"value":2694},{"type":29,"tag":183,"props":10204,"children":10205},{"style":308},[10206],{"type":38,"value":8954},{"type":29,"tag":183,"props":10208,"children":10209},{"style":212},[10210],{"type":38,"value":7487},{"type":29,"tag":183,"props":10212,"children":10213},{"class":185,"line":3154},[10214],{"type":29,"tag":183,"props":10215,"children":10216},{"emptyLinePlaceholder":13},[10217],{"type":38,"value":445},{"type":29,"tag":183,"props":10219,"children":10220},{"class":185,"line":3207},[10221,10225,10229,10233,10238,10242,10247,10251,10255,10259,10263,10268,10272,10277],{"type":29,"tag":183,"props":10222,"children":10223},{"style":8327},[10224],{"type":38,"value":8766},{"type":29,"tag":183,"props":10226,"children":10227},{"style":308},[10228],{"type":38,"value":8485},{"type":29,"tag":183,"props":10230,"children":10231},{"style":228},[10232],{"type":38,"value":8340},{"type":29,"tag":183,"props":10234,"children":10235},{"style":308},[10236],{"type":38,"value":10237}," service",{"type":29,"tag":183,"props":10239,"children":10240},{"style":212},[10241],{"type":38,"value":79},{"type":29,"tag":183,"props":10243,"children":10244},{"style":206},[10245],{"type":38,"value":10246},"createOrder",{"type":29,"tag":183,"props":10248,"children":10249},{"style":212},[10250],{"type":38,"value":770},{"type":29,"tag":183,"props":10252,"children":10253},{"style":200},[10254],{"type":38,"value":1628},{"type":29,"tag":183,"props":10256,"children":10257},{"style":206},[10258],{"type":38,"value":9803},{"type":29,"tag":183,"props":10260,"children":10261},{"style":212},[10262],{"type":38,"value":770},{"type":29,"tag":183,"props":10264,"children":10265},{"style":1683},[10266],{"type":38,"value":10267},"\"user@example.com\"",{"type":29,"tag":183,"props":10269,"children":10270},{"style":212},[10271],{"type":38,"value":2694},{"type":29,"tag":183,"props":10273,"children":10274},{"style":308},[10275],{"type":38,"value":10276}," items",{"type":29,"tag":183,"props":10278,"children":10279},{"style":212},[10280],{"type":38,"value":9534},{"type":29,"tag":183,"props":10282,"children":10283},{"class":185,"line":3224},[10284],{"type":29,"tag":183,"props":10285,"children":10286},{"emptyLinePlaceholder":13},[10287],{"type":38,"value":445},{"type":29,"tag":183,"props":10289,"children":10290},{"class":185,"line":3266},[10291,10296,10300,10304,10308,10313,10317,10321,10326,10331],{"type":29,"tag":183,"props":10292,"children":10293},{"style":206},[10294],{"type":38,"value":10295},"    assertThat",{"type":29,"tag":183,"props":10297,"children":10298},{"style":212},[10299],{"type":38,"value":770},{"type":29,"tag":183,"props":10301,"children":10302},{"style":308},[10303],{"type":38,"value":9705},{"type":29,"tag":183,"props":10305,"children":10306},{"style":212},[10307],{"type":38,"value":79},{"type":29,"tag":183,"props":10309,"children":10310},{"style":206},[10311],{"type":38,"value":10312},"contains",{"type":29,"tag":183,"props":10314,"children":10315},{"style":212},[10316],{"type":38,"value":770},{"type":29,"tag":183,"props":10318,"children":10319},{"style":308},[10320],{"type":38,"value":9942},{"type":29,"tag":183,"props":10322,"children":10323},{"style":212},[10324],{"type":38,"value":10325},")).",{"type":29,"tag":183,"props":10327,"children":10328},{"style":206},[10329],{"type":38,"value":10330},"isTrue",{"type":29,"tag":183,"props":10332,"children":10333},{"style":212},[10334],{"type":38,"value":9916},{"type":29,"tag":183,"props":10336,"children":10337},{"class":185,"line":3275},[10338,10342,10346,10351,10355,10360,10365,10370,10374,10379],{"type":29,"tag":183,"props":10339,"children":10340},{"style":206},[10341],{"type":38,"value":10295},{"type":29,"tag":183,"props":10343,"children":10344},{"style":212},[10345],{"type":38,"value":770},{"type":29,"tag":183,"props":10347,"children":10348},{"style":308},[10349],{"type":38,"value":10350},"notifier",{"type":29,"tag":183,"props":10352,"children":10353},{"style":212},[10354],{"type":38,"value":79},{"type":29,"tag":183,"props":10356,"children":10357},{"style":206},[10358],{"type":38,"value":10359},"getSentConfirmations",{"type":29,"tag":183,"props":10361,"children":10362},{"style":212},[10363],{"type":38,"value":10364},"()).",{"type":29,"tag":183,"props":10366,"children":10367},{"style":206},[10368],{"type":38,"value":10369},"hasSize",{"type":29,"tag":183,"props":10371,"children":10372},{"style":212},[10373],{"type":38,"value":770},{"type":29,"tag":183,"props":10375,"children":10376},{"style":319},[10377],{"type":38,"value":10378},"1",{"type":29,"tag":183,"props":10380,"children":10381},{"style":212},[10382],{"type":38,"value":7487},{"type":29,"tag":183,"props":10384,"children":10385},{"class":185,"line":3283},[10386],{"type":29,"tag":183,"props":10387,"children":10388},{"style":212},[10389],{"type":38,"value":436},{"type":29,"tag":1196,"props":10391,"children":10393},{"cta":1198,"href":1199,"title":10392,"type":1201},"Vous voulez savoir où placer l'abstraction et où vous arrêter ?",[10394],{"type":29,"tag":30,"props":10395,"children":10396},{},[10397],{"type":38,"value":10398},"Inverser une dépendance au bon endroit (et résister à l'envie d'abstraire le reste) ne s'apprend pas en lisant un exemple, ça se travaille sur votre propre code. En mentoring 1:1, je relis vos services avec vous, on extrait les ports ensemble et vous repartez avec le réflexe de sentir quand une dépendance mérite une interface. C'est du 1:1 pour monter en niveau, pas un audit d'équipe.",{"type":29,"tag":46,"props":10400,"children":10401},{},[],{"type":29,"tag":50,"props":10403,"children":10405},{"id":10404},"exemple-2-java-ports-hexagonaux-et-fakes-en-mémoire",[10406],{"type":38,"value":10407},"Exemple 2 : Java, ports hexagonaux et fakes en mémoire",{"type":29,"tag":173,"props":10409,"children":10411},{"code":10410,"language":8271,"meta":8,"className":8272,"style":8},"\u002F\u002F Les ports (abstractions hexagonales)\npublic interface OrderRepository {\n    String save(OrderData orderData);\n    Optional\u003COrder> findById(String orderId);\n}\n\npublic interface PaymentGateway {\n    PaymentResult charge(BigDecimal amount, String currency, String paymentMethodId);\n}\n\n\u002F\u002F Le module de haut niveau - dépend uniquement des ports\n@Service\npublic class OrderService {\n\n    private final OrderRepository repository;\n    private final PaymentGateway payment;\n\n    public OrderService(OrderRepository repository, PaymentGateway payment) {\n        this.repository = repository;\n        this.payment = payment;\n    }\n\n    public Order createPaidOrder(OrderData orderData) {\n        PaymentResult result = payment.charge(\n            orderData.getTotal(),\n            orderData.getCurrency(),\n            orderData.getPaymentMethodId()\n        );\n\n        if (!result.isSuccess()) {\n            throw new PaymentFailedException(result.getErrorCode());\n        }\n\n        String orderId = repository.save(\n            orderData.withPaymentId(result.getTransactionId())\n                     .withStatus(OrderStatus.PAID)\n        );\n\n        return repository.findById(orderId)\n            .orElseThrow(() -> new IllegalStateException(\"Order not found after save\"));\n    }\n}\n\n\u002F\u002F Fake en mémoire pour les tests - sans Stripe, sans base de données\nclass InMemoryOrderRepository implements OrderRepository {\n\n    private final Map\u003CString, OrderData> store = new HashMap\u003C>();\n\n    @Override\n    public String save(OrderData orderData) {\n        String id = UUID.randomUUID().toString();\n        store.put(id, orderData);\n        return id;\n    }\n\n    @Override\n    public Optional\u003COrder> findById(String orderId) {\n        return Optional.ofNullable(store.get(orderId))\n            .map(data -> new Order(orderId, data.getStatus()));\n    }\n}\n\nclass StubPaymentGateway implements PaymentGateway {\n\n    private final boolean shouldSucceed;\n\n    StubPaymentGateway(boolean shouldSucceed) {\n        this.shouldSucceed = shouldSucceed;\n    }\n\n    @Override\n    public PaymentResult charge(BigDecimal amount, String currency, String paymentMethodId) {\n        return shouldSucceed\n            ? PaymentResult.success(\"txn-456\")\n            : PaymentResult.failure(\"CARD_DECLINED\");\n    }\n}\n\n\u002F\u002F Test JUnit 5 - s'exécute en millisecondes, sans infra\nclass OrderServiceTest {\n\n    @Test\n    void shouldCreateOrderWithSuccessfulPayment() {\n        OrderRepository repository = new InMemoryOrderRepository();\n        PaymentGateway payment = new StubPaymentGateway(true);\n        OrderService service = new OrderService(repository, payment);\n\n        Order order = service.createPaidOrder(\n            new OrderData(new BigDecimal(\"1000\"), \"EUR\", \"pm-123\")\n        );\n\n        assertEquals(OrderStatus.PAID, order.getStatus());\n    }\n\n    @Test\n    void shouldThrowWhenPaymentFails() {\n        OrderService service = new OrderService(\n            new InMemoryOrderRepository(),\n            new StubPaymentGateway(false)\n        );\n\n        assertThrows(PaymentFailedException.class, () ->\n            service.createPaidOrder(new OrderData(new BigDecimal(\"1000\"), \"EUR\", \"pm-123\"))\n        );\n    }\n}\n",[10412],{"type":29,"tag":156,"props":10413,"children":10414},{"__ignoreMap":8},[10415,10423,10442,10469,10511,10518,10525,10545,10601,10608,10615,10623,10635,10654,10661,10684,10708,10715,10758,10785,10813,10820,10827,10864,10898,10920,10940,10960,10968,10975,11014,11053,11061,11068,11099,11137,11173,11180,11187,11218,11263,11270,11277,11284,11292,11315,11322,11378,11385,11398,11433,11473,11509,11524,11531,11538,11549,11597,11648,11713,11720,11727,11734,11758,11765,11789,11796,11825,11854,11862,11870,11882,11943,11956,11991,12026,12034,12042,12050,12059,12076,12084,12096,12117,12146,12185,12230,12238,12273,12331,12339,12347,12393,12401,12409,12421,12442,12470,12486,12511,12519,12527,12566,12635,12643,12651],{"type":29,"tag":183,"props":10416,"children":10417},{"class":185,"line":186},[10418],{"type":29,"tag":183,"props":10419,"children":10420},{"style":190},[10421],{"type":38,"value":10422},"\u002F\u002F Les ports (abstractions hexagonales)\n",{"type":29,"tag":183,"props":10424,"children":10425},{"class":185,"line":196},[10426,10430,10434,10438],{"type":29,"tag":183,"props":10427,"children":10428},{"style":200},[10429],{"type":38,"value":8292},{"type":29,"tag":183,"props":10431,"children":10432},{"style":200},[10433],{"type":38,"value":747},{"type":29,"tag":183,"props":10435,"children":10436},{"style":750},[10437],{"type":38,"value":8754},{"type":29,"tag":183,"props":10439,"children":10440},{"style":212},[10441],{"type":38,"value":285},{"type":29,"tag":183,"props":10443,"children":10444},{"class":185,"line":218},[10445,10449,10453,10457,10461,10465],{"type":29,"tag":183,"props":10446,"children":10447},{"style":8327},[10448],{"type":38,"value":8766},{"type":29,"tag":183,"props":10450,"children":10451},{"style":206},[10452],{"type":38,"value":5797},{"type":29,"tag":183,"props":10454,"children":10455},{"style":212},[10456],{"type":38,"value":770},{"type":29,"tag":183,"props":10458,"children":10459},{"style":8327},[10460],{"type":38,"value":8459},{"type":29,"tag":183,"props":10462,"children":10463},{"style":222},[10464],{"type":38,"value":8464},{"type":29,"tag":183,"props":10466,"children":10467},{"style":212},[10468],{"type":38,"value":7487},{"type":29,"tag":183,"props":10470,"children":10471},{"class":185,"line":245},[10472,10477,10481,10486,10490,10495,10499,10503,10507],{"type":29,"tag":183,"props":10473,"children":10474},{"style":8327},[10475],{"type":38,"value":10476},"    Optional",{"type":29,"tag":183,"props":10478,"children":10479},{"style":212},[10480],{"type":38,"value":1442},{"type":29,"tag":183,"props":10482,"children":10483},{"style":200},[10484],{"type":38,"value":10485},"Order",{"type":29,"tag":183,"props":10487,"children":10488},{"style":212},[10489],{"type":38,"value":1452},{"type":29,"tag":183,"props":10491,"children":10492},{"style":206},[10493],{"type":38,"value":10494}," findById",{"type":29,"tag":183,"props":10496,"children":10497},{"style":212},[10498],{"type":38,"value":770},{"type":29,"tag":183,"props":10500,"children":10501},{"style":8327},[10502],{"type":38,"value":8842},{"type":29,"tag":183,"props":10504,"children":10505},{"style":222},[10506],{"type":38,"value":8559},{"type":29,"tag":183,"props":10508,"children":10509},{"style":212},[10510],{"type":38,"value":7487},{"type":29,"tag":183,"props":10512,"children":10513},{"class":185,"line":266},[10514],{"type":29,"tag":183,"props":10515,"children":10516},{"style":212},[10517],{"type":38,"value":436},{"type":29,"tag":183,"props":10519,"children":10520},{"class":185,"line":288},[10521],{"type":29,"tag":183,"props":10522,"children":10523},{"emptyLinePlaceholder":13},[10524],{"type":38,"value":445},{"type":29,"tag":183,"props":10526,"children":10527},{"class":185,"line":330},[10528,10532,10536,10541],{"type":29,"tag":183,"props":10529,"children":10530},{"style":200},[10531],{"type":38,"value":8292},{"type":29,"tag":183,"props":10533,"children":10534},{"style":200},[10535],{"type":38,"value":747},{"type":29,"tag":183,"props":10537,"children":10538},{"style":750},[10539],{"type":38,"value":10540}," PaymentGateway",{"type":29,"tag":183,"props":10542,"children":10543},{"style":212},[10544],{"type":38,"value":285},{"type":29,"tag":183,"props":10546,"children":10547},{"class":185,"line":374},[10548,10553,10558,10562,10567,10572,10576,10580,10584,10588,10592,10597],{"type":29,"tag":183,"props":10549,"children":10550},{"style":8327},[10551],{"type":38,"value":10552},"    PaymentResult",{"type":29,"tag":183,"props":10554,"children":10555},{"style":206},[10556],{"type":38,"value":10557}," charge",{"type":29,"tag":183,"props":10559,"children":10560},{"style":212},[10561],{"type":38,"value":770},{"type":29,"tag":183,"props":10563,"children":10564},{"style":8327},[10565],{"type":38,"value":10566},"BigDecimal",{"type":29,"tag":183,"props":10568,"children":10569},{"style":222},[10570],{"type":38,"value":10571}," amount",{"type":29,"tag":183,"props":10573,"children":10574},{"style":212},[10575],{"type":38,"value":2694},{"type":29,"tag":183,"props":10577,"children":10578},{"style":8327},[10579],{"type":38,"value":7421},{"type":29,"tag":183,"props":10581,"children":10582},{"style":222},[10583],{"type":38,"value":6332},{"type":29,"tag":183,"props":10585,"children":10586},{"style":212},[10587],{"type":38,"value":2694},{"type":29,"tag":183,"props":10589,"children":10590},{"style":8327},[10591],{"type":38,"value":7421},{"type":29,"tag":183,"props":10593,"children":10594},{"style":222},[10595],{"type":38,"value":10596}," paymentMethodId",{"type":29,"tag":183,"props":10598,"children":10599},{"style":212},[10600],{"type":38,"value":7487},{"type":29,"tag":183,"props":10602,"children":10603},{"class":185,"line":430},[10604],{"type":29,"tag":183,"props":10605,"children":10606},{"style":212},[10607],{"type":38,"value":436},{"type":29,"tag":183,"props":10609,"children":10610},{"class":185,"line":439},[10611],{"type":29,"tag":183,"props":10612,"children":10613},{"emptyLinePlaceholder":13},[10614],{"type":38,"value":445},{"type":29,"tag":183,"props":10616,"children":10617},{"class":185,"line":448},[10618],{"type":29,"tag":183,"props":10619,"children":10620},{"style":190},[10621],{"type":38,"value":10622},"\u002F\u002F Le module de haut niveau - dépend uniquement des ports\n",{"type":29,"tag":183,"props":10624,"children":10625},{"class":185,"line":457},[10626,10630],{"type":29,"tag":183,"props":10627,"children":10628},{"style":839},[10629],{"type":38,"value":831},{"type":29,"tag":183,"props":10631,"children":10632},{"style":10084},[10633],{"type":38,"value":10634},"Service\n",{"type":29,"tag":183,"props":10636,"children":10637},{"class":185,"line":474},[10638,10642,10646,10650],{"type":29,"tag":183,"props":10639,"children":10640},{"style":200},[10641],{"type":38,"value":8292},{"type":29,"tag":183,"props":10643,"children":10644},{"style":200},[10645],{"type":38,"value":854},{"type":29,"tag":183,"props":10647,"children":10648},{"style":750},[10649],{"type":38,"value":8301},{"type":29,"tag":183,"props":10651,"children":10652},{"style":212},[10653],{"type":38,"value":285},{"type":29,"tag":183,"props":10655,"children":10656},{"class":185,"line":495},[10657],{"type":29,"tag":183,"props":10658,"children":10659},{"emptyLinePlaceholder":13},[10660],{"type":38,"value":445},{"type":29,"tag":183,"props":10662,"children":10663},{"class":185,"line":516},[10664,10668,10672,10676,10680],{"type":29,"tag":183,"props":10665,"children":10666},{"style":200},[10667],{"type":38,"value":1291},{"type":29,"tag":183,"props":10669,"children":10670},{"style":200},[10671],{"type":38,"value":8324},{"type":29,"tag":183,"props":10673,"children":10674},{"style":8327},[10675],{"type":38,"value":8754},{"type":29,"tag":183,"props":10677,"children":10678},{"style":308},[10679],{"type":38,"value":8930},{"type":29,"tag":183,"props":10681,"children":10682},{"style":212},[10683],{"type":38,"value":327},{"type":29,"tag":183,"props":10685,"children":10686},{"class":185,"line":536},[10687,10691,10695,10699,10704],{"type":29,"tag":183,"props":10688,"children":10689},{"style":200},[10690],{"type":38,"value":1291},{"type":29,"tag":183,"props":10692,"children":10693},{"style":200},[10694],{"type":38,"value":8324},{"type":29,"tag":183,"props":10696,"children":10697},{"style":8327},[10698],{"type":38,"value":10540},{"type":29,"tag":183,"props":10700,"children":10701},{"style":308},[10702],{"type":38,"value":10703}," payment",{"type":29,"tag":183,"props":10705,"children":10706},{"style":212},[10707],{"type":38,"value":327},{"type":29,"tag":183,"props":10709,"children":10710},{"class":185,"line":570},[10711],{"type":29,"tag":183,"props":10712,"children":10713},{"emptyLinePlaceholder":13},[10714],{"type":38,"value":445},{"type":29,"tag":183,"props":10716,"children":10717},{"class":185,"line":613},[10718,10722,10726,10730,10734,10738,10742,10746,10750,10754],{"type":29,"tag":183,"props":10719,"children":10720},{"style":200},[10721],{"type":38,"value":8441},{"type":29,"tag":183,"props":10723,"children":10724},{"style":206},[10725],{"type":38,"value":8301},{"type":29,"tag":183,"props":10727,"children":10728},{"style":212},[10729],{"type":38,"value":770},{"type":29,"tag":183,"props":10731,"children":10732},{"style":8327},[10733],{"type":38,"value":8692},{"type":29,"tag":183,"props":10735,"children":10736},{"style":222},[10737],{"type":38,"value":8930},{"type":29,"tag":183,"props":10739,"children":10740},{"style":212},[10741],{"type":38,"value":2694},{"type":29,"tag":183,"props":10743,"children":10744},{"style":8327},[10745],{"type":38,"value":10540},{"type":29,"tag":183,"props":10747,"children":10748},{"style":222},[10749],{"type":38,"value":10703},{"type":29,"tag":183,"props":10751,"children":10752},{"style":212},[10753],{"type":38,"value":272},{"type":29,"tag":183,"props":10755,"children":10756},{"style":212},[10757],{"type":38,"value":285},{"type":29,"tag":183,"props":10759,"children":10760},{"class":185,"line":662},[10761,10765,10769,10773,10777,10781],{"type":29,"tag":183,"props":10762,"children":10763},{"style":1481},[10764],{"type":38,"value":9016},{"type":29,"tag":183,"props":10766,"children":10767},{"style":212},[10768],{"type":38,"value":79},{"type":29,"tag":183,"props":10770,"children":10771},{"style":308},[10772],{"type":38,"value":9025},{"type":29,"tag":183,"props":10774,"children":10775},{"style":228},[10776],{"type":38,"value":8340},{"type":29,"tag":183,"props":10778,"children":10779},{"style":308},[10780],{"type":38,"value":8930},{"type":29,"tag":183,"props":10782,"children":10783},{"style":212},[10784],{"type":38,"value":327},{"type":29,"tag":183,"props":10786,"children":10787},{"class":185,"line":3095},[10788,10792,10796,10801,10805,10809],{"type":29,"tag":183,"props":10789,"children":10790},{"style":1481},[10791],{"type":38,"value":9016},{"type":29,"tag":183,"props":10793,"children":10794},{"style":212},[10795],{"type":38,"value":79},{"type":29,"tag":183,"props":10797,"children":10798},{"style":308},[10799],{"type":38,"value":10800},"payment ",{"type":29,"tag":183,"props":10802,"children":10803},{"style":228},[10804],{"type":38,"value":8340},{"type":29,"tag":183,"props":10806,"children":10807},{"style":308},[10808],{"type":38,"value":10703},{"type":29,"tag":183,"props":10810,"children":10811},{"style":212},[10812],{"type":38,"value":327},{"type":29,"tag":183,"props":10814,"children":10815},{"class":185,"line":3154},[10816],{"type":29,"tag":183,"props":10817,"children":10818},{"style":212},[10819],{"type":38,"value":1589},{"type":29,"tag":183,"props":10821,"children":10822},{"class":185,"line":3207},[10823],{"type":29,"tag":183,"props":10824,"children":10825},{"emptyLinePlaceholder":13},[10826],{"type":38,"value":445},{"type":29,"tag":183,"props":10828,"children":10829},{"class":185,"line":3224},[10830,10834,10839,10844,10848,10852,10856,10860],{"type":29,"tag":183,"props":10831,"children":10832},{"style":200},[10833],{"type":38,"value":8441},{"type":29,"tag":183,"props":10835,"children":10836},{"style":8327},[10837],{"type":38,"value":10838}," Order",{"type":29,"tag":183,"props":10840,"children":10841},{"style":206},[10842],{"type":38,"value":10843}," createPaidOrder",{"type":29,"tag":183,"props":10845,"children":10846},{"style":212},[10847],{"type":38,"value":770},{"type":29,"tag":183,"props":10849,"children":10850},{"style":8327},[10851],{"type":38,"value":8459},{"type":29,"tag":183,"props":10853,"children":10854},{"style":222},[10855],{"type":38,"value":8464},{"type":29,"tag":183,"props":10857,"children":10858},{"style":212},[10859],{"type":38,"value":272},{"type":29,"tag":183,"props":10861,"children":10862},{"style":212},[10863],{"type":38,"value":285},{"type":29,"tag":183,"props":10865,"children":10866},{"class":185,"line":3266},[10867,10872,10877,10881,10885,10889,10894],{"type":29,"tag":183,"props":10868,"children":10869},{"style":8327},[10870],{"type":38,"value":10871},"        PaymentResult",{"type":29,"tag":183,"props":10873,"children":10874},{"style":308},[10875],{"type":38,"value":10876}," result ",{"type":29,"tag":183,"props":10878,"children":10879},{"style":228},[10880],{"type":38,"value":8340},{"type":29,"tag":183,"props":10882,"children":10883},{"style":308},[10884],{"type":38,"value":10703},{"type":29,"tag":183,"props":10886,"children":10887},{"style":212},[10888],{"type":38,"value":79},{"type":29,"tag":183,"props":10890,"children":10891},{"style":206},[10892],{"type":38,"value":10893},"charge",{"type":29,"tag":183,"props":10895,"children":10896},{"style":212},[10897],{"type":38,"value":215},{"type":29,"tag":183,"props":10899,"children":10900},{"class":185,"line":3275},[10901,10906,10910,10915],{"type":29,"tag":183,"props":10902,"children":10903},{"style":308},[10904],{"type":38,"value":10905},"            orderData",{"type":29,"tag":183,"props":10907,"children":10908},{"style":212},[10909],{"type":38,"value":79},{"type":29,"tag":183,"props":10911,"children":10912},{"style":206},[10913],{"type":38,"value":10914},"getTotal",{"type":29,"tag":183,"props":10916,"children":10917},{"style":212},[10918],{"type":38,"value":10919},"(),\n",{"type":29,"tag":183,"props":10921,"children":10922},{"class":185,"line":3283},[10923,10927,10931,10936],{"type":29,"tag":183,"props":10924,"children":10925},{"style":308},[10926],{"type":38,"value":10905},{"type":29,"tag":183,"props":10928,"children":10929},{"style":212},[10930],{"type":38,"value":79},{"type":29,"tag":183,"props":10932,"children":10933},{"style":206},[10934],{"type":38,"value":10935},"getCurrency",{"type":29,"tag":183,"props":10937,"children":10938},{"style":212},[10939],{"type":38,"value":10919},{"type":29,"tag":183,"props":10941,"children":10942},{"class":185,"line":3292},[10943,10947,10951,10956],{"type":29,"tag":183,"props":10944,"children":10945},{"style":308},[10946],{"type":38,"value":10905},{"type":29,"tag":183,"props":10948,"children":10949},{"style":212},[10950],{"type":38,"value":79},{"type":29,"tag":183,"props":10952,"children":10953},{"style":206},[10954],{"type":38,"value":10955},"getPaymentMethodId",{"type":29,"tag":183,"props":10957,"children":10958},{"style":212},[10959],{"type":38,"value":842},{"type":29,"tag":183,"props":10961,"children":10962},{"class":185,"line":3349},[10963],{"type":29,"tag":183,"props":10964,"children":10965},{"style":212},[10966],{"type":38,"value":10967},"        );\n",{"type":29,"tag":183,"props":10969,"children":10970},{"class":185,"line":3366},[10971],{"type":29,"tag":183,"props":10972,"children":10973},{"emptyLinePlaceholder":13},[10974],{"type":38,"value":445},{"type":29,"tag":183,"props":10976,"children":10977},{"class":185,"line":3395},[10978,10983,10987,10991,10996,11000,11005,11010],{"type":29,"tag":183,"props":10979,"children":10980},{"style":200},[10981],{"type":38,"value":10982},"        if",{"type":29,"tag":183,"props":10984,"children":10985},{"style":212},[10986],{"type":38,"value":1533},{"type":29,"tag":183,"props":10988,"children":10989},{"style":228},[10990],{"type":38,"value":1538},{"type":29,"tag":183,"props":10992,"children":10993},{"style":308},[10994],{"type":38,"value":10995},"result",{"type":29,"tag":183,"props":10997,"children":10998},{"style":212},[10999],{"type":38,"value":79},{"type":29,"tag":183,"props":11001,"children":11002},{"style":206},[11003],{"type":38,"value":11004},"isSuccess",{"type":29,"tag":183,"props":11006,"children":11007},{"style":212},[11008],{"type":38,"value":11009},"())",{"type":29,"tag":183,"props":11011,"children":11012},{"style":212},[11013],{"type":38,"value":285},{"type":29,"tag":183,"props":11015,"children":11016},{"class":185,"line":3425},[11017,11022,11026,11031,11035,11039,11043,11048],{"type":29,"tag":183,"props":11018,"children":11019},{"style":200},[11020],{"type":38,"value":11021},"            throw",{"type":29,"tag":183,"props":11023,"children":11024},{"style":200},[11025],{"type":38,"value":1099},{"type":29,"tag":183,"props":11027,"children":11028},{"style":206},[11029],{"type":38,"value":11030}," PaymentFailedException",{"type":29,"tag":183,"props":11032,"children":11033},{"style":212},[11034],{"type":38,"value":770},{"type":29,"tag":183,"props":11036,"children":11037},{"style":308},[11038],{"type":38,"value":10995},{"type":29,"tag":183,"props":11040,"children":11041},{"style":212},[11042],{"type":38,"value":79},{"type":29,"tag":183,"props":11044,"children":11045},{"style":206},[11046],{"type":38,"value":11047},"getErrorCode",{"type":29,"tag":183,"props":11049,"children":11050},{"style":212},[11051],{"type":38,"value":11052},"());\n",{"type":29,"tag":183,"props":11054,"children":11055},{"class":185,"line":3455},[11056],{"type":29,"tag":183,"props":11057,"children":11058},{"style":212},[11059],{"type":38,"value":11060},"        }\n",{"type":29,"tag":183,"props":11062,"children":11063},{"class":185,"line":3485},[11064],{"type":29,"tag":183,"props":11065,"children":11066},{"emptyLinePlaceholder":13},[11067],{"type":38,"value":445},{"type":29,"tag":183,"props":11069,"children":11070},{"class":185,"line":3498},[11071,11075,11079,11083,11087,11091,11095],{"type":29,"tag":183,"props":11072,"children":11073},{"style":8327},[11074],{"type":38,"value":8480},{"type":29,"tag":183,"props":11076,"children":11077},{"style":308},[11078],{"type":38,"value":8485},{"type":29,"tag":183,"props":11080,"children":11081},{"style":228},[11082],{"type":38,"value":8340},{"type":29,"tag":183,"props":11084,"children":11085},{"style":308},[11086],{"type":38,"value":8930},{"type":29,"tag":183,"props":11088,"children":11089},{"style":212},[11090],{"type":38,"value":79},{"type":29,"tag":183,"props":11092,"children":11093},{"style":206},[11094],{"type":38,"value":8503},{"type":29,"tag":183,"props":11096,"children":11097},{"style":212},[11098],{"type":38,"value":215},{"type":29,"tag":183,"props":11100,"children":11101},{"class":185,"line":3520},[11102,11106,11110,11115,11119,11123,11127,11132],{"type":29,"tag":183,"props":11103,"children":11104},{"style":308},[11105],{"type":38,"value":10905},{"type":29,"tag":183,"props":11107,"children":11108},{"style":212},[11109],{"type":38,"value":79},{"type":29,"tag":183,"props":11111,"children":11112},{"style":206},[11113],{"type":38,"value":11114},"withPaymentId",{"type":29,"tag":183,"props":11116,"children":11117},{"style":212},[11118],{"type":38,"value":770},{"type":29,"tag":183,"props":11120,"children":11121},{"style":308},[11122],{"type":38,"value":10995},{"type":29,"tag":183,"props":11124,"children":11125},{"style":212},[11126],{"type":38,"value":79},{"type":29,"tag":183,"props":11128,"children":11129},{"style":206},[11130],{"type":38,"value":11131},"getTransactionId",{"type":29,"tag":183,"props":11133,"children":11134},{"style":212},[11135],{"type":38,"value":11136},"())\n",{"type":29,"tag":183,"props":11138,"children":11139},{"class":185,"line":3541},[11140,11145,11150,11154,11159,11163,11168],{"type":29,"tag":183,"props":11141,"children":11142},{"style":212},[11143],{"type":38,"value":11144},"                     .",{"type":29,"tag":183,"props":11146,"children":11147},{"style":206},[11148],{"type":38,"value":11149},"withStatus",{"type":29,"tag":183,"props":11151,"children":11152},{"style":212},[11153],{"type":38,"value":770},{"type":29,"tag":183,"props":11155,"children":11156},{"style":308},[11157],{"type":38,"value":11158},"OrderStatus",{"type":29,"tag":183,"props":11160,"children":11161},{"style":212},[11162],{"type":38,"value":79},{"type":29,"tag":183,"props":11164,"children":11165},{"style":308},[11166],{"type":38,"value":11167},"PAID",{"type":29,"tag":183,"props":11169,"children":11170},{"style":212},[11171],{"type":38,"value":11172},")\n",{"type":29,"tag":183,"props":11174,"children":11175},{"class":185,"line":3563},[11176],{"type":29,"tag":183,"props":11177,"children":11178},{"style":212},[11179],{"type":38,"value":10967},{"type":29,"tag":183,"props":11181,"children":11182},{"class":185,"line":3572},[11183],{"type":29,"tag":183,"props":11184,"children":11185},{"emptyLinePlaceholder":13},[11186],{"type":38,"value":445},{"type":29,"tag":183,"props":11188,"children":11189},{"class":185,"line":3588},[11190,11194,11198,11202,11206,11210,11214],{"type":29,"tag":183,"props":11191,"children":11192},{"style":200},[11193],{"type":38,"value":8571},{"type":29,"tag":183,"props":11195,"children":11196},{"style":308},[11197],{"type":38,"value":8930},{"type":29,"tag":183,"props":11199,"children":11200},{"style":212},[11201],{"type":38,"value":79},{"type":29,"tag":183,"props":11203,"children":11204},{"style":206},[11205],{"type":38,"value":1502},{"type":29,"tag":183,"props":11207,"children":11208},{"style":212},[11209],{"type":38,"value":770},{"type":29,"tag":183,"props":11211,"children":11212},{"style":308},[11213],{"type":38,"value":9942},{"type":29,"tag":183,"props":11215,"children":11216},{"style":212},[11217],{"type":38,"value":11172},{"type":29,"tag":183,"props":11219,"children":11220},{"class":185,"line":3633},[11221,11226,11231,11236,11241,11245,11250,11254,11259],{"type":29,"tag":183,"props":11222,"children":11223},{"style":212},[11224],{"type":38,"value":11225},"            .",{"type":29,"tag":183,"props":11227,"children":11228},{"style":206},[11229],{"type":38,"value":11230},"orElseThrow",{"type":29,"tag":183,"props":11232,"children":11233},{"style":212},[11234],{"type":38,"value":11235},"(()",{"type":29,"tag":183,"props":11237,"children":11238},{"style":200},[11239],{"type":38,"value":11240}," ->",{"type":29,"tag":183,"props":11242,"children":11243},{"style":200},[11244],{"type":38,"value":1099},{"type":29,"tag":183,"props":11246,"children":11247},{"style":206},[11248],{"type":38,"value":11249}," IllegalStateException",{"type":29,"tag":183,"props":11251,"children":11252},{"style":212},[11253],{"type":38,"value":770},{"type":29,"tag":183,"props":11255,"children":11256},{"style":1683},[11257],{"type":38,"value":11258},"\"Order not found after save\"",{"type":29,"tag":183,"props":11260,"children":11261},{"style":212},[11262],{"type":38,"value":9534},{"type":29,"tag":183,"props":11264,"children":11265},{"class":185,"line":3665},[11266],{"type":29,"tag":183,"props":11267,"children":11268},{"style":212},[11269],{"type":38,"value":1589},{"type":29,"tag":183,"props":11271,"children":11272},{"class":185,"line":3750},[11273],{"type":29,"tag":183,"props":11274,"children":11275},{"style":212},[11276],{"type":38,"value":436},{"type":29,"tag":183,"props":11278,"children":11279},{"class":185,"line":3766},[11280],{"type":29,"tag":183,"props":11281,"children":11282},{"emptyLinePlaceholder":13},[11283],{"type":38,"value":445},{"type":29,"tag":183,"props":11285,"children":11286},{"class":185,"line":3774},[11287],{"type":29,"tag":183,"props":11288,"children":11289},{"style":190},[11290],{"type":38,"value":11291},"\u002F\u002F Fake en mémoire pour les tests - sans Stripe, sans base de données\n",{"type":29,"tag":183,"props":11293,"children":11294},{"class":185,"line":3783},[11295,11299,11303,11307,11311],{"type":29,"tag":183,"props":11296,"children":11297},{"style":200},[11298],{"type":38,"value":9351},{"type":29,"tag":183,"props":11300,"children":11301},{"style":750},[11302],{"type":38,"value":9759},{"type":29,"tag":183,"props":11304,"children":11305},{"style":200},[11306],{"type":38,"value":864},{"type":29,"tag":183,"props":11308,"children":11309},{"style":750},[11310],{"type":38,"value":8754},{"type":29,"tag":183,"props":11312,"children":11313},{"style":212},[11314],{"type":38,"value":285},{"type":29,"tag":183,"props":11316,"children":11317},{"class":185,"line":3821},[11318],{"type":29,"tag":183,"props":11319,"children":11320},{"emptyLinePlaceholder":13},[11321],{"type":38,"value":445},{"type":29,"tag":183,"props":11323,"children":11324},{"class":185,"line":3941},[11325,11329,11333,11337,11341,11345,11349,11353,11357,11362,11366,11370,11374],{"type":29,"tag":183,"props":11326,"children":11327},{"style":200},[11328],{"type":38,"value":1291},{"type":29,"tag":183,"props":11330,"children":11331},{"style":200},[11332],{"type":38,"value":8324},{"type":29,"tag":183,"props":11334,"children":11335},{"style":8327},[11336],{"type":38,"value":9503},{"type":29,"tag":183,"props":11338,"children":11339},{"style":212},[11340],{"type":38,"value":1442},{"type":29,"tag":183,"props":11342,"children":11343},{"style":200},[11344],{"type":38,"value":8842},{"type":29,"tag":183,"props":11346,"children":11347},{"style":212},[11348],{"type":38,"value":2694},{"type":29,"tag":183,"props":11350,"children":11351},{"style":200},[11352],{"type":38,"value":9803},{"type":29,"tag":183,"props":11354,"children":11355},{"style":212},[11356],{"type":38,"value":1452},{"type":29,"tag":183,"props":11358,"children":11359},{"style":308},[11360],{"type":38,"value":11361}," store ",{"type":29,"tag":183,"props":11363,"children":11364},{"style":228},[11365],{"type":38,"value":8340},{"type":29,"tag":183,"props":11367,"children":11368},{"style":200},[11369],{"type":38,"value":1099},{"type":29,"tag":183,"props":11371,"children":11372},{"style":8327},[11373],{"type":38,"value":9825},{"type":29,"tag":183,"props":11375,"children":11376},{"style":212},[11377],{"type":38,"value":9830},{"type":29,"tag":183,"props":11379,"children":11380},{"class":185,"line":3963},[11381],{"type":29,"tag":183,"props":11382,"children":11383},{"emptyLinePlaceholder":13},[11384],{"type":38,"value":445},{"type":29,"tag":183,"props":11386,"children":11387},{"class":185,"line":4030},[11388,11393],{"type":29,"tag":183,"props":11389,"children":11390},{"style":839},[11391],{"type":38,"value":11392},"    @",{"type":29,"tag":183,"props":11394,"children":11395},{"style":10084},[11396],{"type":38,"value":11397},"Override\n",{"type":29,"tag":183,"props":11399,"children":11400},{"class":185,"line":4046},[11401,11405,11409,11413,11417,11421,11425,11429],{"type":29,"tag":183,"props":11402,"children":11403},{"style":200},[11404],{"type":38,"value":8441},{"type":29,"tag":183,"props":11406,"children":11407},{"style":8327},[11408],{"type":38,"value":7421},{"type":29,"tag":183,"props":11410,"children":11411},{"style":206},[11412],{"type":38,"value":5797},{"type":29,"tag":183,"props":11414,"children":11415},{"style":212},[11416],{"type":38,"value":770},{"type":29,"tag":183,"props":11418,"children":11419},{"style":8327},[11420],{"type":38,"value":8459},{"type":29,"tag":183,"props":11422,"children":11423},{"style":222},[11424],{"type":38,"value":8464},{"type":29,"tag":183,"props":11426,"children":11427},{"style":212},[11428],{"type":38,"value":272},{"type":29,"tag":183,"props":11430,"children":11431},{"style":212},[11432],{"type":38,"value":285},{"type":29,"tag":183,"props":11434,"children":11435},{"class":185,"line":4105},[11436,11440,11445,11449,11453,11457,11461,11465,11469],{"type":29,"tag":183,"props":11437,"children":11438},{"style":8327},[11439],{"type":38,"value":8480},{"type":29,"tag":183,"props":11441,"children":11442},{"style":308},[11443],{"type":38,"value":11444}," id ",{"type":29,"tag":183,"props":11446,"children":11447},{"style":228},[11448],{"type":38,"value":8340},{"type":29,"tag":183,"props":11450,"children":11451},{"style":308},[11452],{"type":38,"value":9892},{"type":29,"tag":183,"props":11454,"children":11455},{"style":212},[11456],{"type":38,"value":79},{"type":29,"tag":183,"props":11458,"children":11459},{"style":206},[11460],{"type":38,"value":9901},{"type":29,"tag":183,"props":11462,"children":11463},{"style":212},[11464],{"type":38,"value":9906},{"type":29,"tag":183,"props":11466,"children":11467},{"style":206},[11468],{"type":38,"value":9911},{"type":29,"tag":183,"props":11470,"children":11471},{"style":212},[11472],{"type":38,"value":9916},{"type":29,"tag":183,"props":11474,"children":11475},{"class":185,"line":4113},[11476,11481,11485,11489,11493,11497,11501,11505],{"type":29,"tag":183,"props":11477,"children":11478},{"style":308},[11479],{"type":38,"value":11480},"        store",{"type":29,"tag":183,"props":11482,"children":11483},{"style":212},[11484],{"type":38,"value":79},{"type":29,"tag":183,"props":11486,"children":11487},{"style":206},[11488],{"type":38,"value":9933},{"type":29,"tag":183,"props":11490,"children":11491},{"style":212},[11492],{"type":38,"value":770},{"type":29,"tag":183,"props":11494,"children":11495},{"style":308},[11496],{"type":38,"value":4227},{"type":29,"tag":183,"props":11498,"children":11499},{"style":212},[11500],{"type":38,"value":2694},{"type":29,"tag":183,"props":11502,"children":11503},{"style":308},[11504],{"type":38,"value":8464},{"type":29,"tag":183,"props":11506,"children":11507},{"style":212},[11508],{"type":38,"value":7487},{"type":29,"tag":183,"props":11510,"children":11511},{"class":185,"line":4122},[11512,11516,11520],{"type":29,"tag":183,"props":11513,"children":11514},{"style":200},[11515],{"type":38,"value":8571},{"type":29,"tag":183,"props":11517,"children":11518},{"style":308},[11519],{"type":38,"value":2872},{"type":29,"tag":183,"props":11521,"children":11522},{"style":212},[11523],{"type":38,"value":327},{"type":29,"tag":183,"props":11525,"children":11526},{"class":185,"line":4160},[11527],{"type":29,"tag":183,"props":11528,"children":11529},{"style":212},[11530],{"type":38,"value":1589},{"type":29,"tag":183,"props":11532,"children":11533},{"class":185,"line":4182},[11534],{"type":29,"tag":183,"props":11535,"children":11536},{"emptyLinePlaceholder":13},[11537],{"type":38,"value":445},{"type":29,"tag":183,"props":11539,"children":11540},{"class":185,"line":4204},[11541,11545],{"type":29,"tag":183,"props":11542,"children":11543},{"style":839},[11544],{"type":38,"value":11392},{"type":29,"tag":183,"props":11546,"children":11547},{"style":10084},[11548],{"type":38,"value":11397},{"type":29,"tag":183,"props":11550,"children":11551},{"class":185,"line":4234},[11552,11556,11561,11565,11569,11573,11577,11581,11585,11589,11593],{"type":29,"tag":183,"props":11553,"children":11554},{"style":200},[11555],{"type":38,"value":8441},{"type":29,"tag":183,"props":11557,"children":11558},{"style":8327},[11559],{"type":38,"value":11560}," Optional",{"type":29,"tag":183,"props":11562,"children":11563},{"style":212},[11564],{"type":38,"value":1442},{"type":29,"tag":183,"props":11566,"children":11567},{"style":200},[11568],{"type":38,"value":10485},{"type":29,"tag":183,"props":11570,"children":11571},{"style":212},[11572],{"type":38,"value":1452},{"type":29,"tag":183,"props":11574,"children":11575},{"style":206},[11576],{"type":38,"value":10494},{"type":29,"tag":183,"props":11578,"children":11579},{"style":212},[11580],{"type":38,"value":770},{"type":29,"tag":183,"props":11582,"children":11583},{"style":8327},[11584],{"type":38,"value":8842},{"type":29,"tag":183,"props":11586,"children":11587},{"style":222},[11588],{"type":38,"value":8559},{"type":29,"tag":183,"props":11590,"children":11591},{"style":212},[11592],{"type":38,"value":272},{"type":29,"tag":183,"props":11594,"children":11595},{"style":212},[11596],{"type":38,"value":285},{"type":29,"tag":183,"props":11598,"children":11599},{"class":185,"line":4255},[11600,11604,11608,11612,11617,11621,11626,11630,11635,11639,11643],{"type":29,"tag":183,"props":11601,"children":11602},{"style":200},[11603],{"type":38,"value":8571},{"type":29,"tag":183,"props":11605,"children":11606},{"style":308},[11607],{"type":38,"value":11560},{"type":29,"tag":183,"props":11609,"children":11610},{"style":212},[11611],{"type":38,"value":79},{"type":29,"tag":183,"props":11613,"children":11614},{"style":206},[11615],{"type":38,"value":11616},"ofNullable",{"type":29,"tag":183,"props":11618,"children":11619},{"style":212},[11620],{"type":38,"value":770},{"type":29,"tag":183,"props":11622,"children":11623},{"style":308},[11624],{"type":38,"value":11625},"store",{"type":29,"tag":183,"props":11627,"children":11628},{"style":212},[11629],{"type":38,"value":79},{"type":29,"tag":183,"props":11631,"children":11632},{"style":206},[11633],{"type":38,"value":11634},"get",{"type":29,"tag":183,"props":11636,"children":11637},{"style":212},[11638],{"type":38,"value":770},{"type":29,"tag":183,"props":11640,"children":11641},{"style":308},[11642],{"type":38,"value":9942},{"type":29,"tag":183,"props":11644,"children":11645},{"style":212},[11646],{"type":38,"value":11647},"))\n",{"type":29,"tag":183,"props":11649,"children":11650},{"class":185,"line":4289},[11651,11655,11660,11664,11669,11674,11678,11682,11686,11690,11694,11699,11703,11708],{"type":29,"tag":183,"props":11652,"children":11653},{"style":212},[11654],{"type":38,"value":11225},{"type":29,"tag":183,"props":11656,"children":11657},{"style":206},[11658],{"type":38,"value":11659},"map",{"type":29,"tag":183,"props":11661,"children":11662},{"style":212},[11663],{"type":38,"value":770},{"type":29,"tag":183,"props":11665,"children":11666},{"style":308},[11667],{"type":38,"value":11668},"data ",{"type":29,"tag":183,"props":11670,"children":11671},{"style":200},[11672],{"type":38,"value":11673},"->",{"type":29,"tag":183,"props":11675,"children":11676},{"style":200},[11677],{"type":38,"value":1099},{"type":29,"tag":183,"props":11679,"children":11680},{"style":206},[11681],{"type":38,"value":10838},{"type":29,"tag":183,"props":11683,"children":11684},{"style":212},[11685],{"type":38,"value":770},{"type":29,"tag":183,"props":11687,"children":11688},{"style":308},[11689],{"type":38,"value":9942},{"type":29,"tag":183,"props":11691,"children":11692},{"style":212},[11693],{"type":38,"value":2694},{"type":29,"tag":183,"props":11695,"children":11696},{"style":308},[11697],{"type":38,"value":11698}," data",{"type":29,"tag":183,"props":11700,"children":11701},{"style":212},[11702],{"type":38,"value":79},{"type":29,"tag":183,"props":11704,"children":11705},{"style":206},[11706],{"type":38,"value":11707},"getStatus",{"type":29,"tag":183,"props":11709,"children":11710},{"style":212},[11711],{"type":38,"value":11712},"()));\n",{"type":29,"tag":183,"props":11714,"children":11715},{"class":185,"line":4305},[11716],{"type":29,"tag":183,"props":11717,"children":11718},{"style":212},[11719],{"type":38,"value":1589},{"type":29,"tag":183,"props":11721,"children":11722},{"class":185,"line":4313},[11723],{"type":29,"tag":183,"props":11724,"children":11725},{"style":212},[11726],{"type":38,"value":436},{"type":29,"tag":183,"props":11728,"children":11729},{"class":185,"line":4322},[11730],{"type":29,"tag":183,"props":11731,"children":11732},{"emptyLinePlaceholder":13},[11733],{"type":38,"value":445},{"type":29,"tag":183,"props":11735,"children":11736},{"class":185,"line":2341},[11737,11741,11746,11750,11754],{"type":29,"tag":183,"props":11738,"children":11739},{"style":200},[11740],{"type":38,"value":9351},{"type":29,"tag":183,"props":11742,"children":11743},{"style":750},[11744],{"type":38,"value":11745}," StubPaymentGateway",{"type":29,"tag":183,"props":11747,"children":11748},{"style":200},[11749],{"type":38,"value":864},{"type":29,"tag":183,"props":11751,"children":11752},{"style":750},[11753],{"type":38,"value":10540},{"type":29,"tag":183,"props":11755,"children":11756},{"style":212},[11757],{"type":38,"value":285},{"type":29,"tag":183,"props":11759,"children":11760},{"class":185,"line":4413},[11761],{"type":29,"tag":183,"props":11762,"children":11763},{"emptyLinePlaceholder":13},[11764],{"type":38,"value":445},{"type":29,"tag":183,"props":11766,"children":11767},{"class":185,"line":11},[11768,11772,11776,11780,11785],{"type":29,"tag":183,"props":11769,"children":11770},{"style":200},[11771],{"type":38,"value":1291},{"type":29,"tag":183,"props":11773,"children":11774},{"style":200},[11775],{"type":38,"value":8324},{"type":29,"tag":183,"props":11777,"children":11778},{"style":200},[11779],{"type":38,"value":9995},{"type":29,"tag":183,"props":11781,"children":11782},{"style":308},[11783],{"type":38,"value":11784}," shouldSucceed",{"type":29,"tag":183,"props":11786,"children":11787},{"style":212},[11788],{"type":38,"value":327},{"type":29,"tag":183,"props":11790,"children":11791},{"class":185,"line":4450},[11792],{"type":29,"tag":183,"props":11793,"children":11794},{"emptyLinePlaceholder":13},[11795],{"type":38,"value":445},{"type":29,"tag":183,"props":11797,"children":11799},{"class":185,"line":11798},67,[11800,11805,11809,11813,11817,11821],{"type":29,"tag":183,"props":11801,"children":11802},{"style":206},[11803],{"type":38,"value":11804},"    StubPaymentGateway",{"type":29,"tag":183,"props":11806,"children":11807},{"style":212},[11808],{"type":38,"value":770},{"type":29,"tag":183,"props":11810,"children":11811},{"style":200},[11812],{"type":38,"value":4741},{"type":29,"tag":183,"props":11814,"children":11815},{"style":222},[11816],{"type":38,"value":11784},{"type":29,"tag":183,"props":11818,"children":11819},{"style":212},[11820],{"type":38,"value":272},{"type":29,"tag":183,"props":11822,"children":11823},{"style":212},[11824],{"type":38,"value":285},{"type":29,"tag":183,"props":11826,"children":11828},{"class":185,"line":11827},68,[11829,11833,11837,11842,11846,11850],{"type":29,"tag":183,"props":11830,"children":11831},{"style":1481},[11832],{"type":38,"value":9016},{"type":29,"tag":183,"props":11834,"children":11835},{"style":212},[11836],{"type":38,"value":79},{"type":29,"tag":183,"props":11838,"children":11839},{"style":308},[11840],{"type":38,"value":11841},"shouldSucceed ",{"type":29,"tag":183,"props":11843,"children":11844},{"style":228},[11845],{"type":38,"value":8340},{"type":29,"tag":183,"props":11847,"children":11848},{"style":308},[11849],{"type":38,"value":11784},{"type":29,"tag":183,"props":11851,"children":11852},{"style":212},[11853],{"type":38,"value":327},{"type":29,"tag":183,"props":11855,"children":11857},{"class":185,"line":11856},69,[11858],{"type":29,"tag":183,"props":11859,"children":11860},{"style":212},[11861],{"type":38,"value":1589},{"type":29,"tag":183,"props":11863,"children":11865},{"class":185,"line":11864},70,[11866],{"type":29,"tag":183,"props":11867,"children":11868},{"emptyLinePlaceholder":13},[11869],{"type":38,"value":445},{"type":29,"tag":183,"props":11871,"children":11873},{"class":185,"line":11872},71,[11874,11878],{"type":29,"tag":183,"props":11875,"children":11876},{"style":839},[11877],{"type":38,"value":11392},{"type":29,"tag":183,"props":11879,"children":11880},{"style":10084},[11881],{"type":38,"value":11397},{"type":29,"tag":183,"props":11883,"children":11885},{"class":185,"line":11884},72,[11886,11890,11895,11899,11903,11907,11911,11915,11919,11923,11927,11931,11935,11939],{"type":29,"tag":183,"props":11887,"children":11888},{"style":200},[11889],{"type":38,"value":8441},{"type":29,"tag":183,"props":11891,"children":11892},{"style":8327},[11893],{"type":38,"value":11894}," PaymentResult",{"type":29,"tag":183,"props":11896,"children":11897},{"style":206},[11898],{"type":38,"value":10557},{"type":29,"tag":183,"props":11900,"children":11901},{"style":212},[11902],{"type":38,"value":770},{"type":29,"tag":183,"props":11904,"children":11905},{"style":8327},[11906],{"type":38,"value":10566},{"type":29,"tag":183,"props":11908,"children":11909},{"style":222},[11910],{"type":38,"value":10571},{"type":29,"tag":183,"props":11912,"children":11913},{"style":212},[11914],{"type":38,"value":2694},{"type":29,"tag":183,"props":11916,"children":11917},{"style":8327},[11918],{"type":38,"value":7421},{"type":29,"tag":183,"props":11920,"children":11921},{"style":222},[11922],{"type":38,"value":6332},{"type":29,"tag":183,"props":11924,"children":11925},{"style":212},[11926],{"type":38,"value":2694},{"type":29,"tag":183,"props":11928,"children":11929},{"style":8327},[11930],{"type":38,"value":7421},{"type":29,"tag":183,"props":11932,"children":11933},{"style":222},[11934],{"type":38,"value":10596},{"type":29,"tag":183,"props":11936,"children":11937},{"style":212},[11938],{"type":38,"value":272},{"type":29,"tag":183,"props":11940,"children":11941},{"style":212},[11942],{"type":38,"value":285},{"type":29,"tag":183,"props":11944,"children":11946},{"class":185,"line":11945},73,[11947,11951],{"type":29,"tag":183,"props":11948,"children":11949},{"style":200},[11950],{"type":38,"value":8571},{"type":29,"tag":183,"props":11952,"children":11953},{"style":308},[11954],{"type":38,"value":11955}," shouldSucceed\n",{"type":29,"tag":183,"props":11957,"children":11959},{"class":185,"line":11958},74,[11960,11965,11969,11973,11978,11982,11987],{"type":29,"tag":183,"props":11961,"children":11962},{"style":200},[11963],{"type":38,"value":11964},"            ?",{"type":29,"tag":183,"props":11966,"children":11967},{"style":308},[11968],{"type":38,"value":11894},{"type":29,"tag":183,"props":11970,"children":11971},{"style":212},[11972],{"type":38,"value":79},{"type":29,"tag":183,"props":11974,"children":11975},{"style":206},[11976],{"type":38,"value":11977},"success",{"type":29,"tag":183,"props":11979,"children":11980},{"style":212},[11981],{"type":38,"value":770},{"type":29,"tag":183,"props":11983,"children":11984},{"style":1683},[11985],{"type":38,"value":11986},"\"txn-456\"",{"type":29,"tag":183,"props":11988,"children":11989},{"style":212},[11990],{"type":38,"value":11172},{"type":29,"tag":183,"props":11992,"children":11994},{"class":185,"line":11993},75,[11995,12000,12004,12008,12013,12017,12022],{"type":29,"tag":183,"props":11996,"children":11997},{"style":200},[11998],{"type":38,"value":11999},"            :",{"type":29,"tag":183,"props":12001,"children":12002},{"style":308},[12003],{"type":38,"value":11894},{"type":29,"tag":183,"props":12005,"children":12006},{"style":212},[12007],{"type":38,"value":79},{"type":29,"tag":183,"props":12009,"children":12010},{"style":206},[12011],{"type":38,"value":12012},"failure",{"type":29,"tag":183,"props":12014,"children":12015},{"style":212},[12016],{"type":38,"value":770},{"type":29,"tag":183,"props":12018,"children":12019},{"style":1683},[12020],{"type":38,"value":12021},"\"CARD_DECLINED\"",{"type":29,"tag":183,"props":12023,"children":12024},{"style":212},[12025],{"type":38,"value":7487},{"type":29,"tag":183,"props":12027,"children":12029},{"class":185,"line":12028},76,[12030],{"type":29,"tag":183,"props":12031,"children":12032},{"style":212},[12033],{"type":38,"value":1589},{"type":29,"tag":183,"props":12035,"children":12037},{"class":185,"line":12036},77,[12038],{"type":29,"tag":183,"props":12039,"children":12040},{"style":212},[12041],{"type":38,"value":436},{"type":29,"tag":183,"props":12043,"children":12045},{"class":185,"line":12044},78,[12046],{"type":29,"tag":183,"props":12047,"children":12048},{"emptyLinePlaceholder":13},[12049],{"type":38,"value":445},{"type":29,"tag":183,"props":12051,"children":12053},{"class":185,"line":12052},79,[12054],{"type":29,"tag":183,"props":12055,"children":12056},{"style":190},[12057],{"type":38,"value":12058},"\u002F\u002F Test JUnit 5 - s'exécute en millisecondes, sans infra\n",{"type":29,"tag":183,"props":12060,"children":12062},{"class":185,"line":12061},80,[12063,12067,12072],{"type":29,"tag":183,"props":12064,"children":12065},{"style":200},[12066],{"type":38,"value":9351},{"type":29,"tag":183,"props":12068,"children":12069},{"style":750},[12070],{"type":38,"value":12071}," OrderServiceTest",{"type":29,"tag":183,"props":12073,"children":12074},{"style":212},[12075],{"type":38,"value":285},{"type":29,"tag":183,"props":12077,"children":12079},{"class":185,"line":12078},81,[12080],{"type":29,"tag":183,"props":12081,"children":12082},{"emptyLinePlaceholder":13},[12083],{"type":38,"value":445},{"type":29,"tag":183,"props":12085,"children":12087},{"class":185,"line":12086},82,[12088,12092],{"type":29,"tag":183,"props":12089,"children":12090},{"style":839},[12091],{"type":38,"value":11392},{"type":29,"tag":183,"props":12093,"children":12094},{"style":10084},[12095],{"type":38,"value":10087},{"type":29,"tag":183,"props":12097,"children":12099},{"class":185,"line":12098},83,[12100,12104,12109,12113],{"type":29,"tag":183,"props":12101,"children":12102},{"style":200},[12103],{"type":38,"value":8828},{"type":29,"tag":183,"props":12105,"children":12106},{"style":206},[12107],{"type":38,"value":12108}," shouldCreateOrderWithSuccessfulPayment",{"type":29,"tag":183,"props":12110,"children":12111},{"style":212},[12112],{"type":38,"value":1108},{"type":29,"tag":183,"props":12114,"children":12115},{"style":212},[12116],{"type":38,"value":285},{"type":29,"tag":183,"props":12118,"children":12120},{"class":185,"line":12119},84,[12121,12126,12130,12134,12138,12142],{"type":29,"tag":183,"props":12122,"children":12123},{"style":8327},[12124],{"type":38,"value":12125},"        OrderRepository",{"type":29,"tag":183,"props":12127,"children":12128},{"style":308},[12129],{"type":38,"value":9600},{"type":29,"tag":183,"props":12131,"children":12132},{"style":228},[12133],{"type":38,"value":8340},{"type":29,"tag":183,"props":12135,"children":12136},{"style":200},[12137],{"type":38,"value":1099},{"type":29,"tag":183,"props":12139,"children":12140},{"style":206},[12141],{"type":38,"value":9759},{"type":29,"tag":183,"props":12143,"children":12144},{"style":212},[12145],{"type":38,"value":9916},{"type":29,"tag":183,"props":12147,"children":12149},{"class":185,"line":12148},85,[12150,12155,12160,12164,12168,12172,12176,12181],{"type":29,"tag":183,"props":12151,"children":12152},{"style":8327},[12153],{"type":38,"value":12154},"        PaymentGateway",{"type":29,"tag":183,"props":12156,"children":12157},{"style":308},[12158],{"type":38,"value":12159}," payment ",{"type":29,"tag":183,"props":12161,"children":12162},{"style":228},[12163],{"type":38,"value":8340},{"type":29,"tag":183,"props":12165,"children":12166},{"style":200},[12167],{"type":38,"value":1099},{"type":29,"tag":183,"props":12169,"children":12170},{"style":206},[12171],{"type":38,"value":11745},{"type":29,"tag":183,"props":12173,"children":12174},{"style":212},[12175],{"type":38,"value":770},{"type":29,"tag":183,"props":12177,"children":12178},{"style":1481},[12179],{"type":38,"value":12180},"true",{"type":29,"tag":183,"props":12182,"children":12183},{"style":212},[12184],{"type":38,"value":7487},{"type":29,"tag":183,"props":12186,"children":12188},{"class":185,"line":12187},86,[12189,12194,12198,12202,12206,12210,12214,12218,12222,12226],{"type":29,"tag":183,"props":12190,"children":12191},{"style":8327},[12192],{"type":38,"value":12193},"        OrderService",{"type":29,"tag":183,"props":12195,"children":12196},{"style":308},[12197],{"type":38,"value":10178},{"type":29,"tag":183,"props":12199,"children":12200},{"style":228},[12201],{"type":38,"value":8340},{"type":29,"tag":183,"props":12203,"children":12204},{"style":200},[12205],{"type":38,"value":1099},{"type":29,"tag":183,"props":12207,"children":12208},{"style":206},[12209],{"type":38,"value":8301},{"type":29,"tag":183,"props":12211,"children":12212},{"style":212},[12213],{"type":38,"value":770},{"type":29,"tag":183,"props":12215,"children":12216},{"style":308},[12217],{"type":38,"value":9705},{"type":29,"tag":183,"props":12219,"children":12220},{"style":212},[12221],{"type":38,"value":2694},{"type":29,"tag":183,"props":12223,"children":12224},{"style":308},[12225],{"type":38,"value":10703},{"type":29,"tag":183,"props":12227,"children":12228},{"style":212},[12229],{"type":38,"value":7487},{"type":29,"tag":183,"props":12231,"children":12233},{"class":185,"line":12232},87,[12234],{"type":29,"tag":183,"props":12235,"children":12236},{"emptyLinePlaceholder":13},[12237],{"type":38,"value":445},{"type":29,"tag":183,"props":12239,"children":12241},{"class":185,"line":12240},88,[12242,12247,12252,12256,12260,12264,12269],{"type":29,"tag":183,"props":12243,"children":12244},{"style":8327},[12245],{"type":38,"value":12246},"        Order",{"type":29,"tag":183,"props":12248,"children":12249},{"style":308},[12250],{"type":38,"value":12251}," order ",{"type":29,"tag":183,"props":12253,"children":12254},{"style":228},[12255],{"type":38,"value":8340},{"type":29,"tag":183,"props":12257,"children":12258},{"style":308},[12259],{"type":38,"value":10237},{"type":29,"tag":183,"props":12261,"children":12262},{"style":212},[12263],{"type":38,"value":79},{"type":29,"tag":183,"props":12265,"children":12266},{"style":206},[12267],{"type":38,"value":12268},"createPaidOrder",{"type":29,"tag":183,"props":12270,"children":12271},{"style":212},[12272],{"type":38,"value":215},{"type":29,"tag":183,"props":12274,"children":12276},{"class":185,"line":12275},89,[12277,12282,12286,12290,12294,12299,12303,12308,12313,12318,12322,12327],{"type":29,"tag":183,"props":12278,"children":12279},{"style":200},[12280],{"type":38,"value":12281},"            new",{"type":29,"tag":183,"props":12283,"children":12284},{"style":206},[12285],{"type":38,"value":9803},{"type":29,"tag":183,"props":12287,"children":12288},{"style":212},[12289],{"type":38,"value":770},{"type":29,"tag":183,"props":12291,"children":12292},{"style":200},[12293],{"type":38,"value":1628},{"type":29,"tag":183,"props":12295,"children":12296},{"style":206},[12297],{"type":38,"value":12298}," BigDecimal",{"type":29,"tag":183,"props":12300,"children":12301},{"style":212},[12302],{"type":38,"value":770},{"type":29,"tag":183,"props":12304,"children":12305},{"style":1683},[12306],{"type":38,"value":12307},"\"1000\"",{"type":29,"tag":183,"props":12309,"children":12310},{"style":212},[12311],{"type":38,"value":12312},"),",{"type":29,"tag":183,"props":12314,"children":12315},{"style":1683},[12316],{"type":38,"value":12317}," \"EUR\"",{"type":29,"tag":183,"props":12319,"children":12320},{"style":212},[12321],{"type":38,"value":2694},{"type":29,"tag":183,"props":12323,"children":12324},{"style":1683},[12325],{"type":38,"value":12326}," \"pm-123\"",{"type":29,"tag":183,"props":12328,"children":12329},{"style":212},[12330],{"type":38,"value":11172},{"type":29,"tag":183,"props":12332,"children":12334},{"class":185,"line":12333},90,[12335],{"type":29,"tag":183,"props":12336,"children":12337},{"style":212},[12338],{"type":38,"value":10967},{"type":29,"tag":183,"props":12340,"children":12342},{"class":185,"line":12341},91,[12343],{"type":29,"tag":183,"props":12344,"children":12345},{"emptyLinePlaceholder":13},[12346],{"type":38,"value":445},{"type":29,"tag":183,"props":12348,"children":12350},{"class":185,"line":12349},92,[12351,12356,12360,12364,12368,12372,12376,12381,12385,12389],{"type":29,"tag":183,"props":12352,"children":12353},{"style":206},[12354],{"type":38,"value":12355},"        assertEquals",{"type":29,"tag":183,"props":12357,"children":12358},{"style":212},[12359],{"type":38,"value":770},{"type":29,"tag":183,"props":12361,"children":12362},{"style":308},[12363],{"type":38,"value":11158},{"type":29,"tag":183,"props":12365,"children":12366},{"style":212},[12367],{"type":38,"value":79},{"type":29,"tag":183,"props":12369,"children":12370},{"style":308},[12371],{"type":38,"value":11167},{"type":29,"tag":183,"props":12373,"children":12374},{"style":212},[12375],{"type":38,"value":2694},{"type":29,"tag":183,"props":12377,"children":12378},{"style":308},[12379],{"type":38,"value":12380}," order",{"type":29,"tag":183,"props":12382,"children":12383},{"style":212},[12384],{"type":38,"value":79},{"type":29,"tag":183,"props":12386,"children":12387},{"style":206},[12388],{"type":38,"value":11707},{"type":29,"tag":183,"props":12390,"children":12391},{"style":212},[12392],{"type":38,"value":11052},{"type":29,"tag":183,"props":12394,"children":12396},{"class":185,"line":12395},93,[12397],{"type":29,"tag":183,"props":12398,"children":12399},{"style":212},[12400],{"type":38,"value":1589},{"type":29,"tag":183,"props":12402,"children":12404},{"class":185,"line":12403},94,[12405],{"type":29,"tag":183,"props":12406,"children":12407},{"emptyLinePlaceholder":13},[12408],{"type":38,"value":445},{"type":29,"tag":183,"props":12410,"children":12412},{"class":185,"line":12411},95,[12413,12417],{"type":29,"tag":183,"props":12414,"children":12415},{"style":839},[12416],{"type":38,"value":11392},{"type":29,"tag":183,"props":12418,"children":12419},{"style":10084},[12420],{"type":38,"value":10087},{"type":29,"tag":183,"props":12422,"children":12424},{"class":185,"line":12423},96,[12425,12429,12434,12438],{"type":29,"tag":183,"props":12426,"children":12427},{"style":200},[12428],{"type":38,"value":8828},{"type":29,"tag":183,"props":12430,"children":12431},{"style":206},[12432],{"type":38,"value":12433}," shouldThrowWhenPaymentFails",{"type":29,"tag":183,"props":12435,"children":12436},{"style":212},[12437],{"type":38,"value":1108},{"type":29,"tag":183,"props":12439,"children":12440},{"style":212},[12441],{"type":38,"value":285},{"type":29,"tag":183,"props":12443,"children":12445},{"class":185,"line":12444},97,[12446,12450,12454,12458,12462,12466],{"type":29,"tag":183,"props":12447,"children":12448},{"style":8327},[12449],{"type":38,"value":12193},{"type":29,"tag":183,"props":12451,"children":12452},{"style":308},[12453],{"type":38,"value":10178},{"type":29,"tag":183,"props":12455,"children":12456},{"style":228},[12457],{"type":38,"value":8340},{"type":29,"tag":183,"props":12459,"children":12460},{"style":200},[12461],{"type":38,"value":1099},{"type":29,"tag":183,"props":12463,"children":12464},{"style":206},[12465],{"type":38,"value":8301},{"type":29,"tag":183,"props":12467,"children":12468},{"style":212},[12469],{"type":38,"value":215},{"type":29,"tag":183,"props":12471,"children":12473},{"class":185,"line":12472},98,[12474,12478,12482],{"type":29,"tag":183,"props":12475,"children":12476},{"style":200},[12477],{"type":38,"value":12281},{"type":29,"tag":183,"props":12479,"children":12480},{"style":206},[12481],{"type":38,"value":9759},{"type":29,"tag":183,"props":12483,"children":12484},{"style":212},[12485],{"type":38,"value":10919},{"type":29,"tag":183,"props":12487,"children":12489},{"class":185,"line":12488},99,[12490,12494,12498,12502,12507],{"type":29,"tag":183,"props":12491,"children":12492},{"style":200},[12493],{"type":38,"value":12281},{"type":29,"tag":183,"props":12495,"children":12496},{"style":206},[12497],{"type":38,"value":11745},{"type":29,"tag":183,"props":12499,"children":12500},{"style":212},[12501],{"type":38,"value":770},{"type":29,"tag":183,"props":12503,"children":12504},{"style":1481},[12505],{"type":38,"value":12506},"false",{"type":29,"tag":183,"props":12508,"children":12509},{"style":212},[12510],{"type":38,"value":11172},{"type":29,"tag":183,"props":12512,"children":12514},{"class":185,"line":12513},100,[12515],{"type":29,"tag":183,"props":12516,"children":12517},{"style":212},[12518],{"type":38,"value":10967},{"type":29,"tag":183,"props":12520,"children":12522},{"class":185,"line":12521},101,[12523],{"type":29,"tag":183,"props":12524,"children":12525},{"emptyLinePlaceholder":13},[12526],{"type":38,"value":445},{"type":29,"tag":183,"props":12528,"children":12530},{"class":185,"line":12529},102,[12531,12536,12540,12545,12549,12553,12557,12561],{"type":29,"tag":183,"props":12532,"children":12533},{"style":206},[12534],{"type":38,"value":12535},"        assertThrows",{"type":29,"tag":183,"props":12537,"children":12538},{"style":212},[12539],{"type":38,"value":770},{"type":29,"tag":183,"props":12541,"children":12542},{"style":308},[12543],{"type":38,"value":12544},"PaymentFailedException",{"type":29,"tag":183,"props":12546,"children":12547},{"style":212},[12548],{"type":38,"value":79},{"type":29,"tag":183,"props":12550,"children":12551},{"style":308},[12552],{"type":38,"value":9351},{"type":29,"tag":183,"props":12554,"children":12555},{"style":212},[12556],{"type":38,"value":2694},{"type":29,"tag":183,"props":12558,"children":12559},{"style":212},[12560],{"type":38,"value":5725},{"type":29,"tag":183,"props":12562,"children":12563},{"style":200},[12564],{"type":38,"value":12565}," ->\n",{"type":29,"tag":183,"props":12567,"children":12569},{"class":185,"line":12568},103,[12570,12575,12579,12583,12587,12591,12595,12599,12603,12607,12611,12615,12619,12623,12627,12631],{"type":29,"tag":183,"props":12571,"children":12572},{"style":308},[12573],{"type":38,"value":12574},"            service",{"type":29,"tag":183,"props":12576,"children":12577},{"style":212},[12578],{"type":38,"value":79},{"type":29,"tag":183,"props":12580,"children":12581},{"style":206},[12582],{"type":38,"value":12268},{"type":29,"tag":183,"props":12584,"children":12585},{"style":212},[12586],{"type":38,"value":770},{"type":29,"tag":183,"props":12588,"children":12589},{"style":200},[12590],{"type":38,"value":1628},{"type":29,"tag":183,"props":12592,"children":12593},{"style":206},[12594],{"type":38,"value":9803},{"type":29,"tag":183,"props":12596,"children":12597},{"style":212},[12598],{"type":38,"value":770},{"type":29,"tag":183,"props":12600,"children":12601},{"style":200},[12602],{"type":38,"value":1628},{"type":29,"tag":183,"props":12604,"children":12605},{"style":206},[12606],{"type":38,"value":12298},{"type":29,"tag":183,"props":12608,"children":12609},{"style":212},[12610],{"type":38,"value":770},{"type":29,"tag":183,"props":12612,"children":12613},{"style":1683},[12614],{"type":38,"value":12307},{"type":29,"tag":183,"props":12616,"children":12617},{"style":212},[12618],{"type":38,"value":12312},{"type":29,"tag":183,"props":12620,"children":12621},{"style":1683},[12622],{"type":38,"value":12317},{"type":29,"tag":183,"props":12624,"children":12625},{"style":212},[12626],{"type":38,"value":2694},{"type":29,"tag":183,"props":12628,"children":12629},{"style":1683},[12630],{"type":38,"value":12326},{"type":29,"tag":183,"props":12632,"children":12633},{"style":212},[12634],{"type":38,"value":11647},{"type":29,"tag":183,"props":12636,"children":12638},{"class":185,"line":12637},104,[12639],{"type":29,"tag":183,"props":12640,"children":12641},{"style":212},[12642],{"type":38,"value":10967},{"type":29,"tag":183,"props":12644,"children":12646},{"class":185,"line":12645},105,[12647],{"type":29,"tag":183,"props":12648,"children":12649},{"style":212},[12650],{"type":38,"value":1589},{"type":29,"tag":183,"props":12652,"children":12654},{"class":185,"line":12653},106,[12655],{"type":29,"tag":183,"props":12656,"children":12657},{"style":212},[12658],{"type":38,"value":436},{"type":29,"tag":30,"props":12660,"children":12661},{},[12662,12667,12669,12675,12677,12683,12684,12690],{"type":29,"tag":34,"props":12663,"children":12664},{},[12665],{"type":38,"value":12666},"L'avantage Java\u002FSpring :",{"type":38,"value":12668}," les interfaces sont des contrats vérifiés à la compilation. Si un adapter ne respecte pas le port, ",{"type":29,"tag":156,"props":12670,"children":12672},{"className":12671},[],[12673],{"type":38,"value":12674},"javac",{"type":38,"value":12676}," rejette le code avant l'exécution. Spring injecte automatiquement l'adapter correct (",{"type":29,"tag":156,"props":12678,"children":12680},{"className":12679},[],[12681],{"type":38,"value":12682},"@Repository",{"type":38,"value":4468},{"type":29,"tag":156,"props":12685,"children":12687},{"className":12686},[],[12688],{"type":38,"value":12689},"@Component",{"type":38,"value":12691},") en production : le service métier ne sait pas quelle implémentation tourne.",{"type":29,"tag":46,"props":12693,"children":12694},{},[],{"type":29,"tag":50,"props":12696,"children":12698},{"id":12697},"exemple-3-java-le-dip-avec-spring",[12699],{"type":38,"value":12700},"Exemple 3 : Java, le DIP avec Spring",{"type":29,"tag":173,"props":12702,"children":12704},{"code":12703,"language":8271,"meta":8,"className":8272,"style":8},"\u002F\u002F L'abstraction\npublic interface NotificationService {\n    void sendOrderConfirmation(String userId, String orderId);\n    void sendShippingUpdate(String userId, String orderId, String trackingCode);\n}\n\n\u002F\u002F Le module de haut niveau (service métier)\n@Service\npublic class OrderFulfillmentService {\n\n    private final OrderRepository orderRepository;\n    private final NotificationService notificationService;\n\n    public OrderFulfillmentService(\n            OrderRepository orderRepository,\n            NotificationService notificationService) {\n        this.orderRepository = orderRepository;\n        this.notificationService = notificationService;\n    }\n\n    public void fulfillOrder(String orderId) {\n        Order order = orderRepository.findById(orderId)\n            .orElseThrow(() -> new OrderNotFoundException(orderId));\n\n        order.setStatus(OrderStatus.FULFILLING);\n        orderRepository.save(order);\n\n        notificationService.sendOrderConfirmation(order.getUserId(), orderId);\n    }\n}\n\n\u002F\u002F Implémentation de test\n@Service\n@Profile(\"test\")\npublic class MockNotificationService implements NotificationService {\n\n    private final List\u003CString> sentNotifications = new ArrayList\u003C>();\n\n    @Override\n    public void sendOrderConfirmation(String userId, String orderId) {\n        sentNotifications.add(\"confirmation:\" + userId + \":\" + orderId);\n    }\n}\n",[12705],{"type":29,"tag":156,"props":12706,"children":12707},{"__ignoreMap":8},[12708,12716,12736,12777,12830,12837,12844,12852,12863,12883,12890,12914,12938,12945,12960,12976,12996,13024,13052,13059,13066,13102,13141,13181,13188,13226,13255,13262,13308,13315,13322,13329,13337,13348,13373,13401,13408,13458,13465,13476,13523,13579,13586],{"type":29,"tag":183,"props":12709,"children":12710},{"class":185,"line":186},[12711],{"type":29,"tag":183,"props":12712,"children":12713},{"style":190},[12714],{"type":38,"value":12715},"\u002F\u002F L'abstraction\n",{"type":29,"tag":183,"props":12717,"children":12718},{"class":185,"line":196},[12719,12723,12727,12732],{"type":29,"tag":183,"props":12720,"children":12721},{"style":200},[12722],{"type":38,"value":8292},{"type":29,"tag":183,"props":12724,"children":12725},{"style":200},[12726],{"type":38,"value":747},{"type":29,"tag":183,"props":12728,"children":12729},{"style":750},[12730],{"type":38,"value":12731}," NotificationService",{"type":29,"tag":183,"props":12733,"children":12734},{"style":212},[12735],{"type":38,"value":285},{"type":29,"tag":183,"props":12737,"children":12738},{"class":185,"line":218},[12739,12743,12748,12752,12756,12761,12765,12769,12773],{"type":29,"tag":183,"props":12740,"children":12741},{"style":200},[12742],{"type":38,"value":8828},{"type":29,"tag":183,"props":12744,"children":12745},{"style":206},[12746],{"type":38,"value":12747}," sendOrderConfirmation",{"type":29,"tag":183,"props":12749,"children":12750},{"style":212},[12751],{"type":38,"value":770},{"type":29,"tag":183,"props":12753,"children":12754},{"style":8327},[12755],{"type":38,"value":8842},{"type":29,"tag":183,"props":12757,"children":12758},{"style":222},[12759],{"type":38,"value":12760}," userId",{"type":29,"tag":183,"props":12762,"children":12763},{"style":212},[12764],{"type":38,"value":2694},{"type":29,"tag":183,"props":12766,"children":12767},{"style":8327},[12768],{"type":38,"value":7421},{"type":29,"tag":183,"props":12770,"children":12771},{"style":222},[12772],{"type":38,"value":8559},{"type":29,"tag":183,"props":12774,"children":12775},{"style":212},[12776],{"type":38,"value":7487},{"type":29,"tag":183,"props":12778,"children":12779},{"class":185,"line":245},[12780,12784,12789,12793,12797,12801,12805,12809,12813,12817,12821,12826],{"type":29,"tag":183,"props":12781,"children":12782},{"style":200},[12783],{"type":38,"value":8828},{"type":29,"tag":183,"props":12785,"children":12786},{"style":206},[12787],{"type":38,"value":12788}," sendShippingUpdate",{"type":29,"tag":183,"props":12790,"children":12791},{"style":212},[12792],{"type":38,"value":770},{"type":29,"tag":183,"props":12794,"children":12795},{"style":8327},[12796],{"type":38,"value":8842},{"type":29,"tag":183,"props":12798,"children":12799},{"style":222},[12800],{"type":38,"value":12760},{"type":29,"tag":183,"props":12802,"children":12803},{"style":212},[12804],{"type":38,"value":2694},{"type":29,"tag":183,"props":12806,"children":12807},{"style":8327},[12808],{"type":38,"value":7421},{"type":29,"tag":183,"props":12810,"children":12811},{"style":222},[12812],{"type":38,"value":8559},{"type":29,"tag":183,"props":12814,"children":12815},{"style":212},[12816],{"type":38,"value":2694},{"type":29,"tag":183,"props":12818,"children":12819},{"style":8327},[12820],{"type":38,"value":7421},{"type":29,"tag":183,"props":12822,"children":12823},{"style":222},[12824],{"type":38,"value":12825}," trackingCode",{"type":29,"tag":183,"props":12827,"children":12828},{"style":212},[12829],{"type":38,"value":7487},{"type":29,"tag":183,"props":12831,"children":12832},{"class":185,"line":266},[12833],{"type":29,"tag":183,"props":12834,"children":12835},{"style":212},[12836],{"type":38,"value":436},{"type":29,"tag":183,"props":12838,"children":12839},{"class":185,"line":288},[12840],{"type":29,"tag":183,"props":12841,"children":12842},{"emptyLinePlaceholder":13},[12843],{"type":38,"value":445},{"type":29,"tag":183,"props":12845,"children":12846},{"class":185,"line":330},[12847],{"type":29,"tag":183,"props":12848,"children":12849},{"style":190},[12850],{"type":38,"value":12851},"\u002F\u002F Le module de haut niveau (service métier)\n",{"type":29,"tag":183,"props":12853,"children":12854},{"class":185,"line":374},[12855,12859],{"type":29,"tag":183,"props":12856,"children":12857},{"style":839},[12858],{"type":38,"value":831},{"type":29,"tag":183,"props":12860,"children":12861},{"style":10084},[12862],{"type":38,"value":10634},{"type":29,"tag":183,"props":12864,"children":12865},{"class":185,"line":430},[12866,12870,12874,12879],{"type":29,"tag":183,"props":12867,"children":12868},{"style":200},[12869],{"type":38,"value":8292},{"type":29,"tag":183,"props":12871,"children":12872},{"style":200},[12873],{"type":38,"value":854},{"type":29,"tag":183,"props":12875,"children":12876},{"style":750},[12877],{"type":38,"value":12878}," OrderFulfillmentService",{"type":29,"tag":183,"props":12880,"children":12881},{"style":212},[12882],{"type":38,"value":285},{"type":29,"tag":183,"props":12884,"children":12885},{"class":185,"line":439},[12886],{"type":29,"tag":183,"props":12887,"children":12888},{"emptyLinePlaceholder":13},[12889],{"type":38,"value":445},{"type":29,"tag":183,"props":12891,"children":12892},{"class":185,"line":448},[12893,12897,12901,12905,12910],{"type":29,"tag":183,"props":12894,"children":12895},{"style":200},[12896],{"type":38,"value":1291},{"type":29,"tag":183,"props":12898,"children":12899},{"style":200},[12900],{"type":38,"value":8324},{"type":29,"tag":183,"props":12902,"children":12903},{"style":8327},[12904],{"type":38,"value":8754},{"type":29,"tag":183,"props":12906,"children":12907},{"style":308},[12908],{"type":38,"value":12909}," orderRepository",{"type":29,"tag":183,"props":12911,"children":12912},{"style":212},[12913],{"type":38,"value":327},{"type":29,"tag":183,"props":12915,"children":12916},{"class":185,"line":457},[12917,12921,12925,12929,12934],{"type":29,"tag":183,"props":12918,"children":12919},{"style":200},[12920],{"type":38,"value":1291},{"type":29,"tag":183,"props":12922,"children":12923},{"style":200},[12924],{"type":38,"value":8324},{"type":29,"tag":183,"props":12926,"children":12927},{"style":8327},[12928],{"type":38,"value":12731},{"type":29,"tag":183,"props":12930,"children":12931},{"style":308},[12932],{"type":38,"value":12933}," notificationService",{"type":29,"tag":183,"props":12935,"children":12936},{"style":212},[12937],{"type":38,"value":327},{"type":29,"tag":183,"props":12939,"children":12940},{"class":185,"line":474},[12941],{"type":29,"tag":183,"props":12942,"children":12943},{"emptyLinePlaceholder":13},[12944],{"type":38,"value":445},{"type":29,"tag":183,"props":12946,"children":12947},{"class":185,"line":495},[12948,12952,12956],{"type":29,"tag":183,"props":12949,"children":12950},{"style":200},[12951],{"type":38,"value":8441},{"type":29,"tag":183,"props":12953,"children":12954},{"style":206},[12955],{"type":38,"value":12878},{"type":29,"tag":183,"props":12957,"children":12958},{"style":212},[12959],{"type":38,"value":215},{"type":29,"tag":183,"props":12961,"children":12962},{"class":185,"line":516},[12963,12968,12972],{"type":29,"tag":183,"props":12964,"children":12965},{"style":8327},[12966],{"type":38,"value":12967},"            OrderRepository",{"type":29,"tag":183,"props":12969,"children":12970},{"style":222},[12971],{"type":38,"value":12909},{"type":29,"tag":183,"props":12973,"children":12974},{"style":212},[12975],{"type":38,"value":242},{"type":29,"tag":183,"props":12977,"children":12978},{"class":185,"line":536},[12979,12984,12988,12992],{"type":29,"tag":183,"props":12980,"children":12981},{"style":8327},[12982],{"type":38,"value":12983},"            NotificationService",{"type":29,"tag":183,"props":12985,"children":12986},{"style":222},[12987],{"type":38,"value":12933},{"type":29,"tag":183,"props":12989,"children":12990},{"style":212},[12991],{"type":38,"value":272},{"type":29,"tag":183,"props":12993,"children":12994},{"style":212},[12995],{"type":38,"value":285},{"type":29,"tag":183,"props":12997,"children":12998},{"class":185,"line":570},[12999,13003,13007,13012,13016,13020],{"type":29,"tag":183,"props":13000,"children":13001},{"style":1481},[13002],{"type":38,"value":9016},{"type":29,"tag":183,"props":13004,"children":13005},{"style":212},[13006],{"type":38,"value":79},{"type":29,"tag":183,"props":13008,"children":13009},{"style":308},[13010],{"type":38,"value":13011},"orderRepository ",{"type":29,"tag":183,"props":13013,"children":13014},{"style":228},[13015],{"type":38,"value":8340},{"type":29,"tag":183,"props":13017,"children":13018},{"style":308},[13019],{"type":38,"value":12909},{"type":29,"tag":183,"props":13021,"children":13022},{"style":212},[13023],{"type":38,"value":327},{"type":29,"tag":183,"props":13025,"children":13026},{"class":185,"line":613},[13027,13031,13035,13040,13044,13048],{"type":29,"tag":183,"props":13028,"children":13029},{"style":1481},[13030],{"type":38,"value":9016},{"type":29,"tag":183,"props":13032,"children":13033},{"style":212},[13034],{"type":38,"value":79},{"type":29,"tag":183,"props":13036,"children":13037},{"style":308},[13038],{"type":38,"value":13039},"notificationService ",{"type":29,"tag":183,"props":13041,"children":13042},{"style":228},[13043],{"type":38,"value":8340},{"type":29,"tag":183,"props":13045,"children":13046},{"style":308},[13047],{"type":38,"value":12933},{"type":29,"tag":183,"props":13049,"children":13050},{"style":212},[13051],{"type":38,"value":327},{"type":29,"tag":183,"props":13053,"children":13054},{"class":185,"line":662},[13055],{"type":29,"tag":183,"props":13056,"children":13057},{"style":212},[13058],{"type":38,"value":1589},{"type":29,"tag":183,"props":13060,"children":13061},{"class":185,"line":3095},[13062],{"type":29,"tag":183,"props":13063,"children":13064},{"emptyLinePlaceholder":13},[13065],{"type":38,"value":445},{"type":29,"tag":183,"props":13067,"children":13068},{"class":185,"line":3154},[13069,13073,13077,13082,13086,13090,13094,13098],{"type":29,"tag":183,"props":13070,"children":13071},{"style":200},[13072],{"type":38,"value":8441},{"type":29,"tag":183,"props":13074,"children":13075},{"style":200},[13076],{"type":38,"value":9424},{"type":29,"tag":183,"props":13078,"children":13079},{"style":206},[13080],{"type":38,"value":13081}," fulfillOrder",{"type":29,"tag":183,"props":13083,"children":13084},{"style":212},[13085],{"type":38,"value":770},{"type":29,"tag":183,"props":13087,"children":13088},{"style":8327},[13089],{"type":38,"value":8842},{"type":29,"tag":183,"props":13091,"children":13092},{"style":222},[13093],{"type":38,"value":8559},{"type":29,"tag":183,"props":13095,"children":13096},{"style":212},[13097],{"type":38,"value":272},{"type":29,"tag":183,"props":13099,"children":13100},{"style":212},[13101],{"type":38,"value":285},{"type":29,"tag":183,"props":13103,"children":13104},{"class":185,"line":3207},[13105,13109,13113,13117,13121,13125,13129,13133,13137],{"type":29,"tag":183,"props":13106,"children":13107},{"style":8327},[13108],{"type":38,"value":12246},{"type":29,"tag":183,"props":13110,"children":13111},{"style":308},[13112],{"type":38,"value":12251},{"type":29,"tag":183,"props":13114,"children":13115},{"style":228},[13116],{"type":38,"value":8340},{"type":29,"tag":183,"props":13118,"children":13119},{"style":308},[13120],{"type":38,"value":12909},{"type":29,"tag":183,"props":13122,"children":13123},{"style":212},[13124],{"type":38,"value":79},{"type":29,"tag":183,"props":13126,"children":13127},{"style":206},[13128],{"type":38,"value":1502},{"type":29,"tag":183,"props":13130,"children":13131},{"style":212},[13132],{"type":38,"value":770},{"type":29,"tag":183,"props":13134,"children":13135},{"style":308},[13136],{"type":38,"value":9942},{"type":29,"tag":183,"props":13138,"children":13139},{"style":212},[13140],{"type":38,"value":11172},{"type":29,"tag":183,"props":13142,"children":13143},{"class":185,"line":3224},[13144,13148,13152,13156,13160,13164,13169,13173,13177],{"type":29,"tag":183,"props":13145,"children":13146},{"style":212},[13147],{"type":38,"value":11225},{"type":29,"tag":183,"props":13149,"children":13150},{"style":206},[13151],{"type":38,"value":11230},{"type":29,"tag":183,"props":13153,"children":13154},{"style":212},[13155],{"type":38,"value":11235},{"type":29,"tag":183,"props":13157,"children":13158},{"style":200},[13159],{"type":38,"value":11240},{"type":29,"tag":183,"props":13161,"children":13162},{"style":200},[13163],{"type":38,"value":1099},{"type":29,"tag":183,"props":13165,"children":13166},{"style":206},[13167],{"type":38,"value":13168}," OrderNotFoundException",{"type":29,"tag":183,"props":13170,"children":13171},{"style":212},[13172],{"type":38,"value":770},{"type":29,"tag":183,"props":13174,"children":13175},{"style":308},[13176],{"type":38,"value":9942},{"type":29,"tag":183,"props":13178,"children":13179},{"style":212},[13180],{"type":38,"value":9534},{"type":29,"tag":183,"props":13182,"children":13183},{"class":185,"line":3266},[13184],{"type":29,"tag":183,"props":13185,"children":13186},{"emptyLinePlaceholder":13},[13187],{"type":38,"value":445},{"type":29,"tag":183,"props":13189,"children":13190},{"class":185,"line":3275},[13191,13196,13200,13205,13209,13213,13217,13222],{"type":29,"tag":183,"props":13192,"children":13193},{"style":308},[13194],{"type":38,"value":13195},"        order",{"type":29,"tag":183,"props":13197,"children":13198},{"style":212},[13199],{"type":38,"value":79},{"type":29,"tag":183,"props":13201,"children":13202},{"style":206},[13203],{"type":38,"value":13204},"setStatus",{"type":29,"tag":183,"props":13206,"children":13207},{"style":212},[13208],{"type":38,"value":770},{"type":29,"tag":183,"props":13210,"children":13211},{"style":308},[13212],{"type":38,"value":11158},{"type":29,"tag":183,"props":13214,"children":13215},{"style":212},[13216],{"type":38,"value":79},{"type":29,"tag":183,"props":13218,"children":13219},{"style":308},[13220],{"type":38,"value":13221},"FULFILLING",{"type":29,"tag":183,"props":13223,"children":13224},{"style":212},[13225],{"type":38,"value":7487},{"type":29,"tag":183,"props":13227,"children":13228},{"class":185,"line":3283},[13229,13234,13238,13242,13246,13251],{"type":29,"tag":183,"props":13230,"children":13231},{"style":308},[13232],{"type":38,"value":13233},"        orderRepository",{"type":29,"tag":183,"props":13235,"children":13236},{"style":212},[13237],{"type":38,"value":79},{"type":29,"tag":183,"props":13239,"children":13240},{"style":206},[13241],{"type":38,"value":8503},{"type":29,"tag":183,"props":13243,"children":13244},{"style":212},[13245],{"type":38,"value":770},{"type":29,"tag":183,"props":13247,"children":13248},{"style":308},[13249],{"type":38,"value":13250},"order",{"type":29,"tag":183,"props":13252,"children":13253},{"style":212},[13254],{"type":38,"value":7487},{"type":29,"tag":183,"props":13256,"children":13257},{"class":185,"line":3292},[13258],{"type":29,"tag":183,"props":13259,"children":13260},{"emptyLinePlaceholder":13},[13261],{"type":38,"value":445},{"type":29,"tag":183,"props":13263,"children":13264},{"class":185,"line":3349},[13265,13270,13274,13279,13283,13287,13291,13296,13300,13304],{"type":29,"tag":183,"props":13266,"children":13267},{"style":308},[13268],{"type":38,"value":13269},"        notificationService",{"type":29,"tag":183,"props":13271,"children":13272},{"style":212},[13273],{"type":38,"value":79},{"type":29,"tag":183,"props":13275,"children":13276},{"style":206},[13277],{"type":38,"value":13278},"sendOrderConfirmation",{"type":29,"tag":183,"props":13280,"children":13281},{"style":212},[13282],{"type":38,"value":770},{"type":29,"tag":183,"props":13284,"children":13285},{"style":308},[13286],{"type":38,"value":13250},{"type":29,"tag":183,"props":13288,"children":13289},{"style":212},[13290],{"type":38,"value":79},{"type":29,"tag":183,"props":13292,"children":13293},{"style":206},[13294],{"type":38,"value":13295},"getUserId",{"type":29,"tag":183,"props":13297,"children":13298},{"style":212},[13299],{"type":38,"value":8554},{"type":29,"tag":183,"props":13301,"children":13302},{"style":308},[13303],{"type":38,"value":8559},{"type":29,"tag":183,"props":13305,"children":13306},{"style":212},[13307],{"type":38,"value":7487},{"type":29,"tag":183,"props":13309,"children":13310},{"class":185,"line":3366},[13311],{"type":29,"tag":183,"props":13312,"children":13313},{"style":212},[13314],{"type":38,"value":1589},{"type":29,"tag":183,"props":13316,"children":13317},{"class":185,"line":3395},[13318],{"type":29,"tag":183,"props":13319,"children":13320},{"style":212},[13321],{"type":38,"value":436},{"type":29,"tag":183,"props":13323,"children":13324},{"class":185,"line":3425},[13325],{"type":29,"tag":183,"props":13326,"children":13327},{"emptyLinePlaceholder":13},[13328],{"type":38,"value":445},{"type":29,"tag":183,"props":13330,"children":13331},{"class":185,"line":3455},[13332],{"type":29,"tag":183,"props":13333,"children":13334},{"style":190},[13335],{"type":38,"value":13336},"\u002F\u002F Implémentation de test\n",{"type":29,"tag":183,"props":13338,"children":13339},{"class":185,"line":3485},[13340,13344],{"type":29,"tag":183,"props":13341,"children":13342},{"style":839},[13343],{"type":38,"value":831},{"type":29,"tag":183,"props":13345,"children":13346},{"style":10084},[13347],{"type":38,"value":10634},{"type":29,"tag":183,"props":13349,"children":13350},{"class":185,"line":3498},[13351,13355,13360,13364,13369],{"type":29,"tag":183,"props":13352,"children":13353},{"style":839},[13354],{"type":38,"value":831},{"type":29,"tag":183,"props":13356,"children":13357},{"style":10084},[13358],{"type":38,"value":13359},"Profile",{"type":29,"tag":183,"props":13361,"children":13362},{"style":212},[13363],{"type":38,"value":770},{"type":29,"tag":183,"props":13365,"children":13366},{"style":1683},[13367],{"type":38,"value":13368},"\"test\"",{"type":29,"tag":183,"props":13370,"children":13371},{"style":212},[13372],{"type":38,"value":11172},{"type":29,"tag":183,"props":13374,"children":13375},{"class":185,"line":3520},[13376,13380,13384,13389,13393,13397],{"type":29,"tag":183,"props":13377,"children":13378},{"style":200},[13379],{"type":38,"value":8292},{"type":29,"tag":183,"props":13381,"children":13382},{"style":200},[13383],{"type":38,"value":854},{"type":29,"tag":183,"props":13385,"children":13386},{"style":750},[13387],{"type":38,"value":13388}," MockNotificationService",{"type":29,"tag":183,"props":13390,"children":13391},{"style":200},[13392],{"type":38,"value":864},{"type":29,"tag":183,"props":13394,"children":13395},{"style":750},[13396],{"type":38,"value":12731},{"type":29,"tag":183,"props":13398,"children":13399},{"style":212},[13400],{"type":38,"value":285},{"type":29,"tag":183,"props":13402,"children":13403},{"class":185,"line":3541},[13404],{"type":29,"tag":183,"props":13405,"children":13406},{"emptyLinePlaceholder":13},[13407],{"type":38,"value":445},{"type":29,"tag":183,"props":13409,"children":13410},{"class":185,"line":3563},[13411,13415,13419,13424,13428,13432,13436,13441,13445,13449,13454],{"type":29,"tag":183,"props":13412,"children":13413},{"style":200},[13414],{"type":38,"value":1291},{"type":29,"tag":183,"props":13416,"children":13417},{"style":200},[13418],{"type":38,"value":8324},{"type":29,"tag":183,"props":13420,"children":13421},{"style":8327},[13422],{"type":38,"value":13423}," List",{"type":29,"tag":183,"props":13425,"children":13426},{"style":212},[13427],{"type":38,"value":1442},{"type":29,"tag":183,"props":13429,"children":13430},{"style":200},[13431],{"type":38,"value":8842},{"type":29,"tag":183,"props":13433,"children":13434},{"style":212},[13435],{"type":38,"value":1452},{"type":29,"tag":183,"props":13437,"children":13438},{"style":308},[13439],{"type":38,"value":13440}," sentNotifications ",{"type":29,"tag":183,"props":13442,"children":13443},{"style":228},[13444],{"type":38,"value":8340},{"type":29,"tag":183,"props":13446,"children":13447},{"style":200},[13448],{"type":38,"value":1099},{"type":29,"tag":183,"props":13450,"children":13451},{"style":8327},[13452],{"type":38,"value":13453}," ArrayList",{"type":29,"tag":183,"props":13455,"children":13456},{"style":212},[13457],{"type":38,"value":9830},{"type":29,"tag":183,"props":13459,"children":13460},{"class":185,"line":3572},[13461],{"type":29,"tag":183,"props":13462,"children":13463},{"emptyLinePlaceholder":13},[13464],{"type":38,"value":445},{"type":29,"tag":183,"props":13466,"children":13467},{"class":185,"line":3588},[13468,13472],{"type":29,"tag":183,"props":13469,"children":13470},{"style":839},[13471],{"type":38,"value":11392},{"type":29,"tag":183,"props":13473,"children":13474},{"style":10084},[13475],{"type":38,"value":11397},{"type":29,"tag":183,"props":13477,"children":13478},{"class":185,"line":3633},[13479,13483,13487,13491,13495,13499,13503,13507,13511,13515,13519],{"type":29,"tag":183,"props":13480,"children":13481},{"style":200},[13482],{"type":38,"value":8441},{"type":29,"tag":183,"props":13484,"children":13485},{"style":200},[13486],{"type":38,"value":9424},{"type":29,"tag":183,"props":13488,"children":13489},{"style":206},[13490],{"type":38,"value":12747},{"type":29,"tag":183,"props":13492,"children":13493},{"style":212},[13494],{"type":38,"value":770},{"type":29,"tag":183,"props":13496,"children":13497},{"style":8327},[13498],{"type":38,"value":8842},{"type":29,"tag":183,"props":13500,"children":13501},{"style":222},[13502],{"type":38,"value":12760},{"type":29,"tag":183,"props":13504,"children":13505},{"style":212},[13506],{"type":38,"value":2694},{"type":29,"tag":183,"props":13508,"children":13509},{"style":8327},[13510],{"type":38,"value":7421},{"type":29,"tag":183,"props":13512,"children":13513},{"style":222},[13514],{"type":38,"value":8559},{"type":29,"tag":183,"props":13516,"children":13517},{"style":212},[13518],{"type":38,"value":272},{"type":29,"tag":183,"props":13520,"children":13521},{"style":212},[13522],{"type":38,"value":285},{"type":29,"tag":183,"props":13524,"children":13525},{"class":185,"line":3665},[13526,13531,13535,13540,13544,13549,13553,13558,13562,13567,13571,13575],{"type":29,"tag":183,"props":13527,"children":13528},{"style":308},[13529],{"type":38,"value":13530},"        sentNotifications",{"type":29,"tag":183,"props":13532,"children":13533},{"style":212},[13534],{"type":38,"value":79},{"type":29,"tag":183,"props":13536,"children":13537},{"style":206},[13538],{"type":38,"value":13539},"add",{"type":29,"tag":183,"props":13541,"children":13542},{"style":212},[13543],{"type":38,"value":770},{"type":29,"tag":183,"props":13545,"children":13546},{"style":1683},[13547],{"type":38,"value":13548},"\"confirmation:\"",{"type":29,"tag":183,"props":13550,"children":13551},{"style":228},[13552],{"type":38,"value":947},{"type":29,"tag":183,"props":13554,"children":13555},{"style":308},[13556],{"type":38,"value":13557}," userId ",{"type":29,"tag":183,"props":13559,"children":13560},{"style":228},[13561],{"type":38,"value":354},{"type":29,"tag":183,"props":13563,"children":13564},{"style":1683},[13565],{"type":38,"value":13566}," \":\"",{"type":29,"tag":183,"props":13568,"children":13569},{"style":228},[13570],{"type":38,"value":947},{"type":29,"tag":183,"props":13572,"children":13573},{"style":308},[13574],{"type":38,"value":8559},{"type":29,"tag":183,"props":13576,"children":13577},{"style":212},[13578],{"type":38,"value":7487},{"type":29,"tag":183,"props":13580,"children":13581},{"class":185,"line":3750},[13582],{"type":29,"tag":183,"props":13583,"children":13584},{"style":212},[13585],{"type":38,"value":1589},{"type":29,"tag":183,"props":13587,"children":13588},{"class":185,"line":3766},[13589],{"type":29,"tag":183,"props":13590,"children":13591},{"style":212},[13592],{"type":38,"value":436},{"type":29,"tag":30,"props":13594,"children":13595},{},[13596,13601,13602,13608],{"type":29,"tag":34,"props":13597,"children":13598},{},[13599],{"type":38,"value":13600},"L'avantage Spring :",{"type":38,"value":1959},{"type":29,"tag":156,"props":13603,"children":13605},{"className":13604},[],[13606],{"type":38,"value":13607},"@Profile(\"test\")",{"type":38,"value":13609}," permet d'utiliser automatiquement le mock en environnement de test sans modifier le code métier. Le framework gère le wiring, le code métier reste pur.",{"type":29,"tag":46,"props":13611,"children":13612},{},[],{"type":29,"tag":50,"props":13614,"children":13616},{"id":13615},"quand-appliquer-le-dip-et-quand-ne-pas-le-faire",[13617],{"type":38,"value":13618},"Quand appliquer le DIP, et quand ne pas le faire",{"type":29,"tag":30,"props":13620,"children":13621},{},[13622],{"type":29,"tag":34,"props":13623,"children":13624},{},[13625],{"type":38,"value":13626},"Appliquer le DIP :",{"type":29,"tag":8603,"props":13628,"children":13629},{},[13630,13635,13640],{"type":29,"tag":8607,"props":13631,"children":13632},{},[13633],{"type":38,"value":13634},"Toute dépendance vers un système externe (base de données, API tierce, service d'email, service de paiement, file de message)",{"type":29,"tag":8607,"props":13636,"children":13637},{},[13638],{"type":38,"value":13639},"Toute dépendance vers une infrastructure susceptible de changer",{"type":29,"tag":8607,"props":13641,"children":13642},{},[13643],{"type":38,"value":13644},"Tout code que vous voulez unit-tester sans infrastructure",{"type":29,"tag":30,"props":13646,"children":13647},{},[13648],{"type":29,"tag":34,"props":13649,"children":13650},{},[13651],{"type":38,"value":13652},"Ne pas appliquer le DIP mécaniquement :",{"type":29,"tag":8603,"props":13654,"children":13655},{},[13656,13661,13666],{"type":29,"tag":8607,"props":13657,"children":13658},{},[13659],{"type":38,"value":13660},"Les entités et value objects du domaine (Order, User, Money) : pas de logique d'infrastructure",{"type":29,"tag":8607,"props":13662,"children":13663},{},[13664],{"type":38,"value":13665},"Les utilitaires purs (calculs mathématiques, formatage de dates) : pas d'effet de bord",{"type":29,"tag":8607,"props":13667,"children":13668},{},[13669],{"type":38,"value":13670},"Les dépendances stables et peu susceptibles de changer dans des petits projets",{"type":29,"tag":30,"props":13672,"children":13673},{},[13674,13679,13681,13687],{"type":29,"tag":34,"props":13675,"children":13676},{},[13677],{"type":38,"value":13678},"Le signal",{"type":38,"value":13680}," : si écrire un test unitaire pour votre classe nécessite de démarrer une base de données, une queue de messages, ou de configurer un service externe, appliquez le DIP. Cette question est aussi centrale dans les ",{"type":29,"tag":62,"props":13682,"children":13684},{"href":13683},"\u002Ffr\u002Fdette-technique\u002Ftests-integration-legacy-pieges",[13685],{"type":38,"value":13686},"tests d'intégration sur du code legacy",{"type":38,"value":13688}," : l'absence de DIP est souvent ce qui rend ces tests si difficiles et si fragiles à mettre en place.",{"type":29,"tag":46,"props":13690,"children":13691},{},[],{"type":29,"tag":1196,"props":13693,"children":13695},{"cta":2185,"href":2186,"title":13694,"type":2188},"Le DIP n'est qu'une des 100 pratiques qui rendent un code testable",[13696],{"type":29,"tag":30,"props":13697,"children":13698},{},[13699],{"type":38,"value":13700},"Cet article détaille une pratique craft : inverser ses dépendances pour découpler le métier de l'infrastructure. Le Craft Bundle réunit les 100 pratiques que j'applique pour coder propre, du choix d'une abstraction au design d'un test rapide. Celles que l'IA ne vous apprendra jamais parce qu'elle ne les a jamais vues tenir en production.",{"type":29,"tag":46,"props":13702,"children":13703},{},[],{"type":29,"tag":50,"props":13705,"children":13707},{"id":13706},"faq-sur-le-dependency-inversion-principle",[13708],{"type":38,"value":13709},"FAQ sur le Dependency Inversion Principle",{"type":29,"tag":2205,"props":13711,"children":13712},{},[13713,13718],{"type":29,"tag":2209,"props":13714,"children":13715},{},[13716],{"type":38,"value":13717},"1. Quelle est la différence entre DIP et Dependency Injection ?",{"type":29,"tag":30,"props":13719,"children":13720},{},[13721],{"type":38,"value":13722},"Le DIP est un principe architectural : les modules doivent dépendre d'abstractions. La Dependency Injection (DI) est une technique d'implémentation du DIP : les dépendances sont fournies de l'extérieur plutôt que créées à l'intérieur. On peut respecter le DIP sans DI (ex : factory pattern). On peut utiliser la DI sans respecter le DIP (ex : injecter une classe concrète sans interface). En pratique, les deux vont généralement ensemble.",{"type":29,"tag":2205,"props":13724,"children":13725},{},[13726,13731],{"type":29,"tag":2209,"props":13727,"children":13728},{},[13729],{"type":38,"value":13730},"2. Les containers DI (Spring, .NET DI, Angular) font-ils le travail à notre place ?",{"type":29,"tag":30,"props":13732,"children":13733},{},[13734],{"type":38,"value":13735},"Ils automatisent le wiring (qui injecte quoi), mais ne créent pas les abstractions à notre place. Spring injecte les classes concrètes si vous ne créez pas d'interfaces. La discipline architecturale de créer des interfaces pour les dépendances d'infrastructure reste une décision de l'équipe. Le framework ne peut pas la prendre à votre place.",{"type":29,"tag":2205,"props":13737,"children":13738},{},[13739,13744],{"type":29,"tag":2209,"props":13740,"children":13741},{},[13742],{"type":38,"value":13743},"3. Le DIP ne crée-t-il pas trop d'abstractions ?",{"type":29,"tag":30,"props":13745,"children":13746},{},[13747],{"type":38,"value":13748},"Oui, si mal appliqué. Créer une interface pour chaque classe, même les plus stables, est du sur-engineering. La règle que Martin Fowler formule clairement : créer une abstraction quand il y a au moins 2 implémentations possibles (production + test, provider A + provider B) ou quand la dépendance est vers un système externe. \"Pas d'abstraction prématurée\" s'applique au DIP comme à tout principe.",{"type":29,"tag":2205,"props":13750,"children":13751},{},[13752,13757],{"type":29,"tag":2209,"props":13753,"children":13754},{},[13755],{"type":38,"value":13756},"4. Comment introduire le DIP progressivement dans un codebase existant ?",{"type":29,"tag":30,"props":13758,"children":13759},{},[13760,13762,13768],{"type":38,"value":13761},"Le strangler fig pattern appliqué au DIP : ne pas refactorer tout le code existant d'un coup. À chaque nouvelle fonctionnalité ou bug fix qui touche une classe avec dépendances directes, extraire l'interface et introduire l'injection. Après 6 mois de cette discipline, les zones les plus actives du codebase respectent le DIP. Les zones stables peuvent rester dans l'état existant si elles ne causent pas de problèmes. Dans un contexte de ",{"type":29,"tag":62,"props":13763,"children":13765},{"href":13764},"\u002Ffr\u002Fdette-technique\u002Flegacy-code-evaluer-risque",[13766],{"type":38,"value":13767},"code legacy fortement couplé",{"type":38,"value":13769},", cette approche progressive est souvent la seule viable sans bloquer les livraisons.",{"type":29,"tag":2205,"props":13771,"children":13772},{},[13773,13778],{"type":29,"tag":2209,"props":13774,"children":13775},{},[13776],{"type":38,"value":13777},"5. Le DIP s'applique-t-il aux frontends (React, Vue) ?",{"type":29,"tag":30,"props":13779,"children":13780},{},[13781,13783,13789,13790,13796,13798,13804],{"type":38,"value":13782},"Oui. En React : les composants ne doivent pas appeler directement ",{"type":29,"tag":156,"props":13784,"children":13786},{"className":13785},[],[13787],{"type":38,"value":13788},"fetch()",{"type":38,"value":7745},{"type":29,"tag":156,"props":13791,"children":13793},{"className":13792},[],[13794],{"type":38,"value":13795},"axios",{"type":38,"value":13797}," : ils doivent dépendre d'une abstraction (un service, un hook custom, un context) qui peut être mockée dans les tests. ",{"type":29,"tag":156,"props":13799,"children":13801},{"className":13800},[],[13802],{"type":38,"value":13803},"useOrderService()",{"type":38,"value":13805}," hook qui cache l'implémentation HTTP, facilement mockable dans les tests. Le DIP s'applique partout où il y a des effets de bord, frontend inclus.",{"type":29,"tag":46,"props":13807,"children":13808},{},[],{"type":29,"tag":1196,"props":13810,"children":13814},{"cta":13811,"href":13812,"title":13813,"type":2307},"Faire mon auto-évaluation →","\u002Fema","Ressource gratuite : Engineering Maturity Self-Assessment",[13815],{"type":29,"tag":30,"props":13816,"children":13817},{},[13818],{"type":38,"value":13819},"L'Engineering Maturity Self-Assessment couvre le domaine Craft & Conception : évaluez votre niveau sur les principes SOLID, le couplage, et la testabilité. Obtenez un score de maturité et des recommandations concrètes en 10 minutes.",{"type":29,"tag":2315,"props":13821,"children":13822},{},[13823],{"type":38,"value":2319},{"title":8,"searchDepth":196,"depth":196,"links":13825},[13826,13827,13828,13829,13830,13831,13832],{"id":8247,"depth":196,"text":8250},{"id":8655,"depth":196,"text":8658},{"id":8720,"depth":196,"text":8723},{"id":10404,"depth":196,"text":10407},{"id":12697,"depth":196,"text":12700},{"id":13615,"depth":196,"text":13618},{"id":13706,"depth":196,"text":13709},"content:fr:architecture-craft:dependency-inversion-pratique.md","fr\u002Farchitecture-craft\u002Fdependency-inversion-pratique.md","fr\u002Farchitecture-craft\u002Fdependency-inversion-pratique",{"_path":13837,"_dir":13838,"_draft":7,"_partial":7,"_locale":8,"title":13839,"description":13840,"id":570,"date":13841,"listed":13,"nocomments":7,"hidden":7,"categories":13842,"tags":13843,"cover":13845,"readingTime":13846,"body":13851,"_type":2331,"_id":14284,"_source":2333,"_file":14285,"_stem":14286,"_extension":2336},"\u002Ffr\u002Fpratiques-agiles\u002Fanti-patterns-backlog","pratiques-agiles","Les anti-patterns du backlog : comment en sortir","Un backlog de 400 items n'est pas un outil de planification : c'est un cimetière de bonnes intentions. Les 5 anti-patterns et la méthode pour retrouver un backlog utilisable.","2026-02-11",[13838],[13844,17],"agile","covers\u002Farticles\u002Fanti-patterns-backlog.jpg",{"text":13847,"minutes":13848,"time":13849,"words":13850},"8 min read",7.61,456600,1522,{"type":26,"children":13852,"toc":14275},[13853,13858,13863,13868,13873,13878,13881,13887,13897,13915,13925,13930,13933,13939,13948,13957,13966,13969,13975,13984,13993,14002,14035,14040,14051,14054,14060,14069,14078,14087,14092,14095,14101,14110,14119,14128,14133,14136,14142,14152,14162,14180,14183,14189,14210,14223,14236,14249,14262,14265],{"type":29,"tag":30,"props":13854,"children":13855},{},[13856],{"type":38,"value":13857},"J'ai ouvert le Jira d'une équipe bancaire que j'accompagnais pour un diagnostic de delivery. 847 tickets. Les plus anciens dataient de 3 ans. Le PO m'a dit : \"On garde tout, on sait jamais.\"",{"type":29,"tag":30,"props":13859,"children":13860},{},[13861],{"type":38,"value":13862},"J'ai ensuite demandé combien d'items avaient été développés parmi ceux créés il y a plus de 6 mois. La réponse : moins de 8%.",{"type":29,"tag":30,"props":13864,"children":13865},{},[13866],{"type":38,"value":13867},"92% de ce backlog ne serait jamais traité. Mais il existait. Il occupait de l'espace cognitif à chaque session de planning, chaque affinage, chaque conversation sur les priorités. C'est le paradoxe du backlog aspirateur : plus il grossit, moins il est utile, et plus il coûte.",{"type":29,"tag":30,"props":13869,"children":13870},{},[13871],{"type":38,"value":13872},"La promesse du backlog est simple : tout ce qu'on veut faire est documenté, priorisé, et prêt à être planifié. La réalité dans 80% des équipes que j'accompagne : le backlog grossit plus vite qu'il ne se vide, personne ne le lit entièrement, et les vrais sujets urgents se trouvent dans des messages Slack plutôt que dans Jira.",{"type":29,"tag":30,"props":13874,"children":13875},{},[13876],{"type":38,"value":13877},"Voici les 5 anti-patterns responsables de 90% des backlogs inutilisables, et la méthode de sortie.",{"type":29,"tag":46,"props":13879,"children":13880},{},[],{"type":29,"tag":50,"props":13882,"children":13884},{"id":13883},"anti-pattern-1-le-backlog-aspirateur",[13885],{"type":38,"value":13886},"Anti-pattern 1 : Le backlog aspirateur",{"type":29,"tag":30,"props":13888,"children":13889},{},[13890,13895],{"type":29,"tag":34,"props":13891,"children":13892},{},[13893],{"type":38,"value":13894},"Symptôme",{"type":38,"value":13896}," : tout ce qui est mentionné lors d'une réunion, d'une conversation Slack, ou d'un email devient un ticket. Le volume augmente de 10 à 20 items par semaine. Les tickets créés ne sont jamais fermés sauf quand ils sont développés.",{"type":29,"tag":30,"props":13898,"children":13899},{},[13900,13905,13907,13913],{"type":29,"tag":34,"props":13901,"children":13902},{},[13903],{"type":38,"value":13904},"Coût",{"type":38,"value":13906}," : un backlog aspirateur génère une charge cognitive invisible. Chaque session de ",{"type":29,"tag":62,"props":13908,"children":13910},{"href":13909},"\u002Ffr\u002Fpratiques-agiles\u002Fsprint-planning-efficace",[13911],{"type":38,"value":13912},"sprint planning",{"type":38,"value":13914}," ou d'affinage nécessite de parcourir des centaines d'items pour trouver les 5 à 10 pertinents pour le prochain sprint. En termes de temps : 2 à 4 heures par semaine de chasse aux items pertinents sur un backlog de 400 items.",{"type":29,"tag":30,"props":13916,"children":13917},{},[13918,13923],{"type":29,"tag":34,"props":13919,"children":13920},{},[13921],{"type":38,"value":13922},"Sortie",{"type":38,"value":13924}," : instaurer un critère d'entrée dans le backlog. Un item n'entre dans le backlog que si le PO l'a validé comme pertinent, s'il a une valeur business identifiable, et s'il sera probablement traité dans les 3 prochains mois.",{"type":29,"tag":30,"props":13926,"children":13927},{},[13928],{"type":38,"value":13929},"Les idées \"peut-être un jour\" vont dans un document séparé (Notion, Confluence, même un Google Sheets), non accessible dans le backlog de sprint. La frontière entre \"backlog de travail\" et \"liste d'idées\" est l'une des distinctions les plus importantes qu'une équipe peut établir.",{"type":29,"tag":46,"props":13931,"children":13932},{},[],{"type":29,"tag":50,"props":13934,"children":13936},{"id":13935},"anti-pattern-2-les-stories-sans-critères-dacceptation",[13937],{"type":38,"value":13938},"Anti-pattern 2 : Les stories sans critères d'acceptation",{"type":29,"tag":30,"props":13940,"children":13941},{},[13942,13946],{"type":29,"tag":34,"props":13943,"children":13944},{},[13945],{"type":38,"value":13894},{"type":38,"value":13947}," : des tickets avec un titre, parfois une description vague, et aucun critère d'acceptation. \"Améliorer le dashboard.\" \"Corriger les problèmes de performance.\" Aucune mesure de succès.",{"type":29,"tag":30,"props":13949,"children":13950},{},[13951,13955],{"type":29,"tag":34,"props":13952,"children":13953},{},[13954],{"type":38,"value":13904},{"type":38,"value":13956}," : une story sans critères d'acceptation entre en sprint et génère des aller-retours entre le développeur et le PO pendant le sprint. En moyenne, 3 à 5 interruptions par story floue, à 30 minutes chacune. Sur un sprint avec 4 stories floues : 6 à 10 heures perdues, sans compter le contexte-switching.",{"type":29,"tag":30,"props":13958,"children":13959},{},[13960,13964],{"type":29,"tag":34,"props":13961,"children":13962},{},[13963],{"type":38,"value":13922},{"type":38,"value":13965}," : appliquer la règle \"if it's not testable, it's not ready\". Chaque story qui ne peut pas être vérifiée par un test (automatique ou manuel) est retirée du backlog jusqu'à ce que ses critères d'acceptation soient définis. Le PO est responsable de cette définition.",{"type":29,"tag":46,"props":13967,"children":13968},{},[],{"type":29,"tag":50,"props":13970,"children":13972},{"id":13971},"anti-pattern-3-labsence-de-priorisation-explicite",[13973],{"type":38,"value":13974},"Anti-pattern 3 : L'absence de priorisation explicite",{"type":29,"tag":30,"props":13976,"children":13977},{},[13978,13982],{"type":29,"tag":34,"props":13979,"children":13980},{},[13981],{"type":38,"value":13894},{"type":38,"value":13983}," : le backlog est trié par date de création, alphabétiquement, ou pas du tout. La priorité de chaque item est \"implicite\", connue du PO mais pas visible dans l'outil.",{"type":29,"tag":30,"props":13985,"children":13986},{},[13987,13991],{"type":29,"tag":34,"props":13988,"children":13989},{},[13990],{"type":38,"value":13904},{"type":38,"value":13992}," : lors de chaque sprint planning, la question \"par quoi on commence ?\" déclenche une discussion de 30 à 60 minutes. Le résultat dépend de qui est le plus vocal dans la salle, pas de la valeur business réelle. C'est une forme de prise de décision politique déguisée en planification.",{"type":29,"tag":30,"props":13994,"children":13995},{},[13996,14000],{"type":29,"tag":34,"props":13997,"children":13998},{},[13999],{"type":38,"value":13922},{"type":38,"value":14001}," : priorisation explicite par une méthode cohérente. La méthode importe moins que la cohérence :",{"type":29,"tag":8603,"props":14003,"children":14004},{},[14005,14015,14025],{"type":29,"tag":8607,"props":14006,"children":14007},{},[14008,14013],{"type":29,"tag":34,"props":14009,"children":14010},{},[14011],{"type":38,"value":14012},"RICE",{"type":38,"value":14014}," (Reach × Impact × Confidence \u002F Effort) : chiffré, comparable",{"type":29,"tag":8607,"props":14016,"children":14017},{},[14018,14023],{"type":29,"tag":34,"props":14019,"children":14020},{},[14021],{"type":38,"value":14022},"MoSCoW",{"type":38,"value":14024}," (Must\u002FShould\u002FCould\u002FWon't) : simple, rapide",{"type":29,"tag":8607,"props":14026,"children":14027},{},[14028,14033],{"type":29,"tag":34,"props":14029,"children":14030},{},[14031],{"type":38,"value":14032},"Weighted Shortest Job First",{"type":38,"value":14034}," : ratio valeur\u002Feffort, utilisé dans SAFe",{"type":29,"tag":30,"props":14036,"children":14037},{},[14038],{"type":38,"value":14039},"Ce qui compte : la priorité est visible dans l'outil et mise à jour au moins une fois par sprint.",{"type":29,"tag":1196,"props":14041,"children":14045},{"cta":14042,"href":14043,"title":14044,"type":1201},"Révéler les angles morts de mon équipe →","https:\u002F\u002Fapp.kamanga.fr\u002Fforms\u002Fdiscovery-call","Votre backlog gonfle, mais voyez-vous vraiment ce qu'il révèle sur votre delivery ?",[14046],{"type":29,"tag":30,"props":14047,"children":14048},{},[14049],{"type":38,"value":14050},"Un backlog qui dérape est rarement le vrai problème : c'est le symptôme d'un product discovery absent, d'une priorisation floue ou d'une tension PO\u002Féquipe que vos métriques de vélocité ne montrent pas. En 30 minutes de diagnostic ciblé sur votre équipe, je vous aide à cartographier ces angles morts et à prioriser les 2-3 leviers qui assainiront durablement votre flux de delivery.",{"type":29,"tag":46,"props":14052,"children":14053},{},[],{"type":29,"tag":50,"props":14055,"children":14057},{"id":14056},"anti-pattern-4-les-epics-zombies",[14058],{"type":38,"value":14059},"Anti-pattern 4 : Les epics zombies",{"type":29,"tag":30,"props":14061,"children":14062},{},[14063,14067],{"type":29,"tag":34,"props":14064,"children":14065},{},[14066],{"type":38,"value":13894},{"type":38,"value":14068}," : des epics créées il y a 12, 18, 24 mois, toujours \"en cours\", avec 3 stories terminées sur 20. Elles ne sont pas fermées parce que \"on va y revenir un jour.\"",{"type":29,"tag":30,"props":14070,"children":14071},{},[14072,14076],{"type":29,"tag":34,"props":14073,"children":14074},{},[14075],{"type":38,"value":13904},{"type":38,"value":14077}," : les epics zombies créent une illusion de planification. Les items sous ces epics apparaissent dans les recherches et les rapports, gonflant artificiellement le backlog et perturbant les métriques de vélocité. Plus insidieux : elles occupent mentalement le PO et l'équipe dans des discussions de planification sur des sujets qui ne seront statistiquement jamais développés.",{"type":29,"tag":30,"props":14079,"children":14080},{},[14081,14085],{"type":29,"tag":34,"props":14082,"children":14083},{},[14084],{"type":38,"value":13922},{"type":38,"value":14086}," : lors d'une session de \"backlog détox\", appliquer la règle des 90 jours sur les epics. Une epic qui n'a pas eu de story développée dans les 90 jours est soit fermée avec les stories non-terminées marquées \"won't do\", soit réarchivée dans un document de vision produit, soit continuée uniquement si une décision consciente est prise de l'inclure dans la roadmap des 3 prochains mois.",{"type":29,"tag":30,"props":14088,"children":14089},{},[14090],{"type":38,"value":14091},"Dans l'équipe bancaire mentionnée en introduction, la suppression des epics zombies a réduit le backlog de 847 à 312 items en une session de 2 heures. La clarté retrouvée a été immédiate.",{"type":29,"tag":46,"props":14093,"children":14094},{},[],{"type":29,"tag":50,"props":14096,"children":14098},{"id":14097},"anti-pattern-5-le-backlog-comme-outil-de-micro-management",[14099],{"type":38,"value":14100},"Anti-pattern 5 : Le backlog comme outil de micro-management",{"type":29,"tag":30,"props":14102,"children":14103},{},[14104,14108],{"type":29,"tag":34,"props":14105,"children":14106},{},[14107],{"type":38,"value":13894},{"type":38,"value":14109}," : des tickets créés par des managers avec des descriptions de solutions techniques plutôt que de problèmes à résoudre. Ou des tickets de suivi créés pour chaque sous-tâche d'un développement, utilisés pour monitorer l'avancement heure par heure.",{"type":29,"tag":30,"props":14111,"children":14112},{},[14113,14117],{"type":29,"tag":34,"props":14114,"children":14115},{},[14116],{"type":38,"value":13904},{"type":38,"value":14118}," : les développeurs passent plus de temps à mettre à jour les tickets qu'à développer. La création de tickets devient une activité à part entière, et la qualité du code baisse parce que le focus est sur les sous-tâches visibles, pas sur la livraison de valeur.",{"type":29,"tag":30,"props":14120,"children":14121},{},[14122,14126],{"type":29,"tag":34,"props":14123,"children":14124},{},[14125],{"type":38,"value":13922},{"type":38,"value":14127}," : distinguer les tickets de valeur (ce qu'on cherche à accomplir pour l'utilisateur) des tâches techniques (comment on va l'accomplir). Les tâches techniques sont gérées par le développeur dans sa branche Git, pas dans Jira. Le manager voit l'avancement de la story, pas des sous-tâches.",{"type":29,"tag":30,"props":14129,"children":14130},{},[14131],{"type":38,"value":14132},"Ce n'était jamais un problème de confiance individuelle. C'était un problème de système de pilotage inadapté.",{"type":29,"tag":46,"props":14134,"children":14135},{},[],{"type":29,"tag":50,"props":14137,"children":14139},{"id":14138},"la-méthode-backlog-détox-en-3-sessions-de-2h",[14140],{"type":38,"value":14141},"La méthode \"backlog détox\" en 3 sessions de 2h",{"type":29,"tag":30,"props":14143,"children":14144},{},[14145,14150],{"type":29,"tag":34,"props":14146,"children":14147},{},[14148],{"type":38,"value":14149},"Session 1 : Le tri brutal",{"type":38,"value":14151}," (PO + Tech Lead) : parcourir tous les items avec une règle binaire : ce ticket sera-t-il développé dans les 3 prochains mois ? Si non, archiver sans remords. Un ticket archivé peut toujours être réactivé. Résultat attendu : réduction de 40 à 60% du backlog.",{"type":29,"tag":30,"props":14153,"children":14154},{},[14155,14160],{"type":29,"tag":34,"props":14156,"children":14157},{},[14158],{"type":38,"value":14159},"Session 2 : La priorisation",{"type":38,"value":14161}," (PO + équipe) : sur les items conservés, appliquer une méthode de priorisation explicite. Trier le backlog par priorité décroissante. Résultat attendu : un backlog où les 20 premiers items sont les 20 items les plus importants.",{"type":29,"tag":30,"props":14163,"children":14164},{},[14165,14170,14172,14178],{"type":29,"tag":34,"props":14166,"children":14167},{},[14168],{"type":38,"value":14169},"Session 3 : La DoR",{"type":38,"value":14171}," (PO + Tech Lead) : pour les 15 à 20 premiers items (ceux qui pourraient entrer dans les 2 prochains sprints), vérifier que chaque item respecte la ",{"type":29,"tag":62,"props":14173,"children":14175},{"href":14174},"\u002Ffr\u002Fpratiques-agiles\u002Fdefinition-of-ready-bugs-sprint",[14176],{"type":38,"value":14177},"Definition of Ready",{"type":38,"value":14179},". Les items qui ne la respectent pas sont enrichis ou reportés. Résultat attendu : un backlog actionnable, priorisé, avec les premiers items \"DoR-validés\".",{"type":29,"tag":46,"props":14181,"children":14182},{},[],{"type":29,"tag":50,"props":14184,"children":14186},{"id":14185},"faq-sur-le-backlog-agile",[14187],{"type":38,"value":14188},"FAQ sur le backlog Agile",{"type":29,"tag":2205,"props":14190,"children":14191},{},[14192,14197],{"type":29,"tag":2209,"props":14193,"children":14194},{},[14195],{"type":38,"value":14196},"1. Quelle taille maximale devrait avoir un backlog ?",{"type":29,"tag":30,"props":14198,"children":14199},{},[14200,14202,14208],{"type":38,"value":14201},"Il n'y a pas de règle universelle, mais un backlog utilisable devrait contenir 2 à 3 mois de travail maximum pour les items priorisés. Un backlog surchargé augmente mécaniquement le ",{"type":29,"tag":62,"props":14203,"children":14205},{"href":14204},"\u002Ffr\u002Fpratiques-agiles\u002Freduire-work-in-progress-velocite",[14206],{"type":38,"value":14207},"Work In Progress",{"type":38,"value":14209}," et allonge le lead time. Au-delà, la priorisation devient abstraite et les items du bas ne seront statistiquement jamais développés. Pour une équipe qui livre 20 à 30 story points par sprint, cela représente 80 à 120 items priorisés, avec un volume illimité d'idées dans une liste séparée \"future\".",{"type":29,"tag":2205,"props":14211,"children":14212},{},[14213,14218],{"type":29,"tag":2209,"props":14214,"children":14215},{},[14216],{"type":38,"value":14217},"2. Qui est responsable du nettoyage du backlog ?",{"type":29,"tag":30,"props":14219,"children":14220},{},[14221],{"type":38,"value":14222},"Le PO est responsable de la santé du backlog, mais le nettoyage est un travail collectif. Le PO décide quoi garder et quoi archiver, mais l'équipe et le Tech Lead valident que les items conservés sont techniquement réalistes et suffisamment détaillés. Un backlog propre est le résultat d'une collaboration, pas d'un seul rôle.",{"type":29,"tag":2205,"props":14224,"children":14225},{},[14226,14231],{"type":29,"tag":2209,"props":14227,"children":14228},{},[14229],{"type":38,"value":14230},"3. Comment convaincre un PO de supprimer des items qu'il a créés ?",{"type":29,"tag":30,"props":14232,"children":14233},{},[14234],{"type":38,"value":14235},"Utiliser les données. Dans les 6 derniers mois, combien d'items vieux de plus de 6 mois ont été développés ? En général, moins de 10%. Montrer que les 90% restants génèrent du bruit sans produire de valeur. L'argument qui fonctionne : \"Un backlog propre nous permet de nous concentrer sur les 20 items qui comptent vraiment. Les 380 autres nous distraient de ces 20.\"",{"type":29,"tag":2205,"props":14237,"children":14238},{},[14239,14244],{"type":29,"tag":2209,"props":14240,"children":14241},{},[14242],{"type":38,"value":14243},"4. Faut-il un outil différent pour les \"idées futures\" séparées du backlog ?",{"type":29,"tag":30,"props":14245,"children":14246},{},[14247],{"type":38,"value":14248},"Pas nécessairement. Une section ou un label différent dans le même outil suffit. L'important est la séparation visuelle et fonctionnelle : les items \"futures\" n'apparaissent pas dans le sprint planning, ne sont pas inclus dans les métriques de vélocité, et ne nécessitent pas de DoR. Confluence, Notion, ou un simple Google Sheets fonctionnent très bien pour cette liste d'idées.",{"type":29,"tag":2205,"props":14250,"children":14251},{},[14252,14257],{"type":29,"tag":2209,"props":14253,"children":14254},{},[14255],{"type":38,"value":14256},"5. À quelle fréquence faut-il faire un backlog détox ?",{"type":29,"tag":30,"props":14258,"children":14259},{},[14260],{"type":38,"value":14261},"Une session initiale de détox (les 3 sessions de 2h décrites ci-dessus), puis une maintenance hebdomadaire de 30 minutes en affinage suffit pour maintenir le backlog sain. Sans maintenance régulière, le backlog reviendra à son état précédent en 3 à 4 mois : les mécanismes d'accumulation sont structurels, pas accidentels.",{"type":29,"tag":46,"props":14263,"children":14264},{},[],{"type":29,"tag":1196,"props":14266,"children":14269},{"cta":14267,"href":2305,"title":14268,"type":2307},"Télécharger le guide gratuit →","Ressource gratuite : Guide Lead Time -50% en 90 jours",[14270],{"type":29,"tag":30,"props":14271,"children":14272},{},[14273],{"type":38,"value":14274},"Le framework pour réduire votre lead time en 90 jours inclut une section complète sur l'optimisation du backlog et des processus de priorisation, avec les templates de session de backlog détox prêts à l'emploi.",{"title":8,"searchDepth":196,"depth":196,"links":14276},[14277,14278,14279,14280,14281,14282,14283],{"id":13883,"depth":196,"text":13886},{"id":13935,"depth":196,"text":13938},{"id":13971,"depth":196,"text":13974},{"id":14056,"depth":196,"text":14059},{"id":14097,"depth":196,"text":14100},{"id":14138,"depth":196,"text":14141},{"id":14185,"depth":196,"text":14188},"content:fr:pratiques-agiles:anti-patterns-backlog.md","fr\u002Fpratiques-agiles\u002Fanti-patterns-backlog.md","fr\u002Fpratiques-agiles\u002Fanti-patterns-backlog",{"_path":14288,"_dir":14289,"_draft":7,"_partial":7,"_locale":8,"title":14290,"description":14291,"id":4113,"date":14292,"listed":13,"nocomments":7,"hidden":7,"categories":14293,"tags":14294,"cover":14295,"readingTime":14296,"body":14300,"_type":2331,"_id":15475,"_source":2333,"_file":15476,"_stem":15477,"_extension":2336},"\u002Ffr\u002Fdette-technique\u002Fboy-scout-rule-developpement-code-clean-java","dette-technique","La règle du Boy Scout en Développement, Comment améliorer votre code au quotidien","Découvrez la règle du Boy Scout en développement logiciel, son application pratique avec des exemples en Java, et des conseils pour garder une codebase propre et maintenable.","2024-09-04",[14289],[17,2345],"covers\u002Farticles\u002Fboy-scout-rule-developpement-code-clean-java.jpg",{"text":13847,"minutes":14297,"time":14298,"words":14299},7.17,430200,1434,{"type":26,"children":14301,"toc":15459},[14302,14307,14312,14317,14320,14326,14333,14345,14350,14356,14361,14366,14369,14375,14381,14386,14393,14422,14502,14508,14513,14567,14573,14578,14650,14661,14716,14722,14733,14739,14744,14992,14998,15008,15179,15188,15194,15199,15238,15241,15247,15253,15258,15269,15274,15285,15297,15308,15313,15319,15324,15329,15335,15340,15350,15355,15365,15370,15380,15385,15396,15401,15410,15413,15419,15432,15445,15455],{"type":29,"tag":30,"props":14303,"children":14304},{},[14305],{"type":38,"value":14306},"Chez BNP Paribas CIB comme à l'Agirc-Arrco, j'ai vu le même schéma. Une codebase qui se dégrade sprint après sprint. Des développeurs qui n'osent plus toucher certaines classes. Personne pour ramasser le papier qui traîne (la métaphore vaut ce qu'elle vaut, mais elle colle). La règle du Boy Scout, appliquée au code, dit exactement ça : laissez l'endroit un peu plus propre que vous ne l'avez trouvé.",{"type":29,"tag":30,"props":14308,"children":14309},{},[14310],{"type":38,"value":14311},"La pression est réelle. Livrer vite, ajouter des fonctionnalités, fermer les tickets. Mais négliger les petits problèmes aujourd'hui transforme votre code en casse-tête demain. C'est mécanique.",{"type":29,"tag":30,"props":14313,"children":14314},{},[14315],{"type":38,"value":14316},"L'article qui suit montre comment appliquer cette règle au quotidien sans ralentir, avec des exemples Java concrets.",{"type":29,"tag":46,"props":14318,"children":14319},{},[],{"type":29,"tag":50,"props":14321,"children":14323},{"id":14322},"introduction-au-boy-scout-rule",[14324],{"type":38,"value":14325},"Introduction au Boy Scout Rule",{"type":29,"tag":14327,"props":14328,"children":14330},"h3",{"id":14329},"comprendre-le-concept",[14331],{"type":38,"value":14332},"Comprendre le concept",{"type":29,"tag":30,"props":14334,"children":14335},{},[14336,14338,14343],{"type":38,"value":14337},"La règle du Boy Scout, popularisée par Robert C. Martin, aussi connu sous le nom de Uncle Bob, est simple : ",{"type":29,"tag":34,"props":14339,"children":14340},{},[14341],{"type":38,"value":14342},"« Laissez le campement plus propre que vous ne l'avez trouvé. »",{"type":38,"value":14344}," Appliquée au développement logiciel, cette règle signifie que chaque fois que vous touchez une partie du code, vous devriez la laisser dans un état légèrement meilleur que celui dans lequel vous l'avez trouvée.",{"type":29,"tag":30,"props":14346,"children":14347},{},[14348],{"type":38,"value":14349},"Concrètement ? Renommer une variable cryptique, supprimer un bloc mort, ajouter un commentaire qui clarifie un algorithme tordu. Rien d'héroïque. De petites améliorations qui, cumulées sprint après sprint, transforment la codebase en une ressource lisible et maintenable.",{"type":29,"tag":14327,"props":14351,"children":14353},{"id":14352},"pourquoi-cette-règle-est-elle-importante",[14354],{"type":38,"value":14355},"Pourquoi cette règle est-elle importante ?",{"type":29,"tag":30,"props":14357,"children":14358},{},[14359],{"type":38,"value":14360},"Du code compliqué, mal documenté, criblé de \"quick fixes\" : tout le monde a déjà été confronté à ça. Chaque modification risque d'introduire un bug. La dette s'accumule, et même les tâches simples deviennent des projets. Dans les équipes que j'ai accompagnées chez BNP Paribas CIB et Agirc-Arrco, le moment où la dette devient critique est presque toujours atteint avant que l'équipe en prenne conscience.",{"type":29,"tag":30,"props":14362,"children":14363},{},[14364],{"type":38,"value":14365},"La règle du Boy Scout est un antidote. Appliquée régulièrement, elle évite que la dette devienne ingérable : cycles de livraison plus courts, coût de maintenance qui baisse. Pas de révolution immédiate. Un processus graduel qui, suivi rigoureusement, transforme la codebase en ressource fiable.",{"type":29,"tag":46,"props":14367,"children":14368},{},[],{"type":29,"tag":50,"props":14370,"children":14372},{"id":14371},"application-pratique-de-la-règle",[14373],{"type":38,"value":14374},"Application pratique de la règle",{"type":29,"tag":14327,"props":14376,"children":14378},{"id":14377},"exemples-concrets-en-java",[14379],{"type":38,"value":14380},"Exemples concrets en Java",{"type":29,"tag":30,"props":14382,"children":14383},{},[14384],{"type":38,"value":14385},"Appliquer la règle ne veut pas dire refactoriser chaque ligne touchée. Plutôt : enchaîner les petites améliorations qui, cumulées, font basculer la qualité. Quelques exemples en Java.",{"type":29,"tag":14387,"props":14388,"children":14390},"h4",{"id":14389},"_1-renommage-de-variables",[14391],{"type":38,"value":14392},"1. Renommage de variables",{"type":29,"tag":30,"props":14394,"children":14395},{},[14396,14398,14404,14406,14412,14414,14420],{"type":38,"value":14397},"Imaginez que vous travaillez sur une classe où vous trouvez une variable mal nommée, comme ",{"type":29,"tag":156,"props":14399,"children":14401},{"className":14400},[],[14402],{"type":38,"value":14403},"int x",{"type":38,"value":14405},". Vous devez y ajouter une nouvelle fonctionnalité. Avant de le faire, prenez quelques secondes pour renommer ",{"type":29,"tag":156,"props":14407,"children":14409},{"className":14408},[],[14410],{"type":38,"value":14411},"x",{"type":38,"value":14413}," en quelque chose de plus descriptif, comme ",{"type":29,"tag":156,"props":14415,"children":14417},{"className":14416},[],[14418],{"type":38,"value":14419},"int numberOfItems",{"type":38,"value":14421},". Cela améliore instantanément la lisibilité du code pour vous et pour les autres développeurs qui y travailleront plus tard.",{"type":29,"tag":173,"props":14423,"children":14425},{"className":8272,"code":14424,"language":8271,"meta":8,"style":8},"\u002F\u002F Avant\nint x = 5;\n\n\u002F\u002F Après\nint numberOfItems = 5;\n",[14426],{"type":29,"tag":156,"props":14427,"children":14428},{"__ignoreMap":8},[14429,14437,14463,14470,14478],{"type":29,"tag":183,"props":14430,"children":14431},{"class":185,"line":186},[14432],{"type":29,"tag":183,"props":14433,"children":14434},{"style":190},[14435],{"type":38,"value":14436},"\u002F\u002F Avant\n",{"type":29,"tag":183,"props":14438,"children":14439},{"class":185,"line":196},[14440,14445,14450,14454,14459],{"type":29,"tag":183,"props":14441,"children":14442},{"style":200},[14443],{"type":38,"value":14444},"int",{"type":29,"tag":183,"props":14446,"children":14447},{"style":308},[14448],{"type":38,"value":14449}," x ",{"type":29,"tag":183,"props":14451,"children":14452},{"style":228},[14453],{"type":38,"value":8340},{"type":29,"tag":183,"props":14455,"children":14456},{"style":319},[14457],{"type":38,"value":14458}," 5",{"type":29,"tag":183,"props":14460,"children":14461},{"style":212},[14462],{"type":38,"value":327},{"type":29,"tag":183,"props":14464,"children":14465},{"class":185,"line":218},[14466],{"type":29,"tag":183,"props":14467,"children":14468},{"emptyLinePlaceholder":13},[14469],{"type":38,"value":445},{"type":29,"tag":183,"props":14471,"children":14472},{"class":185,"line":245},[14473],{"type":29,"tag":183,"props":14474,"children":14475},{"style":190},[14476],{"type":38,"value":14477},"\u002F\u002F Après\n",{"type":29,"tag":183,"props":14479,"children":14480},{"class":185,"line":266},[14481,14485,14490,14494,14498],{"type":29,"tag":183,"props":14482,"children":14483},{"style":200},[14484],{"type":38,"value":14444},{"type":29,"tag":183,"props":14486,"children":14487},{"style":308},[14488],{"type":38,"value":14489}," numberOfItems ",{"type":29,"tag":183,"props":14491,"children":14492},{"style":228},[14493],{"type":38,"value":8340},{"type":29,"tag":183,"props":14495,"children":14496},{"style":319},[14497],{"type":38,"value":14458},{"type":29,"tag":183,"props":14499,"children":14500},{"style":212},[14501],{"type":38,"value":327},{"type":29,"tag":14387,"props":14503,"children":14505},{"id":14504},"_2-suppression-de-code-mort",[14506],{"type":38,"value":14507},"2. Suppression de code mort",{"type":29,"tag":30,"props":14509,"children":14510},{},[14511],{"type":38,"value":14512},"Il est fréquent de trouver des blocs de code commentés ou des méthodes obsolètes qui ne sont plus utilisés. Par exemple, si vous trouvez une méthode inutilisée dans une classe, supprimez-la. Cela allège la classe et réduit le bruit visuel pour les autres développeurs.",{"type":29,"tag":173,"props":14514,"children":14516},{"className":8272,"code":14515,"language":8271,"meta":8,"style":8},"\u002F\u002F Code mort à supprimer\npublic void oldMethod() {\n    \u002F\u002F Cette méthode n'est plus utilisée\n}\n",[14517],{"type":29,"tag":156,"props":14518,"children":14519},{"__ignoreMap":8},[14520,14528,14552,14560],{"type":29,"tag":183,"props":14521,"children":14522},{"class":185,"line":186},[14523],{"type":29,"tag":183,"props":14524,"children":14525},{"style":190},[14526],{"type":38,"value":14527},"\u002F\u002F Code mort à supprimer\n",{"type":29,"tag":183,"props":14529,"children":14530},{"class":185,"line":196},[14531,14535,14539,14544,14548],{"type":29,"tag":183,"props":14532,"children":14533},{"style":200},[14534],{"type":38,"value":8292},{"type":29,"tag":183,"props":14536,"children":14537},{"style":200},[14538],{"type":38,"value":9424},{"type":29,"tag":183,"props":14540,"children":14541},{"style":206},[14542],{"type":38,"value":14543}," oldMethod",{"type":29,"tag":183,"props":14545,"children":14546},{"style":212},[14547],{"type":38,"value":1108},{"type":29,"tag":183,"props":14549,"children":14550},{"style":212},[14551],{"type":38,"value":285},{"type":29,"tag":183,"props":14553,"children":14554},{"class":185,"line":218},[14555],{"type":29,"tag":183,"props":14556,"children":14557},{"style":190},[14558],{"type":38,"value":14559},"    \u002F\u002F Cette méthode n'est plus utilisée\n",{"type":29,"tag":183,"props":14561,"children":14562},{"class":185,"line":245},[14563],{"type":29,"tag":183,"props":14564,"children":14565},{"style":212},[14566],{"type":38,"value":436},{"type":29,"tag":14387,"props":14568,"children":14570},{"id":14569},"_3-simplification-des-conditions",[14571],{"type":38,"value":14572},"3. Simplification des conditions",{"type":29,"tag":30,"props":14574,"children":14575},{},[14576],{"type":38,"value":14577},"Si vous tombez sur une condition complexe, essayez de la simplifier. Par exemple, si vous voyez quelque chose comme ceci :",{"type":29,"tag":173,"props":14579,"children":14581},{"className":8272,"code":14580,"language":8271,"meta":8,"style":8},"\u002F\u002F Avant\nif (isUserLoggedIn() == true) {\n    showDashboard();\n}\n",[14582],{"type":29,"tag":156,"props":14583,"children":14584},{"__ignoreMap":8},[14585,14592,14631,14643],{"type":29,"tag":183,"props":14586,"children":14587},{"class":185,"line":186},[14588],{"type":29,"tag":183,"props":14589,"children":14590},{"style":190},[14591],{"type":38,"value":14436},{"type":29,"tag":183,"props":14593,"children":14594},{"class":185,"line":196},[14595,14600,14604,14609,14613,14618,14623,14627],{"type":29,"tag":183,"props":14596,"children":14597},{"style":200},[14598],{"type":38,"value":14599},"if",{"type":29,"tag":183,"props":14601,"children":14602},{"style":212},[14603],{"type":38,"value":1533},{"type":29,"tag":183,"props":14605,"children":14606},{"style":206},[14607],{"type":38,"value":14608},"isUserLoggedIn",{"type":29,"tag":183,"props":14610,"children":14611},{"style":212},[14612],{"type":38,"value":1108},{"type":29,"tag":183,"props":14614,"children":14615},{"style":228},[14616],{"type":38,"value":14617}," ==",{"type":29,"tag":183,"props":14619,"children":14620},{"style":1481},[14621],{"type":38,"value":14622}," true",{"type":29,"tag":183,"props":14624,"children":14625},{"style":212},[14626],{"type":38,"value":272},{"type":29,"tag":183,"props":14628,"children":14629},{"style":212},[14630],{"type":38,"value":285},{"type":29,"tag":183,"props":14632,"children":14633},{"class":185,"line":218},[14634,14639],{"type":29,"tag":183,"props":14635,"children":14636},{"style":206},[14637],{"type":38,"value":14638},"    showDashboard",{"type":29,"tag":183,"props":14640,"children":14641},{"style":212},[14642],{"type":38,"value":9916},{"type":29,"tag":183,"props":14644,"children":14645},{"class":185,"line":245},[14646],{"type":29,"tag":183,"props":14647,"children":14648},{"style":212},[14649],{"type":38,"value":436},{"type":29,"tag":30,"props":14651,"children":14652},{},[14653,14655,14660],{"type":38,"value":14654},"Vous pouvez simplifier en retirant la comparaison inutile avec ",{"type":29,"tag":156,"props":14656,"children":14658},{"className":14657},[],[14659],{"type":38,"value":12180},{"type":38,"value":976},{"type":29,"tag":173,"props":14662,"children":14664},{"className":8272,"code":14663,"language":8271,"meta":8,"style":8},"\u002F\u002F Après\nif (isUserLoggedIn()) {\n    showDashboard();\n}\n",[14665],{"type":29,"tag":156,"props":14666,"children":14667},{"__ignoreMap":8},[14668,14675,14698,14709],{"type":29,"tag":183,"props":14669,"children":14670},{"class":185,"line":186},[14671],{"type":29,"tag":183,"props":14672,"children":14673},{"style":190},[14674],{"type":38,"value":14477},{"type":29,"tag":183,"props":14676,"children":14677},{"class":185,"line":196},[14678,14682,14686,14690,14694],{"type":29,"tag":183,"props":14679,"children":14680},{"style":200},[14681],{"type":38,"value":14599},{"type":29,"tag":183,"props":14683,"children":14684},{"style":212},[14685],{"type":38,"value":1533},{"type":29,"tag":183,"props":14687,"children":14688},{"style":206},[14689],{"type":38,"value":14608},{"type":29,"tag":183,"props":14691,"children":14692},{"style":212},[14693],{"type":38,"value":11009},{"type":29,"tag":183,"props":14695,"children":14696},{"style":212},[14697],{"type":38,"value":285},{"type":29,"tag":183,"props":14699,"children":14700},{"class":185,"line":218},[14701,14705],{"type":29,"tag":183,"props":14702,"children":14703},{"style":206},[14704],{"type":38,"value":14638},{"type":29,"tag":183,"props":14706,"children":14707},{"style":212},[14708],{"type":38,"value":9916},{"type":29,"tag":183,"props":14710,"children":14711},{"class":185,"line":245},[14712],{"type":29,"tag":183,"props":14713,"children":14714},{"style":212},[14715],{"type":38,"value":436},{"type":29,"tag":14327,"props":14717,"children":14719},{"id":14718},"appliquer-la-règle-via-le-clean-code-et-le-refactoring",[14720],{"type":38,"value":14721},"Appliquer la règle via le Clean Code et le Refactoring",{"type":29,"tag":30,"props":14723,"children":14724},{},[14725,14727,14731],{"type":38,"value":14726},"Le ",{"type":29,"tag":62,"props":14728,"children":14729},{"href":130},[14730],{"type":38,"value":2416},{"type":38,"value":14732}," et le refactoring sont les deux pratiques qui rendent la règle du Boy Scout opérationnelle. Voici comment elles s'articulent.",{"type":29,"tag":14387,"props":14734,"children":14736},{"id":14735},"_1-refactoring-continu",[14737],{"type":38,"value":14738},"1. Refactoring continu",{"type":29,"tag":30,"props":14740,"children":14741},{},[14742],{"type":38,"value":14743},"Le refactoring restructure le code sans changer son comportement externe. Chaque fois que vous touchez une section, regardez si vous pouvez simplifier une méthode, réduire la duplication, améliorer la structure. Extraire une méthode pour clarifier une opération complexe, par exemple.",{"type":29,"tag":173,"props":14745,"children":14747},{"className":8272,"code":14746,"language":8271,"meta":8,"style":8},"\u002F\u002F Avant\npublic void processOrder() {\n    \u002F\u002F Code complexe pour vérifier les stocks\n    if (stock >= orderQuantity) {\n        \u002F\u002F Traitement de la commande\n    }\n}\n\n\u002F\u002F Après - Refactoring en extrayant une méthode\npublic void processOrder() {\n    if (isStockSufficient()) {\n        \u002F\u002F Traitement de la commande\n    }\n}\n\nprivate boolean isStockSufficient() {\n    return stock >= orderQuantity;\n}\n",[14748],{"type":29,"tag":156,"props":14749,"children":14750},{"__ignoreMap":8},[14751,14758,14782,14790,14824,14832,14839,14846,14853,14861,14884,14908,14915,14922,14929,14936,14961,14985],{"type":29,"tag":183,"props":14752,"children":14753},{"class":185,"line":186},[14754],{"type":29,"tag":183,"props":14755,"children":14756},{"style":190},[14757],{"type":38,"value":14436},{"type":29,"tag":183,"props":14759,"children":14760},{"class":185,"line":196},[14761,14765,14769,14774,14778],{"type":29,"tag":183,"props":14762,"children":14763},{"style":200},[14764],{"type":38,"value":8292},{"type":29,"tag":183,"props":14766,"children":14767},{"style":200},[14768],{"type":38,"value":9424},{"type":29,"tag":183,"props":14770,"children":14771},{"style":206},[14772],{"type":38,"value":14773}," processOrder",{"type":29,"tag":183,"props":14775,"children":14776},{"style":212},[14777],{"type":38,"value":1108},{"type":29,"tag":183,"props":14779,"children":14780},{"style":212},[14781],{"type":38,"value":285},{"type":29,"tag":183,"props":14783,"children":14784},{"class":185,"line":218},[14785],{"type":29,"tag":183,"props":14786,"children":14787},{"style":190},[14788],{"type":38,"value":14789},"    \u002F\u002F Code complexe pour vérifier les stocks\n",{"type":29,"tag":183,"props":14791,"children":14792},{"class":185,"line":245},[14793,14797,14801,14806,14811,14816,14820],{"type":29,"tag":183,"props":14794,"children":14795},{"style":200},[14796],{"type":38,"value":1528},{"type":29,"tag":183,"props":14798,"children":14799},{"style":212},[14800],{"type":38,"value":1533},{"type":29,"tag":183,"props":14802,"children":14803},{"style":308},[14804],{"type":38,"value":14805},"stock ",{"type":29,"tag":183,"props":14807,"children":14808},{"style":228},[14809],{"type":38,"value":14810},">=",{"type":29,"tag":183,"props":14812,"children":14813},{"style":308},[14814],{"type":38,"value":14815}," orderQuantity",{"type":29,"tag":183,"props":14817,"children":14818},{"style":212},[14819],{"type":38,"value":272},{"type":29,"tag":183,"props":14821,"children":14822},{"style":212},[14823],{"type":38,"value":285},{"type":29,"tag":183,"props":14825,"children":14826},{"class":185,"line":266},[14827],{"type":29,"tag":183,"props":14828,"children":14829},{"style":190},[14830],{"type":38,"value":14831},"        \u002F\u002F Traitement de la commande\n",{"type":29,"tag":183,"props":14833,"children":14834},{"class":185,"line":288},[14835],{"type":29,"tag":183,"props":14836,"children":14837},{"style":212},[14838],{"type":38,"value":1589},{"type":29,"tag":183,"props":14840,"children":14841},{"class":185,"line":330},[14842],{"type":29,"tag":183,"props":14843,"children":14844},{"style":212},[14845],{"type":38,"value":436},{"type":29,"tag":183,"props":14847,"children":14848},{"class":185,"line":374},[14849],{"type":29,"tag":183,"props":14850,"children":14851},{"emptyLinePlaceholder":13},[14852],{"type":38,"value":445},{"type":29,"tag":183,"props":14854,"children":14855},{"class":185,"line":430},[14856],{"type":29,"tag":183,"props":14857,"children":14858},{"style":190},[14859],{"type":38,"value":14860},"\u002F\u002F Après - Refactoring en extrayant une méthode\n",{"type":29,"tag":183,"props":14862,"children":14863},{"class":185,"line":439},[14864,14868,14872,14876,14880],{"type":29,"tag":183,"props":14865,"children":14866},{"style":200},[14867],{"type":38,"value":8292},{"type":29,"tag":183,"props":14869,"children":14870},{"style":200},[14871],{"type":38,"value":9424},{"type":29,"tag":183,"props":14873,"children":14874},{"style":206},[14875],{"type":38,"value":14773},{"type":29,"tag":183,"props":14877,"children":14878},{"style":212},[14879],{"type":38,"value":1108},{"type":29,"tag":183,"props":14881,"children":14882},{"style":212},[14883],{"type":38,"value":285},{"type":29,"tag":183,"props":14885,"children":14886},{"class":185,"line":448},[14887,14891,14895,14900,14904],{"type":29,"tag":183,"props":14888,"children":14889},{"style":200},[14890],{"type":38,"value":1528},{"type":29,"tag":183,"props":14892,"children":14893},{"style":212},[14894],{"type":38,"value":1533},{"type":29,"tag":183,"props":14896,"children":14897},{"style":206},[14898],{"type":38,"value":14899},"isStockSufficient",{"type":29,"tag":183,"props":14901,"children":14902},{"style":212},[14903],{"type":38,"value":11009},{"type":29,"tag":183,"props":14905,"children":14906},{"style":212},[14907],{"type":38,"value":285},{"type":29,"tag":183,"props":14909,"children":14910},{"class":185,"line":457},[14911],{"type":29,"tag":183,"props":14912,"children":14913},{"style":190},[14914],{"type":38,"value":14831},{"type":29,"tag":183,"props":14916,"children":14917},{"class":185,"line":474},[14918],{"type":29,"tag":183,"props":14919,"children":14920},{"style":212},[14921],{"type":38,"value":1589},{"type":29,"tag":183,"props":14923,"children":14924},{"class":185,"line":495},[14925],{"type":29,"tag":183,"props":14926,"children":14927},{"style":212},[14928],{"type":38,"value":436},{"type":29,"tag":183,"props":14930,"children":14931},{"class":185,"line":516},[14932],{"type":29,"tag":183,"props":14933,"children":14934},{"emptyLinePlaceholder":13},[14935],{"type":38,"value":445},{"type":29,"tag":183,"props":14937,"children":14938},{"class":185,"line":536},[14939,14944,14948,14953,14957],{"type":29,"tag":183,"props":14940,"children":14941},{"style":200},[14942],{"type":38,"value":14943},"private",{"type":29,"tag":183,"props":14945,"children":14946},{"style":200},[14947],{"type":38,"value":9995},{"type":29,"tag":183,"props":14949,"children":14950},{"style":206},[14951],{"type":38,"value":14952}," isStockSufficient",{"type":29,"tag":183,"props":14954,"children":14955},{"style":212},[14956],{"type":38,"value":1108},{"type":29,"tag":183,"props":14958,"children":14959},{"style":212},[14960],{"type":38,"value":285},{"type":29,"tag":183,"props":14962,"children":14963},{"class":185,"line":570},[14964,14968,14973,14977,14981],{"type":29,"tag":183,"props":14965,"children":14966},{"style":200},[14967],{"type":38,"value":919},{"type":29,"tag":183,"props":14969,"children":14970},{"style":308},[14971],{"type":38,"value":14972}," stock ",{"type":29,"tag":183,"props":14974,"children":14975},{"style":228},[14976],{"type":38,"value":14810},{"type":29,"tag":183,"props":14978,"children":14979},{"style":308},[14980],{"type":38,"value":14815},{"type":29,"tag":183,"props":14982,"children":14983},{"style":212},[14984],{"type":38,"value":327},{"type":29,"tag":183,"props":14986,"children":14987},{"class":185,"line":613},[14988],{"type":29,"tag":183,"props":14989,"children":14990},{"style":212},[14991],{"type":38,"value":436},{"type":29,"tag":14387,"props":14993,"children":14995},{"id":14994},"_2-clean-code-en-action",[14996],{"type":38,"value":14997},"2. Clean Code en action",{"type":29,"tag":30,"props":14999,"children":15000},{},[15001,15002,15006],{"type":38,"value":14726},{"type":29,"tag":62,"props":15003,"children":15004},{"href":130},[15005],{"type":38,"value":2416},{"type":38,"value":15007}," vise l'élimination des code smells, l'écriture de tests unitaires, une architecture lisible. Quand vous appliquez la règle du Boy Scout, rendez chaque section touchée conforme à ces principes. Méthode trop longue ? Découpez en plusieurs méthodes plus courtes et plus descriptives.",{"type":29,"tag":173,"props":15009,"children":15011},{"className":8272,"code":15010,"language":8271,"meta":8,"style":8},"\u002F\u002F Avant - Méthode trop longue\npublic void generateReport() {\n    \u002F\u002F Initialisation des paramètres\n    \u002F\u002F Calcul des statistiques\n    \u002F\u002F Génération du fichier de rapport\n    \u002F\u002F Envoi du rapport par email\n}\n\n\u002F\u002F Après - Méthode clean avec des responsabilités claires\npublic void generateReport() {\n    initializeParameters();\n    calculateStatistics();\n    generateReportFile();\n    sendReportByEmail();\n}\n",[15012],{"type":29,"tag":156,"props":15013,"children":15014},{"__ignoreMap":8},[15015,15023,15047,15055,15063,15071,15079,15086,15093,15101,15124,15136,15148,15160,15172],{"type":29,"tag":183,"props":15016,"children":15017},{"class":185,"line":186},[15018],{"type":29,"tag":183,"props":15019,"children":15020},{"style":190},[15021],{"type":38,"value":15022},"\u002F\u002F Avant - Méthode trop longue\n",{"type":29,"tag":183,"props":15024,"children":15025},{"class":185,"line":196},[15026,15030,15034,15039,15043],{"type":29,"tag":183,"props":15027,"children":15028},{"style":200},[15029],{"type":38,"value":8292},{"type":29,"tag":183,"props":15031,"children":15032},{"style":200},[15033],{"type":38,"value":9424},{"type":29,"tag":183,"props":15035,"children":15036},{"style":206},[15037],{"type":38,"value":15038}," generateReport",{"type":29,"tag":183,"props":15040,"children":15041},{"style":212},[15042],{"type":38,"value":1108},{"type":29,"tag":183,"props":15044,"children":15045},{"style":212},[15046],{"type":38,"value":285},{"type":29,"tag":183,"props":15048,"children":15049},{"class":185,"line":218},[15050],{"type":29,"tag":183,"props":15051,"children":15052},{"style":190},[15053],{"type":38,"value":15054},"    \u002F\u002F Initialisation des paramètres\n",{"type":29,"tag":183,"props":15056,"children":15057},{"class":185,"line":245},[15058],{"type":29,"tag":183,"props":15059,"children":15060},{"style":190},[15061],{"type":38,"value":15062},"    \u002F\u002F Calcul des statistiques\n",{"type":29,"tag":183,"props":15064,"children":15065},{"class":185,"line":266},[15066],{"type":29,"tag":183,"props":15067,"children":15068},{"style":190},[15069],{"type":38,"value":15070},"    \u002F\u002F Génération du fichier de rapport\n",{"type":29,"tag":183,"props":15072,"children":15073},{"class":185,"line":288},[15074],{"type":29,"tag":183,"props":15075,"children":15076},{"style":190},[15077],{"type":38,"value":15078},"    \u002F\u002F Envoi du rapport par email\n",{"type":29,"tag":183,"props":15080,"children":15081},{"class":185,"line":330},[15082],{"type":29,"tag":183,"props":15083,"children":15084},{"style":212},[15085],{"type":38,"value":436},{"type":29,"tag":183,"props":15087,"children":15088},{"class":185,"line":374},[15089],{"type":29,"tag":183,"props":15090,"children":15091},{"emptyLinePlaceholder":13},[15092],{"type":38,"value":445},{"type":29,"tag":183,"props":15094,"children":15095},{"class":185,"line":430},[15096],{"type":29,"tag":183,"props":15097,"children":15098},{"style":190},[15099],{"type":38,"value":15100},"\u002F\u002F Après - Méthode clean avec des responsabilités claires\n",{"type":29,"tag":183,"props":15102,"children":15103},{"class":185,"line":439},[15104,15108,15112,15116,15120],{"type":29,"tag":183,"props":15105,"children":15106},{"style":200},[15107],{"type":38,"value":8292},{"type":29,"tag":183,"props":15109,"children":15110},{"style":200},[15111],{"type":38,"value":9424},{"type":29,"tag":183,"props":15113,"children":15114},{"style":206},[15115],{"type":38,"value":15038},{"type":29,"tag":183,"props":15117,"children":15118},{"style":212},[15119],{"type":38,"value":1108},{"type":29,"tag":183,"props":15121,"children":15122},{"style":212},[15123],{"type":38,"value":285},{"type":29,"tag":183,"props":15125,"children":15126},{"class":185,"line":448},[15127,15132],{"type":29,"tag":183,"props":15128,"children":15129},{"style":206},[15130],{"type":38,"value":15131},"    initializeParameters",{"type":29,"tag":183,"props":15133,"children":15134},{"style":212},[15135],{"type":38,"value":9916},{"type":29,"tag":183,"props":15137,"children":15138},{"class":185,"line":457},[15139,15144],{"type":29,"tag":183,"props":15140,"children":15141},{"style":206},[15142],{"type":38,"value":15143},"    calculateStatistics",{"type":29,"tag":183,"props":15145,"children":15146},{"style":212},[15147],{"type":38,"value":9916},{"type":29,"tag":183,"props":15149,"children":15150},{"class":185,"line":474},[15151,15156],{"type":29,"tag":183,"props":15152,"children":15153},{"style":206},[15154],{"type":38,"value":15155},"    generateReportFile",{"type":29,"tag":183,"props":15157,"children":15158},{"style":212},[15159],{"type":38,"value":9916},{"type":29,"tag":183,"props":15161,"children":15162},{"class":185,"line":495},[15163,15168],{"type":29,"tag":183,"props":15164,"children":15165},{"style":206},[15166],{"type":38,"value":15167},"    sendReportByEmail",{"type":29,"tag":183,"props":15169,"children":15170},{"style":212},[15171],{"type":38,"value":9916},{"type":29,"tag":183,"props":15173,"children":15174},{"class":185,"line":516},[15175],{"type":29,"tag":183,"props":15176,"children":15177},{"style":212},[15178],{"type":38,"value":436},{"type":29,"tag":1196,"props":15180,"children":15182},{"cta":1198,"href":1199,"title":15181,"type":1201},"Vous voulez prendre le réflexe de laisser chaque classe plus propre que vous ne l'avez trouvée ?",[15183],{"type":29,"tag":30,"props":15184,"children":15185},{},[15186],{"type":38,"value":15187},"Repérer la bonne petite amélioration au bon moment, sans tomber dans la réécriture qui casse tout, ça ne s'apprend pas en lisant un article : ça se travaille. En mentoring 1:1, je relis votre code avec vous, on refactorise ensemble sur vos vrais commits, et vous développez le jugement qui fait la différence entre un nettoyage utile et une perte de temps.",{"type":29,"tag":14327,"props":15189,"children":15191},{"id":15190},"quand-et-comment-lappliquer",[15192],{"type":38,"value":15193},"Quand et comment l'appliquer ?",{"type":29,"tag":30,"props":15195,"children":15196},{},[15197],{"type":38,"value":15198},"La règle ne veut pas dire passer son temps à nettoyer. Plutôt : saisir les opportunités quand elles se présentent.",{"type":29,"tag":8603,"props":15200,"children":15201},{},[15202,15218,15228],{"type":29,"tag":8607,"props":15203,"children":15204},{},[15205,15216],{"type":29,"tag":34,"props":15206,"children":15207},{},[15208,15210,15215],{"type":38,"value":15209},"Pendant une ",{"type":29,"tag":62,"props":15211,"children":15212},{"href":2140},[15213],{"type":38,"value":15214},"révision de code",{"type":38,"value":976},{"type":38,"value":15217}," Lors de la relecture du code d'un collègue, si vous voyez une opportunité d'amélioration, suggérez-la. Cela peut être une bonne occasion d'appliquer la règle sans perturber le flux de travail.",{"type":29,"tag":8607,"props":15219,"children":15220},{},[15221,15226],{"type":29,"tag":34,"props":15222,"children":15223},{},[15224],{"type":38,"value":15225},"Avant d'ajouter une nouvelle fonctionnalité :",{"type":38,"value":15227}," Avant d'ajouter du nouveau code, prenez quelques instants pour voir si la zone que vous modifiez peut être améliorée.",{"type":29,"tag":8607,"props":15229,"children":15230},{},[15231,15236],{"type":29,"tag":34,"props":15232,"children":15233},{},[15234],{"type":38,"value":15235},"En corrigeant un bug :",{"type":38,"value":15237}," Lorsque vous travaillez sur un correctif, profitez de l'occasion pour nettoyer les sections du code concernées.",{"type":29,"tag":46,"props":15239,"children":15240},{},[],{"type":29,"tag":50,"props":15242,"children":15244},{"id":15243},"conseils-pour-intégrer-la-règle-dans-votre-routine",[15245],{"type":38,"value":15246},"Conseils pour intégrer la règle dans votre routine",{"type":29,"tag":14327,"props":15248,"children":15250},{"id":15249},"meilleures-pratiques",[15251],{"type":38,"value":15252},"Meilleures pratiques",{"type":29,"tag":30,"props":15254,"children":15255},{},[15256],{"type":38,"value":15257},"Intégrer la règle au quotidien ne demande pas de révolution. Quelques habitudes suffisent.",{"type":29,"tag":14387,"props":15259,"children":15261},{"id":15260},"_1-adoptez-une-mentalité-damélioration-continue",[15262,15264],{"type":38,"value":15263},"1. ",{"type":29,"tag":34,"props":15265,"children":15266},{},[15267],{"type":38,"value":15268},"Adoptez une mentalité d'amélioration continue",{"type":29,"tag":30,"props":15270,"children":15271},{},[15272],{"type":38,"value":15273},"La règle du Boy Scout est d'abord une question d'état d'esprit. Le code n'est pas figé. C'est un organisme vivant qui peut toujours être amélioré. Chaque petit changement positif contribue à la santé globale de la codebase.",{"type":29,"tag":14387,"props":15275,"children":15277},{"id":15276},"_2-intégrez-des-revues-de-code-régulières",[15278,15280],{"type":38,"value":15279},"2. ",{"type":29,"tag":34,"props":15281,"children":15282},{},[15283],{"type":38,"value":15284},"Intégrez des revues de code régulières",{"type":29,"tag":30,"props":15286,"children":15287},{},[15288,15290,15295],{"type":38,"value":15289},"Les ",{"type":29,"tag":62,"props":15291,"children":15292},{"href":2140},[15293],{"type":38,"value":15294},"revues de code",{"type":38,"value":15296}," ne sont pas seulement l'occasion de détecter des erreurs, mais aussi de repérer des opportunités d'amélioration. Je recommande aux équipes que j'accompagne d'utiliser ces moments pour identifier et appliquer la règle du Boy Scout, en proposant des suggestions pour nettoyer ou refactorer le code.",{"type":29,"tag":14387,"props":15298,"children":15300},{"id":15299},"_3-utilisez-des-outils-danalyse-statique",[15301,15303],{"type":38,"value":15302},"3. ",{"type":29,"tag":34,"props":15304,"children":15305},{},[15306],{"type":38,"value":15307},"Utilisez des outils d'analyse statique",{"type":29,"tag":30,"props":15309,"children":15310},{},[15311],{"type":38,"value":15312},"SonarQube, Checkstyle ou PMD détectent automatiquement les code smells et les violations des principes de Clean Code. Intégrez-les dans le pipeline CI\u002FCD pour garantir que les nouvelles modifications ne dégradent pas la qualité.",{"type":29,"tag":14387,"props":15314,"children":15316},{"id":15315},"_4-allouez",[15317],{"type":38,"value":15318},"4. **Allouez",{"type":29,"tag":30,"props":15320,"children":15321},{},[15322],{"type":38,"value":15323},"du temps pour le refactoring**",{"type":29,"tag":30,"props":15325,"children":15326},{},[15327],{"type":38,"value":15328},"Le refactoring ne doit pas être vu comme une tâche distincte qui prend du temps supplémentaire, mais comme une partie intégrante de votre processus de développement. Réservez régulièrement du temps pour nettoyer le code, que ce soit en début ou en fin de sprint, ou chaque fois que vous travaillez sur une nouvelle fonctionnalité.",{"type":29,"tag":14327,"props":15330,"children":15332},{"id":15331},"comment-éviter-les-pièges-courants",[15333],{"type":38,"value":15334},"Comment éviter les pièges courants ?",{"type":29,"tag":30,"props":15336,"children":15337},{},[15338],{"type":38,"value":15339},"Simple en théorie, la règle se heurte à quelques pièges récurrents.",{"type":29,"tag":14387,"props":15341,"children":15343},{"id":15342},"_1-ne-pas-confondre-amélioration-avec-réécriture-complète",[15344,15345],{"type":38,"value":15263},{"type":29,"tag":34,"props":15346,"children":15347},{},[15348],{"type":38,"value":15349},"Ne pas confondre amélioration avec réécriture complète",{"type":29,"tag":30,"props":15351,"children":15352},{},[15353],{"type":38,"value":15354},"L'idée n'est pas de tout refactorer d'un coup. Tentant sur du code ancien, mais ça introduit des bugs et fait dérailler les délais. Restez sur de petites améliorations progressives.",{"type":29,"tag":14387,"props":15356,"children":15358},{"id":15357},"_2-éviter-de-casser-le-flux-de-travail",[15359,15360],{"type":38,"value":15279},{"type":29,"tag":34,"props":15361,"children":15362},{},[15363],{"type":38,"value":15364},"Éviter de casser le flux de travail",{"type":29,"tag":30,"props":15366,"children":15367},{},[15368],{"type":38,"value":15369},"Ne passez pas trop de temps à nettoyer au détriment des fonctionnalités à livrer. Limitez vos améliorations à ce qui se fait en quelques minutes, ou planifiez des sessions dédiées pour les refactorings conséquents.",{"type":29,"tag":14387,"props":15371,"children":15373},{"id":15372},"_3-ne-pas-négliger-les-tests",[15374,15375],{"type":38,"value":15302},{"type":29,"tag":34,"props":15376,"children":15377},{},[15378],{"type":38,"value":15379},"Ne pas négliger les tests",{"type":29,"tag":30,"props":15381,"children":15382},{},[15383],{"type":38,"value":15384},"Chaque amélioration doit être couverte par des tests. Sans filet automatisé, vos petits coups de balai finiront par introduire des régressions.",{"type":29,"tag":14387,"props":15386,"children":15388},{"id":15387},"_4-éviter-la-surcharge-de-commentaires",[15389,15391],{"type":38,"value":15390},"4. ",{"type":29,"tag":34,"props":15392,"children":15393},{},[15394],{"type":38,"value":15395},"Éviter la surcharge de commentaires",{"type":29,"tag":30,"props":15397,"children":15398},{},[15399],{"type":38,"value":15400},"Tentation classique : commenter chaque amélioration. Résultat : code verbeux, illisible. Préférez des noms de variables et de méthodes qui se suffisent à eux-mêmes.",{"type":29,"tag":1196,"props":15402,"children":15404},{"cta":2185,"href":2186,"title":15403,"type":2188},"La règle du Boy Scout n'est qu'une pratique parmi 100",[15405],{"type":29,"tag":30,"props":15406,"children":15407},{},[15408],{"type":38,"value":15409},"Laisser le code plus propre que vous ne l'avez trouvé, c'est une seule des habitudes qui distinguent un développeur senior. Le Craft Bundle réunit les 100 pratiques craft que j'applique au quotidien pour garder une codebase saine, celles que l'IA ne vous apprendra jamais parce qu'elle ne les a jamais vues tenir dans la durée sur un vrai projet.",{"type":29,"tag":46,"props":15411,"children":15412},{},[],{"type":29,"tag":50,"props":15414,"children":15416},{"id":15415},"faq",[15417],{"type":38,"value":15418},"FAQ",{"type":29,"tag":2205,"props":15420,"children":15421},{},[15422,15427],{"type":29,"tag":2209,"props":15423,"children":15424},{},[15425],{"type":38,"value":15426},"1. Quand est-il préférable de ne pas appliquer la règle du Boy Scout ?",{"type":29,"tag":30,"props":15428,"children":15429},{},[15430],{"type":38,"value":15431},"Quand le délai est serré sur une fonctionnalité critique ou un correctif urgent : concentrez-vous sur la tâche, point. Programmez une session de nettoyage après livraison plutôt que de risquer un retard.",{"type":29,"tag":2205,"props":15433,"children":15434},{},[15435,15440],{"type":29,"tag":2209,"props":15436,"children":15437},{},[15438],{"type":38,"value":15439},"2. Combien de temps dois-je passer sur le nettoyage à chaque itération ?",{"type":29,"tag":30,"props":15441,"children":15442},{},[15443],{"type":38,"value":15444},"Quelques minutes maximum à chaque fois que vous touchez du code. La règle doit rester légère pour ne pas concurrencer votre tâche principale. Si vous repérez une zone qui mérite un refactoring conséquent, notez-la et planifiez un créneau dédié.",{"type":29,"tag":1196,"props":15446,"children":15449},{"cta":15447,"href":2305,"title":15448,"type":2307},"Accéder à l'assessment gratuit →","Ressource gratuite : Votre équipe livre-t-elle aussi vite qu'elle le pourrait ?",[15450],{"type":29,"tag":30,"props":15451,"children":15452},{},[15453],{"type":38,"value":15454},"30 questions, 5 dimensions, score sur 100. Mesurez la maturité engineering de votre équipe avec le benchmark utilisé dans des DSI de 50 à 800+ développeurs, et identifiez vos 3 chantiers prioritaires.",{"type":29,"tag":2315,"props":15456,"children":15457},{},[15458],{"type":38,"value":2319},{"title":8,"searchDepth":196,"depth":196,"links":15460},[15461,15465,15470,15474],{"id":14322,"depth":196,"text":14325,"children":15462},[15463,15464],{"id":14329,"depth":218,"text":14332},{"id":14352,"depth":218,"text":14355},{"id":14371,"depth":196,"text":14374,"children":15466},[15467,15468,15469],{"id":14377,"depth":218,"text":14380},{"id":14718,"depth":218,"text":14721},{"id":15190,"depth":218,"text":15193},{"id":15243,"depth":196,"text":15246,"children":15471},[15472,15473],{"id":15249,"depth":218,"text":15252},{"id":15331,"depth":218,"text":15334},{"id":15415,"depth":196,"text":15418},"content:fr:dette-technique:boy-scout-rule-developpement-code-clean-java.md","fr\u002Fdette-technique\u002Fboy-scout-rule-developpement-code-clean-java.md","fr\u002Fdette-technique\u002Fboy-scout-rule-developpement-code-clean-java",{"_path":1182,"_dir":14289,"_draft":7,"_partial":7,"_locale":8,"title":15479,"description":15480,"id":3633,"date":15481,"listed":13,"nocomments":7,"hidden":7,"categories":15482,"tags":15483,"cover":15484,"readingTime":15485,"body":15490,"_type":2331,"_id":19092,"_source":2333,"_file":19093,"_stem":19094,"_extension":2336},"Appliquer le principe KISS en développement logiciel, Bonnes pratiques et exemples Java","Découvrez comment appliquer le principe KISS (Keep It Simple, Stupid) pour écrire du code simple et de qualité. Apprenez des bonnes pratiques de Software Craftsmanship...","2024-08-06",[14289],[17,2345],"covers\u002Farticles\u002Fprincipe-kiss.jpg",{"text":15486,"minutes":15487,"time":15488,"words":15489},"10 min read",9.14,548400,1828,{"type":26,"children":15491,"toc":19072},[15492,15498,15503,15528,15533,15536,15542,15547,15552,15558,15563,15568,15571,15580,15586,15591,15597,15602,15610,16054,16066,16072,16077,16083,16101,16109,16265,16271,16290,16296,16314,16317,16323,16334,16340,16345,16698,16709,17018,17023,17029,17034,17274,17279,17408,17413,17419,17424,17801,17812,17996,18001,18007,18012,18410,18421,18975,18980,18989,18992,18998,19011,19024,19037,19068],{"type":29,"tag":50,"props":15493,"children":15495},{"id":15494},"appliquer-le-principe-kiss-en-développement-logiciel-bonnes-pratiques-et-exemples-java",[15496],{"type":38,"value":15497},"Appliquer le principe KISS en développement logiciel : Bonnes pratiques et exemples Java",{"type":29,"tag":30,"props":15499,"children":15500},{},[15501],{"type":38,"value":15502},"Un projet qui démarre simple et finit en labyrinthe ingérable : tous les développeurs un peu expérimentés ont vécu ça. Les erreurs se planquent dans des couches d’abstraction sans nom clair, chaque nouvelle fonctionnalité réveille deux bugs ailleurs, et l’équipe finit par négocier les modifications comme des opérations chirurgicales.",{"type":29,"tag":30,"props":15504,"children":15505},{},[15506,15508,15513,15515,15519,15521,15526],{"type":38,"value":15507},"Le principe ",{"type":29,"tag":34,"props":15509,"children":15510},{},[15511],{"type":38,"value":15512},"KISS",{"type":38,"value":15514}," (\"Keep It Simple, Stupid\") répond à cette dérive. Pas en simplifiant pour appauvrir, mais en interrogeant chaque ligne, chaque abstraction, chaque dépendance : est-ce vraiment indispensable ? Robert C. Martin formalise cette discipline dans ",{"type":29,"tag":114,"props":15516,"children":15517},{},[15518],{"type":38,"value":2416},{"type":38,"value":15520},", le ",{"type":29,"tag":34,"props":15522,"children":15523},{},[15524],{"type":38,"value":15525},"software craftsmanship",{"type":38,"value":15527}," en fait un principe de pratique quotidienne.",{"type":29,"tag":30,"props":15529,"children":15530},{},[15531],{"type":38,"value":15532},"Sur le terrain, dans les grandes DSI où j’interviens, c’est la complexité non nécessaire qui coûte le plus cher : onboardings rallongés à plusieurs semaines, bugs en cascade après chaque refactoring, et un sentiment diffus d’insécurité technique qui finit par freiner toutes les décisions.",{"type":29,"tag":46,"props":15534,"children":15535},{},[],{"type":29,"tag":50,"props":15537,"children":15539},{"id":15538},"simplicité-ne-veut-pas-dire-médiocrité",[15540],{"type":38,"value":15541},"Simplicité ne veut pas dire médiocrité",{"type":29,"tag":30,"props":15543,"children":15544},{},[15545],{"type":38,"value":15546},"Confondre simple et simpliste est une erreur fréquente. Un code simple n'est pas un code pauvre : il est généralement plus difficile à produire qu'un code chargé. Écrire simple suppose d'avoir compris le problème en profondeur, repéré l'essentiel et écarté le décor. C'est la complexité qui se laisse aller, pas la simplicité.",{"type":29,"tag":30,"props":15548,"children":15549},{},[15550],{"type":38,"value":15551},"La question à poser face à chaque morceau de code est directe : quel est le chemin le plus court entre l'entrée et le besoin métier ? La complexité reste évidemment justifiée dans certains contextes (algorithmes de performance, systèmes distribués, contraintes de concurrence). Mais même là, le bon réflexe est de découper la complexité en briques simples nommées, plutôt que de la laisser s'agglomérer dans une seule méthode.",{"type":29,"tag":14327,"props":15553,"children":15555},{"id":15554},"simplicité-et-performance-ne-sopposent-pas",[15556],{"type":38,"value":15557},"Simplicité et performance ne s'opposent pas",{"type":29,"tag":30,"props":15559,"children":15560},{},[15561],{"type":38,"value":15562},"L'objection classique : \"simple = moins performant\". Faux dans la grande majorité des cas. Un code simple est plus facile à profiler, à optimiser localement, à déboguer quand une régression survient. À l'inverse, une architecture complexe avec des interactions multiples entre classes ralentit l'équipe sans toujours apporter de gain mesurable.",{"type":29,"tag":30,"props":15564,"children":15565},{},[15566],{"type":38,"value":15567},"Exemple typique : un système avec quatre couches d'abstraction \"pour bien séparer les responsabilités\", alors que trois des couches ne contiennent qu'une indirection vers la suivante. Fusionner ces classes ne dégrade rien, ça libère du temps de cerveau pour les optimisations qui comptent vraiment.",{"type":29,"tag":46,"props":15569,"children":15570},{},[],{"type":29,"tag":1196,"props":15572,"children":15574},{"cta":1198,"href":1199,"title":15573,"type":1201},"Vous voulez écrire enfin du code simple sans tomber dans le simpliste ?",[15575],{"type":29,"tag":30,"props":15576,"children":15577},{},[15578],{"type":38,"value":15579},"Repérer la complexité inutile dans une méthode, savoir quelle abstraction garder et laquelle fusionner, ça ne se lit pas dans un article : ça se travaille. En mentoring 1:1, je relis votre code avec vous, on simplifie ensemble vos cas concrets, et vous développez le réflexe KISS qui rend chaque revue de code plus rapide.",{"type":29,"tag":50,"props":15581,"children":15583},{"id":15582},"cinq-leviers-concrets-pour-appliquer-kiss",[15584],{"type":38,"value":15585},"Cinq leviers concrets pour appliquer KISS",{"type":29,"tag":30,"props":15587,"children":15588},{},[15589],{"type":38,"value":15590},"KISS prend forme dans des pratiques quotidiennes, pas dans des slogans. Voici cinq leviers qui font la différence sur les projets Java où ils sont appliqués sérieusement.",{"type":29,"tag":14327,"props":15592,"children":15594},{"id":15593},"_1-respecter-la-lisibilité",[15595],{"type":38,"value":15596},"1. Respecter la lisibilité",{"type":29,"tag":30,"props":15598,"children":15599},{},[15600],{"type":38,"value":15601},"Un code lisible est un code que d'autres développeurs (et vous-même) peuvent facilement comprendre. La lisibilité ne se limite pas à bien nommer vos variables et méthodes, elle concerne également la structure du code, la manière dont vous organisez vos blocs logiques et la simplicité de votre logique.",{"type":29,"tag":30,"props":15603,"children":15604},{},[15605],{"type":29,"tag":34,"props":15606,"children":15607},{},[15608],{"type":38,"value":15609},"Exemple en Java :",{"type":29,"tag":173,"props":15611,"children":15613},{"className":8272,"code":15612,"language":8271,"meta":8,"style":8},"\u002F\u002F Code moins lisible\npublic void processData(String data) {\n    for (int i = 0; i \u003C data.length(); i++) {\n        if (data.charAt(i) == 'A') {\n            \u002F\u002F ...\n        }\n    }\n}\n\n\u002F\u002F Code plus lisible en appliquant KISS\npublic void processData(String data) {\n    for (char character : data.toCharArray()) {\n        if (isCharacterValid(character)) {\n            \u002F\u002F ...\n        }\n    }\n}\n\nprivate boolean isCharacterValid(char character) {\n    return character == 'A';\n}\n",[15614],{"type":29,"tag":156,"props":15615,"children":15616},{"__ignoreMap":8},[15617,15625,15661,15738,15793,15801,15808,15815,15822,15829,15837,15872,15918,15952,15959,15966,15973,15980,15987,16024,16047],{"type":29,"tag":183,"props":15618,"children":15619},{"class":185,"line":186},[15620],{"type":29,"tag":183,"props":15621,"children":15622},{"style":190},[15623],{"type":38,"value":15624},"\u002F\u002F Code moins lisible\n",{"type":29,"tag":183,"props":15626,"children":15627},{"class":185,"line":196},[15628,15632,15636,15641,15645,15649,15653,15657],{"type":29,"tag":183,"props":15629,"children":15630},{"style":200},[15631],{"type":38,"value":8292},{"type":29,"tag":183,"props":15633,"children":15634},{"style":200},[15635],{"type":38,"value":9424},{"type":29,"tag":183,"props":15637,"children":15638},{"style":206},[15639],{"type":38,"value":15640}," processData",{"type":29,"tag":183,"props":15642,"children":15643},{"style":212},[15644],{"type":38,"value":770},{"type":29,"tag":183,"props":15646,"children":15647},{"style":8327},[15648],{"type":38,"value":8842},{"type":29,"tag":183,"props":15650,"children":15651},{"style":308},[15652],{"type":38,"value":11698},{"type":29,"tag":183,"props":15654,"children":15655},{"style":212},[15656],{"type":38,"value":272},{"type":29,"tag":183,"props":15658,"children":15659},{"style":212},[15660],{"type":38,"value":285},{"type":29,"tag":183,"props":15662,"children":15663},{"class":185,"line":218},[15664,15669,15673,15677,15682,15686,15690,15694,15698,15702,15706,15710,15715,15720,15725,15730,15734],{"type":29,"tag":183,"props":15665,"children":15666},{"style":200},[15667],{"type":38,"value":15668},"    for",{"type":29,"tag":183,"props":15670,"children":15671},{"style":212},[15672],{"type":38,"value":1533},{"type":29,"tag":183,"props":15674,"children":15675},{"style":200},[15676],{"type":38,"value":14444},{"type":29,"tag":183,"props":15678,"children":15679},{"style":308},[15680],{"type":38,"value":15681}," i ",{"type":29,"tag":183,"props":15683,"children":15684},{"style":228},[15685],{"type":38,"value":8340},{"type":29,"tag":183,"props":15687,"children":15688},{"style":319},[15689],{"type":38,"value":981},{"type":29,"tag":183,"props":15691,"children":15692},{"style":212},[15693],{"type":38,"value":6109},{"type":29,"tag":183,"props":15695,"children":15696},{"style":308},[15697],{"type":38,"value":15681},{"type":29,"tag":183,"props":15699,"children":15700},{"style":228},[15701],{"type":38,"value":1442},{"type":29,"tag":183,"props":15703,"children":15704},{"style":308},[15705],{"type":38,"value":11698},{"type":29,"tag":183,"props":15707,"children":15708},{"style":212},[15709],{"type":38,"value":79},{"type":29,"tag":183,"props":15711,"children":15712},{"style":206},[15713],{"type":38,"value":15714},"length",{"type":29,"tag":183,"props":15716,"children":15717},{"style":212},[15718],{"type":38,"value":15719},"();",{"type":29,"tag":183,"props":15721,"children":15722},{"style":308},[15723],{"type":38,"value":15724}," i",{"type":29,"tag":183,"props":15726,"children":15727},{"style":228},[15728],{"type":38,"value":15729},"++",{"type":29,"tag":183,"props":15731,"children":15732},{"style":212},[15733],{"type":38,"value":272},{"type":29,"tag":183,"props":15735,"children":15736},{"style":212},[15737],{"type":38,"value":285},{"type":29,"tag":183,"props":15739,"children":15740},{"class":185,"line":245},[15741,15745,15749,15754,15758,15763,15767,15772,15776,15780,15785,15789],{"type":29,"tag":183,"props":15742,"children":15743},{"style":200},[15744],{"type":38,"value":10982},{"type":29,"tag":183,"props":15746,"children":15747},{"style":212},[15748],{"type":38,"value":1533},{"type":29,"tag":183,"props":15750,"children":15751},{"style":308},[15752],{"type":38,"value":15753},"data",{"type":29,"tag":183,"props":15755,"children":15756},{"style":212},[15757],{"type":38,"value":79},{"type":29,"tag":183,"props":15759,"children":15760},{"style":206},[15761],{"type":38,"value":15762},"charAt",{"type":29,"tag":183,"props":15764,"children":15765},{"style":212},[15766],{"type":38,"value":770},{"type":29,"tag":183,"props":15768,"children":15769},{"style":308},[15770],{"type":38,"value":15771},"i",{"type":29,"tag":183,"props":15773,"children":15774},{"style":212},[15775],{"type":38,"value":272},{"type":29,"tag":183,"props":15777,"children":15778},{"style":228},[15779],{"type":38,"value":14617},{"type":29,"tag":183,"props":15781,"children":15782},{"style":1683},[15783],{"type":38,"value":15784}," 'A'",{"type":29,"tag":183,"props":15786,"children":15787},{"style":212},[15788],{"type":38,"value":272},{"type":29,"tag":183,"props":15790,"children":15791},{"style":212},[15792],{"type":38,"value":285},{"type":29,"tag":183,"props":15794,"children":15795},{"class":185,"line":266},[15796],{"type":29,"tag":183,"props":15797,"children":15798},{"style":190},[15799],{"type":38,"value":15800},"            \u002F\u002F ...\n",{"type":29,"tag":183,"props":15802,"children":15803},{"class":185,"line":288},[15804],{"type":29,"tag":183,"props":15805,"children":15806},{"style":212},[15807],{"type":38,"value":11060},{"type":29,"tag":183,"props":15809,"children":15810},{"class":185,"line":330},[15811],{"type":29,"tag":183,"props":15812,"children":15813},{"style":212},[15814],{"type":38,"value":1589},{"type":29,"tag":183,"props":15816,"children":15817},{"class":185,"line":374},[15818],{"type":29,"tag":183,"props":15819,"children":15820},{"style":212},[15821],{"type":38,"value":436},{"type":29,"tag":183,"props":15823,"children":15824},{"class":185,"line":430},[15825],{"type":29,"tag":183,"props":15826,"children":15827},{"emptyLinePlaceholder":13},[15828],{"type":38,"value":445},{"type":29,"tag":183,"props":15830,"children":15831},{"class":185,"line":439},[15832],{"type":29,"tag":183,"props":15833,"children":15834},{"style":190},[15835],{"type":38,"value":15836},"\u002F\u002F Code plus lisible en appliquant KISS\n",{"type":29,"tag":183,"props":15838,"children":15839},{"class":185,"line":448},[15840,15844,15848,15852,15856,15860,15864,15868],{"type":29,"tag":183,"props":15841,"children":15842},{"style":200},[15843],{"type":38,"value":8292},{"type":29,"tag":183,"props":15845,"children":15846},{"style":200},[15847],{"type":38,"value":9424},{"type":29,"tag":183,"props":15849,"children":15850},{"style":206},[15851],{"type":38,"value":15640},{"type":29,"tag":183,"props":15853,"children":15854},{"style":212},[15855],{"type":38,"value":770},{"type":29,"tag":183,"props":15857,"children":15858},{"style":8327},[15859],{"type":38,"value":8842},{"type":29,"tag":183,"props":15861,"children":15862},{"style":308},[15863],{"type":38,"value":11698},{"type":29,"tag":183,"props":15865,"children":15866},{"style":212},[15867],{"type":38,"value":272},{"type":29,"tag":183,"props":15869,"children":15870},{"style":212},[15871],{"type":38,"value":285},{"type":29,"tag":183,"props":15873,"children":15874},{"class":185,"line":457},[15875,15879,15883,15888,15893,15897,15901,15905,15910,15914],{"type":29,"tag":183,"props":15876,"children":15877},{"style":200},[15878],{"type":38,"value":15668},{"type":29,"tag":183,"props":15880,"children":15881},{"style":212},[15882],{"type":38,"value":1533},{"type":29,"tag":183,"props":15884,"children":15885},{"style":200},[15886],{"type":38,"value":15887},"char",{"type":29,"tag":183,"props":15889,"children":15890},{"style":308},[15891],{"type":38,"value":15892}," character ",{"type":29,"tag":183,"props":15894,"children":15895},{"style":200},[15896],{"type":38,"value":231},{"type":29,"tag":183,"props":15898,"children":15899},{"style":308},[15900],{"type":38,"value":11698},{"type":29,"tag":183,"props":15902,"children":15903},{"style":212},[15904],{"type":38,"value":79},{"type":29,"tag":183,"props":15906,"children":15907},{"style":206},[15908],{"type":38,"value":15909},"toCharArray",{"type":29,"tag":183,"props":15911,"children":15912},{"style":212},[15913],{"type":38,"value":11009},{"type":29,"tag":183,"props":15915,"children":15916},{"style":212},[15917],{"type":38,"value":285},{"type":29,"tag":183,"props":15919,"children":15920},{"class":185,"line":474},[15921,15925,15929,15934,15938,15943,15948],{"type":29,"tag":183,"props":15922,"children":15923},{"style":200},[15924],{"type":38,"value":10982},{"type":29,"tag":183,"props":15926,"children":15927},{"style":212},[15928],{"type":38,"value":1533},{"type":29,"tag":183,"props":15930,"children":15931},{"style":206},[15932],{"type":38,"value":15933},"isCharacterValid",{"type":29,"tag":183,"props":15935,"children":15936},{"style":212},[15937],{"type":38,"value":770},{"type":29,"tag":183,"props":15939,"children":15940},{"style":308},[15941],{"type":38,"value":15942},"character",{"type":29,"tag":183,"props":15944,"children":15945},{"style":212},[15946],{"type":38,"value":15947},"))",{"type":29,"tag":183,"props":15949,"children":15950},{"style":212},[15951],{"type":38,"value":285},{"type":29,"tag":183,"props":15953,"children":15954},{"class":185,"line":495},[15955],{"type":29,"tag":183,"props":15956,"children":15957},{"style":190},[15958],{"type":38,"value":15800},{"type":29,"tag":183,"props":15960,"children":15961},{"class":185,"line":516},[15962],{"type":29,"tag":183,"props":15963,"children":15964},{"style":212},[15965],{"type":38,"value":11060},{"type":29,"tag":183,"props":15967,"children":15968},{"class":185,"line":536},[15969],{"type":29,"tag":183,"props":15970,"children":15971},{"style":212},[15972],{"type":38,"value":1589},{"type":29,"tag":183,"props":15974,"children":15975},{"class":185,"line":570},[15976],{"type":29,"tag":183,"props":15977,"children":15978},{"style":212},[15979],{"type":38,"value":436},{"type":29,"tag":183,"props":15981,"children":15982},{"class":185,"line":613},[15983],{"type":29,"tag":183,"props":15984,"children":15985},{"emptyLinePlaceholder":13},[15986],{"type":38,"value":445},{"type":29,"tag":183,"props":15988,"children":15989},{"class":185,"line":662},[15990,15994,15998,16003,16007,16011,16016,16020],{"type":29,"tag":183,"props":15991,"children":15992},{"style":200},[15993],{"type":38,"value":14943},{"type":29,"tag":183,"props":15995,"children":15996},{"style":200},[15997],{"type":38,"value":9995},{"type":29,"tag":183,"props":15999,"children":16000},{"style":206},[16001],{"type":38,"value":16002}," isCharacterValid",{"type":29,"tag":183,"props":16004,"children":16005},{"style":212},[16006],{"type":38,"value":770},{"type":29,"tag":183,"props":16008,"children":16009},{"style":200},[16010],{"type":38,"value":15887},{"type":29,"tag":183,"props":16012,"children":16013},{"style":308},[16014],{"type":38,"value":16015}," character",{"type":29,"tag":183,"props":16017,"children":16018},{"style":212},[16019],{"type":38,"value":272},{"type":29,"tag":183,"props":16021,"children":16022},{"style":212},[16023],{"type":38,"value":285},{"type":29,"tag":183,"props":16025,"children":16026},{"class":185,"line":3095},[16027,16031,16035,16039,16043],{"type":29,"tag":183,"props":16028,"children":16029},{"style":200},[16030],{"type":38,"value":919},{"type":29,"tag":183,"props":16032,"children":16033},{"style":308},[16034],{"type":38,"value":15892},{"type":29,"tag":183,"props":16036,"children":16037},{"style":228},[16038],{"type":38,"value":5504},{"type":29,"tag":183,"props":16040,"children":16041},{"style":1683},[16042],{"type":38,"value":15784},{"type":29,"tag":183,"props":16044,"children":16045},{"style":212},[16046],{"type":38,"value":327},{"type":29,"tag":183,"props":16048,"children":16049},{"class":185,"line":3154},[16050],{"type":29,"tag":183,"props":16051,"children":16052},{"style":212},[16053],{"type":38,"value":436},{"type":29,"tag":30,"props":16055,"children":16056},{},[16057,16059,16064],{"type":38,"value":16058},"Dans cet exemple, le second morceau de code est plus lisible et respectueux du principe KISS. La logique est déléguée à une méthode claire et descriptive (",{"type":29,"tag":156,"props":16060,"children":16062},{"className":16061},[],[16063],{"type":38,"value":15933},{"type":38,"value":16065},"), rendant l'ensemble du processus plus facile à comprendre et à maintenir.",{"type":29,"tag":14327,"props":16067,"children":16069},{"id":16068},"_2-minimiser-les-dépendances",[16070],{"type":38,"value":16071},"2. Minimiser les dépendances",{"type":29,"tag":30,"props":16073,"children":16074},{},[16075],{"type":38,"value":16076},"Chaque dépendance externe ajoute une surface de complexité : conflits de version, ruptures lors des montées, vulnérabilités à surveiller. Mieux vaut écrire vingt lignes de code maison que tirer une lib de 50 Mo pour gagner trois lignes.",{"type":29,"tag":14327,"props":16078,"children":16080},{"id":16079},"_3-écrire-des-tests-automatisés",[16081],{"type":38,"value":16082},"3. Écrire des tests automatisés",{"type":29,"tag":30,"props":16084,"children":16085},{},[16086,16087,16092,16094,16099],{"type":38,"value":15289},{"type":29,"tag":62,"props":16088,"children":16089},{"href":13683},[16090],{"type":38,"value":16091},"tests unitaires et d'intégration",{"type":38,"value":16093}," font partie intégrante du ",{"type":29,"tag":34,"props":16095,"children":16096},{},[16097],{"type":38,"value":16098},"Software Craftsmanship",{"type":38,"value":16100},". Un bon test est aussi simple que le code qu'il teste. Le principe KISS s'applique également ici : écrivez des tests qui sont faciles à comprendre et à maintenir.",{"type":29,"tag":30,"props":16102,"children":16103},{},[16104],{"type":29,"tag":34,"props":16105,"children":16106},{},[16107],{"type":38,"value":16108},"Exemple de test simple en Java avec JUnit :",{"type":29,"tag":173,"props":16110,"children":16112},{"className":8272,"code":16111,"language":8271,"meta":8,"style":8},"@Test\npublic void shouldReturnTrueWhenCharacterIsValid() {\n    assertTrue(isCharacterValid('A'));\n}\n\n@Test\npublic void shouldReturnFalseWhenCharacterIsInvalid() {\n    assertFalse(isCharacterValid('B'));\n}\n",[16113],{"type":29,"tag":156,"props":16114,"children":16115},{"__ignoreMap":8},[16116,16127,16151,16180,16187,16194,16205,16229,16258],{"type":29,"tag":183,"props":16117,"children":16118},{"class":185,"line":186},[16119,16123],{"type":29,"tag":183,"props":16120,"children":16121},{"style":839},[16122],{"type":38,"value":831},{"type":29,"tag":183,"props":16124,"children":16125},{"style":10084},[16126],{"type":38,"value":10087},{"type":29,"tag":183,"props":16128,"children":16129},{"class":185,"line":196},[16130,16134,16138,16143,16147],{"type":29,"tag":183,"props":16131,"children":16132},{"style":200},[16133],{"type":38,"value":8292},{"type":29,"tag":183,"props":16135,"children":16136},{"style":200},[16137],{"type":38,"value":9424},{"type":29,"tag":183,"props":16139,"children":16140},{"style":206},[16141],{"type":38,"value":16142}," shouldReturnTrueWhenCharacterIsValid",{"type":29,"tag":183,"props":16144,"children":16145},{"style":212},[16146],{"type":38,"value":1108},{"type":29,"tag":183,"props":16148,"children":16149},{"style":212},[16150],{"type":38,"value":285},{"type":29,"tag":183,"props":16152,"children":16153},{"class":185,"line":218},[16154,16159,16163,16167,16171,16176],{"type":29,"tag":183,"props":16155,"children":16156},{"style":206},[16157],{"type":38,"value":16158},"    assertTrue",{"type":29,"tag":183,"props":16160,"children":16161},{"style":212},[16162],{"type":38,"value":770},{"type":29,"tag":183,"props":16164,"children":16165},{"style":206},[16166],{"type":38,"value":15933},{"type":29,"tag":183,"props":16168,"children":16169},{"style":212},[16170],{"type":38,"value":770},{"type":29,"tag":183,"props":16172,"children":16173},{"style":1683},[16174],{"type":38,"value":16175},"'A'",{"type":29,"tag":183,"props":16177,"children":16178},{"style":212},[16179],{"type":38,"value":9534},{"type":29,"tag":183,"props":16181,"children":16182},{"class":185,"line":245},[16183],{"type":29,"tag":183,"props":16184,"children":16185},{"style":212},[16186],{"type":38,"value":436},{"type":29,"tag":183,"props":16188,"children":16189},{"class":185,"line":266},[16190],{"type":29,"tag":183,"props":16191,"children":16192},{"emptyLinePlaceholder":13},[16193],{"type":38,"value":445},{"type":29,"tag":183,"props":16195,"children":16196},{"class":185,"line":288},[16197,16201],{"type":29,"tag":183,"props":16198,"children":16199},{"style":839},[16200],{"type":38,"value":831},{"type":29,"tag":183,"props":16202,"children":16203},{"style":10084},[16204],{"type":38,"value":10087},{"type":29,"tag":183,"props":16206,"children":16207},{"class":185,"line":330},[16208,16212,16216,16221,16225],{"type":29,"tag":183,"props":16209,"children":16210},{"style":200},[16211],{"type":38,"value":8292},{"type":29,"tag":183,"props":16213,"children":16214},{"style":200},[16215],{"type":38,"value":9424},{"type":29,"tag":183,"props":16217,"children":16218},{"style":206},[16219],{"type":38,"value":16220}," shouldReturnFalseWhenCharacterIsInvalid",{"type":29,"tag":183,"props":16222,"children":16223},{"style":212},[16224],{"type":38,"value":1108},{"type":29,"tag":183,"props":16226,"children":16227},{"style":212},[16228],{"type":38,"value":285},{"type":29,"tag":183,"props":16230,"children":16231},{"class":185,"line":374},[16232,16237,16241,16245,16249,16254],{"type":29,"tag":183,"props":16233,"children":16234},{"style":206},[16235],{"type":38,"value":16236},"    assertFalse",{"type":29,"tag":183,"props":16238,"children":16239},{"style":212},[16240],{"type":38,"value":770},{"type":29,"tag":183,"props":16242,"children":16243},{"style":206},[16244],{"type":38,"value":15933},{"type":29,"tag":183,"props":16246,"children":16247},{"style":212},[16248],{"type":38,"value":770},{"type":29,"tag":183,"props":16250,"children":16251},{"style":1683},[16252],{"type":38,"value":16253},"'B'",{"type":29,"tag":183,"props":16255,"children":16256},{"style":212},[16257],{"type":38,"value":9534},{"type":29,"tag":183,"props":16259,"children":16260},{"class":185,"line":430},[16261],{"type":29,"tag":183,"props":16262,"children":16263},{"style":212},[16264],{"type":38,"value":436},{"type":29,"tag":14327,"props":16266,"children":16268},{"id":16267},"_4-refactoriser-régulièrement",[16269],{"type":38,"value":16270},"4. Refactoriser régulièrement",{"type":29,"tag":30,"props":16272,"children":16273},{},[16274,16276,16280,16282,16288],{"type":38,"value":16275},"L'un des piliers du ",{"type":29,"tag":34,"props":16277,"children":16278},{},[16279],{"type":38,"value":16098},{"type":38,"value":16281}," est la ",{"type":29,"tag":62,"props":16283,"children":16285},{"href":16284},"\u002Ffr\u002Fdette-technique\u002Fprogramme-refactoring-approuve-business",[16286],{"type":38,"value":16287},"refactorisation régulière",{"type":38,"value":16289}," du code. Je vous recommande de prendre le temps de revoir et d'améliorer le code existant pour le simplifier et le rendre plus efficace. Cela inclut la suppression des redondances, l'élimination des classes inutiles et la simplification des méthodes.",{"type":29,"tag":14327,"props":16291,"children":16293},{"id":16292},"_5-utiliser-les-patrons-de-conception-avec-parcimonie",[16294],{"type":38,"value":16295},"5. Utiliser les patrons de conception avec parcimonie",{"type":29,"tag":30,"props":16297,"children":16298},{},[16299,16300,16305,16307,16312],{"type":38,"value":15289},{"type":29,"tag":34,"props":16301,"children":16302},{},[16303],{"type":38,"value":16304},"design patterns",{"type":38,"value":16306}," structurent efficacement le code, mais leur usage systématique produit l'effet inverse de KISS. Question à se poser avant chaque introduction : ce pattern résout-il un vrai problème ",{"type":29,"tag":114,"props":16308,"children":16309},{},[16310],{"type":38,"value":16311},"actuel",{"type":38,"value":16313},", ou anticipe-t-il un besoin imaginaire ? Le coût de lecture d'un Strategy mal placé dépasse largement le gain, surtout pour les développeurs qui découvrent le code six mois plus tard.",{"type":29,"tag":46,"props":16315,"children":16316},{},[],{"type":29,"tag":50,"props":16318,"children":16320},{"id":16319},"exemples-pratiques-de-kiss-en-java",[16321],{"type":38,"value":16322},"Exemples pratiques de KISS en Java",{"type":29,"tag":30,"props":16324,"children":16325},{},[16326,16328,16332],{"type":38,"value":16327},"Appliquer ",{"type":29,"tag":34,"props":16329,"children":16330},{},[16331],{"type":38,"value":15512},{"type":38,"value":16333}," dans le développement logiciel ne signifie pas seulement écrire du code simple. Il s'agit d'éliminer la complexité inutile, de rendre le code plus lisible et plus maintenable tout en restant fonctionnel et performant. Voici quelques exemples pratiques en Java qui montrent comment simplifier le code tout en maintenant sa robustesse.",{"type":29,"tag":14327,"props":16335,"children":16337},{"id":16336},"exemple-1-simplifier-une-logique-conditionnelle-complexe",[16338],{"type":38,"value":16339},"Exemple 1 : Simplifier une logique conditionnelle complexe",{"type":29,"tag":30,"props":16341,"children":16342},{},[16343],{"type":38,"value":16344},"Prenons une méthode qui valide plusieurs conditions dans un formulaire de saisie d'utilisateur. Voici une version complexe :",{"type":29,"tag":173,"props":16346,"children":16348},{"className":8272,"code":16347,"language":8271,"meta":8,"style":8},"\u002F\u002F Version complexe\npublic boolean isFormValid(UserForm form) {\n    if (form != null) {\n        if (form.getName() != null && !form.getName().isEmpty()) {\n            if (form.getAge() >= 18) {\n                if (form.getEmail() != null && form.getEmail().contains(\"@\")) {\n                    return true;\n                }\n            }\n        }\n    }\n    return false;\n}\n",[16349],{"type":29,"tag":156,"props":16350,"children":16351},{"__ignoreMap":8},[16352,16360,16398,16430,16506,16553,16630,16646,16654,16662,16669,16676,16691],{"type":29,"tag":183,"props":16353,"children":16354},{"class":185,"line":186},[16355],{"type":29,"tag":183,"props":16356,"children":16357},{"style":190},[16358],{"type":38,"value":16359},"\u002F\u002F Version complexe\n",{"type":29,"tag":183,"props":16361,"children":16362},{"class":185,"line":196},[16363,16367,16371,16376,16380,16385,16390,16394],{"type":29,"tag":183,"props":16364,"children":16365},{"style":200},[16366],{"type":38,"value":8292},{"type":29,"tag":183,"props":16368,"children":16369},{"style":200},[16370],{"type":38,"value":9995},{"type":29,"tag":183,"props":16372,"children":16373},{"style":206},[16374],{"type":38,"value":16375}," isFormValid",{"type":29,"tag":183,"props":16377,"children":16378},{"style":212},[16379],{"type":38,"value":770},{"type":29,"tag":183,"props":16381,"children":16382},{"style":8327},[16383],{"type":38,"value":16384},"UserForm",{"type":29,"tag":183,"props":16386,"children":16387},{"style":308},[16388],{"type":38,"value":16389}," form",{"type":29,"tag":183,"props":16391,"children":16392},{"style":212},[16393],{"type":38,"value":272},{"type":29,"tag":183,"props":16395,"children":16396},{"style":212},[16397],{"type":38,"value":285},{"type":29,"tag":183,"props":16399,"children":16400},{"class":185,"line":218},[16401,16405,16409,16414,16418,16422,16426],{"type":29,"tag":183,"props":16402,"children":16403},{"style":200},[16404],{"type":38,"value":1528},{"type":29,"tag":183,"props":16406,"children":16407},{"style":212},[16408],{"type":38,"value":1533},{"type":29,"tag":183,"props":16410,"children":16411},{"style":308},[16412],{"type":38,"value":16413},"form ",{"type":29,"tag":183,"props":16415,"children":16416},{"style":228},[16417],{"type":38,"value":5021},{"type":29,"tag":183,"props":16419,"children":16420},{"style":1481},[16421],{"type":38,"value":5026},{"type":29,"tag":183,"props":16423,"children":16424},{"style":212},[16425],{"type":38,"value":272},{"type":29,"tag":183,"props":16427,"children":16428},{"style":212},[16429],{"type":38,"value":285},{"type":29,"tag":183,"props":16431,"children":16432},{"class":185,"line":245},[16433,16437,16441,16446,16450,16455,16459,16464,16468,16472,16477,16481,16485,16489,16493,16498,16502],{"type":29,"tag":183,"props":16434,"children":16435},{"style":200},[16436],{"type":38,"value":10982},{"type":29,"tag":183,"props":16438,"children":16439},{"style":212},[16440],{"type":38,"value":1533},{"type":29,"tag":183,"props":16442,"children":16443},{"style":308},[16444],{"type":38,"value":16445},"form",{"type":29,"tag":183,"props":16447,"children":16448},{"style":212},[16449],{"type":38,"value":79},{"type":29,"tag":183,"props":16451,"children":16452},{"style":206},[16453],{"type":38,"value":16454},"getName",{"type":29,"tag":183,"props":16456,"children":16457},{"style":212},[16458],{"type":38,"value":1108},{"type":29,"tag":183,"props":16460,"children":16461},{"style":228},[16462],{"type":38,"value":16463}," !=",{"type":29,"tag":183,"props":16465,"children":16466},{"style":1481},[16467],{"type":38,"value":5026},{"type":29,"tag":183,"props":16469,"children":16470},{"style":228},[16471],{"type":38,"value":5031},{"type":29,"tag":183,"props":16473,"children":16474},{"style":228},[16475],{"type":38,"value":16476}," !",{"type":29,"tag":183,"props":16478,"children":16479},{"style":308},[16480],{"type":38,"value":16445},{"type":29,"tag":183,"props":16482,"children":16483},{"style":212},[16484],{"type":38,"value":79},{"type":29,"tag":183,"props":16486,"children":16487},{"style":206},[16488],{"type":38,"value":16454},{"type":29,"tag":183,"props":16490,"children":16491},{"style":212},[16492],{"type":38,"value":9906},{"type":29,"tag":183,"props":16494,"children":16495},{"style":206},[16496],{"type":38,"value":16497},"isEmpty",{"type":29,"tag":183,"props":16499,"children":16500},{"style":212},[16501],{"type":38,"value":11009},{"type":29,"tag":183,"props":16503,"children":16504},{"style":212},[16505],{"type":38,"value":285},{"type":29,"tag":183,"props":16507,"children":16508},{"class":185,"line":266},[16509,16514,16518,16522,16526,16531,16535,16540,16545,16549],{"type":29,"tag":183,"props":16510,"children":16511},{"style":200},[16512],{"type":38,"value":16513},"            if",{"type":29,"tag":183,"props":16515,"children":16516},{"style":212},[16517],{"type":38,"value":1533},{"type":29,"tag":183,"props":16519,"children":16520},{"style":308},[16521],{"type":38,"value":16445},{"type":29,"tag":183,"props":16523,"children":16524},{"style":212},[16525],{"type":38,"value":79},{"type":29,"tag":183,"props":16527,"children":16528},{"style":206},[16529],{"type":38,"value":16530},"getAge",{"type":29,"tag":183,"props":16532,"children":16533},{"style":212},[16534],{"type":38,"value":1108},{"type":29,"tag":183,"props":16536,"children":16537},{"style":228},[16538],{"type":38,"value":16539}," >=",{"type":29,"tag":183,"props":16541,"children":16542},{"style":319},[16543],{"type":38,"value":16544}," 18",{"type":29,"tag":183,"props":16546,"children":16547},{"style":212},[16548],{"type":38,"value":272},{"type":29,"tag":183,"props":16550,"children":16551},{"style":212},[16552],{"type":38,"value":285},{"type":29,"tag":183,"props":16554,"children":16555},{"class":185,"line":288},[16556,16561,16565,16569,16573,16577,16581,16585,16589,16593,16597,16601,16605,16609,16613,16617,16622,16626],{"type":29,"tag":183,"props":16557,"children":16558},{"style":200},[16559],{"type":38,"value":16560},"                if",{"type":29,"tag":183,"props":16562,"children":16563},{"style":212},[16564],{"type":38,"value":1533},{"type":29,"tag":183,"props":16566,"children":16567},{"style":308},[16568],{"type":38,"value":16445},{"type":29,"tag":183,"props":16570,"children":16571},{"style":212},[16572],{"type":38,"value":79},{"type":29,"tag":183,"props":16574,"children":16575},{"style":206},[16576],{"type":38,"value":8549},{"type":29,"tag":183,"props":16578,"children":16579},{"style":212},[16580],{"type":38,"value":1108},{"type":29,"tag":183,"props":16582,"children":16583},{"style":228},[16584],{"type":38,"value":16463},{"type":29,"tag":183,"props":16586,"children":16587},{"style":1481},[16588],{"type":38,"value":5026},{"type":29,"tag":183,"props":16590,"children":16591},{"style":228},[16592],{"type":38,"value":5031},{"type":29,"tag":183,"props":16594,"children":16595},{"style":308},[16596],{"type":38,"value":16389},{"type":29,"tag":183,"props":16598,"children":16599},{"style":212},[16600],{"type":38,"value":79},{"type":29,"tag":183,"props":16602,"children":16603},{"style":206},[16604],{"type":38,"value":8549},{"type":29,"tag":183,"props":16606,"children":16607},{"style":212},[16608],{"type":38,"value":9906},{"type":29,"tag":183,"props":16610,"children":16611},{"style":206},[16612],{"type":38,"value":10312},{"type":29,"tag":183,"props":16614,"children":16615},{"style":212},[16616],{"type":38,"value":770},{"type":29,"tag":183,"props":16618,"children":16619},{"style":1683},[16620],{"type":38,"value":16621},"\"@\"",{"type":29,"tag":183,"props":16623,"children":16624},{"style":212},[16625],{"type":38,"value":15947},{"type":29,"tag":183,"props":16627,"children":16628},{"style":212},[16629],{"type":38,"value":285},{"type":29,"tag":183,"props":16631,"children":16632},{"class":185,"line":330},[16633,16638,16642],{"type":29,"tag":183,"props":16634,"children":16635},{"style":200},[16636],{"type":38,"value":16637},"                    return",{"type":29,"tag":183,"props":16639,"children":16640},{"style":1481},[16641],{"type":38,"value":14622},{"type":29,"tag":183,"props":16643,"children":16644},{"style":212},[16645],{"type":38,"value":327},{"type":29,"tag":183,"props":16647,"children":16648},{"class":185,"line":374},[16649],{"type":29,"tag":183,"props":16650,"children":16651},{"style":212},[16652],{"type":38,"value":16653},"                }\n",{"type":29,"tag":183,"props":16655,"children":16656},{"class":185,"line":430},[16657],{"type":29,"tag":183,"props":16658,"children":16659},{"style":212},[16660],{"type":38,"value":16661},"            }\n",{"type":29,"tag":183,"props":16663,"children":16664},{"class":185,"line":439},[16665],{"type":29,"tag":183,"props":16666,"children":16667},{"style":212},[16668],{"type":38,"value":11060},{"type":29,"tag":183,"props":16670,"children":16671},{"class":185,"line":448},[16672],{"type":29,"tag":183,"props":16673,"children":16674},{"style":212},[16675],{"type":38,"value":1589},{"type":29,"tag":183,"props":16677,"children":16678},{"class":185,"line":457},[16679,16683,16687],{"type":29,"tag":183,"props":16680,"children":16681},{"style":200},[16682],{"type":38,"value":919},{"type":29,"tag":183,"props":16684,"children":16685},{"style":1481},[16686],{"type":38,"value":5543},{"type":29,"tag":183,"props":16688,"children":16689},{"style":212},[16690],{"type":38,"value":327},{"type":29,"tag":183,"props":16692,"children":16693},{"class":185,"line":474},[16694],{"type":29,"tag":183,"props":16695,"children":16696},{"style":212},[16697],{"type":38,"value":436},{"type":29,"tag":30,"props":16699,"children":16700},{},[16701,16703,16707],{"type":38,"value":16702},"Cette méthode devient rapidement difficile à lire à cause des multiples niveaux d'imbrication. En appliquant ",{"type":29,"tag":34,"props":16704,"children":16705},{},[16706],{"type":38,"value":15512},{"type":38,"value":16708},", vous pouvez simplifier cela en éliminant les imbrications inutiles et en rendant le code plus lisible :",{"type":29,"tag":173,"props":16710,"children":16712},{"className":8272,"code":16711,"language":8271,"meta":8,"style":8},"\u002F\u002F Version simplifiée avec KISS\npublic boolean isFormValid(UserForm form) {\n    if (form == null || form.getName() == null || form.getName().isEmpty()) {\n        return false;\n    }\n\n    if (form.getAge() \u003C 18) {\n        return false;\n    }\n\n    return form.getEmail() != null && form.getEmail().contains(\"@\");\n}\n",[16713],{"type":29,"tag":156,"props":16714,"children":16715},{"__ignoreMap":8},[16716,16724,16759,16842,16857,16864,16871,16915,16930,16937,16944,17011],{"type":29,"tag":183,"props":16717,"children":16718},{"class":185,"line":186},[16719],{"type":29,"tag":183,"props":16720,"children":16721},{"style":190},[16722],{"type":38,"value":16723},"\u002F\u002F Version simplifiée avec KISS\n",{"type":29,"tag":183,"props":16725,"children":16726},{"class":185,"line":196},[16727,16731,16735,16739,16743,16747,16751,16755],{"type":29,"tag":183,"props":16728,"children":16729},{"style":200},[16730],{"type":38,"value":8292},{"type":29,"tag":183,"props":16732,"children":16733},{"style":200},[16734],{"type":38,"value":9995},{"type":29,"tag":183,"props":16736,"children":16737},{"style":206},[16738],{"type":38,"value":16375},{"type":29,"tag":183,"props":16740,"children":16741},{"style":212},[16742],{"type":38,"value":770},{"type":29,"tag":183,"props":16744,"children":16745},{"style":8327},[16746],{"type":38,"value":16384},{"type":29,"tag":183,"props":16748,"children":16749},{"style":308},[16750],{"type":38,"value":16389},{"type":29,"tag":183,"props":16752,"children":16753},{"style":212},[16754],{"type":38,"value":272},{"type":29,"tag":183,"props":16756,"children":16757},{"style":212},[16758],{"type":38,"value":285},{"type":29,"tag":183,"props":16760,"children":16761},{"class":185,"line":218},[16762,16766,16770,16774,16778,16782,16786,16790,16794,16798,16802,16806,16810,16814,16818,16822,16826,16830,16834,16838],{"type":29,"tag":183,"props":16763,"children":16764},{"style":200},[16765],{"type":38,"value":1528},{"type":29,"tag":183,"props":16767,"children":16768},{"style":212},[16769],{"type":38,"value":1533},{"type":29,"tag":183,"props":16771,"children":16772},{"style":308},[16773],{"type":38,"value":16413},{"type":29,"tag":183,"props":16775,"children":16776},{"style":228},[16777],{"type":38,"value":5504},{"type":29,"tag":183,"props":16779,"children":16780},{"style":1481},[16781],{"type":38,"value":5026},{"type":29,"tag":183,"props":16783,"children":16784},{"style":228},[16785],{"type":38,"value":5513},{"type":29,"tag":183,"props":16787,"children":16788},{"style":308},[16789],{"type":38,"value":16389},{"type":29,"tag":183,"props":16791,"children":16792},{"style":212},[16793],{"type":38,"value":79},{"type":29,"tag":183,"props":16795,"children":16796},{"style":206},[16797],{"type":38,"value":16454},{"type":29,"tag":183,"props":16799,"children":16800},{"style":212},[16801],{"type":38,"value":1108},{"type":29,"tag":183,"props":16803,"children":16804},{"style":228},[16805],{"type":38,"value":14617},{"type":29,"tag":183,"props":16807,"children":16808},{"style":1481},[16809],{"type":38,"value":5026},{"type":29,"tag":183,"props":16811,"children":16812},{"style":228},[16813],{"type":38,"value":5513},{"type":29,"tag":183,"props":16815,"children":16816},{"style":308},[16817],{"type":38,"value":16389},{"type":29,"tag":183,"props":16819,"children":16820},{"style":212},[16821],{"type":38,"value":79},{"type":29,"tag":183,"props":16823,"children":16824},{"style":206},[16825],{"type":38,"value":16454},{"type":29,"tag":183,"props":16827,"children":16828},{"style":212},[16829],{"type":38,"value":9906},{"type":29,"tag":183,"props":16831,"children":16832},{"style":206},[16833],{"type":38,"value":16497},{"type":29,"tag":183,"props":16835,"children":16836},{"style":212},[16837],{"type":38,"value":11009},{"type":29,"tag":183,"props":16839,"children":16840},{"style":212},[16841],{"type":38,"value":285},{"type":29,"tag":183,"props":16843,"children":16844},{"class":185,"line":245},[16845,16849,16853],{"type":29,"tag":183,"props":16846,"children":16847},{"style":200},[16848],{"type":38,"value":8571},{"type":29,"tag":183,"props":16850,"children":16851},{"style":1481},[16852],{"type":38,"value":5543},{"type":29,"tag":183,"props":16854,"children":16855},{"style":212},[16856],{"type":38,"value":327},{"type":29,"tag":183,"props":16858,"children":16859},{"class":185,"line":266},[16860],{"type":29,"tag":183,"props":16861,"children":16862},{"style":212},[16863],{"type":38,"value":1589},{"type":29,"tag":183,"props":16865,"children":16866},{"class":185,"line":288},[16867],{"type":29,"tag":183,"props":16868,"children":16869},{"emptyLinePlaceholder":13},[16870],{"type":38,"value":445},{"type":29,"tag":183,"props":16872,"children":16873},{"class":185,"line":330},[16874,16878,16882,16886,16890,16894,16898,16903,16907,16911],{"type":29,"tag":183,"props":16875,"children":16876},{"style":200},[16877],{"type":38,"value":1528},{"type":29,"tag":183,"props":16879,"children":16880},{"style":212},[16881],{"type":38,"value":1533},{"type":29,"tag":183,"props":16883,"children":16884},{"style":308},[16885],{"type":38,"value":16445},{"type":29,"tag":183,"props":16887,"children":16888},{"style":212},[16889],{"type":38,"value":79},{"type":29,"tag":183,"props":16891,"children":16892},{"style":206},[16893],{"type":38,"value":16530},{"type":29,"tag":183,"props":16895,"children":16896},{"style":212},[16897],{"type":38,"value":1108},{"type":29,"tag":183,"props":16899,"children":16900},{"style":228},[16901],{"type":38,"value":16902}," \u003C",{"type":29,"tag":183,"props":16904,"children":16905},{"style":319},[16906],{"type":38,"value":16544},{"type":29,"tag":183,"props":16908,"children":16909},{"style":212},[16910],{"type":38,"value":272},{"type":29,"tag":183,"props":16912,"children":16913},{"style":212},[16914],{"type":38,"value":285},{"type":29,"tag":183,"props":16916,"children":16917},{"class":185,"line":374},[16918,16922,16926],{"type":29,"tag":183,"props":16919,"children":16920},{"style":200},[16921],{"type":38,"value":8571},{"type":29,"tag":183,"props":16923,"children":16924},{"style":1481},[16925],{"type":38,"value":5543},{"type":29,"tag":183,"props":16927,"children":16928},{"style":212},[16929],{"type":38,"value":327},{"type":29,"tag":183,"props":16931,"children":16932},{"class":185,"line":430},[16933],{"type":29,"tag":183,"props":16934,"children":16935},{"style":212},[16936],{"type":38,"value":1589},{"type":29,"tag":183,"props":16938,"children":16939},{"class":185,"line":439},[16940],{"type":29,"tag":183,"props":16941,"children":16942},{"emptyLinePlaceholder":13},[16943],{"type":38,"value":445},{"type":29,"tag":183,"props":16945,"children":16946},{"class":185,"line":448},[16947,16951,16955,16959,16963,16967,16971,16975,16979,16983,16987,16991,16995,16999,17003,17007],{"type":29,"tag":183,"props":16948,"children":16949},{"style":200},[16950],{"type":38,"value":919},{"type":29,"tag":183,"props":16952,"children":16953},{"style":308},[16954],{"type":38,"value":16389},{"type":29,"tag":183,"props":16956,"children":16957},{"style":212},[16958],{"type":38,"value":79},{"type":29,"tag":183,"props":16960,"children":16961},{"style":206},[16962],{"type":38,"value":8549},{"type":29,"tag":183,"props":16964,"children":16965},{"style":212},[16966],{"type":38,"value":1108},{"type":29,"tag":183,"props":16968,"children":16969},{"style":228},[16970],{"type":38,"value":16463},{"type":29,"tag":183,"props":16972,"children":16973},{"style":1481},[16974],{"type":38,"value":5026},{"type":29,"tag":183,"props":16976,"children":16977},{"style":228},[16978],{"type":38,"value":5031},{"type":29,"tag":183,"props":16980,"children":16981},{"style":308},[16982],{"type":38,"value":16389},{"type":29,"tag":183,"props":16984,"children":16985},{"style":212},[16986],{"type":38,"value":79},{"type":29,"tag":183,"props":16988,"children":16989},{"style":206},[16990],{"type":38,"value":8549},{"type":29,"tag":183,"props":16992,"children":16993},{"style":212},[16994],{"type":38,"value":9906},{"type":29,"tag":183,"props":16996,"children":16997},{"style":206},[16998],{"type":38,"value":10312},{"type":29,"tag":183,"props":17000,"children":17001},{"style":212},[17002],{"type":38,"value":770},{"type":29,"tag":183,"props":17004,"children":17005},{"style":1683},[17006],{"type":38,"value":16621},{"type":29,"tag":183,"props":17008,"children":17009},{"style":212},[17010],{"type":38,"value":7487},{"type":29,"tag":183,"props":17012,"children":17013},{"class":185,"line":457},[17014],{"type":29,"tag":183,"props":17015,"children":17016},{"style":212},[17017],{"type":38,"value":436},{"type":29,"tag":30,"props":17019,"children":17020},{},[17021],{"type":38,"value":17022},"Le code est maintenant plus linéaire et plus facile à comprendre. En évitant les imbrications excessives, il est plus clair ce qui est validé et dans quel ordre.",{"type":29,"tag":14327,"props":17024,"children":17026},{"id":17025},"exemple-2-réduction-du-code-répétitif",[17027],{"type":38,"value":17028},"Exemple 2 : Réduction du code répétitif",{"type":29,"tag":30,"props":17030,"children":17031},{},[17032],{"type":38,"value":17033},"Voici un exemple où une méthode contient plusieurs lignes de code répétitives pour calculer la somme de nombres d'une liste.",{"type":29,"tag":173,"props":17035,"children":17037},{"className":8272,"code":17036,"language":8271,"meta":8,"style":8},"\u002F\u002F Code répétitif\npublic int sum(List\u003CInteger> numbers) {\n    int sum = 0;\n    for (int i = 0; i \u003C numbers.size();\n\n i++) {\n        sum += numbers.get(i);\n    }\n    return sum;\n}\n",[17038],{"type":29,"tag":156,"props":17039,"children":17040},{"__ignoreMap":8},[17041,17049,17101,17126,17182,17189,17208,17245,17252,17267],{"type":29,"tag":183,"props":17042,"children":17043},{"class":185,"line":186},[17044],{"type":29,"tag":183,"props":17045,"children":17046},{"style":190},[17047],{"type":38,"value":17048},"\u002F\u002F Code répétitif\n",{"type":29,"tag":183,"props":17050,"children":17051},{"class":185,"line":196},[17052,17056,17061,17066,17070,17075,17079,17084,17088,17093,17097],{"type":29,"tag":183,"props":17053,"children":17054},{"style":200},[17055],{"type":38,"value":8292},{"type":29,"tag":183,"props":17057,"children":17058},{"style":200},[17059],{"type":38,"value":17060}," int",{"type":29,"tag":183,"props":17062,"children":17063},{"style":206},[17064],{"type":38,"value":17065}," sum",{"type":29,"tag":183,"props":17067,"children":17068},{"style":212},[17069],{"type":38,"value":770},{"type":29,"tag":183,"props":17071,"children":17072},{"style":8327},[17073],{"type":38,"value":17074},"List",{"type":29,"tag":183,"props":17076,"children":17077},{"style":228},[17078],{"type":38,"value":1442},{"type":29,"tag":183,"props":17080,"children":17081},{"style":308},[17082],{"type":38,"value":17083},"Integer",{"type":29,"tag":183,"props":17085,"children":17086},{"style":228},[17087],{"type":38,"value":1452},{"type":29,"tag":183,"props":17089,"children":17090},{"style":308},[17091],{"type":38,"value":17092}," numbers",{"type":29,"tag":183,"props":17094,"children":17095},{"style":212},[17096],{"type":38,"value":272},{"type":29,"tag":183,"props":17098,"children":17099},{"style":212},[17100],{"type":38,"value":285},{"type":29,"tag":183,"props":17102,"children":17103},{"class":185,"line":218},[17104,17109,17114,17118,17122],{"type":29,"tag":183,"props":17105,"children":17106},{"style":200},[17107],{"type":38,"value":17108},"    int",{"type":29,"tag":183,"props":17110,"children":17111},{"style":308},[17112],{"type":38,"value":17113}," sum ",{"type":29,"tag":183,"props":17115,"children":17116},{"style":228},[17117],{"type":38,"value":8340},{"type":29,"tag":183,"props":17119,"children":17120},{"style":319},[17121],{"type":38,"value":981},{"type":29,"tag":183,"props":17123,"children":17124},{"style":212},[17125],{"type":38,"value":327},{"type":29,"tag":183,"props":17127,"children":17128},{"class":185,"line":245},[17129,17133,17137,17141,17145,17149,17153,17157,17161,17165,17169,17173,17178],{"type":29,"tag":183,"props":17130,"children":17131},{"style":200},[17132],{"type":38,"value":15668},{"type":29,"tag":183,"props":17134,"children":17135},{"style":212},[17136],{"type":38,"value":1533},{"type":29,"tag":183,"props":17138,"children":17139},{"style":200},[17140],{"type":38,"value":14444},{"type":29,"tag":183,"props":17142,"children":17143},{"style":308},[17144],{"type":38,"value":15681},{"type":29,"tag":183,"props":17146,"children":17147},{"style":228},[17148],{"type":38,"value":8340},{"type":29,"tag":183,"props":17150,"children":17151},{"style":319},[17152],{"type":38,"value":981},{"type":29,"tag":183,"props":17154,"children":17155},{"style":212},[17156],{"type":38,"value":6109},{"type":29,"tag":183,"props":17158,"children":17159},{"style":308},[17160],{"type":38,"value":15681},{"type":29,"tag":183,"props":17162,"children":17163},{"style":228},[17164],{"type":38,"value":1442},{"type":29,"tag":183,"props":17166,"children":17167},{"style":308},[17168],{"type":38,"value":17092},{"type":29,"tag":183,"props":17170,"children":17171},{"style":212},[17172],{"type":38,"value":79},{"type":29,"tag":183,"props":17174,"children":17175},{"style":206},[17176],{"type":38,"value":17177},"size",{"type":29,"tag":183,"props":17179,"children":17180},{"style":212},[17181],{"type":38,"value":9916},{"type":29,"tag":183,"props":17183,"children":17184},{"class":185,"line":266},[17185],{"type":29,"tag":183,"props":17186,"children":17187},{"emptyLinePlaceholder":13},[17188],{"type":38,"value":445},{"type":29,"tag":183,"props":17190,"children":17191},{"class":185,"line":288},[17192,17196,17200,17204],{"type":29,"tag":183,"props":17193,"children":17194},{"style":308},[17195],{"type":38,"value":15724},{"type":29,"tag":183,"props":17197,"children":17198},{"style":228},[17199],{"type":38,"value":15729},{"type":29,"tag":183,"props":17201,"children":17202},{"style":212},[17203],{"type":38,"value":272},{"type":29,"tag":183,"props":17205,"children":17206},{"style":212},[17207],{"type":38,"value":285},{"type":29,"tag":183,"props":17209,"children":17210},{"class":185,"line":330},[17211,17216,17221,17225,17229,17233,17237,17241],{"type":29,"tag":183,"props":17212,"children":17213},{"style":308},[17214],{"type":38,"value":17215},"        sum ",{"type":29,"tag":183,"props":17217,"children":17218},{"style":228},[17219],{"type":38,"value":17220},"+=",{"type":29,"tag":183,"props":17222,"children":17223},{"style":308},[17224],{"type":38,"value":17092},{"type":29,"tag":183,"props":17226,"children":17227},{"style":212},[17228],{"type":38,"value":79},{"type":29,"tag":183,"props":17230,"children":17231},{"style":206},[17232],{"type":38,"value":11634},{"type":29,"tag":183,"props":17234,"children":17235},{"style":212},[17236],{"type":38,"value":770},{"type":29,"tag":183,"props":17238,"children":17239},{"style":308},[17240],{"type":38,"value":15771},{"type":29,"tag":183,"props":17242,"children":17243},{"style":212},[17244],{"type":38,"value":7487},{"type":29,"tag":183,"props":17246,"children":17247},{"class":185,"line":374},[17248],{"type":29,"tag":183,"props":17249,"children":17250},{"style":212},[17251],{"type":38,"value":1589},{"type":29,"tag":183,"props":17253,"children":17254},{"class":185,"line":430},[17255,17259,17263],{"type":29,"tag":183,"props":17256,"children":17257},{"style":200},[17258],{"type":38,"value":919},{"type":29,"tag":183,"props":17260,"children":17261},{"style":308},[17262],{"type":38,"value":17065},{"type":29,"tag":183,"props":17264,"children":17265},{"style":212},[17266],{"type":38,"value":327},{"type":29,"tag":183,"props":17268,"children":17269},{"class":185,"line":439},[17270],{"type":29,"tag":183,"props":17271,"children":17272},{"style":212},[17273],{"type":38,"value":436},{"type":29,"tag":30,"props":17275,"children":17276},{},[17277],{"type":38,"value":17278},"On peut simplifier ce code en utilisant une méthode plus concise, telle que les streams de Java 8 :",{"type":29,"tag":173,"props":17280,"children":17282},{"className":8272,"code":17281,"language":8271,"meta":8,"style":8},"\u002F\u002F Version simplifiée avec KISS\npublic int sum(List\u003CInteger> numbers) {\n    return numbers.stream().mapToInt(Integer::intValue).sum();\n}\n",[17283],{"type":29,"tag":156,"props":17284,"children":17285},{"__ignoreMap":8},[17286,17293,17340,17401],{"type":29,"tag":183,"props":17287,"children":17288},{"class":185,"line":186},[17289],{"type":29,"tag":183,"props":17290,"children":17291},{"style":190},[17292],{"type":38,"value":16723},{"type":29,"tag":183,"props":17294,"children":17295},{"class":185,"line":196},[17296,17300,17304,17308,17312,17316,17320,17324,17328,17332,17336],{"type":29,"tag":183,"props":17297,"children":17298},{"style":200},[17299],{"type":38,"value":8292},{"type":29,"tag":183,"props":17301,"children":17302},{"style":200},[17303],{"type":38,"value":17060},{"type":29,"tag":183,"props":17305,"children":17306},{"style":206},[17307],{"type":38,"value":17065},{"type":29,"tag":183,"props":17309,"children":17310},{"style":212},[17311],{"type":38,"value":770},{"type":29,"tag":183,"props":17313,"children":17314},{"style":8327},[17315],{"type":38,"value":17074},{"type":29,"tag":183,"props":17317,"children":17318},{"style":228},[17319],{"type":38,"value":1442},{"type":29,"tag":183,"props":17321,"children":17322},{"style":308},[17323],{"type":38,"value":17083},{"type":29,"tag":183,"props":17325,"children":17326},{"style":228},[17327],{"type":38,"value":1452},{"type":29,"tag":183,"props":17329,"children":17330},{"style":308},[17331],{"type":38,"value":17092},{"type":29,"tag":183,"props":17333,"children":17334},{"style":212},[17335],{"type":38,"value":272},{"type":29,"tag":183,"props":17337,"children":17338},{"style":212},[17339],{"type":38,"value":285},{"type":29,"tag":183,"props":17341,"children":17342},{"class":185,"line":218},[17343,17347,17351,17355,17360,17364,17369,17373,17377,17382,17387,17392,17397],{"type":29,"tag":183,"props":17344,"children":17345},{"style":200},[17346],{"type":38,"value":919},{"type":29,"tag":183,"props":17348,"children":17349},{"style":308},[17350],{"type":38,"value":17092},{"type":29,"tag":183,"props":17352,"children":17353},{"style":212},[17354],{"type":38,"value":79},{"type":29,"tag":183,"props":17356,"children":17357},{"style":206},[17358],{"type":38,"value":17359},"stream",{"type":29,"tag":183,"props":17361,"children":17362},{"style":212},[17363],{"type":38,"value":9906},{"type":29,"tag":183,"props":17365,"children":17366},{"style":206},[17367],{"type":38,"value":17368},"mapToInt",{"type":29,"tag":183,"props":17370,"children":17371},{"style":212},[17372],{"type":38,"value":770},{"type":29,"tag":183,"props":17374,"children":17375},{"style":308},[17376],{"type":38,"value":17083},{"type":29,"tag":183,"props":17378,"children":17379},{"style":200},[17380],{"type":38,"value":17381},"::",{"type":29,"tag":183,"props":17383,"children":17384},{"style":308},[17385],{"type":38,"value":17386},"intValue",{"type":29,"tag":183,"props":17388,"children":17389},{"style":212},[17390],{"type":38,"value":17391},").",{"type":29,"tag":183,"props":17393,"children":17394},{"style":206},[17395],{"type":38,"value":17396},"sum",{"type":29,"tag":183,"props":17398,"children":17399},{"style":212},[17400],{"type":38,"value":9916},{"type":29,"tag":183,"props":17402,"children":17403},{"class":185,"line":245},[17404],{"type":29,"tag":183,"props":17405,"children":17406},{"style":212},[17407],{"type":38,"value":436},{"type":29,"tag":30,"props":17409,"children":17410},{},[17411],{"type":38,"value":17412},"Non seulement ce code est plus simple et plus lisible, mais il est aussi plus performant car il tire parti des fonctionnalités de Java 8 pour traiter les collections de manière efficace.",{"type":29,"tag":14327,"props":17414,"children":17416},{"id":17415},"exemple-3-utilisation-de-classes-inutiles",[17417],{"type":38,"value":17418},"Exemple 3 : Utilisation de classes inutiles",{"type":29,"tag":30,"props":17420,"children":17421},{},[17422],{"type":38,"value":17423},"Il est fréquent de voir des projets où des classes ou des abstractions sont ajoutées sans réelle justification. Par exemple, imaginons que vous ayez deux classes pour gérer l'affichage d'un utilisateur dans un système.",{"type":29,"tag":173,"props":17425,"children":17427},{"className":8272,"code":17426,"language":8271,"meta":8,"style":8},"\u002F\u002F Complexité inutile\npublic class UserDisplayService {\n    public void displayUserInfo(User user) {\n        System.out.println(\"Name: \" + user.getName());\n        System.out.println(\"Email: \" + user.getEmail());\n    }\n}\n\npublic class AdminDisplayService {\n    public void displayAdminInfo(Admin admin) {\n        System.out.println(\"Admin Name: \" + admin.getName());\n        System.out.println(\"Admin Email: \" + admin.getEmail());\n    }\n}\n",[17428],{"type":29,"tag":156,"props":17429,"children":17430},{"__ignoreMap":8},[17431,17439,17459,17497,17552,17604,17611,17618,17625,17645,17683,17735,17787,17794],{"type":29,"tag":183,"props":17432,"children":17433},{"class":185,"line":186},[17434],{"type":29,"tag":183,"props":17435,"children":17436},{"style":190},[17437],{"type":38,"value":17438},"\u002F\u002F Complexité inutile\n",{"type":29,"tag":183,"props":17440,"children":17441},{"class":185,"line":196},[17442,17446,17450,17455],{"type":29,"tag":183,"props":17443,"children":17444},{"style":200},[17445],{"type":38,"value":8292},{"type":29,"tag":183,"props":17447,"children":17448},{"style":200},[17449],{"type":38,"value":854},{"type":29,"tag":183,"props":17451,"children":17452},{"style":750},[17453],{"type":38,"value":17454}," UserDisplayService",{"type":29,"tag":183,"props":17456,"children":17457},{"style":212},[17458],{"type":38,"value":285},{"type":29,"tag":183,"props":17460,"children":17461},{"class":185,"line":218},[17462,17466,17470,17475,17479,17484,17489,17493],{"type":29,"tag":183,"props":17463,"children":17464},{"style":200},[17465],{"type":38,"value":8441},{"type":29,"tag":183,"props":17467,"children":17468},{"style":200},[17469],{"type":38,"value":9424},{"type":29,"tag":183,"props":17471,"children":17472},{"style":206},[17473],{"type":38,"value":17474}," displayUserInfo",{"type":29,"tag":183,"props":17476,"children":17477},{"style":212},[17478],{"type":38,"value":770},{"type":29,"tag":183,"props":17480,"children":17481},{"style":8327},[17482],{"type":38,"value":17483},"User",{"type":29,"tag":183,"props":17485,"children":17486},{"style":222},[17487],{"type":38,"value":17488}," user",{"type":29,"tag":183,"props":17490,"children":17491},{"style":212},[17492],{"type":38,"value":272},{"type":29,"tag":183,"props":17494,"children":17495},{"style":212},[17496],{"type":38,"value":285},{"type":29,"tag":183,"props":17498,"children":17499},{"class":185,"line":245},[17500,17505,17509,17514,17518,17523,17527,17532,17536,17540,17544,17548],{"type":29,"tag":183,"props":17501,"children":17502},{"style":308},[17503],{"type":38,"value":17504},"        System",{"type":29,"tag":183,"props":17506,"children":17507},{"style":212},[17508],{"type":38,"value":79},{"type":29,"tag":183,"props":17510,"children":17511},{"style":308},[17512],{"type":38,"value":17513},"out",{"type":29,"tag":183,"props":17515,"children":17516},{"style":212},[17517],{"type":38,"value":79},{"type":29,"tag":183,"props":17519,"children":17520},{"style":206},[17521],{"type":38,"value":17522},"println",{"type":29,"tag":183,"props":17524,"children":17525},{"style":212},[17526],{"type":38,"value":770},{"type":29,"tag":183,"props":17528,"children":17529},{"style":1683},[17530],{"type":38,"value":17531},"\"Name: \"",{"type":29,"tag":183,"props":17533,"children":17534},{"style":228},[17535],{"type":38,"value":947},{"type":29,"tag":183,"props":17537,"children":17538},{"style":308},[17539],{"type":38,"value":17488},{"type":29,"tag":183,"props":17541,"children":17542},{"style":212},[17543],{"type":38,"value":79},{"type":29,"tag":183,"props":17545,"children":17546},{"style":206},[17547],{"type":38,"value":16454},{"type":29,"tag":183,"props":17549,"children":17550},{"style":212},[17551],{"type":38,"value":11052},{"type":29,"tag":183,"props":17553,"children":17554},{"class":185,"line":266},[17555,17559,17563,17567,17571,17575,17579,17584,17588,17592,17596,17600],{"type":29,"tag":183,"props":17556,"children":17557},{"style":308},[17558],{"type":38,"value":17504},{"type":29,"tag":183,"props":17560,"children":17561},{"style":212},[17562],{"type":38,"value":79},{"type":29,"tag":183,"props":17564,"children":17565},{"style":308},[17566],{"type":38,"value":17513},{"type":29,"tag":183,"props":17568,"children":17569},{"style":212},[17570],{"type":38,"value":79},{"type":29,"tag":183,"props":17572,"children":17573},{"style":206},[17574],{"type":38,"value":17522},{"type":29,"tag":183,"props":17576,"children":17577},{"style":212},[17578],{"type":38,"value":770},{"type":29,"tag":183,"props":17580,"children":17581},{"style":1683},[17582],{"type":38,"value":17583},"\"Email: \"",{"type":29,"tag":183,"props":17585,"children":17586},{"style":228},[17587],{"type":38,"value":947},{"type":29,"tag":183,"props":17589,"children":17590},{"style":308},[17591],{"type":38,"value":17488},{"type":29,"tag":183,"props":17593,"children":17594},{"style":212},[17595],{"type":38,"value":79},{"type":29,"tag":183,"props":17597,"children":17598},{"style":206},[17599],{"type":38,"value":8549},{"type":29,"tag":183,"props":17601,"children":17602},{"style":212},[17603],{"type":38,"value":11052},{"type":29,"tag":183,"props":17605,"children":17606},{"class":185,"line":288},[17607],{"type":29,"tag":183,"props":17608,"children":17609},{"style":212},[17610],{"type":38,"value":1589},{"type":29,"tag":183,"props":17612,"children":17613},{"class":185,"line":330},[17614],{"type":29,"tag":183,"props":17615,"children":17616},{"style":212},[17617],{"type":38,"value":436},{"type":29,"tag":183,"props":17619,"children":17620},{"class":185,"line":374},[17621],{"type":29,"tag":183,"props":17622,"children":17623},{"emptyLinePlaceholder":13},[17624],{"type":38,"value":445},{"type":29,"tag":183,"props":17626,"children":17627},{"class":185,"line":430},[17628,17632,17636,17641],{"type":29,"tag":183,"props":17629,"children":17630},{"style":200},[17631],{"type":38,"value":8292},{"type":29,"tag":183,"props":17633,"children":17634},{"style":200},[17635],{"type":38,"value":854},{"type":29,"tag":183,"props":17637,"children":17638},{"style":750},[17639],{"type":38,"value":17640}," AdminDisplayService",{"type":29,"tag":183,"props":17642,"children":17643},{"style":212},[17644],{"type":38,"value":285},{"type":29,"tag":183,"props":17646,"children":17647},{"class":185,"line":439},[17648,17652,17656,17661,17665,17670,17675,17679],{"type":29,"tag":183,"props":17649,"children":17650},{"style":200},[17651],{"type":38,"value":8441},{"type":29,"tag":183,"props":17653,"children":17654},{"style":200},[17655],{"type":38,"value":9424},{"type":29,"tag":183,"props":17657,"children":17658},{"style":206},[17659],{"type":38,"value":17660}," displayAdminInfo",{"type":29,"tag":183,"props":17662,"children":17663},{"style":212},[17664],{"type":38,"value":770},{"type":29,"tag":183,"props":17666,"children":17667},{"style":8327},[17668],{"type":38,"value":17669},"Admin",{"type":29,"tag":183,"props":17671,"children":17672},{"style":222},[17673],{"type":38,"value":17674}," admin",{"type":29,"tag":183,"props":17676,"children":17677},{"style":212},[17678],{"type":38,"value":272},{"type":29,"tag":183,"props":17680,"children":17681},{"style":212},[17682],{"type":38,"value":285},{"type":29,"tag":183,"props":17684,"children":17685},{"class":185,"line":448},[17686,17690,17694,17698,17702,17706,17710,17715,17719,17723,17727,17731],{"type":29,"tag":183,"props":17687,"children":17688},{"style":308},[17689],{"type":38,"value":17504},{"type":29,"tag":183,"props":17691,"children":17692},{"style":212},[17693],{"type":38,"value":79},{"type":29,"tag":183,"props":17695,"children":17696},{"style":308},[17697],{"type":38,"value":17513},{"type":29,"tag":183,"props":17699,"children":17700},{"style":212},[17701],{"type":38,"value":79},{"type":29,"tag":183,"props":17703,"children":17704},{"style":206},[17705],{"type":38,"value":17522},{"type":29,"tag":183,"props":17707,"children":17708},{"style":212},[17709],{"type":38,"value":770},{"type":29,"tag":183,"props":17711,"children":17712},{"style":1683},[17713],{"type":38,"value":17714},"\"Admin Name: \"",{"type":29,"tag":183,"props":17716,"children":17717},{"style":228},[17718],{"type":38,"value":947},{"type":29,"tag":183,"props":17720,"children":17721},{"style":308},[17722],{"type":38,"value":17674},{"type":29,"tag":183,"props":17724,"children":17725},{"style":212},[17726],{"type":38,"value":79},{"type":29,"tag":183,"props":17728,"children":17729},{"style":206},[17730],{"type":38,"value":16454},{"type":29,"tag":183,"props":17732,"children":17733},{"style":212},[17734],{"type":38,"value":11052},{"type":29,"tag":183,"props":17736,"children":17737},{"class":185,"line":457},[17738,17742,17746,17750,17754,17758,17762,17767,17771,17775,17779,17783],{"type":29,"tag":183,"props":17739,"children":17740},{"style":308},[17741],{"type":38,"value":17504},{"type":29,"tag":183,"props":17743,"children":17744},{"style":212},[17745],{"type":38,"value":79},{"type":29,"tag":183,"props":17747,"children":17748},{"style":308},[17749],{"type":38,"value":17513},{"type":29,"tag":183,"props":17751,"children":17752},{"style":212},[17753],{"type":38,"value":79},{"type":29,"tag":183,"props":17755,"children":17756},{"style":206},[17757],{"type":38,"value":17522},{"type":29,"tag":183,"props":17759,"children":17760},{"style":212},[17761],{"type":38,"value":770},{"type":29,"tag":183,"props":17763,"children":17764},{"style":1683},[17765],{"type":38,"value":17766},"\"Admin Email: \"",{"type":29,"tag":183,"props":17768,"children":17769},{"style":228},[17770],{"type":38,"value":947},{"type":29,"tag":183,"props":17772,"children":17773},{"style":308},[17774],{"type":38,"value":17674},{"type":29,"tag":183,"props":17776,"children":17777},{"style":212},[17778],{"type":38,"value":79},{"type":29,"tag":183,"props":17780,"children":17781},{"style":206},[17782],{"type":38,"value":8549},{"type":29,"tag":183,"props":17784,"children":17785},{"style":212},[17786],{"type":38,"value":11052},{"type":29,"tag":183,"props":17788,"children":17789},{"class":185,"line":474},[17790],{"type":29,"tag":183,"props":17791,"children":17792},{"style":212},[17793],{"type":38,"value":1589},{"type":29,"tag":183,"props":17795,"children":17796},{"class":185,"line":495},[17797],{"type":29,"tag":183,"props":17798,"children":17799},{"style":212},[17800],{"type":38,"value":436},{"type":29,"tag":30,"props":17802,"children":17803},{},[17804,17806,17810],{"type":38,"value":17805},"Dans cet exemple, ces deux classes ont des fonctionnalités presque identiques. Appliquer ",{"type":29,"tag":34,"props":17807,"children":17808},{},[17809],{"type":38,"value":15512},{"type":38,"value":17811}," signifie que nous pouvons simplifier cette logique en utilisant une seule méthode générique.",{"type":29,"tag":173,"props":17813,"children":17815},{"className":8272,"code":17814,"language":8271,"meta":8,"style":8},"\u002F\u002F Version simplifiée avec KISS\npublic class UserDisplayService {\n    public void displayUserInfo(User user) {\n        System.out.println(\"Name: \" + user.getName());\n        System.out.println(\"Email: \" + user.getEmail());\n    }\n}\n",[17816],{"type":29,"tag":156,"props":17817,"children":17818},{"__ignoreMap":8},[17819,17826,17845,17880,17931,17982,17989],{"type":29,"tag":183,"props":17820,"children":17821},{"class":185,"line":186},[17822],{"type":29,"tag":183,"props":17823,"children":17824},{"style":190},[17825],{"type":38,"value":16723},{"type":29,"tag":183,"props":17827,"children":17828},{"class":185,"line":196},[17829,17833,17837,17841],{"type":29,"tag":183,"props":17830,"children":17831},{"style":200},[17832],{"type":38,"value":8292},{"type":29,"tag":183,"props":17834,"children":17835},{"style":200},[17836],{"type":38,"value":854},{"type":29,"tag":183,"props":17838,"children":17839},{"style":750},[17840],{"type":38,"value":17454},{"type":29,"tag":183,"props":17842,"children":17843},{"style":212},[17844],{"type":38,"value":285},{"type":29,"tag":183,"props":17846,"children":17847},{"class":185,"line":218},[17848,17852,17856,17860,17864,17868,17872,17876],{"type":29,"tag":183,"props":17849,"children":17850},{"style":200},[17851],{"type":38,"value":8441},{"type":29,"tag":183,"props":17853,"children":17854},{"style":200},[17855],{"type":38,"value":9424},{"type":29,"tag":183,"props":17857,"children":17858},{"style":206},[17859],{"type":38,"value":17474},{"type":29,"tag":183,"props":17861,"children":17862},{"style":212},[17863],{"type":38,"value":770},{"type":29,"tag":183,"props":17865,"children":17866},{"style":8327},[17867],{"type":38,"value":17483},{"type":29,"tag":183,"props":17869,"children":17870},{"style":222},[17871],{"type":38,"value":17488},{"type":29,"tag":183,"props":17873,"children":17874},{"style":212},[17875],{"type":38,"value":272},{"type":29,"tag":183,"props":17877,"children":17878},{"style":212},[17879],{"type":38,"value":285},{"type":29,"tag":183,"props":17881,"children":17882},{"class":185,"line":245},[17883,17887,17891,17895,17899,17903,17907,17911,17915,17919,17923,17927],{"type":29,"tag":183,"props":17884,"children":17885},{"style":308},[17886],{"type":38,"value":17504},{"type":29,"tag":183,"props":17888,"children":17889},{"style":212},[17890],{"type":38,"value":79},{"type":29,"tag":183,"props":17892,"children":17893},{"style":308},[17894],{"type":38,"value":17513},{"type":29,"tag":183,"props":17896,"children":17897},{"style":212},[17898],{"type":38,"value":79},{"type":29,"tag":183,"props":17900,"children":17901},{"style":206},[17902],{"type":38,"value":17522},{"type":29,"tag":183,"props":17904,"children":17905},{"style":212},[17906],{"type":38,"value":770},{"type":29,"tag":183,"props":17908,"children":17909},{"style":1683},[17910],{"type":38,"value":17531},{"type":29,"tag":183,"props":17912,"children":17913},{"style":228},[17914],{"type":38,"value":947},{"type":29,"tag":183,"props":17916,"children":17917},{"style":308},[17918],{"type":38,"value":17488},{"type":29,"tag":183,"props":17920,"children":17921},{"style":212},[17922],{"type":38,"value":79},{"type":29,"tag":183,"props":17924,"children":17925},{"style":206},[17926],{"type":38,"value":16454},{"type":29,"tag":183,"props":17928,"children":17929},{"style":212},[17930],{"type":38,"value":11052},{"type":29,"tag":183,"props":17932,"children":17933},{"class":185,"line":266},[17934,17938,17942,17946,17950,17954,17958,17962,17966,17970,17974,17978],{"type":29,"tag":183,"props":17935,"children":17936},{"style":308},[17937],{"type":38,"value":17504},{"type":29,"tag":183,"props":17939,"children":17940},{"style":212},[17941],{"type":38,"value":79},{"type":29,"tag":183,"props":17943,"children":17944},{"style":308},[17945],{"type":38,"value":17513},{"type":29,"tag":183,"props":17947,"children":17948},{"style":212},[17949],{"type":38,"value":79},{"type":29,"tag":183,"props":17951,"children":17952},{"style":206},[17953],{"type":38,"value":17522},{"type":29,"tag":183,"props":17955,"children":17956},{"style":212},[17957],{"type":38,"value":770},{"type":29,"tag":183,"props":17959,"children":17960},{"style":1683},[17961],{"type":38,"value":17583},{"type":29,"tag":183,"props":17963,"children":17964},{"style":228},[17965],{"type":38,"value":947},{"type":29,"tag":183,"props":17967,"children":17968},{"style":308},[17969],{"type":38,"value":17488},{"type":29,"tag":183,"props":17971,"children":17972},{"style":212},[17973],{"type":38,"value":79},{"type":29,"tag":183,"props":17975,"children":17976},{"style":206},[17977],{"type":38,"value":8549},{"type":29,"tag":183,"props":17979,"children":17980},{"style":212},[17981],{"type":38,"value":11052},{"type":29,"tag":183,"props":17983,"children":17984},{"class":185,"line":288},[17985],{"type":29,"tag":183,"props":17986,"children":17987},{"style":212},[17988],{"type":38,"value":1589},{"type":29,"tag":183,"props":17990,"children":17991},{"class":185,"line":330},[17992],{"type":29,"tag":183,"props":17993,"children":17994},{"style":212},[17995],{"type":38,"value":436},{"type":29,"tag":30,"props":17997,"children":17998},{},[17999],{"type":38,"value":18000},"Au lieu de dupliquer le code pour les utilisateurs normaux et les administrateurs, nous réutilisons une seule méthode qui accomplit la même tâche. Cela rend le code plus maintenable.",{"type":29,"tag":14327,"props":18002,"children":18004},{"id":18003},"exemple-4-refactorisation-de-méthodes-longues",[18005],{"type":38,"value":18006},"Exemple 4 : Refactorisation de méthodes longues",{"type":29,"tag":30,"props":18008,"children":18009},{},[18010],{"type":38,"value":18011},"Voici un exemple d’une méthode qui fait beaucoup trop de choses à la fois, rendant le code difficile à comprendre et à maintenir :",{"type":29,"tag":173,"props":18013,"children":18015},{"className":8272,"code":18014,"language":8271,"meta":8,"style":8},"\u002F\u002F Méthode longue et complexe\npublic void processOrder(Order order) {\n    \u002F\u002F Valider la commande\n    if (order.isValid()) {\n        \u002F\u002F Calculer le total\n        double total = 0;\n        for (OrderItem item : order.getItems()) {\n            total += item.getPrice() * item.getQuantity();\n        }\n\n        \u002F\u002F Appliquer une réduction\n        if (order.getDiscountCode() != null) {\n            total -= calculateDiscount(total, order.getDiscountCode());\n        }\n\n        \u002F\u002F Envoi de la commande\n        sendOrder(order, total);\n    }\n}\n",[18016],{"type":29,"tag":156,"props":18017,"children":18018},{"__ignoreMap":8},[18019,18027,18062,18070,18102,18110,18135,18182,18234,18241,18248,18256,18300,18346,18353,18360,18368,18396,18403],{"type":29,"tag":183,"props":18020,"children":18021},{"class":185,"line":186},[18022],{"type":29,"tag":183,"props":18023,"children":18024},{"style":190},[18025],{"type":38,"value":18026},"\u002F\u002F Méthode longue et complexe\n",{"type":29,"tag":183,"props":18028,"children":18029},{"class":185,"line":196},[18030,18034,18038,18042,18046,18050,18054,18058],{"type":29,"tag":183,"props":18031,"children":18032},{"style":200},[18033],{"type":38,"value":8292},{"type":29,"tag":183,"props":18035,"children":18036},{"style":200},[18037],{"type":38,"value":9424},{"type":29,"tag":183,"props":18039,"children":18040},{"style":206},[18041],{"type":38,"value":14773},{"type":29,"tag":183,"props":18043,"children":18044},{"style":212},[18045],{"type":38,"value":770},{"type":29,"tag":183,"props":18047,"children":18048},{"style":8327},[18049],{"type":38,"value":10485},{"type":29,"tag":183,"props":18051,"children":18052},{"style":308},[18053],{"type":38,"value":12380},{"type":29,"tag":183,"props":18055,"children":18056},{"style":212},[18057],{"type":38,"value":272},{"type":29,"tag":183,"props":18059,"children":18060},{"style":212},[18061],{"type":38,"value":285},{"type":29,"tag":183,"props":18063,"children":18064},{"class":185,"line":218},[18065],{"type":29,"tag":183,"props":18066,"children":18067},{"style":190},[18068],{"type":38,"value":18069},"    \u002F\u002F Valider la commande\n",{"type":29,"tag":183,"props":18071,"children":18072},{"class":185,"line":245},[18073,18077,18081,18085,18089,18094,18098],{"type":29,"tag":183,"props":18074,"children":18075},{"style":200},[18076],{"type":38,"value":1528},{"type":29,"tag":183,"props":18078,"children":18079},{"style":212},[18080],{"type":38,"value":1533},{"type":29,"tag":183,"props":18082,"children":18083},{"style":308},[18084],{"type":38,"value":13250},{"type":29,"tag":183,"props":18086,"children":18087},{"style":212},[18088],{"type":38,"value":79},{"type":29,"tag":183,"props":18090,"children":18091},{"style":206},[18092],{"type":38,"value":18093},"isValid",{"type":29,"tag":183,"props":18095,"children":18096},{"style":212},[18097],{"type":38,"value":11009},{"type":29,"tag":183,"props":18099,"children":18100},{"style":212},[18101],{"type":38,"value":285},{"type":29,"tag":183,"props":18103,"children":18104},{"class":185,"line":266},[18105],{"type":29,"tag":183,"props":18106,"children":18107},{"style":190},[18108],{"type":38,"value":18109},"        \u002F\u002F Calculer le total\n",{"type":29,"tag":183,"props":18111,"children":18112},{"class":185,"line":288},[18113,18118,18123,18127,18131],{"type":29,"tag":183,"props":18114,"children":18115},{"style":200},[18116],{"type":38,"value":18117},"        double",{"type":29,"tag":183,"props":18119,"children":18120},{"style":308},[18121],{"type":38,"value":18122}," total ",{"type":29,"tag":183,"props":18124,"children":18125},{"style":228},[18126],{"type":38,"value":8340},{"type":29,"tag":183,"props":18128,"children":18129},{"style":319},[18130],{"type":38,"value":981},{"type":29,"tag":183,"props":18132,"children":18133},{"style":212},[18134],{"type":38,"value":327},{"type":29,"tag":183,"props":18136,"children":18137},{"class":185,"line":330},[18138,18143,18147,18152,18157,18161,18165,18169,18174,18178],{"type":29,"tag":183,"props":18139,"children":18140},{"style":200},[18141],{"type":38,"value":18142},"        for",{"type":29,"tag":183,"props":18144,"children":18145},{"style":212},[18146],{"type":38,"value":1533},{"type":29,"tag":183,"props":18148,"children":18149},{"style":8327},[18150],{"type":38,"value":18151},"OrderItem",{"type":29,"tag":183,"props":18153,"children":18154},{"style":308},[18155],{"type":38,"value":18156}," item ",{"type":29,"tag":183,"props":18158,"children":18159},{"style":200},[18160],{"type":38,"value":231},{"type":29,"tag":183,"props":18162,"children":18163},{"style":308},[18164],{"type":38,"value":12380},{"type":29,"tag":183,"props":18166,"children":18167},{"style":212},[18168],{"type":38,"value":79},{"type":29,"tag":183,"props":18170,"children":18171},{"style":206},[18172],{"type":38,"value":18173},"getItems",{"type":29,"tag":183,"props":18175,"children":18176},{"style":212},[18177],{"type":38,"value":11009},{"type":29,"tag":183,"props":18179,"children":18180},{"style":212},[18181],{"type":38,"value":285},{"type":29,"tag":183,"props":18183,"children":18184},{"class":185,"line":374},[18185,18190,18194,18199,18203,18208,18212,18217,18221,18225,18230],{"type":29,"tag":183,"props":18186,"children":18187},{"style":308},[18188],{"type":38,"value":18189},"            total ",{"type":29,"tag":183,"props":18191,"children":18192},{"style":228},[18193],{"type":38,"value":17220},{"type":29,"tag":183,"props":18195,"children":18196},{"style":308},[18197],{"type":38,"value":18198}," item",{"type":29,"tag":183,"props":18200,"children":18201},{"style":212},[18202],{"type":38,"value":79},{"type":29,"tag":183,"props":18204,"children":18205},{"style":206},[18206],{"type":38,"value":18207},"getPrice",{"type":29,"tag":183,"props":18209,"children":18210},{"style":212},[18211],{"type":38,"value":1108},{"type":29,"tag":183,"props":18213,"children":18214},{"style":228},[18215],{"type":38,"value":18216}," *",{"type":29,"tag":183,"props":18218,"children":18219},{"style":308},[18220],{"type":38,"value":18198},{"type":29,"tag":183,"props":18222,"children":18223},{"style":212},[18224],{"type":38,"value":79},{"type":29,"tag":183,"props":18226,"children":18227},{"style":206},[18228],{"type":38,"value":18229},"getQuantity",{"type":29,"tag":183,"props":18231,"children":18232},{"style":212},[18233],{"type":38,"value":9916},{"type":29,"tag":183,"props":18235,"children":18236},{"class":185,"line":430},[18237],{"type":29,"tag":183,"props":18238,"children":18239},{"style":212},[18240],{"type":38,"value":11060},{"type":29,"tag":183,"props":18242,"children":18243},{"class":185,"line":439},[18244],{"type":29,"tag":183,"props":18245,"children":18246},{"emptyLinePlaceholder":13},[18247],{"type":38,"value":445},{"type":29,"tag":183,"props":18249,"children":18250},{"class":185,"line":448},[18251],{"type":29,"tag":183,"props":18252,"children":18253},{"style":190},[18254],{"type":38,"value":18255},"        \u002F\u002F Appliquer une réduction\n",{"type":29,"tag":183,"props":18257,"children":18258},{"class":185,"line":457},[18259,18263,18267,18271,18275,18280,18284,18288,18292,18296],{"type":29,"tag":183,"props":18260,"children":18261},{"style":200},[18262],{"type":38,"value":10982},{"type":29,"tag":183,"props":18264,"children":18265},{"style":212},[18266],{"type":38,"value":1533},{"type":29,"tag":183,"props":18268,"children":18269},{"style":308},[18270],{"type":38,"value":13250},{"type":29,"tag":183,"props":18272,"children":18273},{"style":212},[18274],{"type":38,"value":79},{"type":29,"tag":183,"props":18276,"children":18277},{"style":206},[18278],{"type":38,"value":18279},"getDiscountCode",{"type":29,"tag":183,"props":18281,"children":18282},{"style":212},[18283],{"type":38,"value":1108},{"type":29,"tag":183,"props":18285,"children":18286},{"style":228},[18287],{"type":38,"value":16463},{"type":29,"tag":183,"props":18289,"children":18290},{"style":1481},[18291],{"type":38,"value":5026},{"type":29,"tag":183,"props":18293,"children":18294},{"style":212},[18295],{"type":38,"value":272},{"type":29,"tag":183,"props":18297,"children":18298},{"style":212},[18299],{"type":38,"value":285},{"type":29,"tag":183,"props":18301,"children":18302},{"class":185,"line":474},[18303,18307,18312,18317,18321,18326,18330,18334,18338,18342],{"type":29,"tag":183,"props":18304,"children":18305},{"style":308},[18306],{"type":38,"value":18189},{"type":29,"tag":183,"props":18308,"children":18309},{"style":228},[18310],{"type":38,"value":18311},"-=",{"type":29,"tag":183,"props":18313,"children":18314},{"style":206},[18315],{"type":38,"value":18316}," calculateDiscount",{"type":29,"tag":183,"props":18318,"children":18319},{"style":212},[18320],{"type":38,"value":770},{"type":29,"tag":183,"props":18322,"children":18323},{"style":308},[18324],{"type":38,"value":18325},"total",{"type":29,"tag":183,"props":18327,"children":18328},{"style":212},[18329],{"type":38,"value":2694},{"type":29,"tag":183,"props":18331,"children":18332},{"style":308},[18333],{"type":38,"value":12380},{"type":29,"tag":183,"props":18335,"children":18336},{"style":212},[18337],{"type":38,"value":79},{"type":29,"tag":183,"props":18339,"children":18340},{"style":206},[18341],{"type":38,"value":18279},{"type":29,"tag":183,"props":18343,"children":18344},{"style":212},[18345],{"type":38,"value":11052},{"type":29,"tag":183,"props":18347,"children":18348},{"class":185,"line":495},[18349],{"type":29,"tag":183,"props":18350,"children":18351},{"style":212},[18352],{"type":38,"value":11060},{"type":29,"tag":183,"props":18354,"children":18355},{"class":185,"line":516},[18356],{"type":29,"tag":183,"props":18357,"children":18358},{"emptyLinePlaceholder":13},[18359],{"type":38,"value":445},{"type":29,"tag":183,"props":18361,"children":18362},{"class":185,"line":536},[18363],{"type":29,"tag":183,"props":18364,"children":18365},{"style":190},[18366],{"type":38,"value":18367},"        \u002F\u002F Envoi de la commande\n",{"type":29,"tag":183,"props":18369,"children":18370},{"class":185,"line":570},[18371,18376,18380,18384,18388,18392],{"type":29,"tag":183,"props":18372,"children":18373},{"style":206},[18374],{"type":38,"value":18375},"        sendOrder",{"type":29,"tag":183,"props":18377,"children":18378},{"style":212},[18379],{"type":38,"value":770},{"type":29,"tag":183,"props":18381,"children":18382},{"style":308},[18383],{"type":38,"value":13250},{"type":29,"tag":183,"props":18385,"children":18386},{"style":212},[18387],{"type":38,"value":2694},{"type":29,"tag":183,"props":18389,"children":18390},{"style":308},[18391],{"type":38,"value":580},{"type":29,"tag":183,"props":18393,"children":18394},{"style":212},[18395],{"type":38,"value":7487},{"type":29,"tag":183,"props":18397,"children":18398},{"class":185,"line":613},[18399],{"type":29,"tag":183,"props":18400,"children":18401},{"style":212},[18402],{"type":38,"value":1589},{"type":29,"tag":183,"props":18404,"children":18405},{"class":185,"line":662},[18406],{"type":29,"tag":183,"props":18407,"children":18408},{"style":212},[18409],{"type":38,"value":436},{"type":29,"tag":30,"props":18411,"children":18412},{},[18413,18415,18419],{"type":38,"value":18414},"En appliquant ",{"type":29,"tag":34,"props":18416,"children":18417},{},[18418],{"type":38,"value":15512},{"type":38,"value":18420},", nous pouvons décomposer cette méthode en plusieurs petites méthodes avec des responsabilités claires :",{"type":29,"tag":173,"props":18422,"children":18424},{"className":8272,"code":18423,"language":8271,"meta":8,"style":8},"\u002F\u002F Version simplifiée avec KISS\npublic void processOrder(Order order) {\n    if (!order.isValid()) {\n        return;\n    }\n    \n    double total = calculateTotal(order);\n    total = applyDiscount(order, total);\n    \n    sendOrder(order, total);\n}\n\nprivate double calculateTotal(Order order) {\n    return order.getItems().stream()\n        .mapToDouble(item -> item.getPrice() * item.getQuantity())\n        .sum();\n}\n\nprivate double applyDiscount(Order order, double total) {\n    if (order.getDiscountCode() != null) {\n        return total - calculateDiscount(total, order.getDiscountCode());\n    }\n    return total;\n}\n",[18425],{"type":29,"tag":156,"props":18426,"children":18427},{"__ignoreMap":8},[18428,18435,18470,18505,18516,18523,18531,18564,18601,18608,18636,18643,18650,18686,18717,18779,18794,18801,18808,18855,18898,18946,18953,18968],{"type":29,"tag":183,"props":18429,"children":18430},{"class":185,"line":186},[18431],{"type":29,"tag":183,"props":18432,"children":18433},{"style":190},[18434],{"type":38,"value":16723},{"type":29,"tag":183,"props":18436,"children":18437},{"class":185,"line":196},[18438,18442,18446,18450,18454,18458,18462,18466],{"type":29,"tag":183,"props":18439,"children":18440},{"style":200},[18441],{"type":38,"value":8292},{"type":29,"tag":183,"props":18443,"children":18444},{"style":200},[18445],{"type":38,"value":9424},{"type":29,"tag":183,"props":18447,"children":18448},{"style":206},[18449],{"type":38,"value":14773},{"type":29,"tag":183,"props":18451,"children":18452},{"style":212},[18453],{"type":38,"value":770},{"type":29,"tag":183,"props":18455,"children":18456},{"style":8327},[18457],{"type":38,"value":10485},{"type":29,"tag":183,"props":18459,"children":18460},{"style":308},[18461],{"type":38,"value":12380},{"type":29,"tag":183,"props":18463,"children":18464},{"style":212},[18465],{"type":38,"value":272},{"type":29,"tag":183,"props":18467,"children":18468},{"style":212},[18469],{"type":38,"value":285},{"type":29,"tag":183,"props":18471,"children":18472},{"class":185,"line":218},[18473,18477,18481,18485,18489,18493,18497,18501],{"type":29,"tag":183,"props":18474,"children":18475},{"style":200},[18476],{"type":38,"value":1528},{"type":29,"tag":183,"props":18478,"children":18479},{"style":212},[18480],{"type":38,"value":1533},{"type":29,"tag":183,"props":18482,"children":18483},{"style":228},[18484],{"type":38,"value":1538},{"type":29,"tag":183,"props":18486,"children":18487},{"style":308},[18488],{"type":38,"value":13250},{"type":29,"tag":183,"props":18490,"children":18491},{"style":212},[18492],{"type":38,"value":79},{"type":29,"tag":183,"props":18494,"children":18495},{"style":206},[18496],{"type":38,"value":18093},{"type":29,"tag":183,"props":18498,"children":18499},{"style":212},[18500],{"type":38,"value":11009},{"type":29,"tag":183,"props":18502,"children":18503},{"style":212},[18504],{"type":38,"value":285},{"type":29,"tag":183,"props":18506,"children":18507},{"class":185,"line":245},[18508,18512],{"type":29,"tag":183,"props":18509,"children":18510},{"style":200},[18511],{"type":38,"value":8571},{"type":29,"tag":183,"props":18513,"children":18514},{"style":212},[18515],{"type":38,"value":327},{"type":29,"tag":183,"props":18517,"children":18518},{"class":185,"line":266},[18519],{"type":29,"tag":183,"props":18520,"children":18521},{"style":212},[18522],{"type":38,"value":1589},{"type":29,"tag":183,"props":18524,"children":18525},{"class":185,"line":288},[18526],{"type":29,"tag":183,"props":18527,"children":18528},{"style":308},[18529],{"type":38,"value":18530},"    \n",{"type":29,"tag":183,"props":18532,"children":18533},{"class":185,"line":330},[18534,18539,18543,18547,18552,18556,18560],{"type":29,"tag":183,"props":18535,"children":18536},{"style":200},[18537],{"type":38,"value":18538},"    double",{"type":29,"tag":183,"props":18540,"children":18541},{"style":308},[18542],{"type":38,"value":18122},{"type":29,"tag":183,"props":18544,"children":18545},{"style":228},[18546],{"type":38,"value":8340},{"type":29,"tag":183,"props":18548,"children":18549},{"style":206},[18550],{"type":38,"value":18551}," calculateTotal",{"type":29,"tag":183,"props":18553,"children":18554},{"style":212},[18555],{"type":38,"value":770},{"type":29,"tag":183,"props":18557,"children":18558},{"style":308},[18559],{"type":38,"value":13250},{"type":29,"tag":183,"props":18561,"children":18562},{"style":212},[18563],{"type":38,"value":7487},{"type":29,"tag":183,"props":18565,"children":18566},{"class":185,"line":374},[18567,18572,18576,18581,18585,18589,18593,18597],{"type":29,"tag":183,"props":18568,"children":18569},{"style":308},[18570],{"type":38,"value":18571},"    total ",{"type":29,"tag":183,"props":18573,"children":18574},{"style":228},[18575],{"type":38,"value":8340},{"type":29,"tag":183,"props":18577,"children":18578},{"style":206},[18579],{"type":38,"value":18580}," applyDiscount",{"type":29,"tag":183,"props":18582,"children":18583},{"style":212},[18584],{"type":38,"value":770},{"type":29,"tag":183,"props":18586,"children":18587},{"style":308},[18588],{"type":38,"value":13250},{"type":29,"tag":183,"props":18590,"children":18591},{"style":212},[18592],{"type":38,"value":2694},{"type":29,"tag":183,"props":18594,"children":18595},{"style":308},[18596],{"type":38,"value":580},{"type":29,"tag":183,"props":18598,"children":18599},{"style":212},[18600],{"type":38,"value":7487},{"type":29,"tag":183,"props":18602,"children":18603},{"class":185,"line":430},[18604],{"type":29,"tag":183,"props":18605,"children":18606},{"style":308},[18607],{"type":38,"value":18530},{"type":29,"tag":183,"props":18609,"children":18610},{"class":185,"line":439},[18611,18616,18620,18624,18628,18632],{"type":29,"tag":183,"props":18612,"children":18613},{"style":206},[18614],{"type":38,"value":18615},"    sendOrder",{"type":29,"tag":183,"props":18617,"children":18618},{"style":212},[18619],{"type":38,"value":770},{"type":29,"tag":183,"props":18621,"children":18622},{"style":308},[18623],{"type":38,"value":13250},{"type":29,"tag":183,"props":18625,"children":18626},{"style":212},[18627],{"type":38,"value":2694},{"type":29,"tag":183,"props":18629,"children":18630},{"style":308},[18631],{"type":38,"value":580},{"type":29,"tag":183,"props":18633,"children":18634},{"style":212},[18635],{"type":38,"value":7487},{"type":29,"tag":183,"props":18637,"children":18638},{"class":185,"line":448},[18639],{"type":29,"tag":183,"props":18640,"children":18641},{"style":212},[18642],{"type":38,"value":436},{"type":29,"tag":183,"props":18644,"children":18645},{"class":185,"line":457},[18646],{"type":29,"tag":183,"props":18647,"children":18648},{"emptyLinePlaceholder":13},[18649],{"type":38,"value":445},{"type":29,"tag":183,"props":18651,"children":18652},{"class":185,"line":474},[18653,18657,18662,18666,18670,18674,18678,18682],{"type":29,"tag":183,"props":18654,"children":18655},{"style":200},[18656],{"type":38,"value":14943},{"type":29,"tag":183,"props":18658,"children":18659},{"style":200},[18660],{"type":38,"value":18661}," double",{"type":29,"tag":183,"props":18663,"children":18664},{"style":206},[18665],{"type":38,"value":18551},{"type":29,"tag":183,"props":18667,"children":18668},{"style":212},[18669],{"type":38,"value":770},{"type":29,"tag":183,"props":18671,"children":18672},{"style":8327},[18673],{"type":38,"value":10485},{"type":29,"tag":183,"props":18675,"children":18676},{"style":308},[18677],{"type":38,"value":12380},{"type":29,"tag":183,"props":18679,"children":18680},{"style":212},[18681],{"type":38,"value":272},{"type":29,"tag":183,"props":18683,"children":18684},{"style":212},[18685],{"type":38,"value":285},{"type":29,"tag":183,"props":18687,"children":18688},{"class":185,"line":495},[18689,18693,18697,18701,18705,18709,18713],{"type":29,"tag":183,"props":18690,"children":18691},{"style":200},[18692],{"type":38,"value":919},{"type":29,"tag":183,"props":18694,"children":18695},{"style":308},[18696],{"type":38,"value":12380},{"type":29,"tag":183,"props":18698,"children":18699},{"style":212},[18700],{"type":38,"value":79},{"type":29,"tag":183,"props":18702,"children":18703},{"style":206},[18704],{"type":38,"value":18173},{"type":29,"tag":183,"props":18706,"children":18707},{"style":212},[18708],{"type":38,"value":9906},{"type":29,"tag":183,"props":18710,"children":18711},{"style":206},[18712],{"type":38,"value":17359},{"type":29,"tag":183,"props":18714,"children":18715},{"style":212},[18716],{"type":38,"value":842},{"type":29,"tag":183,"props":18718,"children":18719},{"class":185,"line":516},[18720,18725,18730,18734,18739,18743,18747,18751,18755,18759,18763,18767,18771,18775],{"type":29,"tag":183,"props":18721,"children":18722},{"style":212},[18723],{"type":38,"value":18724},"        .",{"type":29,"tag":183,"props":18726,"children":18727},{"style":206},[18728],{"type":38,"value":18729},"mapToDouble",{"type":29,"tag":183,"props":18731,"children":18732},{"style":212},[18733],{"type":38,"value":770},{"type":29,"tag":183,"props":18735,"children":18736},{"style":308},[18737],{"type":38,"value":18738},"item ",{"type":29,"tag":183,"props":18740,"children":18741},{"style":200},[18742],{"type":38,"value":11673},{"type":29,"tag":183,"props":18744,"children":18745},{"style":308},[18746],{"type":38,"value":18198},{"type":29,"tag":183,"props":18748,"children":18749},{"style":212},[18750],{"type":38,"value":79},{"type":29,"tag":183,"props":18752,"children":18753},{"style":206},[18754],{"type":38,"value":18207},{"type":29,"tag":183,"props":18756,"children":18757},{"style":212},[18758],{"type":38,"value":1108},{"type":29,"tag":183,"props":18760,"children":18761},{"style":228},[18762],{"type":38,"value":18216},{"type":29,"tag":183,"props":18764,"children":18765},{"style":308},[18766],{"type":38,"value":18198},{"type":29,"tag":183,"props":18768,"children":18769},{"style":212},[18770],{"type":38,"value":79},{"type":29,"tag":183,"props":18772,"children":18773},{"style":206},[18774],{"type":38,"value":18229},{"type":29,"tag":183,"props":18776,"children":18777},{"style":212},[18778],{"type":38,"value":11136},{"type":29,"tag":183,"props":18780,"children":18781},{"class":185,"line":536},[18782,18786,18790],{"type":29,"tag":183,"props":18783,"children":18784},{"style":212},[18785],{"type":38,"value":18724},{"type":29,"tag":183,"props":18787,"children":18788},{"style":206},[18789],{"type":38,"value":17396},{"type":29,"tag":183,"props":18791,"children":18792},{"style":212},[18793],{"type":38,"value":9916},{"type":29,"tag":183,"props":18795,"children":18796},{"class":185,"line":570},[18797],{"type":29,"tag":183,"props":18798,"children":18799},{"style":212},[18800],{"type":38,"value":436},{"type":29,"tag":183,"props":18802,"children":18803},{"class":185,"line":613},[18804],{"type":29,"tag":183,"props":18805,"children":18806},{"emptyLinePlaceholder":13},[18807],{"type":38,"value":445},{"type":29,"tag":183,"props":18809,"children":18810},{"class":185,"line":662},[18811,18815,18819,18823,18827,18831,18835,18839,18843,18847,18851],{"type":29,"tag":183,"props":18812,"children":18813},{"style":200},[18814],{"type":38,"value":14943},{"type":29,"tag":183,"props":18816,"children":18817},{"style":200},[18818],{"type":38,"value":18661},{"type":29,"tag":183,"props":18820,"children":18821},{"style":206},[18822],{"type":38,"value":18580},{"type":29,"tag":183,"props":18824,"children":18825},{"style":212},[18826],{"type":38,"value":770},{"type":29,"tag":183,"props":18828,"children":18829},{"style":8327},[18830],{"type":38,"value":10485},{"type":29,"tag":183,"props":18832,"children":18833},{"style":308},[18834],{"type":38,"value":12380},{"type":29,"tag":183,"props":18836,"children":18837},{"style":212},[18838],{"type":38,"value":2694},{"type":29,"tag":183,"props":18840,"children":18841},{"style":200},[18842],{"type":38,"value":18661},{"type":29,"tag":183,"props":18844,"children":18845},{"style":308},[18846],{"type":38,"value":580},{"type":29,"tag":183,"props":18848,"children":18849},{"style":212},[18850],{"type":38,"value":272},{"type":29,"tag":183,"props":18852,"children":18853},{"style":212},[18854],{"type":38,"value":285},{"type":29,"tag":183,"props":18856,"children":18857},{"class":185,"line":3095},[18858,18862,18866,18870,18874,18878,18882,18886,18890,18894],{"type":29,"tag":183,"props":18859,"children":18860},{"style":200},[18861],{"type":38,"value":1528},{"type":29,"tag":183,"props":18863,"children":18864},{"style":212},[18865],{"type":38,"value":1533},{"type":29,"tag":183,"props":18867,"children":18868},{"style":308},[18869],{"type":38,"value":13250},{"type":29,"tag":183,"props":18871,"children":18872},{"style":212},[18873],{"type":38,"value":79},{"type":29,"tag":183,"props":18875,"children":18876},{"style":206},[18877],{"type":38,"value":18279},{"type":29,"tag":183,"props":18879,"children":18880},{"style":212},[18881],{"type":38,"value":1108},{"type":29,"tag":183,"props":18883,"children":18884},{"style":228},[18885],{"type":38,"value":16463},{"type":29,"tag":183,"props":18887,"children":18888},{"style":1481},[18889],{"type":38,"value":5026},{"type":29,"tag":183,"props":18891,"children":18892},{"style":212},[18893],{"type":38,"value":272},{"type":29,"tag":183,"props":18895,"children":18896},{"style":212},[18897],{"type":38,"value":285},{"type":29,"tag":183,"props":18899,"children":18900},{"class":185,"line":3154},[18901,18905,18909,18914,18918,18922,18926,18930,18934,18938,18942],{"type":29,"tag":183,"props":18902,"children":18903},{"style":200},[18904],{"type":38,"value":8571},{"type":29,"tag":183,"props":18906,"children":18907},{"style":308},[18908],{"type":38,"value":18122},{"type":29,"tag":183,"props":18910,"children":18911},{"style":228},[18912],{"type":38,"value":18913},"-",{"type":29,"tag":183,"props":18915,"children":18916},{"style":206},[18917],{"type":38,"value":18316},{"type":29,"tag":183,"props":18919,"children":18920},{"style":212},[18921],{"type":38,"value":770},{"type":29,"tag":183,"props":18923,"children":18924},{"style":308},[18925],{"type":38,"value":18325},{"type":29,"tag":183,"props":18927,"children":18928},{"style":212},[18929],{"type":38,"value":2694},{"type":29,"tag":183,"props":18931,"children":18932},{"style":308},[18933],{"type":38,"value":12380},{"type":29,"tag":183,"props":18935,"children":18936},{"style":212},[18937],{"type":38,"value":79},{"type":29,"tag":183,"props":18939,"children":18940},{"style":206},[18941],{"type":38,"value":18279},{"type":29,"tag":183,"props":18943,"children":18944},{"style":212},[18945],{"type":38,"value":11052},{"type":29,"tag":183,"props":18947,"children":18948},{"class":185,"line":3207},[18949],{"type":29,"tag":183,"props":18950,"children":18951},{"style":212},[18952],{"type":38,"value":1589},{"type":29,"tag":183,"props":18954,"children":18955},{"class":185,"line":3224},[18956,18960,18964],{"type":29,"tag":183,"props":18957,"children":18958},{"style":200},[18959],{"type":38,"value":919},{"type":29,"tag":183,"props":18961,"children":18962},{"style":308},[18963],{"type":38,"value":580},{"type":29,"tag":183,"props":18965,"children":18966},{"style":212},[18967],{"type":38,"value":327},{"type":29,"tag":183,"props":18969,"children":18970},{"class":185,"line":3266},[18971],{"type":29,"tag":183,"props":18972,"children":18973},{"style":212},[18974],{"type":38,"value":436},{"type":29,"tag":30,"props":18976,"children":18977},{},[18978],{"type":38,"value":18979},"Ce code est désormais plus simple, plus lisible, et plus facile à tester, car chaque méthode a une responsabilité unique.",{"type":29,"tag":1196,"props":18981,"children":18983},{"cta":2185,"href":2186,"title":18982,"type":2188},"KISS n'est qu'une pratique parmi 100 pour coder propre",[18984],{"type":29,"tag":30,"props":18985,"children":18986},{},[18987],{"type":38,"value":18988},"Cet article détaille une seule discipline : interroger chaque ligne pour rester simple. Le Craft Bundle réunit les 100 pratiques craft que j'applique au quotidien pour écrire du code lisible et maintenable, celles que l'IA ne vous apprendra jamais parce qu'elle ne les a jamais vues survivre à un projet sur la durée.",{"type":29,"tag":46,"props":18990,"children":18991},{},[],{"type":29,"tag":50,"props":18993,"children":18995},{"id":18994},"questions-fréquentes-sur-kiss",[18996],{"type":38,"value":18997},"Questions fréquentes sur KISS",{"type":29,"tag":2205,"props":18999,"children":19000},{},[19001,19006],{"type":29,"tag":2209,"props":19002,"children":19003},{},[19004],{"type":38,"value":19005},"Comment éviter la sur-simplification ?",{"type":29,"tag":30,"props":19007,"children":19008},{},[19009],{"type":38,"value":19010},"Le piège existe : simplifier ne veut pas dire amputer. Le bon critère est la couverture du besoin : toutes les règles métier doivent rester correctement traitées, simplement sans détours inutiles. Si une simplification supprime un cas légitime, c'est qu'elle est allée trop loin.",{"type":29,"tag":2205,"props":19012,"children":19013},{},[19014,19019],{"type":29,"tag":2209,"props":19015,"children":19016},{},[19017],{"type":38,"value":19018},"Comment convaincre une équipe qui aime la sur-ingénierie ?",{"type":29,"tag":30,"props":19020,"children":19021},{},[19022],{"type":38,"value":19023},"Les arguments théoriques ne marchent pas. Ce qui marche : prendre un module complexe, en faire une version KISS, mesurer le temps de relecture et le nombre de bugs sur six semaines. Les chiffres font le travail que les discours ne font pas. Ensuite, introduire la question \"et si on faisait plus simple ?\" en revue de code devient naturel.",{"type":29,"tag":2205,"props":19025,"children":19026},{},[19027,19032],{"type":29,"tag":2209,"props":19028,"children":19029},{},[19030],{"type":38,"value":19031},"La simplicité dégrade-t-elle vraiment la performance ?",{"type":29,"tag":30,"props":19033,"children":19034},{},[19035],{"type":38,"value":19036},"Très rarement, et presque jamais sur les chemins qui comptent. Les goulots d'étranglement réels sont souvent dans des endroits inattendus, repérables avec un profiler, pas avec de la sur-optimisation préventive. La règle reste : code simple d'abord, optimisation ciblée ensuite, avec mesure.",{"type":29,"tag":2205,"props":19038,"children":19039},{},[19040,19045,19050,19053,19058],{"type":29,"tag":2209,"props":19041,"children":19042},{},[19043],{"type":38,"value":19044},"Que faire quand le code est déjà trop complexe ?",{"type":29,"tag":30,"props":19046,"children":19047},{},[19048],{"type":38,"value":19049},"Pas de big bang. Identifier un module particulièrement douloureux, le couvrir de tests s'il ne l'est pas, puis le simplifier par petites itérations. Chaque sprint, un morceau. C'est la seule approche réaliste sur une base mature : la grande refonte échoue presque toujours, le refactoring incrémental réussit presque toujours.",{"type":29,"tag":46,"props":19051,"children":19052},{},[],{"type":29,"tag":30,"props":19054,"children":19055},{},[19056],{"type":38,"value":19057},"Appliquer KISS n'est pas une posture intellectuelle, c'est une discipline quotidienne. À chaque méthode écrite, à chaque revue de code, à chaque refactoring : \"Peut-on faire plus simple sans perdre le besoin ?\" Cette question, posée mille fois sur la durée d'un projet, fait la différence entre une base saine et une base qu'on n'ose plus toucher.",{"type":29,"tag":1196,"props":19059,"children":19062},{"cta":19060,"href":2305,"title":19061,"type":2307},"Accéder au template gratuit →","Ressource gratuite : Faites votre propre audit engineering en 2 heures",[19063],{"type":29,"tag":30,"props":19064,"children":19065},{},[19066],{"type":38,"value":19067},"Le template Notion utilisé dans 15+ audits professionnels. 6 sections, 40 questions guidées, scoring visuel automatique, format décisionnel prêt à présenter à votre direction.",{"type":29,"tag":2315,"props":19069,"children":19070},{},[19071],{"type":38,"value":2319},{"title":8,"searchDepth":196,"depth":196,"links":19073},[19074,19075,19078,19085,19091],{"id":15494,"depth":196,"text":15497},{"id":15538,"depth":196,"text":15541,"children":19076},[19077],{"id":15554,"depth":218,"text":15557},{"id":15582,"depth":196,"text":15585,"children":19079},[19080,19081,19082,19083,19084],{"id":15593,"depth":218,"text":15596},{"id":16068,"depth":218,"text":16071},{"id":16079,"depth":218,"text":16082},{"id":16267,"depth":218,"text":16270},{"id":16292,"depth":218,"text":16295},{"id":16319,"depth":196,"text":16322,"children":19086},[19087,19088,19089,19090],{"id":16336,"depth":218,"text":16339},{"id":17025,"depth":218,"text":17028},{"id":17415,"depth":218,"text":17418},{"id":18003,"depth":218,"text":18006},{"id":18994,"depth":196,"text":18997},"content:fr:dette-technique:principe-kiss-bonnes-pratiques-java.md","fr\u002Fdette-technique\u002Fprincipe-kiss-bonnes-pratiques-java.md","fr\u002Fdette-technique\u002Fprincipe-kiss-bonnes-pratiques-java",{"_path":130,"_dir":14289,"_draft":7,"_partial":7,"_locale":8,"title":19096,"description":19097,"id":4030,"date":19098,"listed":13,"nocomments":7,"hidden":7,"categories":19099,"tags":19100,"cover":19101,"readingTime":19102,"body":19106,"_type":2331,"_id":23509,"_source":2333,"_file":23510,"_stem":23511,"_extension":2336},"Découvrir le Clean Code en Software Craftsmanship, Les Bonnes Pratiques en Java","Découvrez les principes du Clean Code et comment écrire du code propre et maintenable avec des exemples concrets en Java. Astuces, FAQ et bonnes pratiques pour...","2024-07-17",[14289],[17,2345],"covers\u002Farticles\u002Fprincipe-clean-code.jpg",{"text":21,"minutes":19103,"time":19104,"words":19105},13.555,813300,2711,{"type":26,"children":19107,"toc":23470},[19108,19117,19126,19152,19163,19168,19171,19180,19185,19194,19212,19219,19297,19318,19323,19332,19344,19351,20136,20149,20154,20157,20166,20175,20193,20200,20496,20501,20504,20513,20531,20540,20551,20558,20636,20657,20666,20671,20678,21147,21152,21157,21160,21169,21174,21181,21522,21527,21540,21549,21559,21568,21585,21592,21985,21990,21996,22005,22010,22017,22488,22493,22499,22508,22523,22530,22842,22854,22860,22869,22880,22889,22908,22915,23213,23226,23232,23241,23246,23257,23290,23296,23305,23322,23330,23363,23368,23377,23380,23389,23402,23415,23428,23441,23444,23451,23456,23466],{"type":29,"tag":50,"props":19109,"children":19111},{"id":19110},"découvrir-le-clean-code-en-software-craftsmanship-les-bonnes-pratiques-en-java",[19112],{"type":29,"tag":34,"props":19113,"children":19114},{},[19115],{"type":38,"value":19116},"Découvrir le Clean Code en Software Craftsmanship : Les Bonnes Pratiques en Java",{"type":29,"tag":14327,"props":19118,"children":19120},{"id":19119},"le-coût-caché-dun-code-mal-écrit",[19121],{"type":29,"tag":34,"props":19122,"children":19123},{},[19124],{"type":38,"value":19125},"Le coût caché d'un code mal écrit",{"type":29,"tag":30,"props":19127,"children":19128},{},[19129,19131,19137,19138,19144,19145,19151],{"type":38,"value":19130},"Mission chez BNP Paribas CIB, fin 2018. Un module de pricing critique, écrit dans l'urgence trois ans plus tôt par une équipe depuis dispersée. Le code fonctionnait, c'était même un de ses problèmes : personne n'osait y toucher. La moindre évolution réglementaire prenait six semaines de chiffrage et deux mois d'exécution, l'essentiel passé à reverse-engineerer des méthodes de 400 lignes aux variables ",{"type":29,"tag":156,"props":19132,"children":19134},{"className":19133},[],[19135],{"type":38,"value":19136},"tmp",{"type":38,"value":4468},{"type":29,"tag":156,"props":19139,"children":19141},{"className":19140},[],[19142],{"type":38,"value":19143},"data2",{"type":38,"value":4468},{"type":29,"tag":156,"props":19146,"children":19148},{"className":19147},[],[19149],{"type":38,"value":19150},"result_final",{"type":38,"value":79},{"type":29,"tag":30,"props":19153,"children":19154},{},[19155,19157,19161],{"type":38,"value":19156},"Même schéma chez Agirc-Arrco quelques mois plus tard. Le code livré dans la précipitation lors d'un sprint serré devient le code que personne ne veut maintenir l'année suivante. C'est précisément le problème que résout le ",{"type":29,"tag":34,"props":19158,"children":19159},{},[19160],{"type":38,"value":2416},{"type":38,"value":19162}," : produire du code qui reste modifiable six mois ou trois ans après, par soi-même comme par un autre développeur.",{"type":29,"tag":30,"props":19164,"children":19165},{},[19166],{"type":38,"value":19167},"Cet article rassemble les principes formalisés par Robert C. Martin dans son ouvrage de référence, avec des exemples Java applicables au quotidien, même quand la pression de livraison est forte.",{"type":29,"tag":46,"props":19169,"children":19170},{},[],{"type":29,"tag":50,"props":19172,"children":19174},{"id":19173},"les-principes-fondamentaux-du-clean-code",[19175],{"type":29,"tag":34,"props":19176,"children":19177},{},[19178],{"type":38,"value":19179},"Les principes fondamentaux du Clean Code",{"type":29,"tag":30,"props":19181,"children":19182},{},[19183],{"type":38,"value":19184},"Trois principes structurent la lecture d'un code propre. Ils ne sont pas magiques : appliqués isolément, leur effet est limité. Combinés et répétés sur la durée, ils transforment radicalement la maintenabilité d'une base.",{"type":29,"tag":14327,"props":19186,"children":19188},{"id":19187},"_1-des-noms-de-variables-et-de-fonctions-explicites",[19189],{"type":29,"tag":34,"props":19190,"children":19191},{},[19192],{"type":38,"value":19193},"1. Des noms de variables et de fonctions explicites",{"type":29,"tag":30,"props":19195,"children":19196},{},[19197,19199,19204,19205,19210],{"type":38,"value":19198},"L'un des premiers pas vers un code propre est de choisir des noms ",{"type":29,"tag":34,"props":19200,"children":19201},{},[19202],{"type":38,"value":19203},"clairs",{"type":38,"value":163},{"type":29,"tag":34,"props":19206,"children":19207},{},[19208],{"type":38,"value":19209},"significatifs",{"type":38,"value":19211}," pour vos variables, vos fonctions et vos classes. Si quelqu'un peut comprendre ce qu'une variable fait rien qu'en lisant son nom, alors vous êtes sur la bonne voie.",{"type":29,"tag":30,"props":19213,"children":19214},{},[19215],{"type":29,"tag":34,"props":19216,"children":19217},{},[19218],{"type":38,"value":15609},{"type":29,"tag":173,"props":19220,"children":19222},{"className":8272,"code":19221,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple\nint a = 5;\n\n\u002F\u002F Meilleur exemple\nint nombreDeJours = 5;\n",[19223],{"type":29,"tag":156,"props":19224,"children":19225},{"__ignoreMap":8},[19226,19234,19258,19265,19273],{"type":29,"tag":183,"props":19227,"children":19228},{"class":185,"line":186},[19229],{"type":29,"tag":183,"props":19230,"children":19231},{"style":190},[19232],{"type":38,"value":19233},"\u002F\u002F Mauvais exemple\n",{"type":29,"tag":183,"props":19235,"children":19236},{"class":185,"line":196},[19237,19241,19246,19250,19254],{"type":29,"tag":183,"props":19238,"children":19239},{"style":200},[19240],{"type":38,"value":14444},{"type":29,"tag":183,"props":19242,"children":19243},{"style":308},[19244],{"type":38,"value":19245}," a ",{"type":29,"tag":183,"props":19247,"children":19248},{"style":228},[19249],{"type":38,"value":8340},{"type":29,"tag":183,"props":19251,"children":19252},{"style":319},[19253],{"type":38,"value":14458},{"type":29,"tag":183,"props":19255,"children":19256},{"style":212},[19257],{"type":38,"value":327},{"type":29,"tag":183,"props":19259,"children":19260},{"class":185,"line":218},[19261],{"type":29,"tag":183,"props":19262,"children":19263},{"emptyLinePlaceholder":13},[19264],{"type":38,"value":445},{"type":29,"tag":183,"props":19266,"children":19267},{"class":185,"line":245},[19268],{"type":29,"tag":183,"props":19269,"children":19270},{"style":190},[19271],{"type":38,"value":19272},"\u002F\u002F Meilleur exemple\n",{"type":29,"tag":183,"props":19274,"children":19275},{"class":185,"line":266},[19276,19280,19285,19289,19293],{"type":29,"tag":183,"props":19277,"children":19278},{"style":200},[19279],{"type":38,"value":14444},{"type":29,"tag":183,"props":19281,"children":19282},{"style":308},[19283],{"type":38,"value":19284}," nombreDeJours ",{"type":29,"tag":183,"props":19286,"children":19287},{"style":228},[19288],{"type":38,"value":8340},{"type":29,"tag":183,"props":19290,"children":19291},{"style":319},[19292],{"type":38,"value":14458},{"type":29,"tag":183,"props":19294,"children":19295},{"style":212},[19296],{"type":38,"value":327},{"type":29,"tag":30,"props":19298,"children":19299},{},[19300,19302,19308,19310,19316],{"type":38,"value":19301},"En nommant la variable ",{"type":29,"tag":156,"props":19303,"children":19305},{"className":19304},[],[19306],{"type":38,"value":19307},"nombreDeJours",{"type":38,"value":19309},", on rend immédiatement évident ce que représente cette donnée, sans avoir besoin de commentaires ou de devinettes. De plus, évitez les abréviations trop courtes ou ambiguës comme ",{"type":29,"tag":156,"props":19311,"children":19313},{"className":19312},[],[19314],{"type":38,"value":19315},"nbr",{"type":38,"value":19317},", qui peuvent prêter à confusion.",{"type":29,"tag":30,"props":19319,"children":19320},{},[19321],{"type":38,"value":19322},"Question simple à se poser : ce nom passerait-il dans une explication orale à un collègue ? Si la réponse est non, c'est qu'il est à reprendre.",{"type":29,"tag":14327,"props":19324,"children":19326},{"id":19325},"_2-la-règle-des-fonctions-courtes",[19327],{"type":29,"tag":34,"props":19328,"children":19329},{},[19330],{"type":38,"value":19331},"2. La règle des fonctions courtes",{"type":29,"tag":30,"props":19333,"children":19334},{},[19335,19337,19342],{"type":38,"value":19336},"Une bonne fonction ne doit faire ",{"type":29,"tag":34,"props":19338,"children":19339},{},[19340],{"type":38,"value":19341},"qu'une seule chose",{"type":38,"value":19343}," et bien la faire. Si une fonction devient trop longue, il y a de fortes chances qu'elle fasse trop de choses à la fois. Un bon indicateur : si vous pouvez résumer ce que fait votre fonction en une seule phrase claire, elle est probablement assez concise.",{"type":29,"tag":30,"props":19345,"children":19346},{},[19347],{"type":29,"tag":34,"props":19348,"children":19349},{},[19350],{"type":38,"value":15609},{"type":29,"tag":173,"props":19352,"children":19354},{"className":8272,"code":19353,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple - Trop de responsabilités dans une seule fonction\npublic void processOrder(Order order) {\n    \u002F\u002F Valider la commande\n    if (order.isValid()) {\n        \u002F\u002F Calculer le total\n        double total = order.getAmount() + calculateTax(order);\n\n        \u002F\u002F Traiter le paiement\n        processPayment(order, total);\n\n        \u002F\u002F Envoyer une confirmation\n        sendConfirmationEmail(order);\n    } else {\n        System.out.println(\"Commande invalide\");\n    }\n}\n\n\u002F\u002F Meilleur exemple - Chaque fonction a une responsabilité unique\npublic void processOrder(Order order) {\n    if (order.isValid()) {\n        double total = calculateTotal(order);\n        processPayment(order, total);\n        sendConfirmation(order);\n    } else {\n        handleInvalidOrder();\n    }\n}\n\nprivate double calculateTotal(Order order) {\n    return order.getAmount() + calculateTax(order);\n}\n\nprivate void processPayment(Order order, double total) {\n    \u002F\u002F Code pour traiter le paiement\n}\n\nprivate void sendConfirmation(Order order) {\n    \u002F\u002F Code pour envoyer l'email de confirmation\n}\n\nprivate void handleInvalidOrder() {\n    System.out.println(\"Commande invalide\");\n}\n",[19355],{"type":29,"tag":156,"props":19356,"children":19357},{"__ignoreMap":8},[19358,19366,19401,19408,19439,19446,19499,19506,19514,19542,19549,19557,19577,19593,19629,19636,19643,19650,19658,19693,19724,19755,19782,19802,19817,19829,19836,19843,19850,19885,19928,19935,19942,19990,19998,20005,20012,20047,20055,20062,20069,20093,20129],{"type":29,"tag":183,"props":19359,"children":19360},{"class":185,"line":186},[19361],{"type":29,"tag":183,"props":19362,"children":19363},{"style":190},[19364],{"type":38,"value":19365},"\u002F\u002F Mauvais exemple - Trop de responsabilités dans une seule fonction\n",{"type":29,"tag":183,"props":19367,"children":19368},{"class":185,"line":196},[19369,19373,19377,19381,19385,19389,19393,19397],{"type":29,"tag":183,"props":19370,"children":19371},{"style":200},[19372],{"type":38,"value":8292},{"type":29,"tag":183,"props":19374,"children":19375},{"style":200},[19376],{"type":38,"value":9424},{"type":29,"tag":183,"props":19378,"children":19379},{"style":206},[19380],{"type":38,"value":14773},{"type":29,"tag":183,"props":19382,"children":19383},{"style":212},[19384],{"type":38,"value":770},{"type":29,"tag":183,"props":19386,"children":19387},{"style":8327},[19388],{"type":38,"value":10485},{"type":29,"tag":183,"props":19390,"children":19391},{"style":308},[19392],{"type":38,"value":12380},{"type":29,"tag":183,"props":19394,"children":19395},{"style":212},[19396],{"type":38,"value":272},{"type":29,"tag":183,"props":19398,"children":19399},{"style":212},[19400],{"type":38,"value":285},{"type":29,"tag":183,"props":19402,"children":19403},{"class":185,"line":218},[19404],{"type":29,"tag":183,"props":19405,"children":19406},{"style":190},[19407],{"type":38,"value":18069},{"type":29,"tag":183,"props":19409,"children":19410},{"class":185,"line":245},[19411,19415,19419,19423,19427,19431,19435],{"type":29,"tag":183,"props":19412,"children":19413},{"style":200},[19414],{"type":38,"value":1528},{"type":29,"tag":183,"props":19416,"children":19417},{"style":212},[19418],{"type":38,"value":1533},{"type":29,"tag":183,"props":19420,"children":19421},{"style":308},[19422],{"type":38,"value":13250},{"type":29,"tag":183,"props":19424,"children":19425},{"style":212},[19426],{"type":38,"value":79},{"type":29,"tag":183,"props":19428,"children":19429},{"style":206},[19430],{"type":38,"value":18093},{"type":29,"tag":183,"props":19432,"children":19433},{"style":212},[19434],{"type":38,"value":11009},{"type":29,"tag":183,"props":19436,"children":19437},{"style":212},[19438],{"type":38,"value":285},{"type":29,"tag":183,"props":19440,"children":19441},{"class":185,"line":266},[19442],{"type":29,"tag":183,"props":19443,"children":19444},{"style":190},[19445],{"type":38,"value":18109},{"type":29,"tag":183,"props":19447,"children":19448},{"class":185,"line":288},[19449,19453,19457,19461,19465,19469,19474,19478,19482,19487,19491,19495],{"type":29,"tag":183,"props":19450,"children":19451},{"style":200},[19452],{"type":38,"value":18117},{"type":29,"tag":183,"props":19454,"children":19455},{"style":308},[19456],{"type":38,"value":18122},{"type":29,"tag":183,"props":19458,"children":19459},{"style":228},[19460],{"type":38,"value":8340},{"type":29,"tag":183,"props":19462,"children":19463},{"style":308},[19464],{"type":38,"value":12380},{"type":29,"tag":183,"props":19466,"children":19467},{"style":212},[19468],{"type":38,"value":79},{"type":29,"tag":183,"props":19470,"children":19471},{"style":206},[19472],{"type":38,"value":19473},"getAmount",{"type":29,"tag":183,"props":19475,"children":19476},{"style":212},[19477],{"type":38,"value":1108},{"type":29,"tag":183,"props":19479,"children":19480},{"style":228},[19481],{"type":38,"value":947},{"type":29,"tag":183,"props":19483,"children":19484},{"style":206},[19485],{"type":38,"value":19486}," calculateTax",{"type":29,"tag":183,"props":19488,"children":19489},{"style":212},[19490],{"type":38,"value":770},{"type":29,"tag":183,"props":19492,"children":19493},{"style":308},[19494],{"type":38,"value":13250},{"type":29,"tag":183,"props":19496,"children":19497},{"style":212},[19498],{"type":38,"value":7487},{"type":29,"tag":183,"props":19500,"children":19501},{"class":185,"line":330},[19502],{"type":29,"tag":183,"props":19503,"children":19504},{"emptyLinePlaceholder":13},[19505],{"type":38,"value":445},{"type":29,"tag":183,"props":19507,"children":19508},{"class":185,"line":374},[19509],{"type":29,"tag":183,"props":19510,"children":19511},{"style":190},[19512],{"type":38,"value":19513},"        \u002F\u002F Traiter le paiement\n",{"type":29,"tag":183,"props":19515,"children":19516},{"class":185,"line":430},[19517,19522,19526,19530,19534,19538],{"type":29,"tag":183,"props":19518,"children":19519},{"style":206},[19520],{"type":38,"value":19521},"        processPayment",{"type":29,"tag":183,"props":19523,"children":19524},{"style":212},[19525],{"type":38,"value":770},{"type":29,"tag":183,"props":19527,"children":19528},{"style":308},[19529],{"type":38,"value":13250},{"type":29,"tag":183,"props":19531,"children":19532},{"style":212},[19533],{"type":38,"value":2694},{"type":29,"tag":183,"props":19535,"children":19536},{"style":308},[19537],{"type":38,"value":580},{"type":29,"tag":183,"props":19539,"children":19540},{"style":212},[19541],{"type":38,"value":7487},{"type":29,"tag":183,"props":19543,"children":19544},{"class":185,"line":439},[19545],{"type":29,"tag":183,"props":19546,"children":19547},{"emptyLinePlaceholder":13},[19548],{"type":38,"value":445},{"type":29,"tag":183,"props":19550,"children":19551},{"class":185,"line":448},[19552],{"type":29,"tag":183,"props":19553,"children":19554},{"style":190},[19555],{"type":38,"value":19556},"        \u002F\u002F Envoyer une confirmation\n",{"type":29,"tag":183,"props":19558,"children":19559},{"class":185,"line":457},[19560,19565,19569,19573],{"type":29,"tag":183,"props":19561,"children":19562},{"style":206},[19563],{"type":38,"value":19564},"        sendConfirmationEmail",{"type":29,"tag":183,"props":19566,"children":19567},{"style":212},[19568],{"type":38,"value":770},{"type":29,"tag":183,"props":19570,"children":19571},{"style":308},[19572],{"type":38,"value":13250},{"type":29,"tag":183,"props":19574,"children":19575},{"style":212},[19576],{"type":38,"value":7487},{"type":29,"tag":183,"props":19578,"children":19579},{"class":185,"line":474},[19580,19584,19589],{"type":29,"tag":183,"props":19581,"children":19582},{"style":212},[19583],{"type":38,"value":3213},{"type":29,"tag":183,"props":19585,"children":19586},{"style":200},[19587],{"type":38,"value":19588}," else",{"type":29,"tag":183,"props":19590,"children":19591},{"style":212},[19592],{"type":38,"value":285},{"type":29,"tag":183,"props":19594,"children":19595},{"class":185,"line":495},[19596,19600,19604,19608,19612,19616,19620,19625],{"type":29,"tag":183,"props":19597,"children":19598},{"style":308},[19599],{"type":38,"value":17504},{"type":29,"tag":183,"props":19601,"children":19602},{"style":212},[19603],{"type":38,"value":79},{"type":29,"tag":183,"props":19605,"children":19606},{"style":308},[19607],{"type":38,"value":17513},{"type":29,"tag":183,"props":19609,"children":19610},{"style":212},[19611],{"type":38,"value":79},{"type":29,"tag":183,"props":19613,"children":19614},{"style":206},[19615],{"type":38,"value":17522},{"type":29,"tag":183,"props":19617,"children":19618},{"style":212},[19619],{"type":38,"value":770},{"type":29,"tag":183,"props":19621,"children":19622},{"style":1683},[19623],{"type":38,"value":19624},"\"Commande invalide\"",{"type":29,"tag":183,"props":19626,"children":19627},{"style":212},[19628],{"type":38,"value":7487},{"type":29,"tag":183,"props":19630,"children":19631},{"class":185,"line":516},[19632],{"type":29,"tag":183,"props":19633,"children":19634},{"style":212},[19635],{"type":38,"value":1589},{"type":29,"tag":183,"props":19637,"children":19638},{"class":185,"line":536},[19639],{"type":29,"tag":183,"props":19640,"children":19641},{"style":212},[19642],{"type":38,"value":436},{"type":29,"tag":183,"props":19644,"children":19645},{"class":185,"line":570},[19646],{"type":29,"tag":183,"props":19647,"children":19648},{"emptyLinePlaceholder":13},[19649],{"type":38,"value":445},{"type":29,"tag":183,"props":19651,"children":19652},{"class":185,"line":613},[19653],{"type":29,"tag":183,"props":19654,"children":19655},{"style":190},[19656],{"type":38,"value":19657},"\u002F\u002F Meilleur exemple - Chaque fonction a une responsabilité unique\n",{"type":29,"tag":183,"props":19659,"children":19660},{"class":185,"line":662},[19661,19665,19669,19673,19677,19681,19685,19689],{"type":29,"tag":183,"props":19662,"children":19663},{"style":200},[19664],{"type":38,"value":8292},{"type":29,"tag":183,"props":19666,"children":19667},{"style":200},[19668],{"type":38,"value":9424},{"type":29,"tag":183,"props":19670,"children":19671},{"style":206},[19672],{"type":38,"value":14773},{"type":29,"tag":183,"props":19674,"children":19675},{"style":212},[19676],{"type":38,"value":770},{"type":29,"tag":183,"props":19678,"children":19679},{"style":8327},[19680],{"type":38,"value":10485},{"type":29,"tag":183,"props":19682,"children":19683},{"style":308},[19684],{"type":38,"value":12380},{"type":29,"tag":183,"props":19686,"children":19687},{"style":212},[19688],{"type":38,"value":272},{"type":29,"tag":183,"props":19690,"children":19691},{"style":212},[19692],{"type":38,"value":285},{"type":29,"tag":183,"props":19694,"children":19695},{"class":185,"line":3095},[19696,19700,19704,19708,19712,19716,19720],{"type":29,"tag":183,"props":19697,"children":19698},{"style":200},[19699],{"type":38,"value":1528},{"type":29,"tag":183,"props":19701,"children":19702},{"style":212},[19703],{"type":38,"value":1533},{"type":29,"tag":183,"props":19705,"children":19706},{"style":308},[19707],{"type":38,"value":13250},{"type":29,"tag":183,"props":19709,"children":19710},{"style":212},[19711],{"type":38,"value":79},{"type":29,"tag":183,"props":19713,"children":19714},{"style":206},[19715],{"type":38,"value":18093},{"type":29,"tag":183,"props":19717,"children":19718},{"style":212},[19719],{"type":38,"value":11009},{"type":29,"tag":183,"props":19721,"children":19722},{"style":212},[19723],{"type":38,"value":285},{"type":29,"tag":183,"props":19725,"children":19726},{"class":185,"line":3154},[19727,19731,19735,19739,19743,19747,19751],{"type":29,"tag":183,"props":19728,"children":19729},{"style":200},[19730],{"type":38,"value":18117},{"type":29,"tag":183,"props":19732,"children":19733},{"style":308},[19734],{"type":38,"value":18122},{"type":29,"tag":183,"props":19736,"children":19737},{"style":228},[19738],{"type":38,"value":8340},{"type":29,"tag":183,"props":19740,"children":19741},{"style":206},[19742],{"type":38,"value":18551},{"type":29,"tag":183,"props":19744,"children":19745},{"style":212},[19746],{"type":38,"value":770},{"type":29,"tag":183,"props":19748,"children":19749},{"style":308},[19750],{"type":38,"value":13250},{"type":29,"tag":183,"props":19752,"children":19753},{"style":212},[19754],{"type":38,"value":7487},{"type":29,"tag":183,"props":19756,"children":19757},{"class":185,"line":3207},[19758,19762,19766,19770,19774,19778],{"type":29,"tag":183,"props":19759,"children":19760},{"style":206},[19761],{"type":38,"value":19521},{"type":29,"tag":183,"props":19763,"children":19764},{"style":212},[19765],{"type":38,"value":770},{"type":29,"tag":183,"props":19767,"children":19768},{"style":308},[19769],{"type":38,"value":13250},{"type":29,"tag":183,"props":19771,"children":19772},{"style":212},[19773],{"type":38,"value":2694},{"type":29,"tag":183,"props":19775,"children":19776},{"style":308},[19777],{"type":38,"value":580},{"type":29,"tag":183,"props":19779,"children":19780},{"style":212},[19781],{"type":38,"value":7487},{"type":29,"tag":183,"props":19783,"children":19784},{"class":185,"line":3224},[19785,19790,19794,19798],{"type":29,"tag":183,"props":19786,"children":19787},{"style":206},[19788],{"type":38,"value":19789},"        sendConfirmation",{"type":29,"tag":183,"props":19791,"children":19792},{"style":212},[19793],{"type":38,"value":770},{"type":29,"tag":183,"props":19795,"children":19796},{"style":308},[19797],{"type":38,"value":13250},{"type":29,"tag":183,"props":19799,"children":19800},{"style":212},[19801],{"type":38,"value":7487},{"type":29,"tag":183,"props":19803,"children":19804},{"class":185,"line":3266},[19805,19809,19813],{"type":29,"tag":183,"props":19806,"children":19807},{"style":212},[19808],{"type":38,"value":3213},{"type":29,"tag":183,"props":19810,"children":19811},{"style":200},[19812],{"type":38,"value":19588},{"type":29,"tag":183,"props":19814,"children":19815},{"style":212},[19816],{"type":38,"value":285},{"type":29,"tag":183,"props":19818,"children":19819},{"class":185,"line":3275},[19820,19825],{"type":29,"tag":183,"props":19821,"children":19822},{"style":206},[19823],{"type":38,"value":19824},"        handleInvalidOrder",{"type":29,"tag":183,"props":19826,"children":19827},{"style":212},[19828],{"type":38,"value":9916},{"type":29,"tag":183,"props":19830,"children":19831},{"class":185,"line":3283},[19832],{"type":29,"tag":183,"props":19833,"children":19834},{"style":212},[19835],{"type":38,"value":1589},{"type":29,"tag":183,"props":19837,"children":19838},{"class":185,"line":3292},[19839],{"type":29,"tag":183,"props":19840,"children":19841},{"style":212},[19842],{"type":38,"value":436},{"type":29,"tag":183,"props":19844,"children":19845},{"class":185,"line":3349},[19846],{"type":29,"tag":183,"props":19847,"children":19848},{"emptyLinePlaceholder":13},[19849],{"type":38,"value":445},{"type":29,"tag":183,"props":19851,"children":19852},{"class":185,"line":3366},[19853,19857,19861,19865,19869,19873,19877,19881],{"type":29,"tag":183,"props":19854,"children":19855},{"style":200},[19856],{"type":38,"value":14943},{"type":29,"tag":183,"props":19858,"children":19859},{"style":200},[19860],{"type":38,"value":18661},{"type":29,"tag":183,"props":19862,"children":19863},{"style":206},[19864],{"type":38,"value":18551},{"type":29,"tag":183,"props":19866,"children":19867},{"style":212},[19868],{"type":38,"value":770},{"type":29,"tag":183,"props":19870,"children":19871},{"style":8327},[19872],{"type":38,"value":10485},{"type":29,"tag":183,"props":19874,"children":19875},{"style":308},[19876],{"type":38,"value":12380},{"type":29,"tag":183,"props":19878,"children":19879},{"style":212},[19880],{"type":38,"value":272},{"type":29,"tag":183,"props":19882,"children":19883},{"style":212},[19884],{"type":38,"value":285},{"type":29,"tag":183,"props":19886,"children":19887},{"class":185,"line":3395},[19888,19892,19896,19900,19904,19908,19912,19916,19920,19924],{"type":29,"tag":183,"props":19889,"children":19890},{"style":200},[19891],{"type":38,"value":919},{"type":29,"tag":183,"props":19893,"children":19894},{"style":308},[19895],{"type":38,"value":12380},{"type":29,"tag":183,"props":19897,"children":19898},{"style":212},[19899],{"type":38,"value":79},{"type":29,"tag":183,"props":19901,"children":19902},{"style":206},[19903],{"type":38,"value":19473},{"type":29,"tag":183,"props":19905,"children":19906},{"style":212},[19907],{"type":38,"value":1108},{"type":29,"tag":183,"props":19909,"children":19910},{"style":228},[19911],{"type":38,"value":947},{"type":29,"tag":183,"props":19913,"children":19914},{"style":206},[19915],{"type":38,"value":19486},{"type":29,"tag":183,"props":19917,"children":19918},{"style":212},[19919],{"type":38,"value":770},{"type":29,"tag":183,"props":19921,"children":19922},{"style":308},[19923],{"type":38,"value":13250},{"type":29,"tag":183,"props":19925,"children":19926},{"style":212},[19927],{"type":38,"value":7487},{"type":29,"tag":183,"props":19929,"children":19930},{"class":185,"line":3425},[19931],{"type":29,"tag":183,"props":19932,"children":19933},{"style":212},[19934],{"type":38,"value":436},{"type":29,"tag":183,"props":19936,"children":19937},{"class":185,"line":3455},[19938],{"type":29,"tag":183,"props":19939,"children":19940},{"emptyLinePlaceholder":13},[19941],{"type":38,"value":445},{"type":29,"tag":183,"props":19943,"children":19944},{"class":185,"line":3485},[19945,19949,19953,19958,19962,19966,19970,19974,19978,19982,19986],{"type":29,"tag":183,"props":19946,"children":19947},{"style":200},[19948],{"type":38,"value":14943},{"type":29,"tag":183,"props":19950,"children":19951},{"style":200},[19952],{"type":38,"value":9424},{"type":29,"tag":183,"props":19954,"children":19955},{"style":206},[19956],{"type":38,"value":19957}," processPayment",{"type":29,"tag":183,"props":19959,"children":19960},{"style":212},[19961],{"type":38,"value":770},{"type":29,"tag":183,"props":19963,"children":19964},{"style":8327},[19965],{"type":38,"value":10485},{"type":29,"tag":183,"props":19967,"children":19968},{"style":308},[19969],{"type":38,"value":12380},{"type":29,"tag":183,"props":19971,"children":19972},{"style":212},[19973],{"type":38,"value":2694},{"type":29,"tag":183,"props":19975,"children":19976},{"style":200},[19977],{"type":38,"value":18661},{"type":29,"tag":183,"props":19979,"children":19980},{"style":308},[19981],{"type":38,"value":580},{"type":29,"tag":183,"props":19983,"children":19984},{"style":212},[19985],{"type":38,"value":272},{"type":29,"tag":183,"props":19987,"children":19988},{"style":212},[19989],{"type":38,"value":285},{"type":29,"tag":183,"props":19991,"children":19992},{"class":185,"line":3498},[19993],{"type":29,"tag":183,"props":19994,"children":19995},{"style":190},[19996],{"type":38,"value":19997},"    \u002F\u002F Code pour traiter le paiement\n",{"type":29,"tag":183,"props":19999,"children":20000},{"class":185,"line":3520},[20001],{"type":29,"tag":183,"props":20002,"children":20003},{"style":212},[20004],{"type":38,"value":436},{"type":29,"tag":183,"props":20006,"children":20007},{"class":185,"line":3541},[20008],{"type":29,"tag":183,"props":20009,"children":20010},{"emptyLinePlaceholder":13},[20011],{"type":38,"value":445},{"type":29,"tag":183,"props":20013,"children":20014},{"class":185,"line":3563},[20015,20019,20023,20027,20031,20035,20039,20043],{"type":29,"tag":183,"props":20016,"children":20017},{"style":200},[20018],{"type":38,"value":14943},{"type":29,"tag":183,"props":20020,"children":20021},{"style":200},[20022],{"type":38,"value":9424},{"type":29,"tag":183,"props":20024,"children":20025},{"style":206},[20026],{"type":38,"value":8833},{"type":29,"tag":183,"props":20028,"children":20029},{"style":212},[20030],{"type":38,"value":770},{"type":29,"tag":183,"props":20032,"children":20033},{"style":8327},[20034],{"type":38,"value":10485},{"type":29,"tag":183,"props":20036,"children":20037},{"style":308},[20038],{"type":38,"value":12380},{"type":29,"tag":183,"props":20040,"children":20041},{"style":212},[20042],{"type":38,"value":272},{"type":29,"tag":183,"props":20044,"children":20045},{"style":212},[20046],{"type":38,"value":285},{"type":29,"tag":183,"props":20048,"children":20049},{"class":185,"line":3572},[20050],{"type":29,"tag":183,"props":20051,"children":20052},{"style":190},[20053],{"type":38,"value":20054},"    \u002F\u002F Code pour envoyer l'email de confirmation\n",{"type":29,"tag":183,"props":20056,"children":20057},{"class":185,"line":3588},[20058],{"type":29,"tag":183,"props":20059,"children":20060},{"style":212},[20061],{"type":38,"value":436},{"type":29,"tag":183,"props":20063,"children":20064},{"class":185,"line":3633},[20065],{"type":29,"tag":183,"props":20066,"children":20067},{"emptyLinePlaceholder":13},[20068],{"type":38,"value":445},{"type":29,"tag":183,"props":20070,"children":20071},{"class":185,"line":3665},[20072,20076,20080,20085,20089],{"type":29,"tag":183,"props":20073,"children":20074},{"style":200},[20075],{"type":38,"value":14943},{"type":29,"tag":183,"props":20077,"children":20078},{"style":200},[20079],{"type":38,"value":9424},{"type":29,"tag":183,"props":20081,"children":20082},{"style":206},[20083],{"type":38,"value":20084}," handleInvalidOrder",{"type":29,"tag":183,"props":20086,"children":20087},{"style":212},[20088],{"type":38,"value":1108},{"type":29,"tag":183,"props":20090,"children":20091},{"style":212},[20092],{"type":38,"value":285},{"type":29,"tag":183,"props":20094,"children":20095},{"class":185,"line":3750},[20096,20101,20105,20109,20113,20117,20121,20125],{"type":29,"tag":183,"props":20097,"children":20098},{"style":308},[20099],{"type":38,"value":20100},"    System",{"type":29,"tag":183,"props":20102,"children":20103},{"style":212},[20104],{"type":38,"value":79},{"type":29,"tag":183,"props":20106,"children":20107},{"style":308},[20108],{"type":38,"value":17513},{"type":29,"tag":183,"props":20110,"children":20111},{"style":212},[20112],{"type":38,"value":79},{"type":29,"tag":183,"props":20114,"children":20115},{"style":206},[20116],{"type":38,"value":17522},{"type":29,"tag":183,"props":20118,"children":20119},{"style":212},[20120],{"type":38,"value":770},{"type":29,"tag":183,"props":20122,"children":20123},{"style":1683},[20124],{"type":38,"value":19624},{"type":29,"tag":183,"props":20126,"children":20127},{"style":212},[20128],{"type":38,"value":7487},{"type":29,"tag":183,"props":20130,"children":20131},{"class":185,"line":3766},[20132],{"type":29,"tag":183,"props":20133,"children":20134},{"style":212},[20135],{"type":38,"value":436},{"type":29,"tag":30,"props":20137,"children":20138},{},[20139,20141,20147],{"type":38,"value":20140},"Dans le second exemple, chaque étape du processus est divisée en fonctions plus petites et spécifiques. La fonction ",{"type":29,"tag":156,"props":20142,"children":20144},{"className":20143},[],[20145],{"type":38,"value":20146},"processOrder",{"type":38,"value":20148}," ne fait plus qu'orchestrer les étapes, tandis que les détails comme le calcul du total ou l'envoi de l'email de confirmation sont délégués à des fonctions plus courtes et plus ciblées.",{"type":29,"tag":30,"props":20150,"children":20151},{},[20152],{"type":38,"value":20153},"Un commentaire qui décrit ce que fait une fonction est presque toujours le signe que la fonction fait trop de choses. Le commentaire devient le nom d'une nouvelle méthode extraite.",{"type":29,"tag":46,"props":20155,"children":20156},{},[],{"type":29,"tag":1196,"props":20158,"children":20160},{"cta":1198,"href":1199,"title":20159,"type":1201},"Vous voulez écrire du code que vous comprendrez encore dans six mois ?",[20161],{"type":29,"tag":30,"props":20162,"children":20163},{},[20164],{"type":38,"value":20165},"Nommer juste, garder une fonction courte, écarter les responsabilités qui s'accumulent : ces réflexes ne s'acquièrent pas en lisant un article, ils se travaillent sur votre vrai code. En mentoring 1:1, je relis vos fonctions et vos classes avec vous, je vous montre où ça dérape et comment reprendre la main. Vous repartez avec des gestes que vous appliquez dès la PR suivante.",{"type":29,"tag":14327,"props":20167,"children":20169},{"id":20168},"_3-comment-structurer-le-code-pour-le-rendre-lisible",[20170],{"type":29,"tag":34,"props":20171,"children":20172},{},[20173],{"type":38,"value":20174},"3. Comment structurer le code pour le rendre lisible",{"type":29,"tag":30,"props":20176,"children":20177},{},[20178,20180,20184,20186,20191],{"type":38,"value":20179},"La lisibilité du code est essentielle pour un ",{"type":29,"tag":34,"props":20181,"children":20182},{},[20183],{"type":38,"value":2416},{"type":38,"value":20185},". Un code bien structuré est celui qui peut être compris facilement par un autre développeur, même sans explication supplémentaire. Pour cela, je vous recommande de suivre une ",{"type":29,"tag":34,"props":20187,"children":20188},{},[20189],{"type":38,"value":20190},"hiérarchie logique",{"type":38,"value":20192}," et d'éviter les longs blocs de code imbriqués.",{"type":29,"tag":30,"props":20194,"children":20195},{},[20196],{"type":29,"tag":34,"props":20197,"children":20198},{},[20199],{"type":38,"value":15609},{"type":29,"tag":173,"props":20201,"children":20203},{"className":8272,"code":20202,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple\nif (isValidUser(user)) {\n    if (hasSufficientBalance(user)) {\n        processPayment();\n    } else {\n        \u002F\u002F ...\n    }\n} else {\n    \u002F\u002F ...\n}\n\n\u002F\u002F Meilleur exemple\nif (!isValidUser(user)) {\n    return;\n}\n\nif (!hasSufficientBalance(user)) {\n    return;\n}\n\nprocessPayment();\n",[20204],{"type":29,"tag":156,"props":20205,"children":20206},{"__ignoreMap":8},[20207,20214,20247,20279,20290,20305,20313,20320,20335,20343,20350,20357,20364,20399,20410,20417,20424,20459,20470,20477,20484],{"type":29,"tag":183,"props":20208,"children":20209},{"class":185,"line":186},[20210],{"type":29,"tag":183,"props":20211,"children":20212},{"style":190},[20213],{"type":38,"value":19233},{"type":29,"tag":183,"props":20215,"children":20216},{"class":185,"line":196},[20217,20221,20225,20230,20234,20239,20243],{"type":29,"tag":183,"props":20218,"children":20219},{"style":200},[20220],{"type":38,"value":14599},{"type":29,"tag":183,"props":20222,"children":20223},{"style":212},[20224],{"type":38,"value":1533},{"type":29,"tag":183,"props":20226,"children":20227},{"style":206},[20228],{"type":38,"value":20229},"isValidUser",{"type":29,"tag":183,"props":20231,"children":20232},{"style":212},[20233],{"type":38,"value":770},{"type":29,"tag":183,"props":20235,"children":20236},{"style":308},[20237],{"type":38,"value":20238},"user",{"type":29,"tag":183,"props":20240,"children":20241},{"style":212},[20242],{"type":38,"value":15947},{"type":29,"tag":183,"props":20244,"children":20245},{"style":212},[20246],{"type":38,"value":285},{"type":29,"tag":183,"props":20248,"children":20249},{"class":185,"line":218},[20250,20254,20258,20263,20267,20271,20275],{"type":29,"tag":183,"props":20251,"children":20252},{"style":200},[20253],{"type":38,"value":1528},{"type":29,"tag":183,"props":20255,"children":20256},{"style":212},[20257],{"type":38,"value":1533},{"type":29,"tag":183,"props":20259,"children":20260},{"style":206},[20261],{"type":38,"value":20262},"hasSufficientBalance",{"type":29,"tag":183,"props":20264,"children":20265},{"style":212},[20266],{"type":38,"value":770},{"type":29,"tag":183,"props":20268,"children":20269},{"style":308},[20270],{"type":38,"value":20238},{"type":29,"tag":183,"props":20272,"children":20273},{"style":212},[20274],{"type":38,"value":15947},{"type":29,"tag":183,"props":20276,"children":20277},{"style":212},[20278],{"type":38,"value":285},{"type":29,"tag":183,"props":20280,"children":20281},{"class":185,"line":245},[20282,20286],{"type":29,"tag":183,"props":20283,"children":20284},{"style":206},[20285],{"type":38,"value":19521},{"type":29,"tag":183,"props":20287,"children":20288},{"style":212},[20289],{"type":38,"value":9916},{"type":29,"tag":183,"props":20291,"children":20292},{"class":185,"line":266},[20293,20297,20301],{"type":29,"tag":183,"props":20294,"children":20295},{"style":212},[20296],{"type":38,"value":3213},{"type":29,"tag":183,"props":20298,"children":20299},{"style":200},[20300],{"type":38,"value":19588},{"type":29,"tag":183,"props":20302,"children":20303},{"style":212},[20304],{"type":38,"value":285},{"type":29,"tag":183,"props":20306,"children":20307},{"class":185,"line":288},[20308],{"type":29,"tag":183,"props":20309,"children":20310},{"style":190},[20311],{"type":38,"value":20312},"        \u002F\u002F ...\n",{"type":29,"tag":183,"props":20314,"children":20315},{"class":185,"line":330},[20316],{"type":29,"tag":183,"props":20317,"children":20318},{"style":212},[20319],{"type":38,"value":1589},{"type":29,"tag":183,"props":20321,"children":20322},{"class":185,"line":374},[20323,20327,20331],{"type":29,"tag":183,"props":20324,"children":20325},{"style":212},[20326],{"type":38,"value":2886},{"type":29,"tag":183,"props":20328,"children":20329},{"style":200},[20330],{"type":38,"value":19588},{"type":29,"tag":183,"props":20332,"children":20333},{"style":212},[20334],{"type":38,"value":285},{"type":29,"tag":183,"props":20336,"children":20337},{"class":185,"line":430},[20338],{"type":29,"tag":183,"props":20339,"children":20340},{"style":190},[20341],{"type":38,"value":20342},"    \u002F\u002F ...\n",{"type":29,"tag":183,"props":20344,"children":20345},{"class":185,"line":439},[20346],{"type":29,"tag":183,"props":20347,"children":20348},{"style":212},[20349],{"type":38,"value":436},{"type":29,"tag":183,"props":20351,"children":20352},{"class":185,"line":448},[20353],{"type":29,"tag":183,"props":20354,"children":20355},{"emptyLinePlaceholder":13},[20356],{"type":38,"value":445},{"type":29,"tag":183,"props":20358,"children":20359},{"class":185,"line":457},[20360],{"type":29,"tag":183,"props":20361,"children":20362},{"style":190},[20363],{"type":38,"value":19272},{"type":29,"tag":183,"props":20365,"children":20366},{"class":185,"line":474},[20367,20371,20375,20379,20383,20387,20391,20395],{"type":29,"tag":183,"props":20368,"children":20369},{"style":200},[20370],{"type":38,"value":14599},{"type":29,"tag":183,"props":20372,"children":20373},{"style":212},[20374],{"type":38,"value":1533},{"type":29,"tag":183,"props":20376,"children":20377},{"style":228},[20378],{"type":38,"value":1538},{"type":29,"tag":183,"props":20380,"children":20381},{"style":206},[20382],{"type":38,"value":20229},{"type":29,"tag":183,"props":20384,"children":20385},{"style":212},[20386],{"type":38,"value":770},{"type":29,"tag":183,"props":20388,"children":20389},{"style":308},[20390],{"type":38,"value":20238},{"type":29,"tag":183,"props":20392,"children":20393},{"style":212},[20394],{"type":38,"value":15947},{"type":29,"tag":183,"props":20396,"children":20397},{"style":212},[20398],{"type":38,"value":285},{"type":29,"tag":183,"props":20400,"children":20401},{"class":185,"line":495},[20402,20406],{"type":29,"tag":183,"props":20403,"children":20404},{"style":200},[20405],{"type":38,"value":919},{"type":29,"tag":183,"props":20407,"children":20408},{"style":212},[20409],{"type":38,"value":327},{"type":29,"tag":183,"props":20411,"children":20412},{"class":185,"line":516},[20413],{"type":29,"tag":183,"props":20414,"children":20415},{"style":212},[20416],{"type":38,"value":436},{"type":29,"tag":183,"props":20418,"children":20419},{"class":185,"line":536},[20420],{"type":29,"tag":183,"props":20421,"children":20422},{"emptyLinePlaceholder":13},[20423],{"type":38,"value":445},{"type":29,"tag":183,"props":20425,"children":20426},{"class":185,"line":570},[20427,20431,20435,20439,20443,20447,20451,20455],{"type":29,"tag":183,"props":20428,"children":20429},{"style":200},[20430],{"type":38,"value":14599},{"type":29,"tag":183,"props":20432,"children":20433},{"style":212},[20434],{"type":38,"value":1533},{"type":29,"tag":183,"props":20436,"children":20437},{"style":228},[20438],{"type":38,"value":1538},{"type":29,"tag":183,"props":20440,"children":20441},{"style":206},[20442],{"type":38,"value":20262},{"type":29,"tag":183,"props":20444,"children":20445},{"style":212},[20446],{"type":38,"value":770},{"type":29,"tag":183,"props":20448,"children":20449},{"style":308},[20450],{"type":38,"value":20238},{"type":29,"tag":183,"props":20452,"children":20453},{"style":212},[20454],{"type":38,"value":15947},{"type":29,"tag":183,"props":20456,"children":20457},{"style":212},[20458],{"type":38,"value":285},{"type":29,"tag":183,"props":20460,"children":20461},{"class":185,"line":613},[20462,20466],{"type":29,"tag":183,"props":20463,"children":20464},{"style":200},[20465],{"type":38,"value":919},{"type":29,"tag":183,"props":20467,"children":20468},{"style":212},[20469],{"type":38,"value":327},{"type":29,"tag":183,"props":20471,"children":20472},{"class":185,"line":662},[20473],{"type":29,"tag":183,"props":20474,"children":20475},{"style":212},[20476],{"type":38,"value":436},{"type":29,"tag":183,"props":20478,"children":20479},{"class":185,"line":3095},[20480],{"type":29,"tag":183,"props":20481,"children":20482},{"emptyLinePlaceholder":13},[20483],{"type":38,"value":445},{"type":29,"tag":183,"props":20485,"children":20486},{"class":185,"line":3154},[20487,20492],{"type":29,"tag":183,"props":20488,"children":20489},{"style":206},[20490],{"type":38,"value":20491},"processPayment",{"type":29,"tag":183,"props":20493,"children":20494},{"style":212},[20495],{"type":38,"value":9916},{"type":29,"tag":30,"props":20497,"children":20498},{},[20499],{"type":38,"value":20500},"Dans le second exemple, la structure est plus claire : chaque condition est traitée séparément, les cas d'erreur sont écartés au début. Le lecteur suit le flux nominal sans avoir à dépiler trois niveaux d'imbrication.",{"type":29,"tag":46,"props":20502,"children":20503},{},[],{"type":29,"tag":50,"props":20505,"children":20507},{"id":20506},"exemples-de-clean-code-en-java",[20508],{"type":29,"tag":34,"props":20509,"children":20510},{},[20511],{"type":38,"value":20512},"Exemples de Clean Code en Java",{"type":29,"tag":30,"props":20514,"children":20515},{},[20516,20518,20522,20524,20529],{"type":38,"value":20517},"Rien ne vaut des exemples concrets pour mieux comprendre comment appliquer les principes du ",{"type":29,"tag":34,"props":20519,"children":20520},{},[20521],{"type":38,"value":2416},{"type":38,"value":20523},". Voici quelques exemples pratiques en ",{"type":29,"tag":34,"props":20525,"children":20526},{},[20527],{"type":38,"value":20528},"Java",{"type":38,"value":20530},", basés sur les principes vus précédemment. Ces exemples vous montreront comment améliorer la clarté, la lisibilité et la maintenabilité de votre code.",{"type":29,"tag":14327,"props":20532,"children":20534},{"id":20533},"_1-variables-bien-nommées",[20535],{"type":29,"tag":34,"props":20536,"children":20537},{},[20538],{"type":38,"value":20539},"1. Variables bien nommées",{"type":29,"tag":30,"props":20541,"children":20542},{},[20543,20545,20549],{"type":38,"value":20544},"Donner des noms explicites aux variables reste l'une des bases du ",{"type":29,"tag":34,"props":20546,"children":20547},{},[20548],{"type":38,"value":2416},{"type":38,"value":20550}," : un code bien nommé se passe de commentaires.",{"type":29,"tag":30,"props":20552,"children":20553},{},[20554],{"type":29,"tag":34,"props":20555,"children":20556},{},[20557],{"type":38,"value":15609},{"type":29,"tag":173,"props":20559,"children":20561},{"className":8272,"code":20560,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple\ndouble v = getVolume();\n\n\u002F\u002F Meilleur exemple\ndouble volumeDeLaBoite = getVolume();\n",[20562],{"type":29,"tag":156,"props":20563,"children":20564},{"__ignoreMap":8},[20565,20572,20598,20605,20612],{"type":29,"tag":183,"props":20566,"children":20567},{"class":185,"line":186},[20568],{"type":29,"tag":183,"props":20569,"children":20570},{"style":190},[20571],{"type":38,"value":19233},{"type":29,"tag":183,"props":20573,"children":20574},{"class":185,"line":196},[20575,20580,20585,20589,20594],{"type":29,"tag":183,"props":20576,"children":20577},{"style":200},[20578],{"type":38,"value":20579},"double",{"type":29,"tag":183,"props":20581,"children":20582},{"style":308},[20583],{"type":38,"value":20584}," v ",{"type":29,"tag":183,"props":20586,"children":20587},{"style":228},[20588],{"type":38,"value":8340},{"type":29,"tag":183,"props":20590,"children":20591},{"style":206},[20592],{"type":38,"value":20593}," getVolume",{"type":29,"tag":183,"props":20595,"children":20596},{"style":212},[20597],{"type":38,"value":9916},{"type":29,"tag":183,"props":20599,"children":20600},{"class":185,"line":218},[20601],{"type":29,"tag":183,"props":20602,"children":20603},{"emptyLinePlaceholder":13},[20604],{"type":38,"value":445},{"type":29,"tag":183,"props":20606,"children":20607},{"class":185,"line":245},[20608],{"type":29,"tag":183,"props":20609,"children":20610},{"style":190},[20611],{"type":38,"value":19272},{"type":29,"tag":183,"props":20613,"children":20614},{"class":185,"line":266},[20615,20619,20624,20628,20632],{"type":29,"tag":183,"props":20616,"children":20617},{"style":200},[20618],{"type":38,"value":20579},{"type":29,"tag":183,"props":20620,"children":20621},{"style":308},[20622],{"type":38,"value":20623}," volumeDeLaBoite ",{"type":29,"tag":183,"props":20625,"children":20626},{"style":228},[20627],{"type":38,"value":8340},{"type":29,"tag":183,"props":20629,"children":20630},{"style":206},[20631],{"type":38,"value":20593},{"type":29,"tag":183,"props":20633,"children":20634},{"style":212},[20635],{"type":38,"value":9916},{"type":29,"tag":30,"props":20637,"children":20638},{},[20639,20641,20647,20649,20655],{"type":38,"value":20640},"Dans le second exemple, le nom ",{"type":29,"tag":156,"props":20642,"children":20644},{"className":20643},[],[20645],{"type":38,"value":20646},"volumeDeLaBoite",{"type":38,"value":20648}," explique clairement ce que représente cette donnée, tandis que ",{"type":29,"tag":156,"props":20650,"children":20652},{"className":20651},[],[20653],{"type":38,"value":20654},"v",{"type":38,"value":20656}," est trop vague. On facilite ainsi la compréhension du code sans avoir besoin de lire toute la logique.",{"type":29,"tag":14327,"props":20658,"children":20660},{"id":20659},"_2-fonctions-courtes-et-focalisées",[20661],{"type":29,"tag":34,"props":20662,"children":20663},{},[20664],{"type":38,"value":20665},"2. Fonctions courtes et focalisées",{"type":29,"tag":30,"props":20667,"children":20668},{},[20669],{"type":38,"value":20670},"Une bonne fonction doit être courte et se concentrer sur une seule responsabilité. Cela rend votre code plus lisible et plus facile à tester.",{"type":29,"tag":30,"props":20672,"children":20673},{},[20674],{"type":29,"tag":34,"props":20675,"children":20676},{},[20677],{"type":38,"value":15609},{"type":29,"tag":173,"props":20679,"children":20681},{"className":8272,"code":20680,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple\npublic void calculerEtEnvoyerFacture(Client client) {\n    \u002F\u002F Calcul des montants\n    double montantHT = client.getPrixHT();\n    double taxe = montantHT * 0.2;\n    double montantTotal = montantHT + taxe;\n    \n    \u002F\u002F Envoi du mail\n    String message = \"Facture envoyée\";\n    envoyerMail(client.getEmail(), message);\n}\n\n\u002F\u002F Meilleur exemple\npublic double calculerMontantTotal(Client client) {\n    double montantHT = client.getPrixHT();\n    double taxe = montantHT * 0.2;\n    return montantHT + taxe;\n}\n\npublic void envoyerFacture(Client client) {\n    envoyerMail(client.getEmail(), \"Facture envoyée\");\n}\n",[20682],{"type":29,"tag":156,"props":20683,"children":20684},{"__ignoreMap":8},[20685,20692,20729,20737,20770,20803,20836,20843,20851,20876,20913,20920,20927,20934,20970,21001,21032,21055,21062,21069,21105,21140],{"type":29,"tag":183,"props":20686,"children":20687},{"class":185,"line":186},[20688],{"type":29,"tag":183,"props":20689,"children":20690},{"style":190},[20691],{"type":38,"value":19233},{"type":29,"tag":183,"props":20693,"children":20694},{"class":185,"line":196},[20695,20699,20703,20708,20712,20717,20721,20725],{"type":29,"tag":183,"props":20696,"children":20697},{"style":200},[20698],{"type":38,"value":8292},{"type":29,"tag":183,"props":20700,"children":20701},{"style":200},[20702],{"type":38,"value":9424},{"type":29,"tag":183,"props":20704,"children":20705},{"style":206},[20706],{"type":38,"value":20707}," calculerEtEnvoyerFacture",{"type":29,"tag":183,"props":20709,"children":20710},{"style":212},[20711],{"type":38,"value":770},{"type":29,"tag":183,"props":20713,"children":20714},{"style":8327},[20715],{"type":38,"value":20716},"Client",{"type":29,"tag":183,"props":20718,"children":20719},{"style":308},[20720],{"type":38,"value":1469},{"type":29,"tag":183,"props":20722,"children":20723},{"style":212},[20724],{"type":38,"value":272},{"type":29,"tag":183,"props":20726,"children":20727},{"style":212},[20728],{"type":38,"value":285},{"type":29,"tag":183,"props":20730,"children":20731},{"class":185,"line":218},[20732],{"type":29,"tag":183,"props":20733,"children":20734},{"style":190},[20735],{"type":38,"value":20736},"    \u002F\u002F Calcul des montants\n",{"type":29,"tag":183,"props":20738,"children":20739},{"class":185,"line":245},[20740,20744,20749,20753,20757,20761,20766],{"type":29,"tag":183,"props":20741,"children":20742},{"style":200},[20743],{"type":38,"value":18538},{"type":29,"tag":183,"props":20745,"children":20746},{"style":308},[20747],{"type":38,"value":20748}," montantHT ",{"type":29,"tag":183,"props":20750,"children":20751},{"style":228},[20752],{"type":38,"value":8340},{"type":29,"tag":183,"props":20754,"children":20755},{"style":308},[20756],{"type":38,"value":1469},{"type":29,"tag":183,"props":20758,"children":20759},{"style":212},[20760],{"type":38,"value":79},{"type":29,"tag":183,"props":20762,"children":20763},{"style":206},[20764],{"type":38,"value":20765},"getPrixHT",{"type":29,"tag":183,"props":20767,"children":20768},{"style":212},[20769],{"type":38,"value":9916},{"type":29,"tag":183,"props":20771,"children":20772},{"class":185,"line":266},[20773,20777,20782,20786,20790,20794,20799],{"type":29,"tag":183,"props":20774,"children":20775},{"style":200},[20776],{"type":38,"value":18538},{"type":29,"tag":183,"props":20778,"children":20779},{"style":308},[20780],{"type":38,"value":20781}," taxe ",{"type":29,"tag":183,"props":20783,"children":20784},{"style":228},[20785],{"type":38,"value":8340},{"type":29,"tag":183,"props":20787,"children":20788},{"style":308},[20789],{"type":38,"value":20748},{"type":29,"tag":183,"props":20791,"children":20792},{"style":228},[20793],{"type":38,"value":405},{"type":29,"tag":183,"props":20795,"children":20796},{"style":319},[20797],{"type":38,"value":20798}," 0.2",{"type":29,"tag":183,"props":20800,"children":20801},{"style":212},[20802],{"type":38,"value":327},{"type":29,"tag":183,"props":20804,"children":20805},{"class":185,"line":288},[20806,20810,20815,20819,20823,20827,20832],{"type":29,"tag":183,"props":20807,"children":20808},{"style":200},[20809],{"type":38,"value":18538},{"type":29,"tag":183,"props":20811,"children":20812},{"style":308},[20813],{"type":38,"value":20814}," montantTotal ",{"type":29,"tag":183,"props":20816,"children":20817},{"style":228},[20818],{"type":38,"value":8340},{"type":29,"tag":183,"props":20820,"children":20821},{"style":308},[20822],{"type":38,"value":20748},{"type":29,"tag":183,"props":20824,"children":20825},{"style":228},[20826],{"type":38,"value":354},{"type":29,"tag":183,"props":20828,"children":20829},{"style":308},[20830],{"type":38,"value":20831}," taxe",{"type":29,"tag":183,"props":20833,"children":20834},{"style":212},[20835],{"type":38,"value":327},{"type":29,"tag":183,"props":20837,"children":20838},{"class":185,"line":330},[20839],{"type":29,"tag":183,"props":20840,"children":20841},{"style":308},[20842],{"type":38,"value":18530},{"type":29,"tag":183,"props":20844,"children":20845},{"class":185,"line":374},[20846],{"type":29,"tag":183,"props":20847,"children":20848},{"style":190},[20849],{"type":38,"value":20850},"    \u002F\u002F Envoi du mail\n",{"type":29,"tag":183,"props":20852,"children":20853},{"class":185,"line":430},[20854,20858,20863,20867,20872],{"type":29,"tag":183,"props":20855,"children":20856},{"style":8327},[20857],{"type":38,"value":8766},{"type":29,"tag":183,"props":20859,"children":20860},{"style":308},[20861],{"type":38,"value":20862}," message ",{"type":29,"tag":183,"props":20864,"children":20865},{"style":228},[20866],{"type":38,"value":8340},{"type":29,"tag":183,"props":20868,"children":20869},{"style":1683},[20870],{"type":38,"value":20871}," \"Facture envoyée\"",{"type":29,"tag":183,"props":20873,"children":20874},{"style":212},[20875],{"type":38,"value":327},{"type":29,"tag":183,"props":20877,"children":20878},{"class":185,"line":439},[20879,20884,20888,20892,20896,20900,20904,20909],{"type":29,"tag":183,"props":20880,"children":20881},{"style":206},[20882],{"type":38,"value":20883},"    envoyerMail",{"type":29,"tag":183,"props":20885,"children":20886},{"style":212},[20887],{"type":38,"value":770},{"type":29,"tag":183,"props":20889,"children":20890},{"style":308},[20891],{"type":38,"value":3134},{"type":29,"tag":183,"props":20893,"children":20894},{"style":212},[20895],{"type":38,"value":79},{"type":29,"tag":183,"props":20897,"children":20898},{"style":206},[20899],{"type":38,"value":8549},{"type":29,"tag":183,"props":20901,"children":20902},{"style":212},[20903],{"type":38,"value":8554},{"type":29,"tag":183,"props":20905,"children":20906},{"style":308},[20907],{"type":38,"value":20908}," message",{"type":29,"tag":183,"props":20910,"children":20911},{"style":212},[20912],{"type":38,"value":7487},{"type":29,"tag":183,"props":20914,"children":20915},{"class":185,"line":448},[20916],{"type":29,"tag":183,"props":20917,"children":20918},{"style":212},[20919],{"type":38,"value":436},{"type":29,"tag":183,"props":20921,"children":20922},{"class":185,"line":457},[20923],{"type":29,"tag":183,"props":20924,"children":20925},{"emptyLinePlaceholder":13},[20926],{"type":38,"value":445},{"type":29,"tag":183,"props":20928,"children":20929},{"class":185,"line":474},[20930],{"type":29,"tag":183,"props":20931,"children":20932},{"style":190},[20933],{"type":38,"value":19272},{"type":29,"tag":183,"props":20935,"children":20936},{"class":185,"line":495},[20937,20941,20945,20950,20954,20958,20962,20966],{"type":29,"tag":183,"props":20938,"children":20939},{"style":200},[20940],{"type":38,"value":8292},{"type":29,"tag":183,"props":20942,"children":20943},{"style":200},[20944],{"type":38,"value":18661},{"type":29,"tag":183,"props":20946,"children":20947},{"style":206},[20948],{"type":38,"value":20949}," calculerMontantTotal",{"type":29,"tag":183,"props":20951,"children":20952},{"style":212},[20953],{"type":38,"value":770},{"type":29,"tag":183,"props":20955,"children":20956},{"style":8327},[20957],{"type":38,"value":20716},{"type":29,"tag":183,"props":20959,"children":20960},{"style":308},[20961],{"type":38,"value":1469},{"type":29,"tag":183,"props":20963,"children":20964},{"style":212},[20965],{"type":38,"value":272},{"type":29,"tag":183,"props":20967,"children":20968},{"style":212},[20969],{"type":38,"value":285},{"type":29,"tag":183,"props":20971,"children":20972},{"class":185,"line":516},[20973,20977,20981,20985,20989,20993,20997],{"type":29,"tag":183,"props":20974,"children":20975},{"style":200},[20976],{"type":38,"value":18538},{"type":29,"tag":183,"props":20978,"children":20979},{"style":308},[20980],{"type":38,"value":20748},{"type":29,"tag":183,"props":20982,"children":20983},{"style":228},[20984],{"type":38,"value":8340},{"type":29,"tag":183,"props":20986,"children":20987},{"style":308},[20988],{"type":38,"value":1469},{"type":29,"tag":183,"props":20990,"children":20991},{"style":212},[20992],{"type":38,"value":79},{"type":29,"tag":183,"props":20994,"children":20995},{"style":206},[20996],{"type":38,"value":20765},{"type":29,"tag":183,"props":20998,"children":20999},{"style":212},[21000],{"type":38,"value":9916},{"type":29,"tag":183,"props":21002,"children":21003},{"class":185,"line":536},[21004,21008,21012,21016,21020,21024,21028],{"type":29,"tag":183,"props":21005,"children":21006},{"style":200},[21007],{"type":38,"value":18538},{"type":29,"tag":183,"props":21009,"children":21010},{"style":308},[21011],{"type":38,"value":20781},{"type":29,"tag":183,"props":21013,"children":21014},{"style":228},[21015],{"type":38,"value":8340},{"type":29,"tag":183,"props":21017,"children":21018},{"style":308},[21019],{"type":38,"value":20748},{"type":29,"tag":183,"props":21021,"children":21022},{"style":228},[21023],{"type":38,"value":405},{"type":29,"tag":183,"props":21025,"children":21026},{"style":319},[21027],{"type":38,"value":20798},{"type":29,"tag":183,"props":21029,"children":21030},{"style":212},[21031],{"type":38,"value":327},{"type":29,"tag":183,"props":21033,"children":21034},{"class":185,"line":570},[21035,21039,21043,21047,21051],{"type":29,"tag":183,"props":21036,"children":21037},{"style":200},[21038],{"type":38,"value":919},{"type":29,"tag":183,"props":21040,"children":21041},{"style":308},[21042],{"type":38,"value":20748},{"type":29,"tag":183,"props":21044,"children":21045},{"style":228},[21046],{"type":38,"value":354},{"type":29,"tag":183,"props":21048,"children":21049},{"style":308},[21050],{"type":38,"value":20831},{"type":29,"tag":183,"props":21052,"children":21053},{"style":212},[21054],{"type":38,"value":327},{"type":29,"tag":183,"props":21056,"children":21057},{"class":185,"line":613},[21058],{"type":29,"tag":183,"props":21059,"children":21060},{"style":212},[21061],{"type":38,"value":436},{"type":29,"tag":183,"props":21063,"children":21064},{"class":185,"line":662},[21065],{"type":29,"tag":183,"props":21066,"children":21067},{"emptyLinePlaceholder":13},[21068],{"type":38,"value":445},{"type":29,"tag":183,"props":21070,"children":21071},{"class":185,"line":3095},[21072,21076,21080,21085,21089,21093,21097,21101],{"type":29,"tag":183,"props":21073,"children":21074},{"style":200},[21075],{"type":38,"value":8292},{"type":29,"tag":183,"props":21077,"children":21078},{"style":200},[21079],{"type":38,"value":9424},{"type":29,"tag":183,"props":21081,"children":21082},{"style":206},[21083],{"type":38,"value":21084}," envoyerFacture",{"type":29,"tag":183,"props":21086,"children":21087},{"style":212},[21088],{"type":38,"value":770},{"type":29,"tag":183,"props":21090,"children":21091},{"style":8327},[21092],{"type":38,"value":20716},{"type":29,"tag":183,"props":21094,"children":21095},{"style":308},[21096],{"type":38,"value":1469},{"type":29,"tag":183,"props":21098,"children":21099},{"style":212},[21100],{"type":38,"value":272},{"type":29,"tag":183,"props":21102,"children":21103},{"style":212},[21104],{"type":38,"value":285},{"type":29,"tag":183,"props":21106,"children":21107},{"class":185,"line":3154},[21108,21112,21116,21120,21124,21128,21132,21136],{"type":29,"tag":183,"props":21109,"children":21110},{"style":206},[21111],{"type":38,"value":20883},{"type":29,"tag":183,"props":21113,"children":21114},{"style":212},[21115],{"type":38,"value":770},{"type":29,"tag":183,"props":21117,"children":21118},{"style":308},[21119],{"type":38,"value":3134},{"type":29,"tag":183,"props":21121,"children":21122},{"style":212},[21123],{"type":38,"value":79},{"type":29,"tag":183,"props":21125,"children":21126},{"style":206},[21127],{"type":38,"value":8549},{"type":29,"tag":183,"props":21129,"children":21130},{"style":212},[21131],{"type":38,"value":8554},{"type":29,"tag":183,"props":21133,"children":21134},{"style":1683},[21135],{"type":38,"value":20871},{"type":29,"tag":183,"props":21137,"children":21138},{"style":212},[21139],{"type":38,"value":7487},{"type":29,"tag":183,"props":21141,"children":21142},{"class":185,"line":3207},[21143],{"type":29,"tag":183,"props":21144,"children":21145},{"style":212},[21146],{"type":38,"value":436},{"type":29,"tag":30,"props":21148,"children":21149},{},[21150],{"type":38,"value":21151},"Dans le second exemple, calcul et envoi d'email sont séparés : chaque fonction se teste indépendamment, et l'intention de chaque bloc devient explicite.",{"type":29,"tag":30,"props":21153,"children":21154},{},[21155],{"type":38,"value":21156},"Règle empirique utile : au-delà de vingt lignes, une fonction est presque toujours candidate à être découpée.",{"type":29,"tag":46,"props":21158,"children":21159},{},[],{"type":29,"tag":14327,"props":21161,"children":21163},{"id":21162},"_3-bonne-gestion-des-exceptions",[21164],{"type":29,"tag":34,"props":21165,"children":21166},{},[21167],{"type":38,"value":21168},"3. Bonne gestion des exceptions",{"type":29,"tag":30,"props":21170,"children":21171},{},[21172],{"type":38,"value":21173},"La gestion des erreurs et des exceptions est souvent négligée, mais elle joue un rôle clé dans un code propre. Un bon code doit être capable de traiter les erreurs de manière claire et concise, sans masquer les problèmes.",{"type":29,"tag":30,"props":21175,"children":21176},{},[21177],{"type":29,"tag":34,"props":21178,"children":21179},{},[21180],{"type":38,"value":15609},{"type":29,"tag":173,"props":21182,"children":21184},{"className":8272,"code":21183,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple\ntry {\n    processOrder(order);\n} catch (Exception e) {\n    System.out.println(\"Erreur lors du traitement de la commande\");\n}\n\n\u002F\u002F Meilleur exemple\ntry {\n    processOrder(order);\n} catch (InvalidOrderException e) {\n    System.out.println(\"Commande invalide : \" + e.getMessage());\n} catch (PaymentFailedException e) {\n    System.out.println(\"Échec du paiement : \" + e.getMessage());\n}\n",[21185],{"type":29,"tag":156,"props":21186,"children":21187},{"__ignoreMap":8},[21188,21195,21207,21227,21260,21296,21303,21310,21317,21328,21347,21379,21432,21463,21515],{"type":29,"tag":183,"props":21189,"children":21190},{"class":185,"line":186},[21191],{"type":29,"tag":183,"props":21192,"children":21193},{"style":190},[21194],{"type":38,"value":19233},{"type":29,"tag":183,"props":21196,"children":21197},{"class":185,"line":196},[21198,21203],{"type":29,"tag":183,"props":21199,"children":21200},{"style":200},[21201],{"type":38,"value":21202},"try",{"type":29,"tag":183,"props":21204,"children":21205},{"style":212},[21206],{"type":38,"value":285},{"type":29,"tag":183,"props":21208,"children":21209},{"class":185,"line":218},[21210,21215,21219,21223],{"type":29,"tag":183,"props":21211,"children":21212},{"style":206},[21213],{"type":38,"value":21214},"    processOrder",{"type":29,"tag":183,"props":21216,"children":21217},{"style":212},[21218],{"type":38,"value":770},{"type":29,"tag":183,"props":21220,"children":21221},{"style":308},[21222],{"type":38,"value":13250},{"type":29,"tag":183,"props":21224,"children":21225},{"style":212},[21226],{"type":38,"value":7487},{"type":29,"tag":183,"props":21228,"children":21229},{"class":185,"line":245},[21230,21234,21239,21243,21248,21252,21256],{"type":29,"tag":183,"props":21231,"children":21232},{"style":212},[21233],{"type":38,"value":2886},{"type":29,"tag":183,"props":21235,"children":21236},{"style":200},[21237],{"type":38,"value":21238}," catch",{"type":29,"tag":183,"props":21240,"children":21241},{"style":212},[21242],{"type":38,"value":1533},{"type":29,"tag":183,"props":21244,"children":21245},{"style":8327},[21246],{"type":38,"value":21247},"Exception",{"type":29,"tag":183,"props":21249,"children":21250},{"style":222},[21251],{"type":38,"value":7048},{"type":29,"tag":183,"props":21253,"children":21254},{"style":212},[21255],{"type":38,"value":272},{"type":29,"tag":183,"props":21257,"children":21258},{"style":212},[21259],{"type":38,"value":285},{"type":29,"tag":183,"props":21261,"children":21262},{"class":185,"line":266},[21263,21267,21271,21275,21279,21283,21287,21292],{"type":29,"tag":183,"props":21264,"children":21265},{"style":308},[21266],{"type":38,"value":20100},{"type":29,"tag":183,"props":21268,"children":21269},{"style":212},[21270],{"type":38,"value":79},{"type":29,"tag":183,"props":21272,"children":21273},{"style":308},[21274],{"type":38,"value":17513},{"type":29,"tag":183,"props":21276,"children":21277},{"style":212},[21278],{"type":38,"value":79},{"type":29,"tag":183,"props":21280,"children":21281},{"style":206},[21282],{"type":38,"value":17522},{"type":29,"tag":183,"props":21284,"children":21285},{"style":212},[21286],{"type":38,"value":770},{"type":29,"tag":183,"props":21288,"children":21289},{"style":1683},[21290],{"type":38,"value":21291},"\"Erreur lors du traitement de la commande\"",{"type":29,"tag":183,"props":21293,"children":21294},{"style":212},[21295],{"type":38,"value":7487},{"type":29,"tag":183,"props":21297,"children":21298},{"class":185,"line":288},[21299],{"type":29,"tag":183,"props":21300,"children":21301},{"style":212},[21302],{"type":38,"value":436},{"type":29,"tag":183,"props":21304,"children":21305},{"class":185,"line":330},[21306],{"type":29,"tag":183,"props":21307,"children":21308},{"emptyLinePlaceholder":13},[21309],{"type":38,"value":445},{"type":29,"tag":183,"props":21311,"children":21312},{"class":185,"line":374},[21313],{"type":29,"tag":183,"props":21314,"children":21315},{"style":190},[21316],{"type":38,"value":19272},{"type":29,"tag":183,"props":21318,"children":21319},{"class":185,"line":430},[21320,21324],{"type":29,"tag":183,"props":21321,"children":21322},{"style":200},[21323],{"type":38,"value":21202},{"type":29,"tag":183,"props":21325,"children":21326},{"style":212},[21327],{"type":38,"value":285},{"type":29,"tag":183,"props":21329,"children":21330},{"class":185,"line":439},[21331,21335,21339,21343],{"type":29,"tag":183,"props":21332,"children":21333},{"style":206},[21334],{"type":38,"value":21214},{"type":29,"tag":183,"props":21336,"children":21337},{"style":212},[21338],{"type":38,"value":770},{"type":29,"tag":183,"props":21340,"children":21341},{"style":308},[21342],{"type":38,"value":13250},{"type":29,"tag":183,"props":21344,"children":21345},{"style":212},[21346],{"type":38,"value":7487},{"type":29,"tag":183,"props":21348,"children":21349},{"class":185,"line":448},[21350,21354,21358,21362,21367,21371,21375],{"type":29,"tag":183,"props":21351,"children":21352},{"style":212},[21353],{"type":38,"value":2886},{"type":29,"tag":183,"props":21355,"children":21356},{"style":200},[21357],{"type":38,"value":21238},{"type":29,"tag":183,"props":21359,"children":21360},{"style":212},[21361],{"type":38,"value":1533},{"type":29,"tag":183,"props":21363,"children":21364},{"style":8327},[21365],{"type":38,"value":21366},"InvalidOrderException",{"type":29,"tag":183,"props":21368,"children":21369},{"style":222},[21370],{"type":38,"value":7048},{"type":29,"tag":183,"props":21372,"children":21373},{"style":212},[21374],{"type":38,"value":272},{"type":29,"tag":183,"props":21376,"children":21377},{"style":212},[21378],{"type":38,"value":285},{"type":29,"tag":183,"props":21380,"children":21381},{"class":185,"line":457},[21382,21386,21390,21394,21398,21402,21406,21411,21415,21419,21423,21428],{"type":29,"tag":183,"props":21383,"children":21384},{"style":308},[21385],{"type":38,"value":20100},{"type":29,"tag":183,"props":21387,"children":21388},{"style":212},[21389],{"type":38,"value":79},{"type":29,"tag":183,"props":21391,"children":21392},{"style":308},[21393],{"type":38,"value":17513},{"type":29,"tag":183,"props":21395,"children":21396},{"style":212},[21397],{"type":38,"value":79},{"type":29,"tag":183,"props":21399,"children":21400},{"style":206},[21401],{"type":38,"value":17522},{"type":29,"tag":183,"props":21403,"children":21404},{"style":212},[21405],{"type":38,"value":770},{"type":29,"tag":183,"props":21407,"children":21408},{"style":1683},[21409],{"type":38,"value":21410},"\"Commande invalide : \"",{"type":29,"tag":183,"props":21412,"children":21413},{"style":228},[21414],{"type":38,"value":947},{"type":29,"tag":183,"props":21416,"children":21417},{"style":308},[21418],{"type":38,"value":7048},{"type":29,"tag":183,"props":21420,"children":21421},{"style":212},[21422],{"type":38,"value":79},{"type":29,"tag":183,"props":21424,"children":21425},{"style":206},[21426],{"type":38,"value":21427},"getMessage",{"type":29,"tag":183,"props":21429,"children":21430},{"style":212},[21431],{"type":38,"value":11052},{"type":29,"tag":183,"props":21433,"children":21434},{"class":185,"line":474},[21435,21439,21443,21447,21451,21455,21459],{"type":29,"tag":183,"props":21436,"children":21437},{"style":212},[21438],{"type":38,"value":2886},{"type":29,"tag":183,"props":21440,"children":21441},{"style":200},[21442],{"type":38,"value":21238},{"type":29,"tag":183,"props":21444,"children":21445},{"style":212},[21446],{"type":38,"value":1533},{"type":29,"tag":183,"props":21448,"children":21449},{"style":8327},[21450],{"type":38,"value":12544},{"type":29,"tag":183,"props":21452,"children":21453},{"style":222},[21454],{"type":38,"value":7048},{"type":29,"tag":183,"props":21456,"children":21457},{"style":212},[21458],{"type":38,"value":272},{"type":29,"tag":183,"props":21460,"children":21461},{"style":212},[21462],{"type":38,"value":285},{"type":29,"tag":183,"props":21464,"children":21465},{"class":185,"line":495},[21466,21470,21474,21478,21482,21486,21490,21495,21499,21503,21507,21511],{"type":29,"tag":183,"props":21467,"children":21468},{"style":308},[21469],{"type":38,"value":20100},{"type":29,"tag":183,"props":21471,"children":21472},{"style":212},[21473],{"type":38,"value":79},{"type":29,"tag":183,"props":21475,"children":21476},{"style":308},[21477],{"type":38,"value":17513},{"type":29,"tag":183,"props":21479,"children":21480},{"style":212},[21481],{"type":38,"value":79},{"type":29,"tag":183,"props":21483,"children":21484},{"style":206},[21485],{"type":38,"value":17522},{"type":29,"tag":183,"props":21487,"children":21488},{"style":212},[21489],{"type":38,"value":770},{"type":29,"tag":183,"props":21491,"children":21492},{"style":1683},[21493],{"type":38,"value":21494},"\"Échec du paiement : \"",{"type":29,"tag":183,"props":21496,"children":21497},{"style":228},[21498],{"type":38,"value":947},{"type":29,"tag":183,"props":21500,"children":21501},{"style":308},[21502],{"type":38,"value":7048},{"type":29,"tag":183,"props":21504,"children":21505},{"style":212},[21506],{"type":38,"value":79},{"type":29,"tag":183,"props":21508,"children":21509},{"style":206},[21510],{"type":38,"value":21427},{"type":29,"tag":183,"props":21512,"children":21513},{"style":212},[21514],{"type":38,"value":11052},{"type":29,"tag":183,"props":21516,"children":21517},{"class":185,"line":516},[21518],{"type":29,"tag":183,"props":21519,"children":21520},{"style":212},[21521],{"type":38,"value":436},{"type":29,"tag":30,"props":21523,"children":21524},{},[21525],{"type":38,"value":21526},"Dans le second exemple, chaque type d'erreur reçoit son propre traitement : on sait précisément ce qui a échoué et la réaction peut être adaptée au cas.",{"type":29,"tag":50,"props":21528,"children":21530},{"id":21529},"le-catch-exception-e-générique-est-un-anti-pattern-classique-il-masque-les-vraies-causes-et-complique-le-débogage-en-production",[21531,21532,21538],{"type":38,"value":14726},{"type":29,"tag":156,"props":21533,"children":21535},{"className":21534},[],[21536],{"type":38,"value":21537},"catch (Exception e)",{"type":38,"value":21539}," générique est un anti-pattern classique : il masque les vraies causes et complique le débogage en production.",{"type":29,"tag":50,"props":21541,"children":21543},{"id":21542},"les-bonnes-pratiques-pour-écrire-du-code-maintenable",[21544],{"type":29,"tag":34,"props":21545,"children":21546},{},[21547],{"type":38,"value":21548},"Les bonnes pratiques pour écrire du code maintenable",{"type":29,"tag":30,"props":21550,"children":21551},{},[21552,21553,21557],{"type":38,"value":14726},{"type":29,"tag":34,"props":21554,"children":21555},{},[21556],{"type":38,"value":2416},{"type":38,"value":21558}," ne se limite pas à écrire du code lisible ; il doit aussi être facilement maintenable et évolutif. Voici quelques bonnes pratiques pour s'assurer que votre code reste propre même après plusieurs itérations.",{"type":29,"tag":14327,"props":21560,"children":21562},{"id":21561},"_1-le-principe-de-responsabilité-unique-single-responsibility-principle-srp",[21563],{"type":29,"tag":34,"props":21564,"children":21565},{},[21566],{"type":38,"value":21567},"1. Le principe de responsabilité unique (Single Responsibility Principle - SRP)",{"type":29,"tag":30,"props":21569,"children":21570},{},[21571,21572,21577,21579,21583],{"type":38,"value":14726},{"type":29,"tag":34,"props":21573,"children":21574},{},[21575],{"type":38,"value":21576},"principe de responsabilité unique",{"type":38,"value":21578},", formalisé par Robert C. Martin dans ",{"type":29,"tag":114,"props":21580,"children":21581},{},[21582],{"type":38,"value":2416},{"type":38,"value":21584},", énonce qu'une classe ou une fonction ne doit avoir qu'une seule raison de changer. Le bénéfice est direct : moins de dépendances, des tests plus simples, une maintenance qui n'engendre pas d'effets de bord.",{"type":29,"tag":30,"props":21586,"children":21587},{},[21588],{"type":29,"tag":34,"props":21589,"children":21590},{},[21591],{"type":38,"value":15609},{"type":29,"tag":173,"props":21593,"children":21595},{"className":8272,"code":21594,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple - Une classe gère trop de responsabilités\npublic class GestionnaireDeCommande {\n    public void creerCommande() {\n        \u002F\u002F Crée une commande\n    }\n    \n    public void calculerRemises() {\n        \u002F\u002F Calcule les remises\n    }\n\n    public void envoyerEmailConfirmation() {\n        \u002F\u002F Envoie un email de confirmation\n    }\n}\n\n\u002F\u002F Meilleur exemple - Responsabilités divisées en plusieurs classes\npublic class CommandeService {\n    public void creerCommande() {\n        \u002F\u002F Crée une commande\n    }\n}\n\npublic class RemiseService {\n    public void calculerRemises() {\n        \u002F\u002F Calcule les remises\n    }\n}\n\npublic class NotificationService {\n    public void envoyerEmailConfirmation() {\n        \u002F\u002F Envoie un email de confirmation\n    }\n}\n",[21596],{"type":29,"tag":156,"props":21597,"children":21598},{"__ignoreMap":8},[21599,21607,21627,21651,21659,21666,21673,21697,21705,21712,21719,21743,21751,21758,21765,21772,21780,21800,21823,21830,21837,21844,21851,21871,21894,21901,21908,21915,21922,21941,21964,21971,21978],{"type":29,"tag":183,"props":21600,"children":21601},{"class":185,"line":186},[21602],{"type":29,"tag":183,"props":21603,"children":21604},{"style":190},[21605],{"type":38,"value":21606},"\u002F\u002F Mauvais exemple - Une classe gère trop de responsabilités\n",{"type":29,"tag":183,"props":21608,"children":21609},{"class":185,"line":196},[21610,21614,21618,21623],{"type":29,"tag":183,"props":21611,"children":21612},{"style":200},[21613],{"type":38,"value":8292},{"type":29,"tag":183,"props":21615,"children":21616},{"style":200},[21617],{"type":38,"value":854},{"type":29,"tag":183,"props":21619,"children":21620},{"style":750},[21621],{"type":38,"value":21622}," GestionnaireDeCommande",{"type":29,"tag":183,"props":21624,"children":21625},{"style":212},[21626],{"type":38,"value":285},{"type":29,"tag":183,"props":21628,"children":21629},{"class":185,"line":218},[21630,21634,21638,21643,21647],{"type":29,"tag":183,"props":21631,"children":21632},{"style":200},[21633],{"type":38,"value":8441},{"type":29,"tag":183,"props":21635,"children":21636},{"style":200},[21637],{"type":38,"value":9424},{"type":29,"tag":183,"props":21639,"children":21640},{"style":206},[21641],{"type":38,"value":21642}," creerCommande",{"type":29,"tag":183,"props":21644,"children":21645},{"style":212},[21646],{"type":38,"value":1108},{"type":29,"tag":183,"props":21648,"children":21649},{"style":212},[21650],{"type":38,"value":285},{"type":29,"tag":183,"props":21652,"children":21653},{"class":185,"line":245},[21654],{"type":29,"tag":183,"props":21655,"children":21656},{"style":190},[21657],{"type":38,"value":21658},"        \u002F\u002F Crée une commande\n",{"type":29,"tag":183,"props":21660,"children":21661},{"class":185,"line":266},[21662],{"type":29,"tag":183,"props":21663,"children":21664},{"style":212},[21665],{"type":38,"value":1589},{"type":29,"tag":183,"props":21667,"children":21668},{"class":185,"line":288},[21669],{"type":29,"tag":183,"props":21670,"children":21671},{"style":308},[21672],{"type":38,"value":18530},{"type":29,"tag":183,"props":21674,"children":21675},{"class":185,"line":330},[21676,21680,21684,21689,21693],{"type":29,"tag":183,"props":21677,"children":21678},{"style":200},[21679],{"type":38,"value":8441},{"type":29,"tag":183,"props":21681,"children":21682},{"style":200},[21683],{"type":38,"value":9424},{"type":29,"tag":183,"props":21685,"children":21686},{"style":206},[21687],{"type":38,"value":21688}," calculerRemises",{"type":29,"tag":183,"props":21690,"children":21691},{"style":212},[21692],{"type":38,"value":1108},{"type":29,"tag":183,"props":21694,"children":21695},{"style":212},[21696],{"type":38,"value":285},{"type":29,"tag":183,"props":21698,"children":21699},{"class":185,"line":374},[21700],{"type":29,"tag":183,"props":21701,"children":21702},{"style":190},[21703],{"type":38,"value":21704},"        \u002F\u002F Calcule les remises\n",{"type":29,"tag":183,"props":21706,"children":21707},{"class":185,"line":430},[21708],{"type":29,"tag":183,"props":21709,"children":21710},{"style":212},[21711],{"type":38,"value":1589},{"type":29,"tag":183,"props":21713,"children":21714},{"class":185,"line":439},[21715],{"type":29,"tag":183,"props":21716,"children":21717},{"emptyLinePlaceholder":13},[21718],{"type":38,"value":445},{"type":29,"tag":183,"props":21720,"children":21721},{"class":185,"line":448},[21722,21726,21730,21735,21739],{"type":29,"tag":183,"props":21723,"children":21724},{"style":200},[21725],{"type":38,"value":8441},{"type":29,"tag":183,"props":21727,"children":21728},{"style":200},[21729],{"type":38,"value":9424},{"type":29,"tag":183,"props":21731,"children":21732},{"style":206},[21733],{"type":38,"value":21734}," envoyerEmailConfirmation",{"type":29,"tag":183,"props":21736,"children":21737},{"style":212},[21738],{"type":38,"value":1108},{"type":29,"tag":183,"props":21740,"children":21741},{"style":212},[21742],{"type":38,"value":285},{"type":29,"tag":183,"props":21744,"children":21745},{"class":185,"line":457},[21746],{"type":29,"tag":183,"props":21747,"children":21748},{"style":190},[21749],{"type":38,"value":21750},"        \u002F\u002F Envoie un email de confirmation\n",{"type":29,"tag":183,"props":21752,"children":21753},{"class":185,"line":474},[21754],{"type":29,"tag":183,"props":21755,"children":21756},{"style":212},[21757],{"type":38,"value":1589},{"type":29,"tag":183,"props":21759,"children":21760},{"class":185,"line":495},[21761],{"type":29,"tag":183,"props":21762,"children":21763},{"style":212},[21764],{"type":38,"value":436},{"type":29,"tag":183,"props":21766,"children":21767},{"class":185,"line":516},[21768],{"type":29,"tag":183,"props":21769,"children":21770},{"emptyLinePlaceholder":13},[21771],{"type":38,"value":445},{"type":29,"tag":183,"props":21773,"children":21774},{"class":185,"line":536},[21775],{"type":29,"tag":183,"props":21776,"children":21777},{"style":190},[21778],{"type":38,"value":21779},"\u002F\u002F Meilleur exemple - Responsabilités divisées en plusieurs classes\n",{"type":29,"tag":183,"props":21781,"children":21782},{"class":185,"line":570},[21783,21787,21791,21796],{"type":29,"tag":183,"props":21784,"children":21785},{"style":200},[21786],{"type":38,"value":8292},{"type":29,"tag":183,"props":21788,"children":21789},{"style":200},[21790],{"type":38,"value":854},{"type":29,"tag":183,"props":21792,"children":21793},{"style":750},[21794],{"type":38,"value":21795}," CommandeService",{"type":29,"tag":183,"props":21797,"children":21798},{"style":212},[21799],{"type":38,"value":285},{"type":29,"tag":183,"props":21801,"children":21802},{"class":185,"line":613},[21803,21807,21811,21815,21819],{"type":29,"tag":183,"props":21804,"children":21805},{"style":200},[21806],{"type":38,"value":8441},{"type":29,"tag":183,"props":21808,"children":21809},{"style":200},[21810],{"type":38,"value":9424},{"type":29,"tag":183,"props":21812,"children":21813},{"style":206},[21814],{"type":38,"value":21642},{"type":29,"tag":183,"props":21816,"children":21817},{"style":212},[21818],{"type":38,"value":1108},{"type":29,"tag":183,"props":21820,"children":21821},{"style":212},[21822],{"type":38,"value":285},{"type":29,"tag":183,"props":21824,"children":21825},{"class":185,"line":662},[21826],{"type":29,"tag":183,"props":21827,"children":21828},{"style":190},[21829],{"type":38,"value":21658},{"type":29,"tag":183,"props":21831,"children":21832},{"class":185,"line":3095},[21833],{"type":29,"tag":183,"props":21834,"children":21835},{"style":212},[21836],{"type":38,"value":1589},{"type":29,"tag":183,"props":21838,"children":21839},{"class":185,"line":3154},[21840],{"type":29,"tag":183,"props":21841,"children":21842},{"style":212},[21843],{"type":38,"value":436},{"type":29,"tag":183,"props":21845,"children":21846},{"class":185,"line":3207},[21847],{"type":29,"tag":183,"props":21848,"children":21849},{"emptyLinePlaceholder":13},[21850],{"type":38,"value":445},{"type":29,"tag":183,"props":21852,"children":21853},{"class":185,"line":3224},[21854,21858,21862,21867],{"type":29,"tag":183,"props":21855,"children":21856},{"style":200},[21857],{"type":38,"value":8292},{"type":29,"tag":183,"props":21859,"children":21860},{"style":200},[21861],{"type":38,"value":854},{"type":29,"tag":183,"props":21863,"children":21864},{"style":750},[21865],{"type":38,"value":21866}," RemiseService",{"type":29,"tag":183,"props":21868,"children":21869},{"style":212},[21870],{"type":38,"value":285},{"type":29,"tag":183,"props":21872,"children":21873},{"class":185,"line":3266},[21874,21878,21882,21886,21890],{"type":29,"tag":183,"props":21875,"children":21876},{"style":200},[21877],{"type":38,"value":8441},{"type":29,"tag":183,"props":21879,"children":21880},{"style":200},[21881],{"type":38,"value":9424},{"type":29,"tag":183,"props":21883,"children":21884},{"style":206},[21885],{"type":38,"value":21688},{"type":29,"tag":183,"props":21887,"children":21888},{"style":212},[21889],{"type":38,"value":1108},{"type":29,"tag":183,"props":21891,"children":21892},{"style":212},[21893],{"type":38,"value":285},{"type":29,"tag":183,"props":21895,"children":21896},{"class":185,"line":3275},[21897],{"type":29,"tag":183,"props":21898,"children":21899},{"style":190},[21900],{"type":38,"value":21704},{"type":29,"tag":183,"props":21902,"children":21903},{"class":185,"line":3283},[21904],{"type":29,"tag":183,"props":21905,"children":21906},{"style":212},[21907],{"type":38,"value":1589},{"type":29,"tag":183,"props":21909,"children":21910},{"class":185,"line":3292},[21911],{"type":29,"tag":183,"props":21912,"children":21913},{"style":212},[21914],{"type":38,"value":436},{"type":29,"tag":183,"props":21916,"children":21917},{"class":185,"line":3349},[21918],{"type":29,"tag":183,"props":21919,"children":21920},{"emptyLinePlaceholder":13},[21921],{"type":38,"value":445},{"type":29,"tag":183,"props":21923,"children":21924},{"class":185,"line":3366},[21925,21929,21933,21937],{"type":29,"tag":183,"props":21926,"children":21927},{"style":200},[21928],{"type":38,"value":8292},{"type":29,"tag":183,"props":21930,"children":21931},{"style":200},[21932],{"type":38,"value":854},{"type":29,"tag":183,"props":21934,"children":21935},{"style":750},[21936],{"type":38,"value":12731},{"type":29,"tag":183,"props":21938,"children":21939},{"style":212},[21940],{"type":38,"value":285},{"type":29,"tag":183,"props":21942,"children":21943},{"class":185,"line":3395},[21944,21948,21952,21956,21960],{"type":29,"tag":183,"props":21945,"children":21946},{"style":200},[21947],{"type":38,"value":8441},{"type":29,"tag":183,"props":21949,"children":21950},{"style":200},[21951],{"type":38,"value":9424},{"type":29,"tag":183,"props":21953,"children":21954},{"style":206},[21955],{"type":38,"value":21734},{"type":29,"tag":183,"props":21957,"children":21958},{"style":212},[21959],{"type":38,"value":1108},{"type":29,"tag":183,"props":21961,"children":21962},{"style":212},[21963],{"type":38,"value":285},{"type":29,"tag":183,"props":21965,"children":21966},{"class":185,"line":3425},[21967],{"type":29,"tag":183,"props":21968,"children":21969},{"style":190},[21970],{"type":38,"value":21750},{"type":29,"tag":183,"props":21972,"children":21973},{"class":185,"line":3455},[21974],{"type":29,"tag":183,"props":21975,"children":21976},{"style":212},[21977],{"type":38,"value":1589},{"type":29,"tag":183,"props":21979,"children":21980},{"class":185,"line":3485},[21981],{"type":29,"tag":183,"props":21982,"children":21983},{"style":212},[21984],{"type":38,"value":436},{"type":29,"tag":30,"props":21986,"children":21987},{},[21988],{"type":38,"value":21989},"Chaque classe a maintenant une responsabilité unique : les classes restent légères, les modifications restent localisées, et l'impact d'un changement ne se propage pas en cascade.",{"type":29,"tag":50,"props":21991,"children":21993},{"id":21992},"test-pratique-si-lexplication-de-ce-que-fait-une-classe-nécessite-un-et-elle-fait-x-et-y-il-y-a-une-responsabilité-de-trop",[21994],{"type":38,"value":21995},"Test pratique : si l'explication de ce que fait une classe nécessite un \"et\" (\"elle fait X et Y\"), il y a une responsabilité de trop.",{"type":29,"tag":14327,"props":21997,"children":21999},{"id":21998},"_2-éviter-les-duplications-de-code",[22000],{"type":29,"tag":34,"props":22001,"children":22002},{},[22003],{"type":38,"value":22004},"2. Éviter les duplications de code",{"type":29,"tag":30,"props":22006,"children":22007},{},[22008],{"type":38,"value":22009},"Le code dupliqué est un piège fréquent qui complique la maintenance. En éliminant les duplications, vous vous assurez qu'un changement à un endroit du code n'entraîne pas une cascade de modifications à différents endroits.",{"type":29,"tag":30,"props":22011,"children":22012},{},[22013],{"type":29,"tag":34,"props":22014,"children":22015},{},[22016],{"type":38,"value":15609},{"type":29,"tag":173,"props":22018,"children":22020},{"className":8272,"code":22019,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple - Duplication de logique\ndouble calculerRemiseClient(double montant) {\n    double remise = 0;\n    if (montant > 1000) {\n        remise = montant * 0.1;\n    }\n    return remise;\n}\n\ndouble calculerRemisePartenaire(double montant) {\n    double remise = 0;\n    if (montant > 1000) {\n        remise = montant * 0.1;\n    }\n    return remise;\n}\n\n\u002F\u002F Meilleur exemple - Refactorisation pour éviter la duplication\ndouble calculerRemise(double montant) {\n    double remise = 0;\n    if (montant > 1000) {\n        remise = montant * 0.1;\n    }\n    return remise;\n}\n",[22021],{"type":29,"tag":156,"props":22022,"children":22023},{"__ignoreMap":8},[22024,22032,22065,22089,22122,22152,22159,22175,22182,22189,22221,22244,22275,22302,22309,22324,22331,22338,22346,22378,22401,22432,22459,22466,22481],{"type":29,"tag":183,"props":22025,"children":22026},{"class":185,"line":186},[22027],{"type":29,"tag":183,"props":22028,"children":22029},{"style":190},[22030],{"type":38,"value":22031},"\u002F\u002F Mauvais exemple - Duplication de logique\n",{"type":29,"tag":183,"props":22033,"children":22034},{"class":185,"line":196},[22035,22039,22044,22048,22052,22057,22061],{"type":29,"tag":183,"props":22036,"children":22037},{"style":200},[22038],{"type":38,"value":20579},{"type":29,"tag":183,"props":22040,"children":22041},{"style":206},[22042],{"type":38,"value":22043}," calculerRemiseClient",{"type":29,"tag":183,"props":22045,"children":22046},{"style":212},[22047],{"type":38,"value":770},{"type":29,"tag":183,"props":22049,"children":22050},{"style":200},[22051],{"type":38,"value":20579},{"type":29,"tag":183,"props":22053,"children":22054},{"style":308},[22055],{"type":38,"value":22056}," montant",{"type":29,"tag":183,"props":22058,"children":22059},{"style":212},[22060],{"type":38,"value":272},{"type":29,"tag":183,"props":22062,"children":22063},{"style":212},[22064],{"type":38,"value":285},{"type":29,"tag":183,"props":22066,"children":22067},{"class":185,"line":218},[22068,22072,22077,22081,22085],{"type":29,"tag":183,"props":22069,"children":22070},{"style":200},[22071],{"type":38,"value":18538},{"type":29,"tag":183,"props":22073,"children":22074},{"style":308},[22075],{"type":38,"value":22076}," remise ",{"type":29,"tag":183,"props":22078,"children":22079},{"style":228},[22080],{"type":38,"value":8340},{"type":29,"tag":183,"props":22082,"children":22083},{"style":319},[22084],{"type":38,"value":981},{"type":29,"tag":183,"props":22086,"children":22087},{"style":212},[22088],{"type":38,"value":327},{"type":29,"tag":183,"props":22090,"children":22091},{"class":185,"line":245},[22092,22096,22100,22105,22109,22114,22118],{"type":29,"tag":183,"props":22093,"children":22094},{"style":200},[22095],{"type":38,"value":1528},{"type":29,"tag":183,"props":22097,"children":22098},{"style":212},[22099],{"type":38,"value":1533},{"type":29,"tag":183,"props":22101,"children":22102},{"style":308},[22103],{"type":38,"value":22104},"montant ",{"type":29,"tag":183,"props":22106,"children":22107},{"style":228},[22108],{"type":38,"value":1452},{"type":29,"tag":183,"props":22110,"children":22111},{"style":319},[22112],{"type":38,"value":22113}," 1000",{"type":29,"tag":183,"props":22115,"children":22116},{"style":212},[22117],{"type":38,"value":272},{"type":29,"tag":183,"props":22119,"children":22120},{"style":212},[22121],{"type":38,"value":285},{"type":29,"tag":183,"props":22123,"children":22124},{"class":185,"line":266},[22125,22130,22134,22139,22143,22148],{"type":29,"tag":183,"props":22126,"children":22127},{"style":308},[22128],{"type":38,"value":22129},"        remise ",{"type":29,"tag":183,"props":22131,"children":22132},{"style":228},[22133],{"type":38,"value":8340},{"type":29,"tag":183,"props":22135,"children":22136},{"style":308},[22137],{"type":38,"value":22138}," montant ",{"type":29,"tag":183,"props":22140,"children":22141},{"style":228},[22142],{"type":38,"value":405},{"type":29,"tag":183,"props":22144,"children":22145},{"style":319},[22146],{"type":38,"value":22147}," 0.1",{"type":29,"tag":183,"props":22149,"children":22150},{"style":212},[22151],{"type":38,"value":327},{"type":29,"tag":183,"props":22153,"children":22154},{"class":185,"line":288},[22155],{"type":29,"tag":183,"props":22156,"children":22157},{"style":212},[22158],{"type":38,"value":1589},{"type":29,"tag":183,"props":22160,"children":22161},{"class":185,"line":330},[22162,22166,22171],{"type":29,"tag":183,"props":22163,"children":22164},{"style":200},[22165],{"type":38,"value":919},{"type":29,"tag":183,"props":22167,"children":22168},{"style":308},[22169],{"type":38,"value":22170}," remise",{"type":29,"tag":183,"props":22172,"children":22173},{"style":212},[22174],{"type":38,"value":327},{"type":29,"tag":183,"props":22176,"children":22177},{"class":185,"line":374},[22178],{"type":29,"tag":183,"props":22179,"children":22180},{"style":212},[22181],{"type":38,"value":436},{"type":29,"tag":183,"props":22183,"children":22184},{"class":185,"line":430},[22185],{"type":29,"tag":183,"props":22186,"children":22187},{"emptyLinePlaceholder":13},[22188],{"type":38,"value":445},{"type":29,"tag":183,"props":22190,"children":22191},{"class":185,"line":439},[22192,22196,22201,22205,22209,22213,22217],{"type":29,"tag":183,"props":22193,"children":22194},{"style":200},[22195],{"type":38,"value":20579},{"type":29,"tag":183,"props":22197,"children":22198},{"style":206},[22199],{"type":38,"value":22200}," calculerRemisePartenaire",{"type":29,"tag":183,"props":22202,"children":22203},{"style":212},[22204],{"type":38,"value":770},{"type":29,"tag":183,"props":22206,"children":22207},{"style":200},[22208],{"type":38,"value":20579},{"type":29,"tag":183,"props":22210,"children":22211},{"style":308},[22212],{"type":38,"value":22056},{"type":29,"tag":183,"props":22214,"children":22215},{"style":212},[22216],{"type":38,"value":272},{"type":29,"tag":183,"props":22218,"children":22219},{"style":212},[22220],{"type":38,"value":285},{"type":29,"tag":183,"props":22222,"children":22223},{"class":185,"line":448},[22224,22228,22232,22236,22240],{"type":29,"tag":183,"props":22225,"children":22226},{"style":200},[22227],{"type":38,"value":18538},{"type":29,"tag":183,"props":22229,"children":22230},{"style":308},[22231],{"type":38,"value":22076},{"type":29,"tag":183,"props":22233,"children":22234},{"style":228},[22235],{"type":38,"value":8340},{"type":29,"tag":183,"props":22237,"children":22238},{"style":319},[22239],{"type":38,"value":981},{"type":29,"tag":183,"props":22241,"children":22242},{"style":212},[22243],{"type":38,"value":327},{"type":29,"tag":183,"props":22245,"children":22246},{"class":185,"line":457},[22247,22251,22255,22259,22263,22267,22271],{"type":29,"tag":183,"props":22248,"children":22249},{"style":200},[22250],{"type":38,"value":1528},{"type":29,"tag":183,"props":22252,"children":22253},{"style":212},[22254],{"type":38,"value":1533},{"type":29,"tag":183,"props":22256,"children":22257},{"style":308},[22258],{"type":38,"value":22104},{"type":29,"tag":183,"props":22260,"children":22261},{"style":228},[22262],{"type":38,"value":1452},{"type":29,"tag":183,"props":22264,"children":22265},{"style":319},[22266],{"type":38,"value":22113},{"type":29,"tag":183,"props":22268,"children":22269},{"style":212},[22270],{"type":38,"value":272},{"type":29,"tag":183,"props":22272,"children":22273},{"style":212},[22274],{"type":38,"value":285},{"type":29,"tag":183,"props":22276,"children":22277},{"class":185,"line":474},[22278,22282,22286,22290,22294,22298],{"type":29,"tag":183,"props":22279,"children":22280},{"style":308},[22281],{"type":38,"value":22129},{"type":29,"tag":183,"props":22283,"children":22284},{"style":228},[22285],{"type":38,"value":8340},{"type":29,"tag":183,"props":22287,"children":22288},{"style":308},[22289],{"type":38,"value":22138},{"type":29,"tag":183,"props":22291,"children":22292},{"style":228},[22293],{"type":38,"value":405},{"type":29,"tag":183,"props":22295,"children":22296},{"style":319},[22297],{"type":38,"value":22147},{"type":29,"tag":183,"props":22299,"children":22300},{"style":212},[22301],{"type":38,"value":327},{"type":29,"tag":183,"props":22303,"children":22304},{"class":185,"line":495},[22305],{"type":29,"tag":183,"props":22306,"children":22307},{"style":212},[22308],{"type":38,"value":1589},{"type":29,"tag":183,"props":22310,"children":22311},{"class":185,"line":516},[22312,22316,22320],{"type":29,"tag":183,"props":22313,"children":22314},{"style":200},[22315],{"type":38,"value":919},{"type":29,"tag":183,"props":22317,"children":22318},{"style":308},[22319],{"type":38,"value":22170},{"type":29,"tag":183,"props":22321,"children":22322},{"style":212},[22323],{"type":38,"value":327},{"type":29,"tag":183,"props":22325,"children":22326},{"class":185,"line":536},[22327],{"type":29,"tag":183,"props":22328,"children":22329},{"style":212},[22330],{"type":38,"value":436},{"type":29,"tag":183,"props":22332,"children":22333},{"class":185,"line":570},[22334],{"type":29,"tag":183,"props":22335,"children":22336},{"emptyLinePlaceholder":13},[22337],{"type":38,"value":445},{"type":29,"tag":183,"props":22339,"children":22340},{"class":185,"line":613},[22341],{"type":29,"tag":183,"props":22342,"children":22343},{"style":190},[22344],{"type":38,"value":22345},"\u002F\u002F Meilleur exemple - Refactorisation pour éviter la duplication\n",{"type":29,"tag":183,"props":22347,"children":22348},{"class":185,"line":662},[22349,22353,22358,22362,22366,22370,22374],{"type":29,"tag":183,"props":22350,"children":22351},{"style":200},[22352],{"type":38,"value":20579},{"type":29,"tag":183,"props":22354,"children":22355},{"style":206},[22356],{"type":38,"value":22357}," calculerRemise",{"type":29,"tag":183,"props":22359,"children":22360},{"style":212},[22361],{"type":38,"value":770},{"type":29,"tag":183,"props":22363,"children":22364},{"style":200},[22365],{"type":38,"value":20579},{"type":29,"tag":183,"props":22367,"children":22368},{"style":308},[22369],{"type":38,"value":22056},{"type":29,"tag":183,"props":22371,"children":22372},{"style":212},[22373],{"type":38,"value":272},{"type":29,"tag":183,"props":22375,"children":22376},{"style":212},[22377],{"type":38,"value":285},{"type":29,"tag":183,"props":22379,"children":22380},{"class":185,"line":3095},[22381,22385,22389,22393,22397],{"type":29,"tag":183,"props":22382,"children":22383},{"style":200},[22384],{"type":38,"value":18538},{"type":29,"tag":183,"props":22386,"children":22387},{"style":308},[22388],{"type":38,"value":22076},{"type":29,"tag":183,"props":22390,"children":22391},{"style":228},[22392],{"type":38,"value":8340},{"type":29,"tag":183,"props":22394,"children":22395},{"style":319},[22396],{"type":38,"value":981},{"type":29,"tag":183,"props":22398,"children":22399},{"style":212},[22400],{"type":38,"value":327},{"type":29,"tag":183,"props":22402,"children":22403},{"class":185,"line":3154},[22404,22408,22412,22416,22420,22424,22428],{"type":29,"tag":183,"props":22405,"children":22406},{"style":200},[22407],{"type":38,"value":1528},{"type":29,"tag":183,"props":22409,"children":22410},{"style":212},[22411],{"type":38,"value":1533},{"type":29,"tag":183,"props":22413,"children":22414},{"style":308},[22415],{"type":38,"value":22104},{"type":29,"tag":183,"props":22417,"children":22418},{"style":228},[22419],{"type":38,"value":1452},{"type":29,"tag":183,"props":22421,"children":22422},{"style":319},[22423],{"type":38,"value":22113},{"type":29,"tag":183,"props":22425,"children":22426},{"style":212},[22427],{"type":38,"value":272},{"type":29,"tag":183,"props":22429,"children":22430},{"style":212},[22431],{"type":38,"value":285},{"type":29,"tag":183,"props":22433,"children":22434},{"class":185,"line":3207},[22435,22439,22443,22447,22451,22455],{"type":29,"tag":183,"props":22436,"children":22437},{"style":308},[22438],{"type":38,"value":22129},{"type":29,"tag":183,"props":22440,"children":22441},{"style":228},[22442],{"type":38,"value":8340},{"type":29,"tag":183,"props":22444,"children":22445},{"style":308},[22446],{"type":38,"value":22138},{"type":29,"tag":183,"props":22448,"children":22449},{"style":228},[22450],{"type":38,"value":405},{"type":29,"tag":183,"props":22452,"children":22453},{"style":319},[22454],{"type":38,"value":22147},{"type":29,"tag":183,"props":22456,"children":22457},{"style":212},[22458],{"type":38,"value":327},{"type":29,"tag":183,"props":22460,"children":22461},{"class":185,"line":3224},[22462],{"type":29,"tag":183,"props":22463,"children":22464},{"style":212},[22465],{"type":38,"value":1589},{"type":29,"tag":183,"props":22467,"children":22468},{"class":185,"line":3266},[22469,22473,22477],{"type":29,"tag":183,"props":22470,"children":22471},{"style":200},[22472],{"type":38,"value":919},{"type":29,"tag":183,"props":22474,"children":22475},{"style":308},[22476],{"type":38,"value":22170},{"type":29,"tag":183,"props":22478,"children":22479},{"style":212},[22480],{"type":38,"value":327},{"type":29,"tag":183,"props":22482,"children":22483},{"class":185,"line":3275},[22484],{"type":29,"tag":183,"props":22485,"children":22486},{"style":212},[22487],{"type":38,"value":436},{"type":29,"tag":30,"props":22489,"children":22490},{},[22491],{"type":38,"value":22492},"En unifiant la logique de calcul de la remise dans une seule fonction, vous éliminez la duplication et simplifiez la maintenance. Si la logique doit changer (par exemple, le seuil de 1000), vous n'aurez à modifier qu'une seule fonction.",{"type":29,"tag":50,"props":22494,"children":22496},{"id":22495},"deux-occurrences-de-la-même-logique-à-surveiller-trois-occurrences-refactoring-obligatoire-la-troisième-est-presque-toujours-celle-quon-oublie-de-mettre-à-jour",[22497],{"type":38,"value":22498},"Deux occurrences de la même logique = à surveiller. Trois occurrences = refactoring obligatoire : la troisième est presque toujours celle qu'on oublie de mettre à jour.",{"type":29,"tag":14327,"props":22500,"children":22502},{"id":22501},"_3-faciliter-les-tests-unitaires",[22503],{"type":29,"tag":34,"props":22504,"children":22505},{},[22506],{"type":38,"value":22507},"3. Faciliter les tests unitaires",{"type":29,"tag":30,"props":22509,"children":22510},{},[22511,22513,22521],{"type":38,"value":22512},"Un code propre est un code testable. Concrètement : des fonctions courtes, des classes cohérentes, aucune dépendance cachée. Les ",{"type":29,"tag":34,"props":22514,"children":22515},{},[22516],{"type":29,"tag":62,"props":22517,"children":22518},{"href":13683},[22519],{"type":38,"value":22520},"tests unitaires",{"type":38,"value":22522}," restent alors simples et rapides à écrire.",{"type":29,"tag":30,"props":22524,"children":22525},{},[22526],{"type":29,"tag":34,"props":22527,"children":22528},{},[22529],{"type":38,"value":15609},{"type":29,"tag":173,"props":22531,"children":22533},{"className":8272,"code":22532,"language":8271,"meta":8,"style":8},"\u002F\u002F Mauvais exemple - Difficulté à tester en raison des dépendances internes\npublic class CommandeService {\n    public void creerCommande() {\n        Database db = new Database();\n        db.save();\n    }\n}\n\n\u002F\u002F Meilleur exemple - Injection de dépendance pour faciliter les tests\npublic class CommandeService {\n    private Database database;\n\n    public CommandeService(Database database) {\n        this.database = database;\n    }\n\n    public void creerCommande() {\n        database.save();\n    }\n}\n",[22534],{"type":29,"tag":156,"props":22535,"children":22536},{"__ignoreMap":8},[22537,22545,22564,22587,22616,22636,22643,22650,22657,22665,22684,22704,22711,22743,22771,22778,22785,22808,22828,22835],{"type":29,"tag":183,"props":22538,"children":22539},{"class":185,"line":186},[22540],{"type":29,"tag":183,"props":22541,"children":22542},{"style":190},[22543],{"type":38,"value":22544},"\u002F\u002F Mauvais exemple - Difficulté à tester en raison des dépendances internes\n",{"type":29,"tag":183,"props":22546,"children":22547},{"class":185,"line":196},[22548,22552,22556,22560],{"type":29,"tag":183,"props":22549,"children":22550},{"style":200},[22551],{"type":38,"value":8292},{"type":29,"tag":183,"props":22553,"children":22554},{"style":200},[22555],{"type":38,"value":854},{"type":29,"tag":183,"props":22557,"children":22558},{"style":750},[22559],{"type":38,"value":21795},{"type":29,"tag":183,"props":22561,"children":22562},{"style":212},[22563],{"type":38,"value":285},{"type":29,"tag":183,"props":22565,"children":22566},{"class":185,"line":218},[22567,22571,22575,22579,22583],{"type":29,"tag":183,"props":22568,"children":22569},{"style":200},[22570],{"type":38,"value":8441},{"type":29,"tag":183,"props":22572,"children":22573},{"style":200},[22574],{"type":38,"value":9424},{"type":29,"tag":183,"props":22576,"children":22577},{"style":206},[22578],{"type":38,"value":21642},{"type":29,"tag":183,"props":22580,"children":22581},{"style":212},[22582],{"type":38,"value":1108},{"type":29,"tag":183,"props":22584,"children":22585},{"style":212},[22586],{"type":38,"value":285},{"type":29,"tag":183,"props":22588,"children":22589},{"class":185,"line":245},[22590,22595,22599,22603,22607,22612],{"type":29,"tag":183,"props":22591,"children":22592},{"style":8327},[22593],{"type":38,"value":22594},"        Database",{"type":29,"tag":183,"props":22596,"children":22597},{"style":308},[22598],{"type":38,"value":8335},{"type":29,"tag":183,"props":22600,"children":22601},{"style":228},[22602],{"type":38,"value":8340},{"type":29,"tag":183,"props":22604,"children":22605},{"style":200},[22606],{"type":38,"value":1099},{"type":29,"tag":183,"props":22608,"children":22609},{"style":206},[22610],{"type":38,"value":22611}," Database",{"type":29,"tag":183,"props":22613,"children":22614},{"style":212},[22615],{"type":38,"value":9916},{"type":29,"tag":183,"props":22617,"children":22618},{"class":185,"line":266},[22619,22624,22628,22632],{"type":29,"tag":183,"props":22620,"children":22621},{"style":308},[22622],{"type":38,"value":22623},"        db",{"type":29,"tag":183,"props":22625,"children":22626},{"style":212},[22627],{"type":38,"value":79},{"type":29,"tag":183,"props":22629,"children":22630},{"style":206},[22631],{"type":38,"value":8503},{"type":29,"tag":183,"props":22633,"children":22634},{"style":212},[22635],{"type":38,"value":9916},{"type":29,"tag":183,"props":22637,"children":22638},{"class":185,"line":288},[22639],{"type":29,"tag":183,"props":22640,"children":22641},{"style":212},[22642],{"type":38,"value":1589},{"type":29,"tag":183,"props":22644,"children":22645},{"class":185,"line":330},[22646],{"type":29,"tag":183,"props":22647,"children":22648},{"style":212},[22649],{"type":38,"value":436},{"type":29,"tag":183,"props":22651,"children":22652},{"class":185,"line":374},[22653],{"type":29,"tag":183,"props":22654,"children":22655},{"emptyLinePlaceholder":13},[22656],{"type":38,"value":445},{"type":29,"tag":183,"props":22658,"children":22659},{"class":185,"line":430},[22660],{"type":29,"tag":183,"props":22661,"children":22662},{"style":190},[22663],{"type":38,"value":22664},"\u002F\u002F Meilleur exemple - Injection de dépendance pour faciliter les tests\n",{"type":29,"tag":183,"props":22666,"children":22667},{"class":185,"line":439},[22668,22672,22676,22680],{"type":29,"tag":183,"props":22669,"children":22670},{"style":200},[22671],{"type":38,"value":8292},{"type":29,"tag":183,"props":22673,"children":22674},{"style":200},[22675],{"type":38,"value":854},{"type":29,"tag":183,"props":22677,"children":22678},{"style":750},[22679],{"type":38,"value":21795},{"type":29,"tag":183,"props":22681,"children":22682},{"style":212},[22683],{"type":38,"value":285},{"type":29,"tag":183,"props":22685,"children":22686},{"class":185,"line":448},[22687,22691,22695,22700],{"type":29,"tag":183,"props":22688,"children":22689},{"style":200},[22690],{"type":38,"value":1291},{"type":29,"tag":183,"props":22692,"children":22693},{"style":8327},[22694],{"type":38,"value":22611},{"type":29,"tag":183,"props":22696,"children":22697},{"style":308},[22698],{"type":38,"value":22699}," database",{"type":29,"tag":183,"props":22701,"children":22702},{"style":212},[22703],{"type":38,"value":327},{"type":29,"tag":183,"props":22705,"children":22706},{"class":185,"line":457},[22707],{"type":29,"tag":183,"props":22708,"children":22709},{"emptyLinePlaceholder":13},[22710],{"type":38,"value":445},{"type":29,"tag":183,"props":22712,"children":22713},{"class":185,"line":474},[22714,22718,22722,22726,22731,22735,22739],{"type":29,"tag":183,"props":22715,"children":22716},{"style":200},[22717],{"type":38,"value":8441},{"type":29,"tag":183,"props":22719,"children":22720},{"style":206},[22721],{"type":38,"value":21795},{"type":29,"tag":183,"props":22723,"children":22724},{"style":212},[22725],{"type":38,"value":770},{"type":29,"tag":183,"props":22727,"children":22728},{"style":8327},[22729],{"type":38,"value":22730},"Database",{"type":29,"tag":183,"props":22732,"children":22733},{"style":222},[22734],{"type":38,"value":22699},{"type":29,"tag":183,"props":22736,"children":22737},{"style":212},[22738],{"type":38,"value":272},{"type":29,"tag":183,"props":22740,"children":22741},{"style":212},[22742],{"type":38,"value":285},{"type":29,"tag":183,"props":22744,"children":22745},{"class":185,"line":495},[22746,22750,22754,22759,22763,22767],{"type":29,"tag":183,"props":22747,"children":22748},{"style":1481},[22749],{"type":38,"value":9016},{"type":29,"tag":183,"props":22751,"children":22752},{"style":212},[22753],{"type":38,"value":79},{"type":29,"tag":183,"props":22755,"children":22756},{"style":308},[22757],{"type":38,"value":22758},"database ",{"type":29,"tag":183,"props":22760,"children":22761},{"style":228},[22762],{"type":38,"value":8340},{"type":29,"tag":183,"props":22764,"children":22765},{"style":308},[22766],{"type":38,"value":22699},{"type":29,"tag":183,"props":22768,"children":22769},{"style":212},[22770],{"type":38,"value":327},{"type":29,"tag":183,"props":22772,"children":22773},{"class":185,"line":516},[22774],{"type":29,"tag":183,"props":22775,"children":22776},{"style":212},[22777],{"type":38,"value":1589},{"type":29,"tag":183,"props":22779,"children":22780},{"class":185,"line":536},[22781],{"type":29,"tag":183,"props":22782,"children":22783},{"emptyLinePlaceholder":13},[22784],{"type":38,"value":445},{"type":29,"tag":183,"props":22786,"children":22787},{"class":185,"line":570},[22788,22792,22796,22800,22804],{"type":29,"tag":183,"props":22789,"children":22790},{"style":200},[22791],{"type":38,"value":8441},{"type":29,"tag":183,"props":22793,"children":22794},{"style":200},[22795],{"type":38,"value":9424},{"type":29,"tag":183,"props":22797,"children":22798},{"style":206},[22799],{"type":38,"value":21642},{"type":29,"tag":183,"props":22801,"children":22802},{"style":212},[22803],{"type":38,"value":1108},{"type":29,"tag":183,"props":22805,"children":22806},{"style":212},[22807],{"type":38,"value":285},{"type":29,"tag":183,"props":22809,"children":22810},{"class":185,"line":613},[22811,22816,22820,22824],{"type":29,"tag":183,"props":22812,"children":22813},{"style":308},[22814],{"type":38,"value":22815},"        database",{"type":29,"tag":183,"props":22817,"children":22818},{"style":212},[22819],{"type":38,"value":79},{"type":29,"tag":183,"props":22821,"children":22822},{"style":206},[22823],{"type":38,"value":8503},{"type":29,"tag":183,"props":22825,"children":22826},{"style":212},[22827],{"type":38,"value":9916},{"type":29,"tag":183,"props":22829,"children":22830},{"class":185,"line":662},[22831],{"type":29,"tag":183,"props":22832,"children":22833},{"style":212},[22834],{"type":38,"value":1589},{"type":29,"tag":183,"props":22836,"children":22837},{"class":185,"line":3095},[22838],{"type":29,"tag":183,"props":22839,"children":22840},{"style":212},[22841],{"type":38,"value":436},{"type":29,"tag":30,"props":22843,"children":22844},{},[22845,22847,22852],{"type":38,"value":22846},"Dans le second exemple, l'injection de dépendance rend la classe plus testable. Au lieu de créer une instance de ",{"type":29,"tag":156,"props":22848,"children":22850},{"className":22849},[],[22851],{"type":38,"value":22730},{"type":38,"value":22853}," en interne, vous pouvez passer une base de données fictive (mock) lors de vos tests unitaires.",{"type":29,"tag":50,"props":22855,"children":22857},{"id":22856},"linjection-de-dépendances-nest-pas-quun-pattern-de-framework-cest-ce-qui-rend-une-classe-testable-en-isolation-sans-avoir-à-monter-une-base-ou-un-service-externe-pour-la-moindre-vérification",[22858],{"type":38,"value":22859},"L'injection de dépendances n'est pas qu'un pattern de framework : c'est ce qui rend une classe testable en isolation, sans avoir à monter une base ou un service externe pour la moindre vérification.",{"type":29,"tag":50,"props":22861,"children":22863},{"id":22862},"conseils-et-astuces-pour-appliquer-le-clean-code-au-quotidien",[22864],{"type":29,"tag":34,"props":22865,"children":22866},{},[22867],{"type":38,"value":22868},"Conseils et astuces pour appliquer le Clean Code au quotidien",{"type":29,"tag":30,"props":22870,"children":22871},{},[22872,22874,22878],{"type":38,"value":22873},"Maintenant que vous connaissez les bases du ",{"type":29,"tag":34,"props":22875,"children":22876},{},[22877],{"type":38,"value":2416},{"type":38,"value":22879},", voyons comment intégrer ces bonnes pratiques dans votre travail quotidien, même lorsque vous êtes sous pression ou que vous devez travailler sur du code existant. Voici quelques astuces simples mais efficaces pour garder votre code propre, maintenable et lisible à long terme.",{"type":29,"tag":14327,"props":22881,"children":22883},{"id":22882},"_1-réécrire-du-code-existant-le-refactoring-progressif",[22884],{"type":29,"tag":34,"props":22885,"children":22886},{},[22887],{"type":38,"value":22888},"1. Réécrire du code existant : le refactoring progressif",{"type":29,"tag":30,"props":22890,"children":22891},{},[22892,22894,22899,22901,22906],{"type":38,"value":22893},"Quand vous héritez d'un ",{"type":29,"tag":62,"props":22895,"children":22896},{"href":13764},[22897],{"type":38,"value":22898},"code legacy",{"type":38,"value":22900}," mal structuré ou difficile à comprendre, il peut être tentant de tout réécrire. Cependant, ce n'est pas toujours réaliste ou nécessaire. La meilleure approche est souvent le ",{"type":29,"tag":34,"props":22902,"children":22903},{},[22904],{"type":38,"value":22905},"refactoring progressif",{"type":38,"value":22907}," : au lieu de tout changer d'un coup, vous améliorez petit à petit le code à chaque modification ou ajout de fonctionnalité.",{"type":29,"tag":30,"props":22909,"children":22910},{},[22911],{"type":29,"tag":34,"props":22912,"children":22913},{},[22914],{"type":38,"value":15609},{"type":29,"tag":173,"props":22916,"children":22918},{"className":8272,"code":22917,"language":8271,"meta":8,"style":8},"\u002F\u002F Code hérité difficile à comprendre\npublic void traitementCommande(Commande commande) {\n    if (commande.isUrgent() && !commande.isValide()) {\n        System.out.println(\"Erreur\");\n    }\n    \u002F\u002F Autres opérations\n}\n\n\u002F\u002F Refactorisation progressive\npublic void verifierCommandeValide(Commande commande) {\n    if (!commande.isValide()) {\n        throw new IllegalArgumentException(\"Commande invalide\");\n    }\n}\n",[22919],{"type":29,"tag":156,"props":22920,"children":22921},{"__ignoreMap":8},[22922,22930,22968,23026,23062,23069,23077,23084,23091,23099,23135,23170,23199,23206],{"type":29,"tag":183,"props":22923,"children":22924},{"class":185,"line":186},[22925],{"type":29,"tag":183,"props":22926,"children":22927},{"style":190},[22928],{"type":38,"value":22929},"\u002F\u002F Code hérité difficile à comprendre\n",{"type":29,"tag":183,"props":22931,"children":22932},{"class":185,"line":196},[22933,22937,22941,22946,22950,22955,22960,22964],{"type":29,"tag":183,"props":22934,"children":22935},{"style":200},[22936],{"type":38,"value":8292},{"type":29,"tag":183,"props":22938,"children":22939},{"style":200},[22940],{"type":38,"value":9424},{"type":29,"tag":183,"props":22942,"children":22943},{"style":206},[22944],{"type":38,"value":22945}," traitementCommande",{"type":29,"tag":183,"props":22947,"children":22948},{"style":212},[22949],{"type":38,"value":770},{"type":29,"tag":183,"props":22951,"children":22952},{"style":8327},[22953],{"type":38,"value":22954},"Commande",{"type":29,"tag":183,"props":22956,"children":22957},{"style":308},[22958],{"type":38,"value":22959}," commande",{"type":29,"tag":183,"props":22961,"children":22962},{"style":212},[22963],{"type":38,"value":272},{"type":29,"tag":183,"props":22965,"children":22966},{"style":212},[22967],{"type":38,"value":285},{"type":29,"tag":183,"props":22969,"children":22970},{"class":185,"line":218},[22971,22975,22979,22984,22988,22993,22997,23001,23005,23009,23013,23018,23022],{"type":29,"tag":183,"props":22972,"children":22973},{"style":200},[22974],{"type":38,"value":1528},{"type":29,"tag":183,"props":22976,"children":22977},{"style":212},[22978],{"type":38,"value":1533},{"type":29,"tag":183,"props":22980,"children":22981},{"style":308},[22982],{"type":38,"value":22983},"commande",{"type":29,"tag":183,"props":22985,"children":22986},{"style":212},[22987],{"type":38,"value":79},{"type":29,"tag":183,"props":22989,"children":22990},{"style":206},[22991],{"type":38,"value":22992},"isUrgent",{"type":29,"tag":183,"props":22994,"children":22995},{"style":212},[22996],{"type":38,"value":1108},{"type":29,"tag":183,"props":22998,"children":22999},{"style":228},[23000],{"type":38,"value":5031},{"type":29,"tag":183,"props":23002,"children":23003},{"style":228},[23004],{"type":38,"value":16476},{"type":29,"tag":183,"props":23006,"children":23007},{"style":308},[23008],{"type":38,"value":22983},{"type":29,"tag":183,"props":23010,"children":23011},{"style":212},[23012],{"type":38,"value":79},{"type":29,"tag":183,"props":23014,"children":23015},{"style":206},[23016],{"type":38,"value":23017},"isValide",{"type":29,"tag":183,"props":23019,"children":23020},{"style":212},[23021],{"type":38,"value":11009},{"type":29,"tag":183,"props":23023,"children":23024},{"style":212},[23025],{"type":38,"value":285},{"type":29,"tag":183,"props":23027,"children":23028},{"class":185,"line":245},[23029,23033,23037,23041,23045,23049,23053,23058],{"type":29,"tag":183,"props":23030,"children":23031},{"style":308},[23032],{"type":38,"value":17504},{"type":29,"tag":183,"props":23034,"children":23035},{"style":212},[23036],{"type":38,"value":79},{"type":29,"tag":183,"props":23038,"children":23039},{"style":308},[23040],{"type":38,"value":17513},{"type":29,"tag":183,"props":23042,"children":23043},{"style":212},[23044],{"type":38,"value":79},{"type":29,"tag":183,"props":23046,"children":23047},{"style":206},[23048],{"type":38,"value":17522},{"type":29,"tag":183,"props":23050,"children":23051},{"style":212},[23052],{"type":38,"value":770},{"type":29,"tag":183,"props":23054,"children":23055},{"style":1683},[23056],{"type":38,"value":23057},"\"Erreur\"",{"type":29,"tag":183,"props":23059,"children":23060},{"style":212},[23061],{"type":38,"value":7487},{"type":29,"tag":183,"props":23063,"children":23064},{"class":185,"line":266},[23065],{"type":29,"tag":183,"props":23066,"children":23067},{"style":212},[23068],{"type":38,"value":1589},{"type":29,"tag":183,"props":23070,"children":23071},{"class":185,"line":288},[23072],{"type":29,"tag":183,"props":23073,"children":23074},{"style":190},[23075],{"type":38,"value":23076},"    \u002F\u002F Autres opérations\n",{"type":29,"tag":183,"props":23078,"children":23079},{"class":185,"line":330},[23080],{"type":29,"tag":183,"props":23081,"children":23082},{"style":212},[23083],{"type":38,"value":436},{"type":29,"tag":183,"props":23085,"children":23086},{"class":185,"line":374},[23087],{"type":29,"tag":183,"props":23088,"children":23089},{"emptyLinePlaceholder":13},[23090],{"type":38,"value":445},{"type":29,"tag":183,"props":23092,"children":23093},{"class":185,"line":430},[23094],{"type":29,"tag":183,"props":23095,"children":23096},{"style":190},[23097],{"type":38,"value":23098},"\u002F\u002F Refactorisation progressive\n",{"type":29,"tag":183,"props":23100,"children":23101},{"class":185,"line":439},[23102,23106,23110,23115,23119,23123,23127,23131],{"type":29,"tag":183,"props":23103,"children":23104},{"style":200},[23105],{"type":38,"value":8292},{"type":29,"tag":183,"props":23107,"children":23108},{"style":200},[23109],{"type":38,"value":9424},{"type":29,"tag":183,"props":23111,"children":23112},{"style":206},[23113],{"type":38,"value":23114}," verifierCommandeValide",{"type":29,"tag":183,"props":23116,"children":23117},{"style":212},[23118],{"type":38,"value":770},{"type":29,"tag":183,"props":23120,"children":23121},{"style":8327},[23122],{"type":38,"value":22954},{"type":29,"tag":183,"props":23124,"children":23125},{"style":308},[23126],{"type":38,"value":22959},{"type":29,"tag":183,"props":23128,"children":23129},{"style":212},[23130],{"type":38,"value":272},{"type":29,"tag":183,"props":23132,"children":23133},{"style":212},[23134],{"type":38,"value":285},{"type":29,"tag":183,"props":23136,"children":23137},{"class":185,"line":448},[23138,23142,23146,23150,23154,23158,23162,23166],{"type":29,"tag":183,"props":23139,"children":23140},{"style":200},[23141],{"type":38,"value":1528},{"type":29,"tag":183,"props":23143,"children":23144},{"style":212},[23145],{"type":38,"value":1533},{"type":29,"tag":183,"props":23147,"children":23148},{"style":228},[23149],{"type":38,"value":1538},{"type":29,"tag":183,"props":23151,"children":23152},{"style":308},[23153],{"type":38,"value":22983},{"type":29,"tag":183,"props":23155,"children":23156},{"style":212},[23157],{"type":38,"value":79},{"type":29,"tag":183,"props":23159,"children":23160},{"style":206},[23161],{"type":38,"value":23017},{"type":29,"tag":183,"props":23163,"children":23164},{"style":212},[23165],{"type":38,"value":11009},{"type":29,"tag":183,"props":23167,"children":23168},{"style":212},[23169],{"type":38,"value":285},{"type":29,"tag":183,"props":23171,"children":23172},{"class":185,"line":457},[23173,23178,23182,23187,23191,23195],{"type":29,"tag":183,"props":23174,"children":23175},{"style":200},[23176],{"type":38,"value":23177},"        throw",{"type":29,"tag":183,"props":23179,"children":23180},{"style":200},[23181],{"type":38,"value":1099},{"type":29,"tag":183,"props":23183,"children":23184},{"style":206},[23185],{"type":38,"value":23186}," IllegalArgumentException",{"type":29,"tag":183,"props":23188,"children":23189},{"style":212},[23190],{"type":38,"value":770},{"type":29,"tag":183,"props":23192,"children":23193},{"style":1683},[23194],{"type":38,"value":19624},{"type":29,"tag":183,"props":23196,"children":23197},{"style":212},[23198],{"type":38,"value":7487},{"type":29,"tag":183,"props":23200,"children":23201},{"class":185,"line":474},[23202],{"type":29,"tag":183,"props":23203,"children":23204},{"style":212},[23205],{"type":38,"value":1589},{"type":29,"tag":183,"props":23207,"children":23208},{"class":185,"line":495},[23209],{"type":29,"tag":183,"props":23210,"children":23211},{"style":212},[23212],{"type":38,"value":436},{"type":29,"tag":30,"props":23214,"children":23215},{},[23216,23218,23224],{"type":38,"value":23217},"Dans cet exemple, au lieu de réécrire toute la méthode ",{"type":29,"tag":156,"props":23219,"children":23221},{"className":23220},[],[23222],{"type":38,"value":23223},"traitementCommande",{"type":38,"value":23225},", j’ai simplement extrait une partie du code dans une fonction dédiée, ce qui clarifie une portion du processus sans tout chambouler. Ce type de petit refactoring est une manière efficace de rendre le code plus propre à mesure que vous y travaillez.",{"type":29,"tag":50,"props":23227,"children":23229},{"id":23228},"pas-de-grand-refactoring-planifié-sur-trois-sprints-cest-le-scénario-qui-échoue-le-plus-souvent-le-scout-rule-laisser-le-code-un-peu-plus-propre-quon-la-trouvé-marche-lui-sur-la-durée",[23230],{"type":38,"value":23231},"Pas de \"grand refactoring\" planifié sur trois sprints : c'est le scénario qui échoue le plus souvent. Le scout rule (laisser le code un peu plus propre qu'on l'a trouvé) marche, lui, sur la durée.",{"type":29,"tag":14327,"props":23233,"children":23235},{"id":23234},"_2-prioriser-le-clean-code-sous-pression",[23236],{"type":29,"tag":34,"props":23237,"children":23238},{},[23239],{"type":38,"value":23240},"2. Prioriser le Clean Code sous pression",{"type":29,"tag":30,"props":23242,"children":23243},{},[23244],{"type":38,"value":23245},"La tentation est forte de sacrifier la qualité quand les délais se resserrent. C'est un mauvais calcul : un code lisible reste plus rapide à modifier, à déboguer et à étendre, y compris dans le sprint en cours, dès qu'il faut revenir sur une fonctionnalité écrite la veille.",{"type":29,"tag":30,"props":23247,"children":23248},{},[23249,23251,23256],{"type":38,"value":23250},"Voici quelques astuces pour ",{"type":29,"tag":34,"props":23252,"children":23253},{},[23254],{"type":38,"value":23255},"garder votre code propre même sous pression",{"type":38,"value":976},{"type":29,"tag":8603,"props":23258,"children":23259},{},[23260,23270,23280],{"type":29,"tag":8607,"props":23261,"children":23262},{},[23263,23268],{"type":29,"tag":34,"props":23264,"children":23265},{},[23266],{"type":38,"value":23267},"Utilisez des fonctions courtes et bien nommées.",{"type":38,"value":23269}," Même en mode rush, séparer les responsabilités limite les erreurs et accélère le débogage.",{"type":29,"tag":8607,"props":23271,"children":23272},{},[23273,23278],{"type":29,"tag":34,"props":23274,"children":23275},{},[23276],{"type":38,"value":23277},"Nommez les variables clairement.",{"type":38,"value":23279}," Prendre quelques secondes pour choisir un nom explicite peut vous faire gagner des heures plus tard en maintenance.",{"type":29,"tag":8607,"props":23281,"children":23282},{},[23283,23288],{"type":29,"tag":34,"props":23284,"children":23285},{},[23286],{"type":38,"value":23287},"Évitez les solutions \"hacky\".",{"type":38,"value":23289}," Même si une solution rapide semble tentante, elle peut introduire des bugs difficiles à repérer plus tard.",{"type":29,"tag":50,"props":23291,"children":23293},{"id":23292},"test-du-vous-dans-trois-mois-si-la-solution-hacky-ne-sera-plus-comprise-par-vous-même-dans-douze-semaines-cest-quelle-ne-mérite-pas-dêtre-commitée",[23294],{"type":38,"value":23295},"Test du \"vous dans trois mois\" : si la solution hacky ne sera plus comprise par vous-même dans douze semaines, c'est qu'elle ne mérite pas d'être commitée.",{"type":29,"tag":14327,"props":23297,"children":23299},{"id":23298},"_3-collaborer-avec-dautres-développeurs-pour-améliorer-le-code",[23300],{"type":29,"tag":34,"props":23301,"children":23302},{},[23303],{"type":38,"value":23304},"3. Collaborer avec d’autres développeurs pour améliorer le code",{"type":29,"tag":30,"props":23306,"children":23307},{},[23308,23309,23313,23315,23320],{"type":38,"value":14726},{"type":29,"tag":34,"props":23310,"children":23311},{},[23312],{"type":38,"value":2416},{"type":38,"value":23314}," n’est pas seulement une affaire personnelle. Il est aussi essentiel d’inciter vos collègues à adopter ces bonnes pratiques. Une ",{"type":29,"tag":34,"props":23316,"children":23317},{},[23318],{"type":38,"value":23319},"revue de code",{"type":38,"value":23321}," régulière est un excellent moyen d’encourager une culture du Clean Code au sein de votre équipe. Chacun peut ainsi apprendre des autres et partager des conseils sur la façon d’améliorer la qualité du code.",{"type":29,"tag":30,"props":23323,"children":23324},{},[23325],{"type":29,"tag":34,"props":23326,"children":23327},{},[23328],{"type":38,"value":23329},"Quelques conseils pour une bonne collaboration :",{"type":29,"tag":8603,"props":23331,"children":23332},{},[23333,23343,23353],{"type":29,"tag":8607,"props":23334,"children":23335},{},[23336,23341],{"type":29,"tag":34,"props":23337,"children":23338},{},[23339],{"type":38,"value":23340},"Soyez constructif lors des revues de code.",{"type":38,"value":23342}," Au lieu de pointer du doigt les erreurs, proposez des solutions et expliquez pourquoi une modification rendrait le code plus clair.",{"type":29,"tag":8607,"props":23344,"children":23345},{},[23346,23351],{"type":29,"tag":34,"props":23347,"children":23348},{},[23349],{"type":38,"value":23350},"Favorisez la documentation du code.",{"type":38,"value":23352}," Encouragez vos collègues à écrire des noms explicites, à bien structurer les fonctions, et à éviter les duplications.",{"type":29,"tag":8607,"props":23354,"children":23355},{},[23356,23361],{"type":29,"tag":34,"props":23357,"children":23358},{},[23359],{"type":38,"value":23360},"Partagez les succès.",{"type":38,"value":23362}," Quand un bon refactoring ou une amélioration de la lisibilité est fait, mettez-le en avant lors de vos réunions d’équipe.",{"type":29,"tag":30,"props":23364,"children":23365},{},[23366],{"type":38,"value":23367},"Un guide interne avec des exemples concrets tirés de votre propre code vaut mille fois mieux qu'une référence générique copiée d'un blog : il parle le langage du domaine et anticipe les pièges réels du projet.",{"type":29,"tag":1196,"props":23369,"children":23371},{"cta":2185,"href":2186,"title":23370,"type":2188},"Le Clean Code, c'est une pratique parmi cent",[23372],{"type":29,"tag":30,"props":23373,"children":23374},{},[23375],{"type":38,"value":23376},"Cet article détaille une poignée de réflexes : nommer juste, des fonctions courtes, des responsabilités séparées. Ce ne sont que quelques pièces d'un ensemble bien plus large. Le Craft Bundle réunit les 100 pratiques que j'applique pour produire du code propre et maintenable, celles que l'IA ne vous apprendra jamais parce qu'elle ne les a jamais vues tenir trois ans en production.",{"type":29,"tag":46,"props":23378,"children":23379},{},[],{"type":29,"tag":50,"props":23381,"children":23383},{"id":23382},"questions-fréquentes",[23384],{"type":29,"tag":34,"props":23385,"children":23386},{},[23387],{"type":38,"value":23388},"Questions fréquentes",{"type":29,"tag":2205,"props":23390,"children":23391},{},[23392,23397],{"type":29,"tag":2209,"props":23393,"children":23394},{},[23395],{"type":38,"value":23396},"Clean Code = juste du code joliment formaté ?",{"type":29,"tag":30,"props":23398,"children":23399},{},[23400],{"type":38,"value":23401},"Non. Le formatage en fait partie, mais c'est le degré le moins important. Le cœur du Clean Code, c'est la lisibilité structurelle : nommage, taille des fonctions, séparation des responsabilités, gestion claire des erreurs. Une base parfaitement formatée mais aux méthodes de 300 lignes reste un code sale.",{"type":29,"tag":2205,"props":23403,"children":23404},{},[23405,23410],{"type":29,"tag":2209,"props":23406,"children":23407},{},[23408],{"type":38,"value":23409},"Comment appliquer sur du legacy déjà chargé ?",{"type":29,"tag":30,"props":23411,"children":23412},{},[23413],{"type":38,"value":23414},"Pas de big bang. À chaque passage sur une zone (bug fix, ajout de feature, exploration), laisser le code un peu plus propre qu'on l'a trouvé. Un nom de variable, une méthode extraite, un test ajouté. Sur six mois, l'effet cumulé est considérable. Sur trois ans, la base est transformée.",{"type":29,"tag":2205,"props":23416,"children":23417},{},[23418,23423],{"type":29,"tag":2209,"props":23419,"children":23420},{},[23421],{"type":38,"value":23422},"Clean Code et délais serrés sont-ils incompatibles ?",{"type":29,"tag":30,"props":23424,"children":23425},{},[23426],{"type":38,"value":23427},"Non, c'est même l'inverse au-delà de quelques jours. Le code sale livré sous pression devient le code qui ralentit le sprint suivant. Trois pratiques minimales restent toujours rentables, même en mode rush : nommer correctement, garder les méthodes courtes, refuser les \"hacks\" qu'on aura honte de relire.",{"type":29,"tag":2205,"props":23429,"children":23430},{},[23431,23436],{"type":29,"tag":2209,"props":23432,"children":23433},{},[23434],{"type":38,"value":23435},"Comment embarquer une équipe résistante ?",{"type":29,"tag":30,"props":23437,"children":23438},{},[23439],{"type":38,"value":23440},"Les arguments théoriques ne marchent pas. Ce qui marche : prendre un module particulièrement douloureux, le nettoyer avec un binôme volontaire, mesurer le temps de relecture et le nombre de bugs sur six semaines. Ensuite, introduire les revues de code et le scout rule. La culture s'installe par l'exemple, jamais par décret.",{"type":29,"tag":46,"props":23442,"children":23443},{},[],{"type":29,"tag":14327,"props":23445,"children":23446},{"id":2151},[23447],{"type":29,"tag":34,"props":23448,"children":23449},{},[23450],{"type":38,"value":2154},{"type":29,"tag":30,"props":23452,"children":23453},{},[23454],{"type":38,"value":23455},"Le Clean Code n'est pas une posture esthétique : c'est ce qui rend une base maintenable à dix-huit mois plutôt qu'illisible à six. La discipline tient en quelques gestes répétés : nommer pour révéler l'intention, garder les méthodes courtes, séparer les responsabilités, écrire du code qu'on relira sans grimacer. Ces gestes paraissent insignifiants à l'unité ; cumulés sur la durée d'un projet, ils font la différence entre une équipe qui livre et une équipe qui s'enlise.",{"type":29,"tag":1196,"props":23457,"children":23460},{"cta":23458,"href":2305,"title":23459,"type":2307},"Télécharger le diagnostic gratuit →","Ressource gratuite : 10 signaux que votre équipe tech est en danger",[23461],{"type":29,"tag":30,"props":23462,"children":23463},{},[23464],{"type":38,"value":23465},"10 signaux d'alarme pour identifier les problèmes systémiques cachés dans votre équipe avant qu'ils deviennent critiques. Auto-diagnostic inclus : 5 minutes pour savoir où vous en êtes.",{"type":29,"tag":2315,"props":23467,"children":23468},{},[23469],{"type":38,"value":2319},{"title":8,"searchDepth":196,"depth":196,"links":23471},[23472,23475,23480,23485,23487,23490,23493,23496,23497,23500,23503,23506],{"id":19110,"depth":196,"text":19116,"children":23473},[23474],{"id":19119,"depth":218,"text":19125},{"id":19173,"depth":196,"text":19179,"children":23476},[23477,23478,23479],{"id":19187,"depth":218,"text":19193},{"id":19325,"depth":218,"text":19331},{"id":20168,"depth":218,"text":20174},{"id":20506,"depth":196,"text":20512,"children":23481},[23482,23483,23484],{"id":20533,"depth":218,"text":20539},{"id":20659,"depth":218,"text":20665},{"id":21162,"depth":218,"text":21168},{"id":21529,"depth":196,"text":23486},"Le catch (Exception e) générique est un anti-pattern classique : il masque les vraies causes et complique le débogage en production.",{"id":21542,"depth":196,"text":21548,"children":23488},[23489],{"id":21561,"depth":218,"text":21567},{"id":21992,"depth":196,"text":21995,"children":23491},[23492],{"id":21998,"depth":218,"text":22004},{"id":22495,"depth":196,"text":22498,"children":23494},[23495],{"id":22501,"depth":218,"text":22507},{"id":22856,"depth":196,"text":22859},{"id":22862,"depth":196,"text":22868,"children":23498},[23499],{"id":22882,"depth":218,"text":22888},{"id":23228,"depth":196,"text":23231,"children":23501},[23502],{"id":23234,"depth":218,"text":23240},{"id":23292,"depth":196,"text":23295,"children":23504},[23505],{"id":23298,"depth":218,"text":23304},{"id":23382,"depth":196,"text":23388,"children":23507},[23508],{"id":2151,"depth":218,"text":2154},"content:fr:dette-technique:clean-code-software-craftsmanship-principes-java.md","fr\u002Fdette-technique\u002Fclean-code-software-craftsmanship-principes-java.md","fr\u002Fdette-technique\u002Fclean-code-software-craftsmanship-principes-java",{"_path":1174,"_dir":14289,"_draft":7,"_partial":7,"_locale":8,"title":23513,"description":23514,"id":3665,"date":23515,"listed":13,"nocomments":7,"hidden":7,"categories":23516,"tags":23517,"cover":23518,"readingTime":23519,"body":23523,"_type":2331,"_id":24845,"_source":2333,"_file":24846,"_stem":24847,"_extension":2336},"Principe YAGNI, Comment écrire du code de qualité en évitant les fonctionnalités inutiles","Découvrez le principe YAGNI en software craftsmanship et apprenez à simplifier votre code en évitant d'anticiper des besoins futurs. Exemples concrets en Java inclus.","2024-06-18",[14289],[17,2345],"covers\u002Farticles\u002Fprincipe-yagni.jpg",{"text":13847,"minutes":23520,"time":23521,"words":23522},7.79,467400,1558,{"type":26,"children":23524,"toc":24834},[23525,23531,23537,23542,23567,23572,23575,23581,23586,23598,23603,23606,23615,23621,23626,23644,23649,23653,23658,24006,24019,24022,24028,24033,24043,24063,24070,24238,24256,24266,24271,24279,24523,24535,24645,24655,24667,24677,24682,24685,24691,24696,24701,24713,24722,24725,24731,24751,24764,24777,24797,24800,24804,24823,24830],{"type":29,"tag":50,"props":23526,"children":23528},{"id":23527},"yagni-comment-écrire-du-code-de-qualité-en-évitant-les-fonctionnalités-inutiles",[23529],{"type":38,"value":23530},"YAGNI : Comment écrire du code de qualité en évitant les fonctionnalités inutiles",{"type":29,"tag":14327,"props":23532,"children":23534},{"id":23533},"introduction-quest-ce-que-yagni",[23535],{"type":38,"value":23536},"Introduction : Qu’est-ce que YAGNI ?",{"type":29,"tag":30,"props":23538,"children":23539},{},[23540],{"type":38,"value":23541},"Audit d’une plateforme bancaire l’an dernier. Trois jours pour cartographier le code mort : près de 30 % de la base ne répondait à aucun besoin actif. Des modules de conversion multi-devises ajoutés \"au cas où\" cinq ans plus tôt, jamais activés. Une couche d’abstraction sur la persistence prête à supporter trois bases différentes (une seule en production). Chaque livraison ralentie par ce poids mort, chaque onboarding rallongé d’une semaine pour expliquer à quoi servaient des classes que personne n’avait touchées depuis 2019.",{"type":29,"tag":30,"props":23543,"children":23544},{},[23545,23547,23551,23553,23558,23560,23565],{"type":38,"value":23546},"Ce gaspillage a un nom et un antidote : YAGNI (You Aren’t Gonna Need It). Formulé par Kent Beck dans le cadre de l’Extreme Programming, c’est l’un des piliers du ",{"type":29,"tag":34,"props":23548,"children":23549},{},[23550],{"type":38,"value":15525},{"type":38,"value":23552},". La règle tient en une ligne : n’écrivez pas le code dont vous ",{"type":29,"tag":114,"props":23554,"children":23555},{},[23556],{"type":38,"value":23557},"pensez",{"type":38,"value":23559}," avoir besoin demain, écrivez celui dont vous ",{"type":29,"tag":114,"props":23561,"children":23562},{},[23563],{"type":38,"value":23564},"avez",{"type":38,"value":23566}," besoin aujourd’hui.",{"type":29,"tag":30,"props":23568,"children":23569},{},[23570],{"type":38,"value":23571},"Cet article montre comment l’appliquer concrètement en Java, où repérer les ajouts superflus, et comment résister à la tentation d’anticiper.",{"type":29,"tag":46,"props":23573,"children":23574},{},[],{"type":29,"tag":14327,"props":23576,"children":23578},{"id":23577},"ce-que-yagni-vous-évite-vraiment",[23579],{"type":38,"value":23580},"Ce que YAGNI vous évite vraiment",{"type":29,"tag":30,"props":23582,"children":23583},{},[23584],{"type":38,"value":23585},"Trois conséquences directes, observées sur le terrain.",{"type":29,"tag":30,"props":23587,"children":23588},{},[23589,23591,23596],{"type":38,"value":23590},"Chaque fonctionnalité prématurée alourdit la base : plus de classes à lire, plus de chemins à tester, plus de surfaces où loger des bugs. Multipliez par cinq ans d’accumulation et vous obtenez la situation décrite plus haut : 30 % de code qui ne sert à rien mais que tout le monde doit comprendre. C’est de la ",{"type":29,"tag":62,"props":23592,"children":23593},{"href":13764},[23594],{"type":38,"value":23595},"dette technique",{"type":38,"value":23597}," pure, contractée pour rembourser un emprunt qui n’a jamais été demandé.",{"type":29,"tag":30,"props":23599,"children":23600},{},[23601],{"type":38,"value":23602},"Inversement, moins de code écrit, c’est moins de tests à maintenir, moins de revues à instruire, moins de couplage à gérer le jour où le vrai besoin émerge. Un module minimal s’adapte. Un module sur-conçu pour un futur fantasmé doit d’abord être démêlé avant d’être modifié, et personne n’ose y toucher.",{"type":29,"tag":46,"props":23604,"children":23605},{},[],{"type":29,"tag":1196,"props":23607,"children":23609},{"cta":1198,"href":1199,"title":23608,"type":1201},"Vous voulez savoir, avant d'écrire une ligne, si elle est vraiment nécessaire ?",[23610],{"type":29,"tag":30,"props":23611,"children":23612},{},[23613],{"type":38,"value":23614},"Résister à l'envie d'anticiper un besoin, ça ne se décrète pas en lisant un article : ça se travaille sur votre propre code. En mentoring 1:1, je relis vos PR avec vous et on traque ensemble chaque abstraction prématurée, chaque paramètre \"au cas où\". Vous développez le réflexe d'écrire juste ce qu'il faut, et rien de plus.",{"type":29,"tag":14327,"props":23616,"children":23618},{"id":23617},"comment-repérer-une-fonctionnalité-superflue",[23619],{"type":38,"value":23620},"Comment repérer une fonctionnalité superflue",{"type":29,"tag":30,"props":23622,"children":23623},{},[23624],{"type":38,"value":23625},"Trois questions suffisent en général. Si vous répondez \"non\" à la première et \"oui\" aux deux autres, vous tenez un candidat à supprimer ou à ne pas écrire.",{"type":29,"tag":8603,"props":23627,"children":23628},{},[23629,23634,23639],{"type":29,"tag":8607,"props":23630,"children":23631},{},[23632],{"type":38,"value":23633},"Existe-t-il aujourd’hui un cas d’usage concret, validé, qui exige cette fonctionnalité ? Pas un cas hypothétique évoqué en réunion il y a six mois, mais un besoin actif, daté, avec un utilisateur ou un client identifié.",{"type":29,"tag":8607,"props":23635,"children":23636},{},[23637],{"type":38,"value":23638},"L’application fonctionnerait-elle correctement sans cette fonctionnalité ? Si oui, c’est qu’elle n’en a pas besoin maintenant.",{"type":29,"tag":8607,"props":23640,"children":23641},{},[23642],{"type":38,"value":23643},"Cet ajout complique-t-il la lecture, les tests ou la maintenance du code existant ? Une option supplémentaire, un paramètre \"au cas où\", une couche d’abstraction préventive : chacun de ces choix a un coût immédiat pour un bénéfice incertain.",{"type":29,"tag":30,"props":23645,"children":23646},{},[23647],{"type":38,"value":23648},"Quand la pression vient d’un client ou d’un manager qui demande une fonctionnalité \"pour plus tard\", la conversation à avoir est simple : qui en a besoin, à quelle date, et que coûte-t-il d’attendre que ce besoin soit confirmé ? Dans neuf cas sur dix, la demande s’évapore.",{"type":29,"tag":14387,"props":23650,"children":23651},{"id":14377},[23652],{"type":38,"value":14380},{"type":29,"tag":30,"props":23654,"children":23655},{},[23656],{"type":38,"value":23657},"Prenons un exemple simple en Java où vous pourriez être tenté d’ajouter une fonctionnalité inutile :",{"type":29,"tag":173,"props":23659,"children":23661},{"className":8272,"code":23660,"language":8271,"meta":8,"style":8},"\u002F\u002F Exemple où une fonctionnalité inutile est ajoutée\npublic class User {\n    private String name;\n    private int age;\n    private String address; \u002F\u002F Cette information n'est pas encore utilisée\n\n    public User(String name, int age) {\n        this.name = name;\n        this.age = age;\n        \u002F\u002F On pourrait être tenté d'ajouter l'adresse dès maintenant, mais YAGNI !\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public int getAge() {\n        return age;\n    }\n    \n    \u002F\u002F On pourrait ajouter un getter pour l'adresse ici, mais ça serait prématuré.\n}\n",[23662],{"type":29,"tag":156,"props":23663,"children":23664},{"__ignoreMap":8},[23665,23673,23693,23712,23732,23757,23764,23807,23835,23863,23871,23878,23885,23909,23924,23931,23938,23962,23977,23984,23991,23999],{"type":29,"tag":183,"props":23666,"children":23667},{"class":185,"line":186},[23668],{"type":29,"tag":183,"props":23669,"children":23670},{"style":190},[23671],{"type":38,"value":23672},"\u002F\u002F Exemple où une fonctionnalité inutile est ajoutée\n",{"type":29,"tag":183,"props":23674,"children":23675},{"class":185,"line":196},[23676,23680,23684,23689],{"type":29,"tag":183,"props":23677,"children":23678},{"style":200},[23679],{"type":38,"value":8292},{"type":29,"tag":183,"props":23681,"children":23682},{"style":200},[23683],{"type":38,"value":854},{"type":29,"tag":183,"props":23685,"children":23686},{"style":750},[23687],{"type":38,"value":23688}," User",{"type":29,"tag":183,"props":23690,"children":23691},{"style":212},[23692],{"type":38,"value":285},{"type":29,"tag":183,"props":23694,"children":23695},{"class":185,"line":218},[23696,23700,23704,23708],{"type":29,"tag":183,"props":23697,"children":23698},{"style":200},[23699],{"type":38,"value":1291},{"type":29,"tag":183,"props":23701,"children":23702},{"style":8327},[23703],{"type":38,"value":7421},{"type":29,"tag":183,"props":23705,"children":23706},{"style":308},[23707],{"type":38,"value":3869},{"type":29,"tag":183,"props":23709,"children":23710},{"style":212},[23711],{"type":38,"value":327},{"type":29,"tag":183,"props":23713,"children":23714},{"class":185,"line":245},[23715,23719,23723,23728],{"type":29,"tag":183,"props":23716,"children":23717},{"style":200},[23718],{"type":38,"value":1291},{"type":29,"tag":183,"props":23720,"children":23721},{"style":200},[23722],{"type":38,"value":17060},{"type":29,"tag":183,"props":23724,"children":23725},{"style":308},[23726],{"type":38,"value":23727}," age",{"type":29,"tag":183,"props":23729,"children":23730},{"style":212},[23731],{"type":38,"value":327},{"type":29,"tag":183,"props":23733,"children":23734},{"class":185,"line":266},[23735,23739,23743,23748,23752],{"type":29,"tag":183,"props":23736,"children":23737},{"style":200},[23738],{"type":38,"value":1291},{"type":29,"tag":183,"props":23740,"children":23741},{"style":8327},[23742],{"type":38,"value":7421},{"type":29,"tag":183,"props":23744,"children":23745},{"style":308},[23746],{"type":38,"value":23747}," address",{"type":29,"tag":183,"props":23749,"children":23750},{"style":212},[23751],{"type":38,"value":6109},{"type":29,"tag":183,"props":23753,"children":23754},{"style":190},[23755],{"type":38,"value":23756}," \u002F\u002F Cette information n'est pas encore utilisée\n",{"type":29,"tag":183,"props":23758,"children":23759},{"class":185,"line":288},[23760],{"type":29,"tag":183,"props":23761,"children":23762},{"emptyLinePlaceholder":13},[23763],{"type":38,"value":445},{"type":29,"tag":183,"props":23765,"children":23766},{"class":185,"line":330},[23767,23771,23775,23779,23783,23787,23791,23795,23799,23803],{"type":29,"tag":183,"props":23768,"children":23769},{"style":200},[23770],{"type":38,"value":8441},{"type":29,"tag":183,"props":23772,"children":23773},{"style":206},[23774],{"type":38,"value":23688},{"type":29,"tag":183,"props":23776,"children":23777},{"style":212},[23778],{"type":38,"value":770},{"type":29,"tag":183,"props":23780,"children":23781},{"style":8327},[23782],{"type":38,"value":8842},{"type":29,"tag":183,"props":23784,"children":23785},{"style":222},[23786],{"type":38,"value":3869},{"type":29,"tag":183,"props":23788,"children":23789},{"style":212},[23790],{"type":38,"value":2694},{"type":29,"tag":183,"props":23792,"children":23793},{"style":200},[23794],{"type":38,"value":17060},{"type":29,"tag":183,"props":23796,"children":23797},{"style":222},[23798],{"type":38,"value":23727},{"type":29,"tag":183,"props":23800,"children":23801},{"style":212},[23802],{"type":38,"value":272},{"type":29,"tag":183,"props":23804,"children":23805},{"style":212},[23806],{"type":38,"value":285},{"type":29,"tag":183,"props":23808,"children":23809},{"class":185,"line":374},[23810,23814,23818,23823,23827,23831],{"type":29,"tag":183,"props":23811,"children":23812},{"style":1481},[23813],{"type":38,"value":9016},{"type":29,"tag":183,"props":23815,"children":23816},{"style":212},[23817],{"type":38,"value":79},{"type":29,"tag":183,"props":23819,"children":23820},{"style":308},[23821],{"type":38,"value":23822},"name ",{"type":29,"tag":183,"props":23824,"children":23825},{"style":228},[23826],{"type":38,"value":8340},{"type":29,"tag":183,"props":23828,"children":23829},{"style":308},[23830],{"type":38,"value":3869},{"type":29,"tag":183,"props":23832,"children":23833},{"style":212},[23834],{"type":38,"value":327},{"type":29,"tag":183,"props":23836,"children":23837},{"class":185,"line":430},[23838,23842,23846,23851,23855,23859],{"type":29,"tag":183,"props":23839,"children":23840},{"style":1481},[23841],{"type":38,"value":9016},{"type":29,"tag":183,"props":23843,"children":23844},{"style":212},[23845],{"type":38,"value":79},{"type":29,"tag":183,"props":23847,"children":23848},{"style":308},[23849],{"type":38,"value":23850},"age ",{"type":29,"tag":183,"props":23852,"children":23853},{"style":228},[23854],{"type":38,"value":8340},{"type":29,"tag":183,"props":23856,"children":23857},{"style":308},[23858],{"type":38,"value":23727},{"type":29,"tag":183,"props":23860,"children":23861},{"style":212},[23862],{"type":38,"value":327},{"type":29,"tag":183,"props":23864,"children":23865},{"class":185,"line":439},[23866],{"type":29,"tag":183,"props":23867,"children":23868},{"style":190},[23869],{"type":38,"value":23870},"        \u002F\u002F On pourrait être tenté d'ajouter l'adresse dès maintenant, mais YAGNI !\n",{"type":29,"tag":183,"props":23872,"children":23873},{"class":185,"line":448},[23874],{"type":29,"tag":183,"props":23875,"children":23876},{"style":212},[23877],{"type":38,"value":1589},{"type":29,"tag":183,"props":23879,"children":23880},{"class":185,"line":457},[23881],{"type":29,"tag":183,"props":23882,"children":23883},{"emptyLinePlaceholder":13},[23884],{"type":38,"value":445},{"type":29,"tag":183,"props":23886,"children":23887},{"class":185,"line":474},[23888,23892,23896,23901,23905],{"type":29,"tag":183,"props":23889,"children":23890},{"style":200},[23891],{"type":38,"value":8441},{"type":29,"tag":183,"props":23893,"children":23894},{"style":8327},[23895],{"type":38,"value":7421},{"type":29,"tag":183,"props":23897,"children":23898},{"style":206},[23899],{"type":38,"value":23900}," getName",{"type":29,"tag":183,"props":23902,"children":23903},{"style":212},[23904],{"type":38,"value":1108},{"type":29,"tag":183,"props":23906,"children":23907},{"style":212},[23908],{"type":38,"value":285},{"type":29,"tag":183,"props":23910,"children":23911},{"class":185,"line":495},[23912,23916,23920],{"type":29,"tag":183,"props":23913,"children":23914},{"style":200},[23915],{"type":38,"value":8571},{"type":29,"tag":183,"props":23917,"children":23918},{"style":308},[23919],{"type":38,"value":3869},{"type":29,"tag":183,"props":23921,"children":23922},{"style":212},[23923],{"type":38,"value":327},{"type":29,"tag":183,"props":23925,"children":23926},{"class":185,"line":516},[23927],{"type":29,"tag":183,"props":23928,"children":23929},{"style":212},[23930],{"type":38,"value":1589},{"type":29,"tag":183,"props":23932,"children":23933},{"class":185,"line":536},[23934],{"type":29,"tag":183,"props":23935,"children":23936},{"emptyLinePlaceholder":13},[23937],{"type":38,"value":445},{"type":29,"tag":183,"props":23939,"children":23940},{"class":185,"line":570},[23941,23945,23949,23954,23958],{"type":29,"tag":183,"props":23942,"children":23943},{"style":200},[23944],{"type":38,"value":8441},{"type":29,"tag":183,"props":23946,"children":23947},{"style":200},[23948],{"type":38,"value":17060},{"type":29,"tag":183,"props":23950,"children":23951},{"style":206},[23952],{"type":38,"value":23953}," getAge",{"type":29,"tag":183,"props":23955,"children":23956},{"style":212},[23957],{"type":38,"value":1108},{"type":29,"tag":183,"props":23959,"children":23960},{"style":212},[23961],{"type":38,"value":285},{"type":29,"tag":183,"props":23963,"children":23964},{"class":185,"line":613},[23965,23969,23973],{"type":29,"tag":183,"props":23966,"children":23967},{"style":200},[23968],{"type":38,"value":8571},{"type":29,"tag":183,"props":23970,"children":23971},{"style":308},[23972],{"type":38,"value":23727},{"type":29,"tag":183,"props":23974,"children":23975},{"style":212},[23976],{"type":38,"value":327},{"type":29,"tag":183,"props":23978,"children":23979},{"class":185,"line":662},[23980],{"type":29,"tag":183,"props":23981,"children":23982},{"style":212},[23983],{"type":38,"value":1589},{"type":29,"tag":183,"props":23985,"children":23986},{"class":185,"line":3095},[23987],{"type":29,"tag":183,"props":23988,"children":23989},{"style":308},[23990],{"type":38,"value":18530},{"type":29,"tag":183,"props":23992,"children":23993},{"class":185,"line":3154},[23994],{"type":29,"tag":183,"props":23995,"children":23996},{"style":190},[23997],{"type":38,"value":23998},"    \u002F\u002F On pourrait ajouter un getter pour l'adresse ici, mais ça serait prématuré.\n",{"type":29,"tag":183,"props":24000,"children":24001},{"class":185,"line":3207},[24002],{"type":29,"tag":183,"props":24003,"children":24004},{"style":212},[24005],{"type":38,"value":436},{"type":29,"tag":30,"props":24007,"children":24008},{},[24009,24011,24017],{"type":38,"value":24010},"Dans cet exemple, l’attribut ",{"type":29,"tag":156,"props":24012,"children":24014},{"className":24013},[],[24015],{"type":38,"value":24016},"address",{"type":38,"value":24018}," est inutile tant que le programme n’en a pas besoin. Selon YAGNI, ne l’ajoutez pas avant d’avoir une demande précise pour cette fonctionnalité.",{"type":29,"tag":46,"props":24020,"children":24021},{},[],{"type":29,"tag":14327,"props":24023,"children":24025},{"id":24024},"mettre-yagni-en-pratique-au-quotidien",[24026],{"type":38,"value":24027},"Mettre YAGNI en pratique au quotidien",{"type":29,"tag":30,"props":24029,"children":24030},{},[24031],{"type":38,"value":24032},"Appliquer YAGNI demande de la discipline et un cadre. Voici les leviers qui fonctionnent dans les équipes que j’accompagne.",{"type":29,"tag":14387,"props":24034,"children":24036},{"id":24035},"_1-laisser-les-tests-piloter-le-code",[24037,24038],{"type":38,"value":15263},{"type":29,"tag":34,"props":24039,"children":24040},{},[24041],{"type":38,"value":24042},"Laisser les tests piloter le code",{"type":29,"tag":30,"props":24044,"children":24045},{},[24046,24048,24053,24055,24061],{"type":38,"value":24047},"L’approche la plus efficace pour ne pas écrire de code spéculatif reste le ",{"type":29,"tag":34,"props":24049,"children":24050},{},[24051],{"type":38,"value":24052},"Test-Driven Development (TDD)",{"type":38,"value":24054},". Un ",{"type":29,"tag":62,"props":24056,"children":24058},{"href":24057},"\u002Ffr\u002Fdette-technique\u002Fdecouvrir-frameworks-tests-java",[24059],{"type":38,"value":24060},"test",{"type":38,"value":24062}," d’abord, puis juste assez de code pour le faire passer. Le mécanisme oblige à rester sur le besoin réel : si aucun test ne le justifie, le code n’existe pas.",{"type":29,"tag":30,"props":24064,"children":24065},{},[24066],{"type":29,"tag":34,"props":24067,"children":24068},{},[24069],{"type":38,"value":15609},{"type":29,"tag":173,"props":24071,"children":24073},{"className":8272,"code":24072,"language":8271,"meta":8,"style":8},"@Test\npublic void testAddUser() {\n    User user = new User(\"Alice\", 30);\n    assertEquals(\"Alice\", user.getName());\n    assertEquals(30, user.getAge());\n}\n",[24074],{"type":29,"tag":156,"props":24075,"children":24076},{"__ignoreMap":8},[24077,24088,24112,24159,24195,24231],{"type":29,"tag":183,"props":24078,"children":24079},{"class":185,"line":186},[24080,24084],{"type":29,"tag":183,"props":24081,"children":24082},{"style":839},[24083],{"type":38,"value":831},{"type":29,"tag":183,"props":24085,"children":24086},{"style":10084},[24087],{"type":38,"value":10087},{"type":29,"tag":183,"props":24089,"children":24090},{"class":185,"line":196},[24091,24095,24099,24104,24108],{"type":29,"tag":183,"props":24092,"children":24093},{"style":200},[24094],{"type":38,"value":8292},{"type":29,"tag":183,"props":24096,"children":24097},{"style":200},[24098],{"type":38,"value":9424},{"type":29,"tag":183,"props":24100,"children":24101},{"style":206},[24102],{"type":38,"value":24103}," testAddUser",{"type":29,"tag":183,"props":24105,"children":24106},{"style":212},[24107],{"type":38,"value":1108},{"type":29,"tag":183,"props":24109,"children":24110},{"style":212},[24111],{"type":38,"value":285},{"type":29,"tag":183,"props":24113,"children":24114},{"class":185,"line":218},[24115,24120,24125,24129,24133,24137,24141,24146,24150,24155],{"type":29,"tag":183,"props":24116,"children":24117},{"style":8327},[24118],{"type":38,"value":24119},"    User",{"type":29,"tag":183,"props":24121,"children":24122},{"style":308},[24123],{"type":38,"value":24124}," user ",{"type":29,"tag":183,"props":24126,"children":24127},{"style":228},[24128],{"type":38,"value":8340},{"type":29,"tag":183,"props":24130,"children":24131},{"style":200},[24132],{"type":38,"value":1099},{"type":29,"tag":183,"props":24134,"children":24135},{"style":206},[24136],{"type":38,"value":23688},{"type":29,"tag":183,"props":24138,"children":24139},{"style":212},[24140],{"type":38,"value":770},{"type":29,"tag":183,"props":24142,"children":24143},{"style":1683},[24144],{"type":38,"value":24145},"\"Alice\"",{"type":29,"tag":183,"props":24147,"children":24148},{"style":212},[24149],{"type":38,"value":2694},{"type":29,"tag":183,"props":24151,"children":24152},{"style":319},[24153],{"type":38,"value":24154}," 30",{"type":29,"tag":183,"props":24156,"children":24157},{"style":212},[24158],{"type":38,"value":7487},{"type":29,"tag":183,"props":24160,"children":24161},{"class":185,"line":245},[24162,24167,24171,24175,24179,24183,24187,24191],{"type":29,"tag":183,"props":24163,"children":24164},{"style":206},[24165],{"type":38,"value":24166},"    assertEquals",{"type":29,"tag":183,"props":24168,"children":24169},{"style":212},[24170],{"type":38,"value":770},{"type":29,"tag":183,"props":24172,"children":24173},{"style":1683},[24174],{"type":38,"value":24145},{"type":29,"tag":183,"props":24176,"children":24177},{"style":212},[24178],{"type":38,"value":2694},{"type":29,"tag":183,"props":24180,"children":24181},{"style":308},[24182],{"type":38,"value":17488},{"type":29,"tag":183,"props":24184,"children":24185},{"style":212},[24186],{"type":38,"value":79},{"type":29,"tag":183,"props":24188,"children":24189},{"style":206},[24190],{"type":38,"value":16454},{"type":29,"tag":183,"props":24192,"children":24193},{"style":212},[24194],{"type":38,"value":11052},{"type":29,"tag":183,"props":24196,"children":24197},{"class":185,"line":266},[24198,24202,24206,24211,24215,24219,24223,24227],{"type":29,"tag":183,"props":24199,"children":24200},{"style":206},[24201],{"type":38,"value":24166},{"type":29,"tag":183,"props":24203,"children":24204},{"style":212},[24205],{"type":38,"value":770},{"type":29,"tag":183,"props":24207,"children":24208},{"style":319},[24209],{"type":38,"value":24210},"30",{"type":29,"tag":183,"props":24212,"children":24213},{"style":212},[24214],{"type":38,"value":2694},{"type":29,"tag":183,"props":24216,"children":24217},{"style":308},[24218],{"type":38,"value":17488},{"type":29,"tag":183,"props":24220,"children":24221},{"style":212},[24222],{"type":38,"value":79},{"type":29,"tag":183,"props":24224,"children":24225},{"style":206},[24226],{"type":38,"value":16530},{"type":29,"tag":183,"props":24228,"children":24229},{"style":212},[24230],{"type":38,"value":11052},{"type":29,"tag":183,"props":24232,"children":24233},{"class":185,"line":288},[24234],{"type":29,"tag":183,"props":24235,"children":24236},{"style":212},[24237],{"type":38,"value":436},{"type":29,"tag":30,"props":24239,"children":24240},{},[24241,24243,24248,24250,24255],{"type":38,"value":24242},"Avec ce test, vous vous concentrez uniquement sur l’ajout de l’utilisateur avec un nom et un âge. Tant qu’il n’existe pas de test nécessitant l’adresse, n’ajoutez pas d’attribut ",{"type":29,"tag":156,"props":24244,"children":24246},{"className":24245},[],[24247],{"type":38,"value":24016},{"type":38,"value":24249}," à la classe ",{"type":29,"tag":156,"props":24251,"children":24253},{"className":24252},[],[24254],{"type":38,"value":17483},{"type":38,"value":79},{"type":29,"tag":14387,"props":24257,"children":24259},{"id":24258},"_2-évitez-de-généraliser-trop-tôt",[24260,24261],{"type":38,"value":15279},{"type":29,"tag":34,"props":24262,"children":24263},{},[24264],{"type":38,"value":24265},"Évitez de généraliser trop tôt",{"type":29,"tag":30,"props":24267,"children":24268},{},[24269],{"type":38,"value":24270},"Un autre piège commun est de vouloir tout de suite rendre votre code trop générique ou flexible. Par exemple, vous pourriez penser qu’une méthode pourrait être réutilisée plus tard et vouloir la rendre paramétrable. Mais en réalité, si cette flexibilité n’est pas nécessaire maintenant, elle pourrait ne jamais l’être.",{"type":29,"tag":30,"props":24272,"children":24273},{},[24274],{"type":29,"tag":34,"props":24275,"children":24276},{},[24277],{"type":38,"value":24278},"Exemple à éviter :",{"type":29,"tag":173,"props":24280,"children":24282},{"className":8272,"code":24281,"language":8271,"meta":8,"style":8},"public class MathOperations {\n    \u002F\u002F On pourrait être tenté de rendre cette méthode très générique\n    public int multiply(int a, int b, boolean absoluteValues) {\n        if (absoluteValues) {\n            return Math.abs(a) * Math.abs(b);\n        } else {\n            return a * b;\n        }\n    }\n}\n",[24283],{"type":29,"tag":156,"props":24284,"children":24285},{"__ignoreMap":8},[24286,24306,24314,24377,24401,24463,24479,24502,24509,24516],{"type":29,"tag":183,"props":24287,"children":24288},{"class":185,"line":186},[24289,24293,24297,24302],{"type":29,"tag":183,"props":24290,"children":24291},{"style":200},[24292],{"type":38,"value":8292},{"type":29,"tag":183,"props":24294,"children":24295},{"style":200},[24296],{"type":38,"value":854},{"type":29,"tag":183,"props":24298,"children":24299},{"style":750},[24300],{"type":38,"value":24301}," MathOperations",{"type":29,"tag":183,"props":24303,"children":24304},{"style":212},[24305],{"type":38,"value":285},{"type":29,"tag":183,"props":24307,"children":24308},{"class":185,"line":196},[24309],{"type":29,"tag":183,"props":24310,"children":24311},{"style":190},[24312],{"type":38,"value":24313},"    \u002F\u002F On pourrait être tenté de rendre cette méthode très générique\n",{"type":29,"tag":183,"props":24315,"children":24316},{"class":185,"line":218},[24317,24321,24325,24330,24334,24338,24343,24347,24351,24356,24360,24364,24369,24373],{"type":29,"tag":183,"props":24318,"children":24319},{"style":200},[24320],{"type":38,"value":8441},{"type":29,"tag":183,"props":24322,"children":24323},{"style":200},[24324],{"type":38,"value":17060},{"type":29,"tag":183,"props":24326,"children":24327},{"style":206},[24328],{"type":38,"value":24329}," multiply",{"type":29,"tag":183,"props":24331,"children":24332},{"style":212},[24333],{"type":38,"value":770},{"type":29,"tag":183,"props":24335,"children":24336},{"style":200},[24337],{"type":38,"value":14444},{"type":29,"tag":183,"props":24339,"children":24340},{"style":222},[24341],{"type":38,"value":24342}," a",{"type":29,"tag":183,"props":24344,"children":24345},{"style":212},[24346],{"type":38,"value":2694},{"type":29,"tag":183,"props":24348,"children":24349},{"style":200},[24350],{"type":38,"value":17060},{"type":29,"tag":183,"props":24352,"children":24353},{"style":222},[24354],{"type":38,"value":24355}," b",{"type":29,"tag":183,"props":24357,"children":24358},{"style":212},[24359],{"type":38,"value":2694},{"type":29,"tag":183,"props":24361,"children":24362},{"style":200},[24363],{"type":38,"value":9995},{"type":29,"tag":183,"props":24365,"children":24366},{"style":222},[24367],{"type":38,"value":24368}," absoluteValues",{"type":29,"tag":183,"props":24370,"children":24371},{"style":212},[24372],{"type":38,"value":272},{"type":29,"tag":183,"props":24374,"children":24375},{"style":212},[24376],{"type":38,"value":285},{"type":29,"tag":183,"props":24378,"children":24379},{"class":185,"line":245},[24380,24384,24388,24393,24397],{"type":29,"tag":183,"props":24381,"children":24382},{"style":200},[24383],{"type":38,"value":10982},{"type":29,"tag":183,"props":24385,"children":24386},{"style":212},[24387],{"type":38,"value":1533},{"type":29,"tag":183,"props":24389,"children":24390},{"style":308},[24391],{"type":38,"value":24392},"absoluteValues",{"type":29,"tag":183,"props":24394,"children":24395},{"style":212},[24396],{"type":38,"value":272},{"type":29,"tag":183,"props":24398,"children":24399},{"style":212},[24400],{"type":38,"value":285},{"type":29,"tag":183,"props":24402,"children":24403},{"class":185,"line":266},[24404,24409,24413,24417,24422,24426,24430,24434,24438,24442,24446,24450,24454,24459],{"type":29,"tag":183,"props":24405,"children":24406},{"style":200},[24407],{"type":38,"value":24408},"            return",{"type":29,"tag":183,"props":24410,"children":24411},{"style":308},[24412],{"type":38,"value":385},{"type":29,"tag":183,"props":24414,"children":24415},{"style":212},[24416],{"type":38,"value":79},{"type":29,"tag":183,"props":24418,"children":24419},{"style":206},[24420],{"type":38,"value":24421},"abs",{"type":29,"tag":183,"props":24423,"children":24424},{"style":212},[24425],{"type":38,"value":770},{"type":29,"tag":183,"props":24427,"children":24428},{"style":308},[24429],{"type":38,"value":62},{"type":29,"tag":183,"props":24431,"children":24432},{"style":212},[24433],{"type":38,"value":272},{"type":29,"tag":183,"props":24435,"children":24436},{"style":228},[24437],{"type":38,"value":18216},{"type":29,"tag":183,"props":24439,"children":24440},{"style":308},[24441],{"type":38,"value":385},{"type":29,"tag":183,"props":24443,"children":24444},{"style":212},[24445],{"type":38,"value":79},{"type":29,"tag":183,"props":24447,"children":24448},{"style":206},[24449],{"type":38,"value":24421},{"type":29,"tag":183,"props":24451,"children":24452},{"style":212},[24453],{"type":38,"value":770},{"type":29,"tag":183,"props":24455,"children":24456},{"style":308},[24457],{"type":38,"value":24458},"b",{"type":29,"tag":183,"props":24460,"children":24461},{"style":212},[24462],{"type":38,"value":7487},{"type":29,"tag":183,"props":24464,"children":24465},{"class":185,"line":288},[24466,24471,24475],{"type":29,"tag":183,"props":24467,"children":24468},{"style":212},[24469],{"type":38,"value":24470},"        }",{"type":29,"tag":183,"props":24472,"children":24473},{"style":200},[24474],{"type":38,"value":19588},{"type":29,"tag":183,"props":24476,"children":24477},{"style":212},[24478],{"type":38,"value":285},{"type":29,"tag":183,"props":24480,"children":24481},{"class":185,"line":330},[24482,24486,24490,24494,24498],{"type":29,"tag":183,"props":24483,"children":24484},{"style":200},[24485],{"type":38,"value":24408},{"type":29,"tag":183,"props":24487,"children":24488},{"style":308},[24489],{"type":38,"value":19245},{"type":29,"tag":183,"props":24491,"children":24492},{"style":228},[24493],{"type":38,"value":405},{"type":29,"tag":183,"props":24495,"children":24496},{"style":308},[24497],{"type":38,"value":24355},{"type":29,"tag":183,"props":24499,"children":24500},{"style":212},[24501],{"type":38,"value":327},{"type":29,"tag":183,"props":24503,"children":24504},{"class":185,"line":374},[24505],{"type":29,"tag":183,"props":24506,"children":24507},{"style":212},[24508],{"type":38,"value":11060},{"type":29,"tag":183,"props":24510,"children":24511},{"class":185,"line":430},[24512],{"type":29,"tag":183,"props":24513,"children":24514},{"style":212},[24515],{"type":38,"value":1589},{"type":29,"tag":183,"props":24517,"children":24518},{"class":185,"line":439},[24519],{"type":29,"tag":183,"props":24520,"children":24521},{"style":212},[24522],{"type":38,"value":436},{"type":29,"tag":30,"props":24524,"children":24525},{},[24526,24528,24533],{"type":38,"value":24527},"Cette méthode introduit de la complexité inutile (avec le paramètre ",{"type":29,"tag":156,"props":24529,"children":24531},{"className":24530},[],[24532],{"type":38,"value":24392},{"type":38,"value":24534},") si votre programme n'a besoin que de multiplier des nombres sans se préoccuper de leur signe. La solution YAGNI serait de garder la méthode simple :",{"type":29,"tag":173,"props":24536,"children":24538},{"className":8272,"code":24537,"language":8271,"meta":8,"style":8},"public class MathOperations {\n    public int multiply(int a, int b) {\n        return a * b;\n    }\n}\n",[24539],{"type":29,"tag":156,"props":24540,"children":24541},{"__ignoreMap":8},[24542,24561,24608,24631,24638],{"type":29,"tag":183,"props":24543,"children":24544},{"class":185,"line":186},[24545,24549,24553,24557],{"type":29,"tag":183,"props":24546,"children":24547},{"style":200},[24548],{"type":38,"value":8292},{"type":29,"tag":183,"props":24550,"children":24551},{"style":200},[24552],{"type":38,"value":854},{"type":29,"tag":183,"props":24554,"children":24555},{"style":750},[24556],{"type":38,"value":24301},{"type":29,"tag":183,"props":24558,"children":24559},{"style":212},[24560],{"type":38,"value":285},{"type":29,"tag":183,"props":24562,"children":24563},{"class":185,"line":196},[24564,24568,24572,24576,24580,24584,24588,24592,24596,24600,24604],{"type":29,"tag":183,"props":24565,"children":24566},{"style":200},[24567],{"type":38,"value":8441},{"type":29,"tag":183,"props":24569,"children":24570},{"style":200},[24571],{"type":38,"value":17060},{"type":29,"tag":183,"props":24573,"children":24574},{"style":206},[24575],{"type":38,"value":24329},{"type":29,"tag":183,"props":24577,"children":24578},{"style":212},[24579],{"type":38,"value":770},{"type":29,"tag":183,"props":24581,"children":24582},{"style":200},[24583],{"type":38,"value":14444},{"type":29,"tag":183,"props":24585,"children":24586},{"style":222},[24587],{"type":38,"value":24342},{"type":29,"tag":183,"props":24589,"children":24590},{"style":212},[24591],{"type":38,"value":2694},{"type":29,"tag":183,"props":24593,"children":24594},{"style":200},[24595],{"type":38,"value":17060},{"type":29,"tag":183,"props":24597,"children":24598},{"style":222},[24599],{"type":38,"value":24355},{"type":29,"tag":183,"props":24601,"children":24602},{"style":212},[24603],{"type":38,"value":272},{"type":29,"tag":183,"props":24605,"children":24606},{"style":212},[24607],{"type":38,"value":285},{"type":29,"tag":183,"props":24609,"children":24610},{"class":185,"line":218},[24611,24615,24619,24623,24627],{"type":29,"tag":183,"props":24612,"children":24613},{"style":200},[24614],{"type":38,"value":8571},{"type":29,"tag":183,"props":24616,"children":24617},{"style":308},[24618],{"type":38,"value":19245},{"type":29,"tag":183,"props":24620,"children":24621},{"style":228},[24622],{"type":38,"value":405},{"type":29,"tag":183,"props":24624,"children":24625},{"style":308},[24626],{"type":38,"value":24355},{"type":29,"tag":183,"props":24628,"children":24629},{"style":212},[24630],{"type":38,"value":327},{"type":29,"tag":183,"props":24632,"children":24633},{"class":185,"line":245},[24634],{"type":29,"tag":183,"props":24635,"children":24636},{"style":212},[24637],{"type":38,"value":1589},{"type":29,"tag":183,"props":24639,"children":24640},{"class":185,"line":266},[24641],{"type":29,"tag":183,"props":24642,"children":24643},{"style":212},[24644],{"type":38,"value":436},{"type":29,"tag":14387,"props":24646,"children":24648},{"id":24647},"_3-refactoriser-pour-supprimer-pas-seulement-pour-ajouter",[24649,24650],{"type":38,"value":15302},{"type":29,"tag":34,"props":24651,"children":24652},{},[24653],{"type":38,"value":24654},"Refactoriser pour supprimer, pas seulement pour ajouter",{"type":29,"tag":30,"props":24656,"children":24657},{},[24658,24660,24665],{"type":38,"value":24659},"Le refactoring sert aussi à ",{"type":29,"tag":114,"props":24661,"children":24662},{},[24663],{"type":38,"value":24664},"retirer",{"type":38,"value":24666}," ce qui n’a jamais servi. Un projet évolue, certaines parties ajoutées dans l’anticipation ne sont jamais activées. Une revue trimestrielle suffit pour identifier les classes orphelines, les méthodes jamais appelées, les options jamais cochées, et les supprimer sans cérémonie.",{"type":29,"tag":14387,"props":24668,"children":24670},{"id":24669},"_4-trancher-en-équipe-sur-le-besoin-réel",[24671,24672],{"type":38,"value":15390},{"type":29,"tag":34,"props":24673,"children":24674},{},[24675],{"type":38,"value":24676},"Trancher en équipe sur le besoin réel",{"type":29,"tag":30,"props":24678,"children":24679},{},[24680],{"type":38,"value":24681},"Quand une nouvelle fonctionnalité est proposée, une seule question à poser en stand-up : qui en a besoin maintenant ? Si la réponse est \"personne, mais ça pourrait servir\", la fonctionnalité retourne dans le backlog. Pas de débat, pas de compromis. Le backlog est fait pour ça.",{"type":29,"tag":46,"props":24683,"children":24684},{},[],{"type":29,"tag":14327,"props":24686,"children":24688},{"id":24687},"les-deux-pièges-classiques",[24689],{"type":38,"value":24690},"Les deux pièges classiques",{"type":29,"tag":30,"props":24692,"children":24693},{},[24694],{"type":38,"value":24695},"Sur le terrain, deux dérives reviennent constamment.",{"type":29,"tag":30,"props":24697,"children":24698},{},[24699],{"type":38,"value":24700},"La première est le \"juste au cas où\" déguisé en bonne pratique. Un développeur ajoute une couche de gestion multi-devises dans une application qui ne traite que des euros, parce qu’\"on ne sait jamais\". Trois ans plus tard, l’app traite toujours des euros, mais chaque modification du module de paiement doit composer avec une abstraction qui n’a jamais servi. La majorité des scénarios anticipés ne se présentent pas, et ceux qui se présentent ressemblent rarement à ce qu’on avait imaginé.",{"type":29,"tag":30,"props":24702,"children":24703},{},[24704,24706,24711],{"type":38,"value":24705},"La deuxième dérive est l’inverse : confondre YAGNI avec un refus d’anticiper. YAGNI n’interdit pas d’adapter le code quand un besoin réel émerge. Si un client demande une fonctionnalité confirmée et planifiée, on l’implémente. La discipline porte sur les besoins ",{"type":29,"tag":114,"props":24707,"children":24708},{},[24709],{"type":38,"value":24710},"spéculatifs",{"type":38,"value":24712},", pas sur l’évolution légitime du produit. Le critère est simple : un besoin formulé, daté, attribué à un utilisateur identifié, pas un \"ce serait bien si\" entendu en couloir.",{"type":29,"tag":1196,"props":24714,"children":24716},{"cta":2185,"href":2186,"title":24715,"type":2188},"YAGNI n'est qu'une pratique parmi les 100 qui font un code propre",[24717],{"type":29,"tag":30,"props":24718,"children":24719},{},[24720],{"type":38,"value":24721},"Cet article décortique une discipline : ne pas écrire le code dont vous n'avez pas besoin aujourd'hui. Le Craft Bundle réunit les 100 pratiques que j'applique au quotidien pour coder propre, savoir quand simplifier, quand refactoriser, quand s'arrêter. Ce sont celles que l'IA ne vous apprendra jamais, parce qu'elle ne les a jamais vues tenir sur cinq ans de production.",{"type":29,"tag":46,"props":24723,"children":24724},{},[],{"type":29,"tag":14327,"props":24726,"children":24728},{"id":24727},"questions-fréquentes-sur-yagni",[24729],{"type":38,"value":24730},"Questions fréquentes sur YAGNI",{"type":29,"tag":2205,"props":24732,"children":24733},{},[24734,24739],{"type":29,"tag":2209,"props":24735,"children":24736},{},[24737],{"type":38,"value":24738},"YAGNI veut-il dire \"ne jamais anticiper\" ?",{"type":29,"tag":30,"props":24740,"children":24741},{},[24742,24744,24749],{"type":38,"value":24743},"Non. YAGNI cible le code écrit pour des besoins ",{"type":29,"tag":114,"props":24745,"children":24746},{},[24747],{"type":38,"value":24748},"non confirmés",{"type":38,"value":24750},". Si vous savez avec certitude qu’une fonctionnalité sera livrée dans deux semaines parce qu’elle est validée et planifiée, l’ignorer serait absurde. La règle s’applique aux \"au cas où\", pas aux engagements pris.",{"type":29,"tag":2205,"props":24752,"children":24753},{},[24754,24759],{"type":29,"tag":2209,"props":24755,"children":24756},{},[24757],{"type":38,"value":24758},"Comment l’expliquer à un client qui demande des fonctionnalités \"pour plus tard\" ?",{"type":29,"tag":30,"props":24760,"children":24761},{},[24762],{"type":38,"value":24763},"Sortez les chiffres. Une fonctionnalité ajoutée prématurément coûte trois fois : à l’écriture, à la maintenance, et au moment où il faudra la retirer ou la modifier parce que le besoin réel ne correspond pas à ce qui a été imaginé. Proposez plutôt de garder le besoin dans le backlog et de l’implémenter quand il sera confirmé, avec une meilleure compréhension du contexte réel.",{"type":29,"tag":2205,"props":24765,"children":24766},{},[24767,24772],{"type":29,"tag":2209,"props":24768,"children":24769},{},[24770],{"type":38,"value":24771},"\"Si je ne l’ajoute pas maintenant, je devrai tout refaire plus tard\", vraiment ?",{"type":29,"tag":30,"props":24773,"children":24774},{},[24775],{"type":38,"value":24776},"Cette peur est compréhensible mais le terrain la dément. Un code minimal est plus facile à étendre qu’un code sur-conçu. Quand le besoin réel arrive, il diffère presque toujours de ce qui avait été anticipé : l’abstraction préventive devient un obstacle, pas un raccourci.",{"type":29,"tag":2205,"props":24778,"children":24779},{},[24780,24785],{"type":29,"tag":2209,"props":24781,"children":24782},{},[24783],{"type":38,"value":24784},"YAGNI et architectures évolutives : compatibles ?",{"type":29,"tag":30,"props":24786,"children":24787},{},[24788,24790,24795],{"type":38,"value":24789},"Oui. YAGNI ne s’oppose pas à la qualité ni au design : il s’oppose à la spéculation. Vous pouvez parfaitement appliquer SOLID, écrire des interfaces propres et concevoir des modules cohérents ",{"type":29,"tag":114,"props":24791,"children":24792},{},[24793],{"type":38,"value":24794},"sur le code que vous avez besoin d’écrire aujourd’hui",{"type":38,"value":24796},". La différence est qu’on n’invente pas de points d’extension pour des extensions qui n’existent pas encore.",{"type":29,"tag":46,"props":24798,"children":24799},{},[],{"type":29,"tag":14327,"props":24801,"children":24802},{"id":2151},[24803],{"type":38,"value":2154},{"type":29,"tag":30,"props":24805,"children":24806},{},[24807,24809,24814,24816,24821],{"type":38,"value":24808},"YAGNI ne rend pas votre code meilleur : il vous évite simplement de l’aggraver avec des fonctionnalités que personne n’a demandées. La discipline est moins intuitive qu’il n’y paraît, parce qu’elle suppose d’accepter une forme d’inconfort : ne pas écrire le code qu’on aurait ",{"type":29,"tag":114,"props":24810,"children":24811},{},[24812],{"type":38,"value":24813},"envie",{"type":38,"value":24815}," d’écrire, ne pas anticiper ce qu’on ",{"type":29,"tag":114,"props":24817,"children":24818},{},[24819],{"type":38,"value":24820},"imagine",{"type":38,"value":24822}," utile, faire confiance au backlog pour rattraper le besoin quand il sera réel. C’est cette retenue qui distingue les bases de code qui vieillissent bien des autres.",{"type":29,"tag":1196,"props":24824,"children":24825},{"cta":15447,"href":2305,"title":15448,"type":2307},[24826],{"type":29,"tag":30,"props":24827,"children":24828},{},[24829],{"type":38,"value":15454},{"type":29,"tag":2315,"props":24831,"children":24832},{},[24833],{"type":38,"value":2319},{"title":8,"searchDepth":196,"depth":196,"links":24835},[24836],{"id":23527,"depth":196,"text":23530,"children":24837},[24838,24839,24840,24841,24842,24843,24844],{"id":23533,"depth":218,"text":23536},{"id":23577,"depth":218,"text":23580},{"id":23617,"depth":218,"text":23620},{"id":24024,"depth":218,"text":24027},{"id":24687,"depth":218,"text":24690},{"id":24727,"depth":218,"text":24730},{"id":2151,"depth":218,"text":2154},"content:fr:dette-technique:yagni-ecrire-code-qualite-sans-fonctionnalites-inutiles.md","fr\u002Fdette-technique\u002Fyagni-ecrire-code-qualite-sans-fonctionnalites-inutiles.md","fr\u002Fdette-technique\u002Fyagni-ecrire-code-qualite-sans-fonctionnalites-inutiles",1784113923468]