From c4fb43da54b6181881f6fe352d28a67405484781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Santanch=C3=A8?= Date: Fri, 27 Sep 2024 21:08:26 -0300 Subject: [PATCH] feat (model): component model with plantuml --- model/README.md | 22 ++++++ model/basics/components.iuml | 3 + model/basics/step-by-step.ipynb | 127 ++++++++++++++++++++++++++++++++ model/basics/step01-1.wsd | 6 ++ model/basics/step01-2.wsd | 6 ++ model/basics/step02.wsd | 6 ++ model/basics/step03.wsd | 17 +++++ model/web/hierarchical.wsd | 8 ++ model/web/web-model.md | 12 +++ 9 files changed, 207 insertions(+) create mode 100644 model/README.md create mode 100644 model/basics/components.iuml create mode 100644 model/basics/step-by-step.ipynb create mode 100644 model/basics/step01-1.wsd create mode 100644 model/basics/step01-2.wsd create mode 100644 model/basics/step02.wsd create mode 100644 model/basics/step03.wsd create mode 100644 model/web/hierarchical.wsd create mode 100644 model/web/web-model.md diff --git a/model/README.md b/model/README.md new file mode 100644 index 00000000..6834db33 --- /dev/null +++ b/model/README.md @@ -0,0 +1,22 @@ +# Modeling Tools + +## PlantUML +https://plantuml.com/ + +PlantUML is a tool that allows you to create UML diagrams from a simple textual description. It is used to create diagrams like sequence diagrams, use case diagrams, class diagrams, activity diagrams, component diagrams, state diagrams, object diagrams, and deployment diagrams. + +[Full Documentation](https://pdf.plantuml.net/PlantUML_Language_Reference_Guide_en.pdf) + +### Component Diagrams +https://plantuml.com/component-diagram + +#### Required Interfaces + +* [Summary of Required Interfaces](https://stackoverflow.com/questions/55077828/using-required-provided-interfaces-in-component-diagrams-plantuml) + +* Additional details at: +[Deployment Diagrams](https://plantuml.com/deployment-diagram) + +#### Extra Examples + +[Real World PlantUML](https://real-world-plantuml.com/?type=component) \ No newline at end of file diff --git a/model/basics/components.iuml b/model/basics/components.iuml new file mode 100644 index 00000000..55be3ead --- /dev/null +++ b/model/basics/components.iuml @@ -0,0 +1,3 @@ +!procedure $property($name) + portout $name +!endprocedure \ No newline at end of file diff --git a/model/basics/step-by-step.ipynb b/model/basics/step-by-step.ipynb new file mode 100644 index 00000000..5ec1a14e --- /dev/null +++ b/model/basics/step-by-step.ipynb @@ -0,0 +1,127 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "id": "27ce02ea-d456-4eb3-860c-64eb8665e250", + "metadata": {}, + "outputs": [], + "source": [ + "import iplantuml" + ] + }, + { + "cell_type": "markdown", + "id": "0eb0897e-edac-4370-bb72-97c73d0ce885", + "metadata": {}, + "source": [ + "# Step 1 - Components" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "4bc559a1-f44b-4ed8-a633-33f5ca1273b6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing output for /home/santanche/git/component2learn/model/basics/2eb61326-d47f-4210-9dc0-f7f37caa4d3f.uml to 2eb61326-d47f-4210-9dc0-f7f37caa4d3f.svg\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "TableScatterPlot" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "%%plantuml\n", + "\n", + "@startuml\n", + "\n", + "[Table]\n", + "[ScatterPlot]\n", + "\n", + "@enduml" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "2192dabb-c879-4863-bb9e-3b70d0a856e3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Writing output for /home/santanche/git/component2learn/model/basics/94315c6d-128c-49d2-a64d-d7d262251ddd.uml to 94315c6d-128c-49d2-a64d-d7d262251ddd.svg\n" + ] + }, + { + "data": { + "image/svg+xml": [ + "TableDataFlowScatterPlot" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "%%plantuml\n", + "\n", + "@startuml\n", + "\n", + "[Table] -( DataFlow\n", + "DataFlow - [ScatterPlot]\n", + "\n", + "@enduml" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1c4ebaef-1c49-4c40-b3dd-e1164675431f", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/model/basics/step01-1.wsd b/model/basics/step01-1.wsd new file mode 100644 index 00000000..8871ddfc --- /dev/null +++ b/model/basics/step01-1.wsd @@ -0,0 +1,6 @@ +@startuml + +[Table] +[ScatterPlot] + +@enduml \ No newline at end of file diff --git a/model/basics/step01-2.wsd b/model/basics/step01-2.wsd new file mode 100644 index 00000000..e61026dd --- /dev/null +++ b/model/basics/step01-2.wsd @@ -0,0 +1,6 @@ +@startuml + +component Table +component ScatterPlot + +@enduml \ No newline at end of file diff --git a/model/basics/step02.wsd b/model/basics/step02.wsd new file mode 100644 index 00000000..222df929 --- /dev/null +++ b/model/basics/step02.wsd @@ -0,0 +1,6 @@ +@startuml + +[Table] -( DataFlow +DataFlow - [ScatterPlot] + +@enduml \ No newline at end of file diff --git a/model/basics/step03.wsd b/model/basics/step03.wsd new file mode 100644 index 00000000..71909eac --- /dev/null +++ b/model/basics/step03.wsd @@ -0,0 +1,17 @@ +@startuml + +!include components.iuml + +component Table { + $property(file_path) +} +[Table] -( DataFlow + +component ScatterPlot { + $property(xfield) + $property(yfield) + $property(title) +} +DataFlow - [ScatterPlot] + +@enduml \ No newline at end of file diff --git a/model/web/hierarchical.wsd b/model/web/hierarchical.wsd new file mode 100644 index 00000000..a23dc0c2 --- /dev/null +++ b/model/web/hierarchical.wsd @@ -0,0 +1,8 @@ +@startuml + +component PacientList { + [Pesquisa] -[hidden]-> [PatientItem <>] + [PatientItem <>] -[hidden]-> [button] +} + +@enduml \ No newline at end of file diff --git a/model/web/web-model.md b/model/web/web-model.md new file mode 100644 index 00000000..ae841ae0 --- /dev/null +++ b/model/web/web-model.md @@ -0,0 +1,12 @@ +# Modelo de Feridas + +~~~plantuml +component PacientList { + [Pesquisa] -[hidden]-> [PatientItem <>] + [PatientItem <>] -[hidden]-> [button] +} +~~~ + +* Como especificaremos que um componente nosso especializa outro do shadcn? +* Como reduzir os nomes do shadcn na implementaĆ§Ć£o? +