]> pere.pagekite.me Git - homepage.git/blobdiff - blog/index.rss
Generated.
[homepage.git] / blog / index.rss
index 69423e0e198eb32415bc5c46c1fb2d75d6944932..4d8878cb1393d28de7d55715f2e08b13222aeae1 100644 (file)
@@ -6,6 +6,156 @@
                 <link>http://people.skolelinux.org/pere/blog/</link>
                 <atom:link href="http://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
        
                 <link>http://people.skolelinux.org/pere/blog/</link>
                 <atom:link href="http://people.skolelinux.org/pere/blog/index.rss" rel="self" type="application/rss+xml" />
        
+       <item>
+               <title>PlantUML for text based UML diagram modelling - nice free software</title>
+               <link>http://people.skolelinux.org/pere/blog/PlantUML_for_text_based_UML_diagram_modelling___nice_free_software.html</link>
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/PlantUML_for_text_based_UML_diagram_modelling___nice_free_software.html</guid>
+                <pubDate>Mon, 25 Mar 2019 09:35:00 +0100</pubDate>
+               <description>&lt;p&gt;As part of my involvement with the
+&lt;a href=&quot;https://gitlab.com/OsloMet-ABI/nikita-noark5-core/&quot;&gt;Nikita
+Noark 5 core project&lt;/a&gt;, I have been proposing improvements to the
+API specification created by &lt;a href=&quot;https://www.arkivverket.no/&quot;&gt;The
+National Archives of Norway&lt;/a&gt; and helped migrating the text from a
+version control system unfriendly binary format (docx) to Markdown in
+git.  Combined with the migration to a public git repository (on
+github), this has made it possible for anyone to suggest improvement
+to the text.&lt;/p&gt;
+
+&lt;p&gt;The specification is filled with UML diagrams.  I believe the
+original diagrams were modelled using Sparx Systems Enterprise
+Architect, and exported as EMF files for import into docx.  This
+approach make it very hard to track changes using a version control
+system.  To improve the situation I have been looking for a good text
+based UML format with associated command line free software tools on
+Linux and Windows, to allow anyone to send in corrections to the UML
+diagrams in the specification.  The tool must be text based to work
+with git, and command line to be able to run it automatically to
+generate the diagram images.  Finally, it must be free software to
+allow anyone, even those that can not accept a non-free software
+license, to contribute.&lt;/p&gt;
+
+&lt;p&gt;I did not know much about free software UML modelling tools when I
+started.  I have used dia and inkscape for simple modelling in the
+past, but neither are available on Windows, as far as I could tell.  I
+came across a nice
+&lt;a href=&quot;https://modeling-languages.com/text-uml-tools-complete-list/&quot;&gt;list
+of text mode uml tools&lt;/a&gt;, and tested out a few of the tools listed
+there.  &lt;a href=&quot;http://plantuml.com/&quot;&gt;The PlantUML tool&lt;/a&gt; seemed
+most promising.  After verifying that the packages
+&lt;a href=&quot;https://tracker.debian.org/pkg/plantuml&quot;&gt;is available in
+Debian&lt;/a&gt; and found &lt;a href=&quot;https://github.com/plantuml/plantuml&quot;&gt;its
+Java source&lt;/a&gt; under a GPL license on github, I set out to test if it
+could represent the diagrams we needed, ie the ones currently in
+&lt;a href=&quot;https://github.com/arkivverket/noark5-tjenestegrensesnitt-standard/&quot;&gt;the
+Noark 5 Tjenestegrensesnitt specification&lt;/a&gt;.  I am happy to report
+that it could represent them, even thought it have a few warts here
+and there.&lt;/p&gt;
+
+&lt;p&gt;After a few days of modelling I completed the task this weekend.  A
+temporary link to the complete set of diagrams (original and from
+PlantUML) is available in
+&lt;a href=&quot;https://github.com/arkivverket/noark5-tjenestegrensesnitt-standard/issues/76&quot;&gt;the
+github issue discussing the need for a text based UML format&lt;/a&gt;, but
+please note I lack a sensible tool to convert EMF files to PNGs, so
+the &quot;original&quot; rendering is not as good as the original was in the
+publised PDF.&lt;/p&gt;
+
+&lt;p&gt;Here is an example UML diagram, showing the core classes for
+keeping metadata about archived documents:&lt;/p&gt;
+
+&lt;pre&gt;
+@startuml
+skinparam classAttributeIconSize 0
+
+!include media/uml-class-arkivskaper.iuml
+!include media/uml-class-arkiv.iuml
+!include media/uml-class-klassifikasjonssystem.iuml
+!include media/uml-class-klasse.iuml
+!include media/uml-class-arkivdel.iuml
+!include media/uml-class-mappe.iuml
+!include media/uml-class-merknad.iuml
+!include media/uml-class-registrering.iuml
+!include media/uml-class-basisregistrering.iuml
+!include media/uml-class-dokumentbeskrivelse.iuml
+!include media/uml-class-dokumentobjekt.iuml
+!include media/uml-class-konvertering.iuml
+!include media/uml-datatype-elektronisksignatur.iuml
+
+Arkivstruktur.Arkivskaper &quot;+arkivskaper 1..*&quot; &lt;-o &quot;+arkiv 0..*&quot; Arkivstruktur.Arkiv
+Arkivstruktur.Arkiv o--&gt; &quot;+underarkiv 0..*&quot; Arkivstruktur.Arkiv
+Arkivstruktur.Arkiv &quot;+arkiv 1&quot; o--&gt; &quot;+arkivdel 0..*&quot; Arkivstruktur.Arkivdel
+Arkivstruktur.Klassifikasjonssystem &quot;+klassifikasjonssystem [0..1]&quot; &lt;--o &quot;+arkivdel 1..*&quot; Arkivstruktur.Arkivdel
+Arkivstruktur.Klassifikasjonssystem &quot;+klassifikasjonssystem [0..1]&quot; o--&gt; &quot;+klasse 0..*&quot; Arkivstruktur.Klasse
+Arkivstruktur.Arkivdel &quot;+arkivdel 0..1&quot; o--&gt; &quot;+mappe 0..*&quot; Arkivstruktur.Mappe
+Arkivstruktur.Arkivdel &quot;+arkivdel 0..1&quot; o--&gt; &quot;+registrering 0..*&quot; Arkivstruktur.Registrering
+Arkivstruktur.Klasse &quot;+klasse 0..1&quot; o--&gt; &quot;+mappe 0..*&quot; Arkivstruktur.Mappe
+Arkivstruktur.Klasse &quot;+klasse 0..1&quot; o--&gt; &quot;+registrering 0..*&quot; Arkivstruktur.Registrering
+Arkivstruktur.Mappe --&gt; &quot;+undermappe 0..*&quot; Arkivstruktur.Mappe
+Arkivstruktur.Mappe &quot;+mappe 0..1&quot; o--&gt; &quot;+registrering 0..*&quot; Arkivstruktur.Registrering
+Arkivstruktur.Merknad &quot;+merknad 0..*&quot; &lt;--* Arkivstruktur.Mappe
+Arkivstruktur.Merknad &quot;+merknad 0..*&quot; &lt;--* Arkivstruktur.Dokumentbeskrivelse
+Arkivstruktur.Basisregistrering -|&gt; Arkivstruktur.Registrering
+Arkivstruktur.Merknad &quot;+merknad 0..*&quot; &lt;--* Arkivstruktur.Basisregistrering
+Arkivstruktur.Registrering &quot;+registrering 1..*&quot; o--&gt; &quot;+dokumentbeskrivelse 0..*&quot; Arkivstruktur.Dokumentbeskrivelse
+Arkivstruktur.Dokumentbeskrivelse &quot;+dokumentbeskrivelse 1&quot; o-&gt; &quot;+dokumentobjekt 0..*&quot; Arkivstruktur.Dokumentobjekt
+Arkivstruktur.Dokumentobjekt *-&gt; &quot;+konvertering 0..*&quot; Arkivstruktur.Konvertering
+Arkivstruktur.ElektroniskSignatur -[hidden]-&gt; Arkivstruktur.Dokumentobjekt
+@enduml
+&lt;/pre&gt;
+
+&lt;p&gt;&lt;a href=&quot;http://plantuml.com/class-diagram&quot;&gt;The format&lt;/a&gt; is quite
+compact, with little redundant information.  The text expresses
+entities and relations, and there is little layout related fluff.  One
+can reuse content by using include files, allowing for consistent
+naming across several diagrams.  The include files can be standalone
+PlantUML too.  Here is the content of
+&lt;tt&gt;media/uml-class-arkivskaper.iuml&lt;tt&gt;:&lt;/p&gt;
+
+&lt;pre&gt;
+@startuml
+class Arkivstruktur.Arkivskaper &lt;Arkivenhet&gt; {
+  +arkivskaperID : string
+  +arkivskaperNavn : string
+  +beskrivelse : string [0..1]
+}
+@enduml
+&lt;/pre&gt;
+
+&lt;p&gt;This is what the complete diagram for the PlantUML notation above
+look like:&lt;/p&gt;
+
+&lt;p&gt;&lt;img width=&quot;80%&quot; src=&quot;http://people.skolelinux.org/pere/blog/images/2019-03-25-noark5-plantuml-diagrameksempel.png&quot;&gt;&lt;/p&gt;
+
+&lt;p&gt;A cool feature of PlantUML is that the generated PNG files include
+the entire original source diagram as text.  The source (with include
+statements expanded) can be extracted using for example
+&lt;tt&gt;exiftool&lt;/tt&gt;.  Another cool feature is that parts of the entities
+can be hidden after inclusion.  This allow to use include files with
+all attributes listed, even for UML diagrams that should not list any
+attributes.&lt;/p&gt;
+
+&lt;p&gt;The diagram also show some of the warts.  Some times the layout
+engine place text labels on top of each other, and some times it place
+the class boxes too close to each other, not leaving room for the
+labels on the relationship arrows.  The former can be worked around by
+placing extra newlines in the labes (ie &quot;\n&quot;).  I did not do it here
+to be able to demonstrate the issue.  I have not found a good way
+around the latter, so I normally try to reduce the problem by changing
+from vertical to horizontal links to improve the layout.&lt;/p&gt;
+
+&lt;p&gt;All in all, I am quite happy with PlantUML, and very impressed with
+how quickly its lead developer responds to questions.  So far I got an
+answer to my questions in a few hours when I send an email.  I
+definitely recommend looking at PlantUML if you need to make UML
+diagrams.  Note, PlantUML can draw a lot more than class relations.
+Check out the documention for a complete list. :)&lt;/p&gt;
+
+&lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
+activities, please send Bitcoin donations to my address
+&lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
+</description>
+       </item>
+       
        <item>
                <title>Release 0.3 of free software archive API system Nikita announced</title>
                <link>http://people.skolelinux.org/pere/blog/Release_0_3_of_free_software_archive_API_system_Nikita_announced.html</link>
        <item>
                <title>Release 0.3 of free software archive API system Nikita announced</title>
                <link>http://people.skolelinux.org/pere/blog/Release_0_3_of_free_software_archive_API_system_Nikita_announced.html</link>
