Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: mse on May 21, 2021, 06:41:59 pm
-
Suppose you have a class with an attribute typed by a class containing several attributes. How do you set the initial values? For simple types like integer, you just set Initial Value and you will see it show up in the class diagram as attribute = 0 but what about more complex types?
Class A
-timeStamp: Time
Class Time
-hours: int
-minutes: int
-seconds: int
I would like something like:
Class A
-timeStamp: {hours=1,minutes=20,seconds=24}
-
I don't think there's anything stopping you from writing that.
You could also do something like
timeStamp = new Time("01:20:24")
If your Time datatype has a constructor that takes a string.
Geert