-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[uml] Scripts for rendering images files from _plantuml_ files #10
Changes from all commits
3db1996
b9c12ca
e5df1b4
38e69c8
9ba04fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@startuml | ||
|
||
class Localize { | ||
# esContent : String | ||
# usContent : String | ||
|
||
+ Localize(String esContent, String usContent) | ||
+ String greet(String lang) : String | ||
} | ||
|
||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@startuml | ||
|
||
class Mensaje { | ||
+ Mensaje(String esContent, String usContent) | ||
+ String greet() : String | ||
} | ||
|
||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@startuml | ||
|
||
!include ../variables.txt | ||
!include clase_localize.plantuml | ||
!include clase_mensaje.plantuml | ||
|
||
title $MiVar\n | ||
|
||
Localize <|-- Mensaje | ||
|
||
note left of Mensaje | ||
Plantuml soporta inclusión de archivos y | ||
utilización de variables!! | ||
|
||
Esto les permite definir sus clases y | ||
las relaciones en archivos separados. | ||
|
||
Por ejemplo "MiClaseNombre" no se encuentra | ||
definida en este archivo. | ||
|
||
NOTA: | ||
Les recomendamos implementar esta herramienta | ||
para mitigar los errores de inconsistencia en los | ||
diagramas uml. | ||
end note | ||
@enduml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!$MiVar = "<valor variable 'MiVar'>" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Diagramas UML | ||
|
||
|
||
**Recomendamos la utilización de PlantUML por las siguientes razones**: | ||
|
||
- Se pueden versionar los distintos diagramas | ||
- Existen herramientas que lo interpretan y no requiere la instalación de un software. Ver [aquí](#editor-online) | ||
- La utilización de `include` y *variables* facilita la actualización de los diagramas | ||
|
||
## Herramientas | ||
|
||
### Plantuml | ||
|
||
Para trabajar localmente con [Plantuml](https://plantuml.com/) necesitará instalar la aplicación java. Las instrucciones las encontrarán [aquí](https://plantuml.com/starting). | ||
|
||
### Script de traducción | ||
|
||
Utilizando el script `render_diagrams.sh` se pueden generar los archivos `*.png` asociados a cada uno de los diagramas cuyo archivo es `*.plantuml`. | ||
|
||
Este script inspecciona la carpeta `diagrams/`. | ||
|
||
Forma de ejecución: | ||
|
||
```bash | ||
scripts/render_diagrams.sh | ||
``` | ||
Comment on lines
+24
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Se puede agregar un There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Me siento discriminado como usuario de zsh XD There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Jajaj podemos cambiarlo! Pero habría que hacerlo con todos |
||
|
||
**Nota 1:** | ||
|
||
El script requiere que la herramienta [plantuml](#plantuml) esté instalada. | ||
|
||
**Nota 2:** | ||
|
||
No contamos con un script para sistemas operativos Windows. Cualquier colaboración es aceptada. Para más información revisar [guía de desarrollo](../docs/Desarrollo.md). | ||
|
||
### Editor online | ||
|
||
**Nota:** | ||
Es útil para pequeños ensayos de notación. | ||
|
||
- [Plantuml Editor](https://plantuml-editor.kkeisuke.com/) | ||
- [Plant Text](https://www.planttext.com/) | ||
|
||
### IDE como editor | ||
|
||
Existen múltiples plugins para interpretar estos archivos | ||
|
||
|
||
| Herramienta | Version | Plugin | Version | | ||
|---------------------------|:-------:|------------------------------------------|:--------------:| | ||
| [VSCode][external_vscode] | v1.58.0 | [Plantuml extension][external_pplantuml] | v2.15.1 | | ||
| [Idea][external_idea] | 2020.3 | [Plantuml plugin][external_iplantuml] | v2.15.2/v5.5.1 | | ||
| [Emacs][external_emacs] | ? | [Plugin][external_emacs_plugin] | ? | | ||
|
||
## Ventajas | ||
|
||
[Plantuml](https://plantuml.com/) nos permite utilizar inclusión de archivos y utilización de variables! | ||
|
||
Esto les permitiría definir sus clases (una única vez) y utilizarlas en la definición de sus relaciones. | ||
|
||
Aquí pueden econtrar un ejemplo [ejemplo](../diagrams/) | ||
|
||
**Sugerencia:** | ||
|
||
Les recomendamos implementar esta herramienta para mitigar los errores de inconsistencia en los diagramas uml. | ||
|
||
[external_vscode]: https://code.visualstudio.com/Download | ||
[external_idea]: https://www.jetbrains.com/idea/ | ||
[external_emacs]: https://www.gnu.org/software/emacs/ | ||
[external_iplantuml]: https://plugins.jetbrains.com/plugin/7017-plantuml-integration | ||
[external_pplantuml]: https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml | ||
[external_emacs_plugin]: https://plantuml.com/emacs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
diagramsPath="diagrams" | ||
|
||
echo 'AVERTENCIA!!!' | ||
echo | ||
echo "Todos los archivos '*.png' dentro de \"$diagramsPath\" serán borrados." | ||
echo "Se regeneraran a partir de los archivos '*.plantuml'." | ||
echo | ||
|
||
read -t 3 -n 1 -p "Desea continuar (y/N)? " answer | ||
[ -z "$answer" ] && answer="n" | ||
|
||
if [ "$answer" == "y" ] | ||
then | ||
find $diagramsPath -name '*.plantuml' -exec plantuml -v {} \; | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package edu.fiuba.algo3.modelo; | ||
|
||
public class Localize { | ||
protected final String esContent; | ||
protected final String usContent; | ||
|
||
public Localize(String esContent, String usContent) { | ||
this.esContent = esContent; | ||
this.usContent = usContent; | ||
} | ||
|
||
public String greet(String lang) { | ||
if (lang.equals("us")) { | ||
return usContent; | ||
} | ||
|
||
return esContent; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
package edu.fiuba.algo3.modelo; | ||
|
||
public class Message { | ||
private final String content; | ||
public class Message extends Localize { | ||
|
||
public Message(String content) { | ||
this.content = content; | ||
public Message(String esContent, String usContent) { | ||
super(esContent, usContent); | ||
} | ||
|
||
public String greet() { | ||
return content; | ||
return super.greet("es"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Se puede poner solo dos
#
? Como para que quede con el mismo tamaño que el resto de los títulos