{"id":2116,"date":"2026-05-26T08:05:43","date_gmt":"2026-05-26T08:05:43","guid":{"rendered":"https:\/\/www.vpascode.com\/fr\/docs\/uncategorized\/mermaid-js-class-diagram-syntax-guide\/"},"modified":"2026-05-26T08:05:43","modified_gmt":"2026-05-26T08:05:43","slug":"mermaid-js-class-diagram-syntax-guide","status":"publish","type":"ld_docs","link":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","title":{"rendered":"Guide de syntaxe des diagrammes de classes Mermaid.js"},"content":{"rendered":"<h2>Qu&#8217;est-ce qu&#8217;un diagramme de classes ?<\/h2>\n<p>Un <strong>Diagramme de classes<\/strong> diagramme structurel <strong>diagramme UML<\/strong> qui visualise l&#8217;architecture statique d&#8217;un syst\u00e8me logiciel orient\u00e9 objet. En tant que type de diagramme UML indispensable, il repr\u00e9sente les classes individuelles, les interfaces et les mod\u00e8les de donn\u00e9es au sein de votre application, en documentant explicitement leurs champs internes (attributs), leurs fonctions op\u00e9rationnelles (m\u00e9thodes) et les relations structurelles qui les lient ensemble. Ce plan est essentiel pour les ing\u00e9nieurs logiciels qui doivent traduire des conceptions de domaine de haut niveau en structures d&#8217;objets propres et maintenables.<strong>type de diagramme UML<\/strong>il repr\u00e9sente les classes individuelles, les interfaces et les mod\u00e8les de donn\u00e9es au sein de votre application, en documentant explicitement leurs champs internes (attributs), leurs fonctions op\u00e9rationnelles (m\u00e9thodes) et les relations structurelles qui les lient ensemble. Ce plan est essentiel pour les ing\u00e9nieurs logiciels qui doivent traduire des conceptions de domaine de haut niveau en structures d&#8217;objets propres et maintenables.<\/p>\n<p>Avec <strong>Mermaid.js<\/strong>vous pouvez esquisser vos mod\u00e8les de donn\u00e9es et vos services syst\u00e8me \u00e0 l&#8217;aide de d\u00e9finitions intuitives bas\u00e9es sur le texte. Le moteur de mise en page calcule automatiquement les tailles des bo\u00eetes, structure les compartiments de donn\u00e9es UML standards et aligne les fl\u00e8ches relationnelles sur votre canevas sans aucun surcro\u00eet de formatage manuel.<\/p>\n<h2>Guide de syntaxe fondamentale : \u00e9l\u00e9ments et constructions<\/h2>\n<p>Pour concevoir un diagramme de classes UML pr\u00e9cis et conforme aux normes dans Mermaid, vous devez ma\u00eetriser les d\u00e9clarations de membres, les modificateurs d&#8217;acc\u00e8s et les fl\u00e8ches de relations structurelles.<\/p>\n<h3>1. D\u00e9clarer des classes et des compartiments de classes<\/h3>\n<p>Vous pouvez d\u00e9finir une classe en utilisant deux formats valides. Pour une classe simple, utilisez le mot-cl\u00e9 <code>class<\/code>suivi du nom de la classe. Si vous souhaitez inclure imm\u00e9diatement des champs et des m\u00e9thodes, utilisez des accolades en fin de ligne pour cr\u00e9er un bloc de corps clair :<\/p>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiEJocWpRQFF+WmZOqkI1RAIEtINLijLz0hVKgdJ5ibmpmDKpuYmZOUjCpQUpiSWpriBRjbzUcjBDU6EsPzMFoqgWAOaDJdQ=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiEJocWpRQFF+WmZOqkI1RAIEtINLijLz0hVKgdJ5ibmpmDKpuYmZOUjCpQUpiSWpriBRjbzUcjBDU6EsPzMFoqgWAOaDJdQ=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">classDiagram\r\n    class UserProfile {\r\n        +String username\r\n        +String email\r\n        +updateEmail(newEmail) void\r\n    }<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiEJocWpRQFF+WmZOqkI1RAIEtINLijLz0hVKgdJ5ibmpmDKpuYmZOUjCpQUpiSWpriBRjbzUcjBDU6EsPzMFoqgWAOaDJdQ=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiEJocWpRQFF+WmZOqkI1RAIEtINLijLz0hVKgdJ5ibmpmDKpuYmZOUjCpQUpiSWpriBRjbzUcjBDU6EsPzMFoqgWAOaDJdQ=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"QKYoRec\"><img fetchpriority=\"high\" alt=\"\" class=\"alignnone size-full wp-image-618\" decoding=\"async\" fetchpriority=\"high\" height=\"184\" sizes=\"(max-width: 303px) 100vw, 303px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19030c532c9.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19030c532c9.png 303w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19030c532c9-300x182.png 300w\" width=\"303\"\/><\/p>\n<h3>2. Ajouter des modificateurs de visibilit\u00e9 \/ d&#8217;acc\u00e8s<\/h3>\n<p>Pour documenter les r\u00e8gles standard d&#8217;encapsulation UML, placez un symbole sp\u00e9cifique directement avant le nom de votre attribut ou de votre m\u00e9thode afin de d\u00e9finir son niveau de visibilit\u00e9 :<\/p>\n<ul>\n<li><code>+<\/code> **Public :** Accessible depuis n&#8217;importe quelle autre classe.<\/li>\n<li><code>-<\/code> **Priv\u00e9 :** Accessible uniquement au sein de la classe d\u00e9clarante.<\/li>\n<li><code>#<\/code> **Prot\u00e9g\u00e9 :** Accessible au sein de la classe et de ses sous-classes.<\/li>\n<li><code>~<\/code> **Paquet \/ Interne :** Accessible dans les limites du m\u00eame paquet.<\/li>\n<\/ul>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiIJTYl62Y3JyfmleiUI1RAIEdFPyS5NyUhWSEnMS85JTERLKwSVFmXnpCokQPR75OSmpRQhp7fTUEieIHg1NBYghENlaANmyJWY=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiIJzfm5BSapTYl5yYmZRqkI1RA4EdFPyS5NyUhWK83NSUhHCysElRZl56QolmSWlOSA9EBMQCrTTU0uCQXo0NBUgRkDkagEsZSYs\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">classDiagram\r\n    class CompteBancaire {\r\n        -double solde\r\n        #String titulaireCompte\r\n        +getSolde() double\r\n    }<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiIJzfm5BSapTYl5yYmZRqkI1RA4EdFPyS5NyUhWK83NSUhHCysElRZl56QolmSWlOSA9EBMQCrTTU0uCQXo0NBUgRkDkagEsZSYs\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiIJTYl62Y3JyfmleiUI1RAIEdFPyS5NyUhWSEnMS85JTERLKwSVFmXnpCokQPR75OSmpRQhp7fTUEieIHg1NBYghENlaANmyJWY=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"XgBkvsQ\"><img alt=\"\" class=\"alignnone size-full wp-image-619\" decoding=\"async\" height=\"184\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a1903106882d.png\" width=\"249\"\/><\/p>\n<h3>3. Ma\u00eetriser les fl\u00e8ches de relation et les liens d&#8217;h\u00e9ritage<\/h3>\n<p>Pour montrer comment les classes interagissent dans votre mod\u00e8le de diagramme UML, reliez leurs identifiants \u00e0 l&#8217;aide de cha\u00eenes de relation sp\u00e9cifiques. Dans Mermaid, le sens de la ligne est important : la pointe de fl\u00e8che indique la classe parente ou conteneur.<\/p>\n<ul>\n<li><strong>H\u00e9ritage \/ G\u00e9n\u00e9ralisation (fl\u00e8che pointill\u00e9e ou pleine) :<\/strong> <code>Enfant --|&gt; Parent<\/code> (Repr\u00e9sente une relation \u00ab est un \u00bb).<\/li>\n<li><strong>R\u00e9alisation \/ Impl\u00e9mentation :<\/strong> <code>Classe ..|&gt; Interface<\/code> (Repr\u00e9sente une classe qui remplit un contrat d&#8217;interface).<\/li>\n<li><strong>Composition (Diamant plein) :<\/strong> <code>Enfant --* Parent<\/code> (Repr\u00e9sente une propri\u00e9t\u00e9 stricte ; si le parent meurt, l&#8217;enfant meurt aussi).<\/li>\n<li><strong>Agr\u00e9gation (Diamant clair) :<\/strong> <code>Enfant --o Parent<\/code> (Repr\u00e9sente une relation de collection l\u00e2che ; l&#8217;enfant peut exister ind\u00e9pendamment).<\/li>\n<li><strong>D\u00e9pendance :<\/strong> <code>ClasseA ..&gt; ClasseB<\/code> (Repr\u00e9sente une r\u00e9f\u00e9rence temporaire au moment de l&#8217;ex\u00e9cution).<\/li>\n<\/ul>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAAufEIgVd3Ro7hbDUjMzknFQFKwUlz7yM1KLMkmKFtKL8XCWIOte89My8VKBSLbAWkKpihYLEohKF\/DQlAHyeGXI=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgrD8zJLSolQFXd0aO4WwwyszMpNLc1IVrBSUPA6vLMosSVVISVWCKPXNL0ktLQKq1ILrAipzS8wsUShILCrJBCsFADPXH4U=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">classDiagram\r\n    Voiture --|&gt; V\u00e9hicule : \"H\u00e9rite de\"\r\n    Moteur --* Voiture : \"Fait partie de\"<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgrD8zJLSolQFXd0aO4WwwyszMpNLc1IVrBSUPA6vLMosSVVISVWCKPXNL0ktLQKq1ILrAipzS8wsUShILCrJBCsFADPXH4U=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAAufEIgVd3Ro7hbDUjMzknFQFKwUlz7yM1KLMkmKFtKL8XCWIOte89My8VKBSLbAWkKpihYLEohKF\/DQlAHyeGXI=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"wCxJKDf\"><img alt=\"\" class=\"alignnone size-full wp-image-620\" decoding=\"async\" height=\"416\" sizes=\"(max-width: 123px) 100vw, 123px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a1903163fbcf.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a1903163fbcf.png 123w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a1903163fbcf-89x300.png 89w\" width=\"123\"\/><\/p>\n<h2>Meilleures pratiques pour des agencements d&#8217;architecture de classes propres<\/h2>\n<ul>\n<li><strong>Regrouper visuellement les membres de la classe :<\/strong> Regroupez toujours vos variables de classe en haut du bloc de corps et vos fonctions en bas. Ce disposition correspond aux structures de classe standard des IDE et rend vos diagrammes imm\u00e9diatement lisibles.<\/li>\n<li><strong>Sp\u00e9cifiez les types de retour :<\/strong> Lors de la d\u00e9claration des m\u00e9thodes, ajoutez le type de retour \u00e0 la fin de la ligne de m\u00e9thode (par exemple, <code>+fetchData() DataSet<\/code>). Cela fournit \u00e0 votre \u00e9quipe d&#8217;ing\u00e9nierie un contexte d&#8217;impl\u00e9mentation pr\u00e9cis.<\/li>\n<li><strong>Maintenez la multiplicit\u00e9 claire :<\/strong> Pour indiquer les nombres d&#8217;\u00e9l\u00e9ments dans un tableau ou la taille d&#8217;une collection, ajoutez directement les cha\u00eenes de texte de multiplicit\u00e9 au cadre de la ligne de relation (par exemple, <code>Client \"1\" --o \"plusieurs\" Commande<\/code>).<\/li>\n<\/ul>\n<h2>Exemples r\u00e9els de diagrammes de classes Mermaid.js<\/h2>\n<h3>Exemple 1 : Sous-syst\u00e8me domaine Passerelle de paiement (Encapsulation et Interfaces)<\/h3>\n<p>Ce plan fonctionnel mod\u00e9lise un service de domaine de paiement en ligne. Il montre comment utiliser les modificateurs d&#8217;acc\u00e8s, regrouper les membres de classe et impl\u00e9menter proprement les relations d&#8217;interface.<\/p>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNq1UUFqw0AMvAfyhyWnhNI8IASfAsX0Ymj7AHVXcRd2pUUrtzVp\/147ToiTlNJLdBzNSDOSDZDzxkMtEKcT05XtEVNBG5G0EraYM4vZDd2+1mtPirIFi0Vxgu\/SQD5I5xC5IV2YV+aAQCOi4LYhd+TpJ5XugvY9nYzdPKn4hA+g+AHt2Mp936HaQPKP2F7jSC5x5\/ZFwm2M7pcFrp8FKINVzzTPCtrkhXln736N0w2sIPwRJ6LYNyAt3Y3Pe37Y5fKruP78yszKmAL2aJ4NuvME\/9H9AGFPu8s=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNq1UUFOAzEMvFfqH6KeWiH6AFTtCQlVXFaiPMAk7jZSYkeOS7sCHsQ7+FizXRBbihCX+jiesWdsGyDnWw+NQByPTCnbIaaGNiJpLWwxZxbz0ne7Wiw8KcoaLFbVN3yVevKndBqZFEhn5ok5INCAKbjekvsierfa0w\/a23g0tPOg4hPegeIO2qGX665DjYHk77E9x5Fc4mL3UcKFnB63BW5WApTBqmeaZgXdlnnP7N2vecrAGsIfeSKK3RRPS3fpA5+edj5\/rc6ff2Mmy5jCx3sH46QXnmb4l\/AAvUW\/BQ==\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">classDiagram\r\n    class PaymentProcessor {\r\n        &lt;&lt;interface&gt;&gt;\r\n        +processPayment(montant) boolean\r\n        +refundPayment(idTxn) boolean\r\n    }\r\n\r\n    class StripeGateway {\r\n        -String apiKey\r\n        -String endpointUrl\r\n        +processPayment(montant) boolean\r\n        +refundPayment(idTxn) boolean\r\n        -logTransaction(statut) void\r\n    }\r\n\r\n    class PayPalGateway {\r\n        -String merchantId\r\n        +processPayment(montant) boolean\r\n        +refundPayment(idTxn) boolean\r\n    }\r\n\r\n    StripeGateway ..|&gt; PaymentProcessor : \"Impl\u00e9mente\"\r\n    PayPalGateway ..|&gt; PaymentProcessor : \"Impl\u00e9mente\"<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNq1UUFOAzEMvFfqH6KeWiH6AFTtCQlVXFaiPMAk7jZSYkeOS7sCHsQ7+FizXRBbihCX+jiesWdsGyDnWw+NQByPTCnbIaaGNiJpLWwxZxbz0ne7Wiw8KcoaLFbVN3yVevKndBqZFEhn5ok5INCAKbjekvsierfa0w\/a23g0tPOg4hPegeIO2qGX665DjYHk77E9x5Fc4mL3UcKFnB63BW5WApTBqmeaZgXdlnnP7N2vecrAGsIfeSKK3RRPS3fpA5+edj5\/rc6ff2Mmy5jCx3sH46QXnmb4l\/AAvUW\/BQ==\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNq1UUFqw0AMvAfyhyWnhNI8IASfAsX0Ymj7AHVXcRd2pUUrtzVp\/147ToiTlNJLdBzNSDOSDZDzxkMtEKcT05XtEVNBG5G0EraYM4vZDd2+1mtPirIFi0Vxgu\/SQD5I5xC5IV2YV+aAQCOi4LYhd+TpJ5XugvY9nYzdPKn4hA+g+AHt2Mp936HaQPKP2F7jSC5x5\/ZFwm2M7pcFrp8FKINVzzTPCtrkhXln736N0w2sIPwRJ6LYNyAt3Y3Pe37Y5fKruP78yszKmAL2aJ4NuvME\/9H9AGFPu8s=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"dKUznWo\"><img loading=\"lazy\" alt=\"\" class=\"alignnone size-full wp-image-621\" decoding=\"async\" height=\"480\" loading=\"lazy\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19031bd8def.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19031bd8def.png 751w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19031bd8def-300x192.png 300w\" width=\"751\"\/><\/p>\n<p><strong>Analyse syntaxique :<\/strong> Le <code>&lt;&lt;interface&gt;&gt;<\/code> balise marque clairement `PaymentProcessor` comme un contrat architectural de haut niveau. Les deux classes d&#8217;impl\u00e9mentation concr\u00e8tes de passerelle utilisent des champs priv\u00e9s (<code>-apiKey<\/code>) pour les identifiants sensibles, tout en exposant des routines de paiement publiques (<code>+processPayment<\/code>) li\u00e9es par la fl\u00e8che de r\u00e9alisation (<code>..|&gt;<\/code>).<\/p>\n<h3>Exemple 2 : Moteur de traitement des commandes d&#8217;entreprise (Composition et multiplicit\u00e9)<\/h3>\n<p>Ce plan syst\u00e8me avanc\u00e9 mod\u00e9lise un sch\u00e9ma complexe de gestion des commandes e-commerce, illustrant comment documenter la propri\u00e9t\u00e9 structurelle et le nombre d&#8217;objets \u00e0 travers plusieurs classes interconnect\u00e9es.<\/p>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNp1UctqAzEMvAfyD8KnNmEDufZQKJtLTi2k\/QDVFqnBj62spYTQf6\/3kcTbbX2wYEbjGcnaYUo7i0dGv1xAPrpDoG6TRE8M5wHtztoGAT0Se1MQB2EbjhDQU4E2DjU9syG+u4e+DuT3clFa9czMJ3boxGSHQmDyVTPlu6Cq0T\/riAO6g6C0qZBqdLp1WfQaBV1OY2L77uj\/OHshP4tkMzhJ1IGfLQaxcirg4XFo2Gp6IX4LVv50ejKGKdfzfJNJmEjmuJ46jWgTUx6rjub3RNdfVFsFVRVBeQwnNa78AVT8CkkNvbe51XazWXX9q153bdbRZye6CC7xh7cfb33pwzYJJKofTEiiUg==\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNp1kM1KAzEUhfeFvsMlK6200K0LoUw3XSlUHyAmlxLIz3hzA0rxXVza55gXM5kZJeNoFgl8Jyfn3CgrY9wbeSLplgvISxUCTYocHBKcB1rWjfEMahQOuhKOTMafwEuHFW2tVHhPGunqGvpzEN+XizqqV2Y5odBJyF4ygs5bQ5j3SlqP+dmH5KU9suQUK6uSViWbTY+Bpc1tdEjPFv+vc2B0s0omw0mjAl+S9Gz4rcLD49CSUfiA9OQN\/5m005own+f5T0YmRJ5zNU0aaRtiHqsJ+vdEjTWYO4qtgPU6gGhtigYTRQFNcE56jXCbcYix+9QoBlcZ\/kcW281mVeyr\/pnapoLLzm\/Xrh8Gx7C7yU18bbuLNt0FofsQX0OsraY=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">classDiagram\r\n    class Customer {\r\n        +int customerId\r\n        +String name\r\n        +placeOrder() Order\r\n    }\r\n\r\n    class Order {\r\n        +int orderId\r\n        +Date dateCreated\r\n        -String internalStatus\r\n        +calculateTotal() double\r\n    }\r\n\r\n    class OrderItem {\r\n        +int itemId\r\n        +int quantity\r\n        +double pricePerUnit\r\n    }\r\n\r\n    class Address {\r\n        +String street\r\n        +String city\r\n        +String postalCode\r\n    }\r\n\r\n    Client \"1\" --o \"plusieurs\" Commande : \"poss\u00e8de\"\r\n    ItemCommande \"1..*\" --* \"1\" Commande : \"compose\"\r\n    Adresse \"1\" --&gt; Commande : \"exp\u00e9di\u00e9e \u00e0\"<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNp1kM1KAzEUhfeFvsMlK6200K0LoUw3XSlUHyAmlxLIz3hzA0rxXVza55gXM5kZJeNoFgl8Jyfn3CgrY9wbeSLplgvISxUCTYocHBKcB1rWjfEMahQOuhKOTMafwEuHFW2tVHhPGunqGvpzEN+XizqqV2Y5odBJyF4ygs5bQ5j3SlqP+dmH5KU9suQUK6uSViWbTY+Bpc1tdEjPFv+vc2B0s0omw0mjAl+S9Gz4rcLD49CSUfiA9OQN\/5m005own+f5T0YmRJ5zNU0aaRtiHqsJ+vdEjTWYO4qtgPU6gGhtigYTRQFNcE56jXCbcYix+9QoBlcZ\/kcW281mVeyr\/pnapoLLzm\/Xrh8Gx7C7yU18bbuLNt0FofsQX0OsraY=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNp1UctqAzEMvAfyD8KnNmEDufZQKJtLTi2k\/QDVFqnBj62spYTQf6\/3kcTbbX2wYEbjGcnaYUo7i0dGv1xAPrpDoG6TRE8M5wHtztoGAT0Se1MQB2EbjhDQU4E2DjU9syG+u4e+DuT3clFa9czMJ3boxGSHQmDyVTPlu6Cq0T\/riAO6g6C0qZBqdLp1WfQaBV1OY2L77uj\/OHshP4tkMzhJ1IGfLQaxcirg4XFo2Gp6IX4LVv50ejKGKdfzfJNJmEjmuJ46jWgTUx6rjub3RNdfVFsFVRVBeQwnNa78AVT8CkkNvbe51XazWXX9q153bdbRZye6CC7xh7cfb33pwzYJJKofTEiiUg==\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Modifier Mermaid dans VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"nhNYQKB\"><img loading=\"lazy\" alt=\"\" class=\"alignnone size-full wp-image-622\" decoding=\"async\" height=\"450\" loading=\"lazy\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190321054b5.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190321054b5.png 731w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190321054b5-300x185.png 300w\" width=\"731\"\/><\/p>\n<p><strong>Analyse syntaxique :<\/strong> Cet exemple illustre la diff\u00e9rence entre l&#8217;agr\u00e9gation et la composition. La fl\u00e8che en diamant plein (<code>--*<\/code>) montre qu&#8217;un `OrderItem` est \u00e9troitement li\u00e9 \u00e0 un `Order` (si une commande est supprim\u00e9e, ses articles individuels sont \u00e9galement d\u00e9truits). \u00c0 l&#8217;inverse, la fl\u00e8che en diamant clair (<code>--o<\/code>) indique qu&#8217;un `Customer` poss\u00e8de plusieurs commandes, mais que les deux entit\u00e9s peuvent exister ind\u00e9pendamment. Les cha\u00eenes de multiplicit\u00e9 (comme <code>\"1..*\"<\/code>) d\u00e9finissent les exigences relationnelles du syst\u00e8me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Qu&#8217;est-ce qu&#8217;un diagramme de classes ? Un Diagramme de classes diagramme structurel diagramme UML qui visualise l&#8217;architecture statique d&#8217;un syst\u00e8me logiciel orient\u00e9 objet. En tant que type de diagramme UML indispensable, il repr\u00e9sente les classes individuelles, les interfaces et les&#8230;<\/p>\n","protected":false},"author":4,"featured_media":2117,"parent":0,"menu_order":2,"template":"","meta":{"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}}},"ld_collection":[14],"class_list":["post-2116","ld_docs","type-ld_docs","status-publish","has-post-thumbnail","hentry","ld_collection-vpascode-docs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mermaid Class Diagram Syntax | VPasCode Text to Diagram Guide<\/title>\n<meta name=\"description\" content=\"Document code structures and object relationships using Mermaid class diagrams in VPasCode, a free diagram-as-code tool.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mermaid Class Diagram Syntax | VPasCode Text to Diagram Guide\" \/>\n<meta property=\"og:description\" content=\"Document code structures and object relationships using Mermaid class diagrams in VPasCode, a free diagram-as-code tool.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"VPasCode\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vpascode.com\/fr\/wp-content\/uploads\/sites\/6\/2026\/05\/img_6a190321054b5-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"731\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/\",\"name\":\"Mermaid Class Diagram Syntax | VPasCode Text to Diagram Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/wp-content\\\/uploads\\\/sites\\\/6\\\/2026\\\/05\\\/img_6a190321054b5-1.png\",\"datePublished\":\"2026-05-26T08:05:43+00:00\",\"description\":\"Document code structures and object relationships using Mermaid class diagrams in VPasCode, a free diagram-as-code tool.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/wp-content\\\/uploads\\\/sites\\\/6\\\/2026\\\/05\\\/img_6a190321054b5-1.png\",\"contentUrl\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/wp-content\\\/uploads\\\/sites\\\/6\\\/2026\\\/05\\\/img_6a190321054b5-1.png\",\"width\":731,\"height\":450},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lean Docs\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/docs\\\/%ld_collection%\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Guide de syntaxe des diagrammes de classes Mermaid.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/\",\"name\":\"VPasCode\",\"description\":\"by Visual Paradigm\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/#organization\",\"name\":\"VPasCode\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/wp-content\\\/uploads\\\/sites\\\/6\\\/2026\\\/06\\\/cropped-vp-online-logo-v1.png\",\"contentUrl\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/wp-content\\\/uploads\\\/sites\\\/6\\\/2026\\\/06\\\/cropped-vp-online-logo-v1.png\",\"width\":128,\"height\":138,\"caption\":\"VPasCode\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mermaid Class Diagram Syntax | VPasCode Text to Diagram Guide","description":"Document code structures and object relationships using Mermaid class diagrams in VPasCode, a free diagram-as-code tool.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","og_locale":"fr_FR","og_type":"article","og_title":"Mermaid Class Diagram Syntax | VPasCode Text to Diagram Guide","og_description":"Document code structures and object relationships using Mermaid class diagrams in VPasCode, a free diagram-as-code tool.","og_url":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","og_site_name":"VPasCode","og_image":[{"width":731,"height":450,"url":"https:\/\/www.vpascode.com\/fr\/wp-content\/uploads\/sites\/6\/2026\/05\/img_6a190321054b5-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","url":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","name":"Mermaid Class Diagram Syntax | VPasCode Text to Diagram Guide","isPartOf":{"@id":"https:\/\/www.vpascode.com\/fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vpascode.com\/fr\/wp-content\/uploads\/sites\/6\/2026\/05\/img_6a190321054b5-1.png","datePublished":"2026-05-26T08:05:43+00:00","description":"Document code structures and object relationships using Mermaid class diagrams in VPasCode, a free diagram-as-code tool.","breadcrumb":{"@id":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#primaryimage","url":"https:\/\/www.vpascode.com\/fr\/wp-content\/uploads\/sites\/6\/2026\/05\/img_6a190321054b5-1.png","contentUrl":"https:\/\/www.vpascode.com\/fr\/wp-content\/uploads\/sites\/6\/2026\/05\/img_6a190321054b5-1.png","width":731,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/www.vpascode.com\/fr\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vpascode.com\/fr\/"},{"@type":"ListItem","position":2,"name":"Lean Docs","item":"https:\/\/www.vpascode.com\/fr\/docs\/%ld_collection%\/"},{"@type":"ListItem","position":3,"name":"Guide de syntaxe des diagrammes de classes Mermaid.js"}]},{"@type":"WebSite","@id":"https:\/\/www.vpascode.com\/fr\/#website","url":"https:\/\/www.vpascode.com\/fr\/","name":"VPasCode","description":"by Visual Paradigm","publisher":{"@id":"https:\/\/www.vpascode.com\/fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vpascode.com\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/www.vpascode.com\/fr\/#organization","name":"VPasCode","url":"https:\/\/www.vpascode.com\/fr\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.vpascode.com\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/www.vpascode.com\/fr\/wp-content\/uploads\/sites\/6\/2026\/06\/cropped-vp-online-logo-v1.png","contentUrl":"https:\/\/www.vpascode.com\/fr\/wp-content\/uploads\/sites\/6\/2026\/06\/cropped-vp-online-logo-v1.png","width":128,"height":138,"caption":"VPasCode"},"image":{"@id":"https:\/\/www.vpascode.com\/fr\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.vpascode.com\/fr\/wp-json\/wp\/v2\/ld_docs\/2116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vpascode.com\/fr\/wp-json\/wp\/v2\/ld_docs"}],"about":[{"href":"https:\/\/www.vpascode.com\/fr\/wp-json\/wp\/v2\/types\/ld_docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.vpascode.com\/fr\/wp-json\/wp\/v2\/users\/4"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vpascode.com\/fr\/wp-json\/wp\/v2\/media\/2117"}],"wp:attachment":[{"href":"https:\/\/www.vpascode.com\/fr\/wp-json\/wp\/v2\/media?parent=2116"}],"wp:term":[{"taxonomy":"ld_collection","embeddable":true,"href":"https:\/\/www.vpascode.com\/fr\/wp-json\/wp\/v2\/ld_collection?post=2116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}