Skip to content

Latest commit

 

History

History
266 lines (211 loc) · 5.2 KB

slides-05-types-uml.fr.md

File metadata and controls

266 lines (211 loc) · 5.2 KB

Types de diagrammes UML

Types de diagrammes - Sequence

@startuml
hide footbox
actor user
participant webfrontend
participant webserver
participant hwdevice
participant os

user -> hwdevice ++ : power on
hwdevice -> hwdevice ++: boot process
hwdevice -> os ++: boot loader
os -> webserver **: launch
activate webserver
return success
os -> webfrontend **: launch
activate webfrontend
webfrontend -> webserver ++: request html ui
return html ui
webfrontend --> os : success
deactivate webfrontend
@enduml

Types de diagrammes - Sequence (suite)

@startuml
hide footbox
actor user
participant webfrontend
participant webserver
participant hwdevice
participant os

user ->> webfrontend ++: click on process button
webfrontend -> webserver ++: request processing result
webserver -> hwdevice ++: request sensor state\nsample (camera, etc)
return sensors states
webserver -> webserver ++: process sensor states
return result
webfrontend -> webfrontend ++: render into images
return images
webfrontend ->> user: images as light
@enduml

Types de diagrammes - Class

@startuml
interface Animal {
    +get_name(): str
    +get_legs(): Leg[]
}

class Leg
class Fin
class Dog {
    +barks()
}
class Master {
    +run()
}

Animal <|-- Dog: inherits
Animal <|-- Dolphin: inherits
Lion -|> Animal: inherits

Lion o--> "0-1" Dog: hold in its mouth
Lion o--> "0-1" Master: hold in its mouth
Dog *--> "4" Leg: has
Dolphin *--> "0" Leg
Dolphin *--> "1" Fin

Dog ..> Master: depends on its
@enduml

Types de diagrammes - Activity

@startuml
start
-> <u>**Systemd supports parallel boot!**</u>;
partition "System Boot" {
  fork
    partition "Update System" {
      if (requires updates?) then
        repeat :Download <u>*app*</u> update package;
        repeat while (not ok and retry count\nnot exhausted)
        if (download package?) then
          -[#green]->
          :Installing new <u>*app*</u> package;
        else
          -[#red]-> Cannot proceed, this is not safe!
          **shuting down** the system...;
          end
        endif
      endif
    }
  fork again
    :Launching postgres db;
    :Launching application backend;
  end fork
}
:Lauching application;
stop
@enduml

Types de diagrammes - Timing

@startuml
scale 1 as 100 pixels
Title Power of a street light as a function of time
legend
february 18 2017
end legend
header: Test MY-MODEL

robust "Street light power 80000 (kWh) as P" as P
robust "Requested (%)" as R
P has 0.07,0.06,0.05,0.04,0.03,0.02,0.01,0.00
R has 100,90,80,70,60,50,40,30,20,10,0

@0
P is 0.00: 15:00
R is 0
@1
P is 0.00
R is 0
@2
P is 0.02 : 17:00
R is 30
@3
P is 0.08 : Sun set
R is 80
@4
P is 0.04
R is 80
@enduml

Types de diagrammes - State

@startuml
state "Awaiting input" as State1
state "Looking for matches" as State2
state "Processing selection" as State4

[*] -> State1
State1 --> State2 : Input received
State1 --> [*] : Timeout
State2 --> State1 : No matches / To many matches
State2 --> State4 : Single match
State2 --> State3 : Multiple maches found
state State3 {
  [*] --> State3A
  state "CursorOnMatch1" as State3A
  state "CursorOnMatch2" as State3B
  State3A --> State3B: Arrow down
  State3A --> [*]: Enter / Esc / Ctrl+c
  State3B --> State3A: Arrow up
  State3B --> [*]: Enter / Esc / Ctrl+c
}

State3 --> [*] : Selection rejected / Aborted
State3 --> State4 : Single match selected
State4 --> [*]: Done
@enduml

Types de diagrammes - Use Case

@startuml
left to right direction
skinparam packageStyle rectangle
actor customer
actor clerk
rectangle checkout {
  customer -- (checkout)
  (checkout) .> (payment) : include
  (help) .> (checkout) : extends
  (checkout) -- clerk
}
@enduml

Types de diagrammes - Component

@startuml

package "Some Group" {
  HTTP - [First Component]
  [Another Component]
}
 
node "Other Groups" {
  FTP - [Second Component]
  [First Component] --> FTP
} 

cloud {
  [Example 1]
}


database "MySql" {
  folder "This is my folder" {
	[Folder 3]
  }
  frame "Foo" {
	[Frame 4]
  }
}


[Another Component] --> [Example 1]
[Example 1] --> [Folder 3]
[Folder 3] --> [Frame 4]

@enduml

Types de diagrammes - Autres UML

Voici d'autres diagrammes que je n'ai pas encore eu l'occasion ou trouvé le besoin d'utiliser: