From 23db73bafd8becb00b8a106a35a432f4ef4e0eeb Mon Sep 17 00:00:00 2001 From: Michel Grootjans Date: Mon, 30 Dec 2019 11:40:28 +0100 Subject: [PATCH] added plantUML exercise --- plantuml/gilded-rose.puml | 57 +++++++++++++++++++++++++++++++++++++++ plantuml/readme.md | 13 +++++++++ 2 files changed, 70 insertions(+) create mode 100644 plantuml/gilded-rose.puml create mode 100644 plantuml/readme.md diff --git a/plantuml/gilded-rose.puml b/plantuml/gilded-rose.puml new file mode 100644 index 00000000..08b5d7a1 --- /dev/null +++ b/plantuml/gilded-rose.puml @@ -0,0 +1,57 @@ +@startuml + +start +note left + Do this for each item in the list. + An item has a name, a sell in value and a quality value +end note + +if (not "Aged Brie" and not "Backstage passes to a TAFKAL80ETC concert") then (yes) + if (quality > 0) then (yes) + if (not "Sulfuras, Hand of Ragnaros") then (yes) + -lower quality with 1 + endif + endif +else (no) + if (quality < 50) then (yes) + -increase quality with 1 + if ("Backstage passes to a TAFKAL80ETC concert") then (yes) + if (sell in < 11) then (yes) + if (quality < 50) then (yes) + -increase quality with 1 + endif + endif + if (sell in < 6) then (yes) + if (quality < 50) then (yes) + -increase quality with 1 + endif + endif + endif + endif +endif + +if (not "Sulfuras, Hand of Ragnaros") then (yes) + -lower quality with 1 +endif + +if (sell in < 0) then (yes) + if (not "Aged Brie") then (yes) + if (not "Backstage passes to a TAFKAL80ETC concert") then (yes) + if (quality > 0) then (yes) + if (not "Sulfuras, Hand of Ragnaros") then (yes) + -lower quality with 1 + endif + endif + else (no) + -lower quality with quality + endif + else (no) + if (quality < 50) then (yes) + -increase quality with 1 + endif + endif +endif + +stop + +@enduml diff --git a/plantuml/readme.md b/plantuml/readme.md new file mode 100644 index 00000000..90628c47 --- /dev/null +++ b/plantuml/readme.md @@ -0,0 +1,13 @@ +# PlantUML +This UML refactoring exercise is aimed at less technical people like analysts, testsers and other non-programmers. The key takeaway message is clarifying the need for continuous refactoring to people who do not code on a daily basis. + +## Running and rendering +Several alternatives are available to render PlantUML, see https://plantuml.com/running. + +## Syntax +For the syntax of activity diagrams in PlantUML, please refer to https://plantuml.com/activity-diagram-beta + +# Exercise +You can find the original GildedRose challenge in the gilded-rose.puml file. + +If you want to illustrate how this activity diagram got to this state, you can show the requirements and the files under the /history directory. These individual files show the evolution of the activity diagram.