2

I'm new to using PlantUML and would like some clarification if some specific actions are even possible or how they could be solved otherwise!

  1. Class Diagram: How to address relationships from a whole package (3 different classes) to one specific class in another package

  2. Component Diagram: How to address a relationship from an actor to a component? How to change packagestyle to different styles such as <>, <> etc.

This is the code I have tried for creating a relationship between actor and component, but it clearly doesn't work ^^':

package "StudyFun: Systemkontextdiagramm - Gesamsystem" {
allowmixing

Schüler --> [comp1]

component comp1 [
    <<business system>> 
        <b>StudyFun</b>]

actor Schüler

}

As seen in the picture, I would just want to create a line between Actor and component, if it can be solved without creating a relationship, please let me know :)

Current diagram

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111
Alexy
  • 23
  • 7
  • Actors are not really part of component diagrams. Maybe you can use the C4 macros in PlantUML to get a Person instead? See https://github.com/plantuml-stdlib/C4-PlantUML#relationship-types – Fuhrmanator Nov 09 '22 at 13:49
  • Hi thank you for your reply, so far it's more of a Syntax error - others in my class have been able to find a solution, but I'll see if I can fix it! Thank you for your reply, I'll check out the link! – Alexy Nov 09 '22 at 14:10

1 Answers1

1

For question 1 (I'm not sure what you tried). It can work like this:

@startuml Package-to-class
skinparam style strictuml
hide empty members
package P1 {
    class A
    class B
    class C
}
package P2 {
    class X
    class Y
}
' link from pacage to class
P1 ..> X
@enduml

enter image description here

For question 2, just put the association after the declaration of the other things:

@startuml
allowmixing
package "StudyFun: Systemkontextdiagramm - Gesamsystem" {

component comp1 [
    <<business system>> 
        <b>StudyFun</b>]

actor Schüler

Schüler --> comp1

}
@enduml

enter image description here

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111