{"id":2112,"date":"2026-05-26T08:05:43","date_gmt":"2026-05-26T08:05:43","guid":{"rendered":"https:\/\/www.vpascode.com\/pl\/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\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","title":{"rendered":"Przewodnik po sk\u0142adni diagramu klas Mermaid.js"},"content":{"rendered":"<h2>Co to jest diagram klas?<\/h2>\n<p>Diagram <strong>klas<\/strong> to strukturalny <strong>diagram UML<\/strong> kt\u00f3ry wizualizuje statyczn\u0105 architektur\u0119 systemu oprogramowania zorientowanego obiektowo. Jako niezast\u0105piony <strong>typ diagramu UML<\/strong>, mapuje indywidualne klasy, interfejsy i modele danych w Twojej aplikacji, jasno dokumentuj\u0105c ich wewn\u0119trzne pola (atrybuty), funkcje operacyjne (metody) oraz strukturalne relacje \u0142\u0105cz\u0105ce je ze sob\u0105. Ten szkic jest kluczowy dla in\u017cynier\u00f3w oprogramowania, kt\u00f3rzy musz\u0105 przekszta\u0142ca\u0107 wysokie poziomy projekt\u00f3w domenowe w czyste, utrzymywalne struktury obiektowe.<\/p>\n<p>Za pomoc\u0105 <strong>Mermaid.js<\/strong>, mo\u017cesz wykona\u0107 szkic swoich modeli danych i us\u0142ug systemowych za pomoc\u0105 intuicyjnych definicji opartych na tek\u015bcie. Silnik uk\u0142adu automatycznie oblicza rozmiary p\u00f3l, strukturu standardowych kom\u00f3rek danych UML i wyr\u00f3wnuje strza\u0142ki relacyjne na Twoim p\u0142\u00f3tnie bez konieczno\u015bci r\u0119cznego formatowania.<\/p>\n<h2>Podstawowy przewodnik sk\u0142adniowy: elementy i konstrukcje<\/h2>\n<p>Aby stworzy\u0107 dok\u0142adny, zgodny z normami diagram klas UML w Mermaid, musisz opanowa\u0107 deklaracje cz\u0142onk\u00f3w, modyfikatory dost\u0119pu oraz strza\u0142ki relacji strukturalnych.<\/p>\n<h3>1. Deklarowanie klas i kom\u00f3rek klas<\/h3>\n<p>Mo\u017cesz zdefiniowa\u0107 klas\u0119 za pomoc\u0105 dw\u00f3ch poprawnych format\u00f3w. Dla prostej klasy u\u017cyj s\u0142owa kluczowego <code>class<\/code>a nast\u0119pnie nazw\u0119 klasy. Je\u015bli chcesz od razu uwzgl\u0119dni\u0107 pola i metody, u\u017cyj ko\u0144cz\u0105cych si\u0119 klamr klamr, aby stworzy\u0107 jasny blok cia\u0142a:<\/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>Edytuj Mermaid w 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>Edytuj Mermaid w 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. Dodawanie widoczno\u015bci \/ modyfikator\u00f3w dost\u0119pu<\/h3>\n<p>Aby zarejestrowa\u0107 standardowe zasady hermetyzacji UML, umie\u015b\u0107 okre\u015blony symbol bezpo\u015brednio przed nazw\u0105 atrybutu lub metody, aby okre\u015bli\u0107 poziom jej widoczno\u015bci:<\/p>\n<ul>\n<li><code>+<\/code> **Publiczne:** Dost\u0119pne z dowolnej innej klasy.<\/li>\n<li><code>-<\/code> **Prywatne:** Dost\u0119pne wy\u0142\u0105cznie wewn\u0105trz deklaruj\u0105cej klasy.<\/li>\n<li><code>#<\/code> **Chronione:** Dost\u0119pne w klasie i jej podklasach.<\/li>\n<li><code>~<\/code> **Pakiet \/ Wewn\u0119trzny:** Dost\u0119pny w obr\u0119bie tej samej granicy pakietu.<\/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>Edytuj Mermaid w 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:eNpLzkksLnbJTEwvSszl5VIAgmSQiIJTYl62Y3JyfmleiUI1RAIEdFPyS5NyUhWSEnMS85JTERLKwSVFmXnpCokQPR75OSmpRQhp7fTUEieIHg1NBYghENlaANmyJWY=\" \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 BankAccount {\r\n        -double balance\r\n        #String accountHolder\r\n        +getBalance() double\r\n    }<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAgmSQiIJTYl62Y3JyfmleiUI1RAIEdFPyS5NyUhWSEnMS85JTERLKwSVFmXnpCokQPR75OSmpRQhp7fTUEieIHg1NBYghENlaANmyJWY=\" \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>Edytuj Mermaid w 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. Opanowanie strza\u0142ek relacji i \u0142\u0105czy dziedziczenia<\/h3>\n<p>Aby pokaza\u0107, jak klasy wzajemnie si\u0119 oddzia\u0142uj\u0105 w modelu diagramu UML, po\u0142\u0105cz ich identyfikatory za pomoc\u0105 specjalnych ci\u0105g\u00f3w relacji. W Mermaid kierunek linii ma znaczenie: g\u0142\u00f3wka strza\u0142ki wskazuje klas\u0119 nadrz\u0119dna lub kontenerow\u0105.<\/p>\n<ul>\n<li><strong>Dziedziczenie \/ Og\u00f3lnienie (przerywana lub pe\u0142na strza\u0142ka):<\/strong> <code>Child --|&gt; Parent<\/code> (Reprezentuje relacj\u0119 \u201ejest rodzajem\u201d).<\/li>\n<li><strong>Realizacja \/ Zaimplementowanie:<\/strong> <code>Class ..|&gt; Interface<\/code> (Reprezentuje klas\u0119 spe\u0142niaj\u0105c\u0105 kontrakt interfejsu).<\/li>\n<li><strong>Kompozycja (pe\u0142ny diament):<\/strong> <code>Child --* Parent<\/code> (Reprezentuje \u015bci\u015ble przynale\u017cne w\u0142a\u015bcicie\u0144stwo; je\u015bli rodzic umiera, to dziecko r\u00f3wnie\u017c umiera).<\/li>\n<li><strong>Agregacja (przezroczysty diament):<\/strong> <code>Child --o Parent<\/code> (Reprezentuje lu\u017an\u0105 relacj\u0119 zbiorow\u0105; dziecko mo\u017ce istnie\u0107 niezale\u017cnie).<\/li>\n<li><strong>Zale\u017cno\u015b\u0107:<\/strong> <code>ClassA ..&gt; ClassB<\/code> (Reprezentuje przej\u015bciowy odniesienie czasu dzia\u0142ania).<\/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>Edytuj Mermaid w 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:eNpLzkksLnbJTEwvSszl5VIAAufEIgVd3Ro7hbDUjMzknFQFKwUll6rM1JSqzOSqSoUqJYgy17z0zLxUoEotsA6gIq\/U4hKF5KojM4\/OTs480qoEAPKKHPg=\" \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    Car --|&gt; Vehicle : \"Dziedziczy z\"\r\n    Engine --* Car : \"Jest cz\u0119\u015bci\u0105\"<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNpLzkksLnbJTEwvSszl5VIAAufEIgVd3Ro7hbDUjMzknFQFKwUll6rM1JSqzOSqSoUqJYgy17z0zLxUoEotsA6gIq\/U4hKF5KojM4\/OTs480qoEAPKKHPg=\" \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>Edytuj Mermaid w 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>Najlepsze praktyki dla czystych uk\u0142ad\u00f3w architektury klas<\/h2>\n<ul>\n<li><strong>Wizualne grupowanie cz\u0142onk\u00f3w klasy:<\/strong> Zawsze grupuj zmienne klasy na pocz\u0105tku bloku cia\u0142a i funkcje na ko\u0144cu. Ten uk\u0142ad odpowiada standardowym strukturom klas w IDE i sprawia, \u017ce Twoje diagramy s\u0105 od razu czytelne.<\/li>\n<li><strong>Okre\u015bl typy zwracane:<\/strong> Podczas deklarowania metod, dodaj typ zwracany na ko\u0144cu linii metody (np. <code>+fetchData() DataSet<\/code>). Dzi\u0119ki temu tw\u00f3j zesp\u00f3\u0142 in\u017cynieryjny otrzymuje dok\u0142adne informacje o kontek\u015bcie implementacji.<\/li>\n<li><strong>Utrzymuj jasno\u015b\u0107 wielokrotno\u015bci:<\/strong> Aby wskaza\u0107 liczby tablic lub rozmiary kolekcji, dodaj ci\u0105gi tekstowe wielokrotno\u015bci bezpo\u015brednio do otoczki linii relacji (np. <code>Klient \"1\" --o \"wiele\" Zam\u00f3wienie<\/code>).<\/li>\n<\/ul>\n<h2>Przyk\u0142ady rzeczywistych diagram\u00f3w klas Mermaid.js<\/h2>\n<h3>Przyk\u0142ad 1: Podsystem domeny bramy p\u0142atno\u015bci (enkapsulacja i interfejsy)<\/h3>\n<p>Ten funkcjonalny szablon modeluje us\u0142ug\u0119 domeny p\u0142atno\u015bci online. Pokazuje, jak u\u017cywa\u0107 modyfikator\u00f3w dost\u0119pu, grupowa\u0107 cz\u0142onk\u00f3w klasy oraz czysto implementowa\u0107 relacje interfejs\u00f3w.<\/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>Edytuj Mermaid w 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:eNq1UUFOw0AMvFfqH1Y9tUL0AVWVExKKeolEeYC764ZFu\/bK65RG0L+TEBApRYhLfRzP2DO2DZDznYdaIE4npivbI6aCNiJpJWwxZxbzOnT7Wq89KcoeLBbFN3yTBvKndA6RG9KF2TEHBBoRBfcNuS+eHql0P2in6WTs5kHFJ7wHxRdox1Zu+w7VBpLfYHuJI7nEndtHCdcx+rEscL0VoAxWPdM8K2iTF+bA3v0apxtYQfgjTkSxT0Bauiuf9\/ywy+Vbcfn5lZmVMQXs0eYZZ4PyPMP\/lO9emr1t\" \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(amount) boolean\r\n        +refundPayment(txnId) boolean\r\n    }\r\n\r\n    class StripeGateway {\r\n        -String apiKey\r\n        -String endpointUrl\r\n        +processPayment(amount) boolean\r\n        +refundPayment(txnId) boolean\r\n        -logTransaction(status) void\r\n    }\r\n\r\n    class PayPalGateway {\r\n        -String merchantId\r\n        +processPayment(amount) boolean\r\n        +refundPayment(txnId) boolean\r\n    }\r\n\r\n    StripeGateway ..|&gt; PaymentProcessor : \"Implementuje\"\r\n    PayPalGateway ..|&gt; PaymentProcessor : \"Implementuje\"<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNq1UUFOw0AMvFfqH1Y9tUL0AVWVExKKeolEeYC764ZFu\/bK65RG0L+TEBApRYhLfRzP2DO2DZDznYdaIE4npivbI6aCNiJpJWwxZxbzOnT7Wq89KcoeLBbFN3yTBvKndA6RG9KF2TEHBBoRBfcNuS+eHql0P2in6WTs5kHFJ7wHxRdox1Zu+w7VBpLfYHuJI7nEndtHCdcx+rEscL0VoAxWPdM8K2iTF+bA3v0apxtYQfgjTkSxT0Bauiuf9\/ywy+Vbcfn5lZmVMQXs0eYZZ4PyPMP\/lO9emr1t\" \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>Edytuj Mermaid w 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>Analiza sk\u0142adni:<\/strong> Znacznik <code>&lt;&lt;interface&gt;&gt;<\/code> jasno oznacza `PaymentProcessor` jako kontrakt architektoniczny najwy\u017cszego poziomu. Dwie konkretne klasy implementacji bramki u\u017cywaj\u0105 p\u00f3l prywatnych (<code>-apiKey<\/code>) do przechowywania poufnych danych uwierzytelniaj\u0105cych, podczas gdy udost\u0119pniaj\u0105 publiczne procedury p\u0142atno\u015bci (<code>+processPayment<\/code>) po\u0142\u0105czone strza\u0142k\u0105 realizacji (<code>..|&gt;<\/code>).<\/p>\n<h3>Przyk\u0142ad 2: Silnik przetwarzania zam\u00f3wie\u0144 w przedsi\u0119biorstwie (kompozycja i wielokrotno\u015b\u0107)<\/h3>\n<p>Ten zaawansowany szablon systemu modeluje skomplikowan\u0105 struktur\u0119 zarz\u0105dzania zam\u00f3wieniami e-commerce, pokazuj\u0105c, jak dokumentowa\u0107 w\u0142asno\u015b\u0107 strukturaln\u0105 i liczb\u0119 obiekt\u00f3w mi\u0119dzy wieloma po\u0142\u0105czonymi klasami.<\/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>Edytuj Mermaid w 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:eNp1kU1OwzAQhfeVeoeRV1CUSt2yQELppmIBUmHDbrBHlYtjB2csBBWn4ghcjMkPwknACzv6Xp7fm0Q7bJqtxUPEarkAWbolUKaGQ0URTj1t14X1DHoQdiYT9hytP4DHijJaO9R0Gw3Fs3Pozl78WC7yqE6Z5YSWjkK2yARGtjKS7JlUDPnio+jR7Rk5NZlVo9PJiek+MDppY0J6cvR\/nR1TNatkBY4atfAloWfLbxnuL4c6Wk13FB+85T+Tro2JJOdp\/iUbjkQ853qcNNA6NDJWGcx0ohtnSTqqjYKiCKBeLTlS8IjV16c8e0twCUrsFg2q3vM7v9qs16vWuepumLieQ1UHn440+H6m6cOupq+btmPU7+jlJwb1DSZoryE=\" \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    Klient \"1\" --o \"wiele\" Zam\u00f3wienie : \"posiada\"\r\n    OrderItem \"1..*\" --* \"1\" Zam\u00f3wienie : \"komponuje\"\r\n    Address \"1\" --&gt; Zam\u00f3wienie : \"dostarczane do\"<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNp1kU1OwzAQhfeVeoeRV1CUSt2yQELppmIBUmHDbrBHlYtjB2csBBWn4ghcjMkPwknACzv6Xp7fm0Q7bJqtxUPEarkAWbolUKaGQ0URTj1t14X1DHoQdiYT9hytP4DHijJaO9R0Gw3Fs3Pozl78WC7yqE6Z5YSWjkK2yARGtjKS7JlUDPnio+jR7Rk5NZlVo9PJiek+MDppY0J6cvR\/nR1TNatkBY4atfAloWfLbxnuL4c6Wk13FB+85T+Tro2JJOdp\/iUbjkQ853qcNNA6NDJWGcx0ohtnSTqqjYKiCKBeLTlS8IjV16c8e0twCUrsFg2q3vM7v9qs16vWuepumLieQ1UHn440+H6m6cOupq+btmPU7+jlJwb1DSZoryE=\" \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>Edytuj Mermaid w 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>Rozbicie sk\u0142adni:<\/strong> Ten przyk\u0142ad ilustruje r\u00f3\u017cnic\u0119 mi\u0119dzy agregacj\u0105 a kompozycj\u0105. Strza\u0142ka z pe\u0142nym rombem (<code>--*<\/code>) pokazuje, \u017ce `OrderItem` jest silnie powi\u0105zany z `Order` (je\u015bli zam\u00f3wienie zostanie usuni\u0119te, jego poszczeg\u00f3lne pozycje r\u00f3wnie\u017c zostan\u0105 usuni\u0119te). Z kolei strza\u0142ka z pustym rombem (<code>--o<\/code>) wskazuje, \u017ce `Customer` posiada wiele zam\u00f3wie\u0144, ale obie encje mog\u0105 istnie\u0107 niezale\u017cnie. Ci\u0105gi wielokrotno\u015bci (takie jak <code>\"1..*\"<\/code>) definiuj\u0105 wymagania relacyjne systemu.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Co to jest diagram klas? Diagram klas to strukturalny diagram UML kt\u00f3ry wizualizuje statyczn\u0105 architektur\u0119 systemu oprogramowania zorientowanego obiektowo. Jako niezast\u0105piony typ diagramu UML, mapuje indywidualne klasy, interfejsy i modele danych w Twojej aplikacji, jasno dokumentuj\u0105c ich wewn\u0119trzne pola (atrybuty),&#8230;<\/p>\n","protected":false},"author":4,"featured_media":2113,"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-2112","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\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/\" \/>\n<meta property=\"og:locale\" content=\"pl_PL\" \/>\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\/pl\/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\/pl\/wp-content\/uploads\/sites\/9\/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=\"Szacowany czas czytania\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minuty\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/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\\\/pl\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/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\\\/pl\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#breadcrumb\"},\"inLanguage\":\"pl-PL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2026\\\/05\\\/img_6a190321054b5-1.png\",\"contentUrl\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2026\\\/05\\\/img_6a190321054b5-1.png\",\"width\":731,\"height\":450},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/docs\\\/vpascode-docs\\\/mermaid-js-class-diagram-syntax-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lean Docs\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/docs\\\/%ld_collection%\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Przewodnik po sk\u0142adni diagramu klas Mermaid.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/#website\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/\",\"name\":\"VPasCode\",\"description\":\"by Visual Paradigm\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pl-PL\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/#organization\",\"name\":\"VPasCode\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2026\\\/06\\\/cropped-vp-online-logo-v1.png\",\"contentUrl\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2026\\\/06\\\/cropped-vp-online-logo-v1.png\",\"width\":128,\"height\":138,\"caption\":\"VPasCode\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/pl\\\/#\\\/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\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","og_locale":"pl_PL","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\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","og_site_name":"VPasCode","og_image":[{"width":731,"height":450,"url":"https:\/\/www.vpascode.com\/pl\/wp-content\/uploads\/sites\/9\/2026\/05\/img_6a190321054b5-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Szacowany czas czytania":"4 minuty"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vpascode.com\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/","url":"https:\/\/www.vpascode.com\/pl\/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\/pl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vpascode.com\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.vpascode.com\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vpascode.com\/pl\/wp-content\/uploads\/sites\/9\/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\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#breadcrumb"},"inLanguage":"pl-PL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vpascode.com\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/"]}]},{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/www.vpascode.com\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#primaryimage","url":"https:\/\/www.vpascode.com\/pl\/wp-content\/uploads\/sites\/9\/2026\/05\/img_6a190321054b5-1.png","contentUrl":"https:\/\/www.vpascode.com\/pl\/wp-content\/uploads\/sites\/9\/2026\/05\/img_6a190321054b5-1.png","width":731,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/www.vpascode.com\/pl\/docs\/vpascode-docs\/mermaid-js-class-diagram-syntax-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vpascode.com\/pl\/"},{"@type":"ListItem","position":2,"name":"Lean Docs","item":"https:\/\/www.vpascode.com\/pl\/docs\/%ld_collection%\/"},{"@type":"ListItem","position":3,"name":"Przewodnik po sk\u0142adni diagramu klas Mermaid.js"}]},{"@type":"WebSite","@id":"https:\/\/www.vpascode.com\/pl\/#website","url":"https:\/\/www.vpascode.com\/pl\/","name":"VPasCode","description":"by Visual Paradigm","publisher":{"@id":"https:\/\/www.vpascode.com\/pl\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vpascode.com\/pl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pl-PL"},{"@type":"Organization","@id":"https:\/\/www.vpascode.com\/pl\/#organization","name":"VPasCode","url":"https:\/\/www.vpascode.com\/pl\/","logo":{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/www.vpascode.com\/pl\/#\/schema\/logo\/image\/","url":"https:\/\/www.vpascode.com\/pl\/wp-content\/uploads\/sites\/9\/2026\/06\/cropped-vp-online-logo-v1.png","contentUrl":"https:\/\/www.vpascode.com\/pl\/wp-content\/uploads\/sites\/9\/2026\/06\/cropped-vp-online-logo-v1.png","width":128,"height":138,"caption":"VPasCode"},"image":{"@id":"https:\/\/www.vpascode.com\/pl\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.vpascode.com\/pl\/wp-json\/wp\/v2\/ld_docs\/2112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vpascode.com\/pl\/wp-json\/wp\/v2\/ld_docs"}],"about":[{"href":"https:\/\/www.vpascode.com\/pl\/wp-json\/wp\/v2\/types\/ld_docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.vpascode.com\/pl\/wp-json\/wp\/v2\/users\/4"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vpascode.com\/pl\/wp-json\/wp\/v2\/media\/2113"}],"wp:attachment":[{"href":"https:\/\/www.vpascode.com\/pl\/wp-json\/wp\/v2\/media?parent=2112"}],"wp:term":[{"taxonomy":"ld_collection","embeddable":true,"href":"https:\/\/www.vpascode.com\/pl\/wp-json\/wp\/v2\/ld_collection?post=2112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}