3

I'm trying to create in UML a class called LocalStorageHandler that handles a database called LocalStorage, and i'm getting a syntax error. This is my uml code:

@startuml
package SomeGroup {
    class "LocalStorageHandler" {
    }

    database "LocalStorage" {
    }
}
@enduml

and this is the error message: the error

Presen
  • 1,809
  • 4
  • 31
  • 46

1 Answers1

1

You can shoehorn that in by using a package with the Database stereotype:

@startuml
package SomeGroup {
    class "LocalStorageHandler" {
    }
    package LocalStorage <<Database>> {
    }
}
@enduml

enter image description here

Alternatively, as Thomas Kilian noted, and to stay within UML specifications and have it remain a class, you can of course use an arbitrary stereotype on the class definition:

@startuml
package SomeGroup {
    class "LocalStorageHandler" {
    }
    class LocalStorage <<ArbitraryStereotype>> {
    }
}
@enduml

enter image description here

zb226
  • 9,586
  • 6
  • 49
  • 79