@@ -928,60 +1078,6 @@ remaining piece in the puzzle is Open Broadcast Encoder, but it depend
 on quite a lot of patched libraries which would have to be included in
 Debian first.&lt;/p&gt;
 
 on quite a lot of patched libraries which would have to be included in
 Debian first.&lt;/p&gt;
 
-&lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
-activities, please send Bitcoin donations to my address
-&lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
-</description>
-       </item>
-       
-       <item>
-               <title>Learn to program with Minetest on Debian</title>
-               <link>http://people.skolelinux.org/pere/blog/Learn_to_program_with_Minetest_on_Debian.html</link>
-               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Learn_to_program_with_Minetest_on_Debian.html</guid>
-                <pubDate>Sat, 15 Dec 2018 15:30:00 +0100</pubDate>
-               <description>&lt;p&gt;A fun way to learn how to program
-&lt;a href=&quot;https://www.python.org/&quot;&gt;Python&lt;/a&gt; is to follow the
-instructions in the book
-&quot;&lt;a href=&quot;https://nostarch.com/programwithminecraft&quot;&gt;Learn to program
-with Minecraft&lt;/a&gt;&quot;, which introduces programming in Python to people
-who like to play with Minecraft.  The book uses a Python library to
-talk to a TCP/IP socket with an API accepting build instructions and
-providing information about the current players in a Minecraft world.
-The TCP/IP API was first created for the Minecraft implementation for
-Raspberry Pi, and has since been ported to some server versions of
-Minecraft.  The book contain recipes for those using Windows, MacOSX
-and Raspian.  But a little known fact is that you can follow the same
-recipes using the free software construction game
-&lt;a href=&quot;https://minetest.net/&quot;&gt;Minetest&lt;/a&gt;.&lt;/p&gt;
-
-&lt;p&gt;There is &lt;a href=&quot;https://github.com/sprintingkiwi/pycraft_mod&quot;&gt;a
-Minetest module implementing the same API&lt;/a&gt;, making it possible to
-use the Python programs coded to talk to Minecraft with Minetest too.
-I
-&lt;a href=&quot;https://ftp-master.debian.org/new/minetest-mod-pycraft_0.20%2Bgit20180331.0376a0a%2Bdfsg-1.html&quot;&gt;uploaded
-this module&lt;/a&gt; to Debian two weeks ago, and as soon as it clears the
-FTP masters NEW queue, learning to program Python with Minetest on
-Debian will be a simple &#39;apt install&#39; away.  The Debian package is
-maintained as part of the Debian Games team, and
-&lt;a href=&quot;https://salsa.debian.org/games-team/unfinished/minetest-mod-pycraft&quot;&gt;the
-packaging rules&lt;/a&gt; are currently located under &#39;unfinished&#39; on
-Salsa.&lt;/p&gt;
-
-&lt;p&gt;You will most likely need to install several of the Minetest
-modules in Debian for the examples included with the library to work
-well, as there are several blocks used by the example scripts that are
-provided via modules in Minetest.  Without the required blocks, a
-simple stone block is used instead.  My initial testing with a analog
-clock did not get gold arms as instructed in the python library, but
-instead used stone arms.&lt;/p&gt;
-
-&lt;p&gt;I tried to find a way to add the API to the desktop version of
-Minecraft, but were unable to find any working recipes.  The
-&lt;a href=&quot;https://www.epiphanydigest.com/tag/minecraft-python-api/&quot;&gt;recipes&lt;/a&gt;
-I &lt;a href=&quot;https://github.com/kbsriram/mcpiapi&quot;&gt;found&lt;/a&gt; are only
-working with a standalone Minecraft server setup.  Are there any
-options to use with the normal desktop version?&lt;/p&gt;
-
 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
 activities, please send Bitcoin donations to my address
 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
 activities, please send Bitcoin donations to my address
 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;