file How to work with abstract attributes

1 year 11 months ago - 1 year 11 months ago #5302 by Ralf Ebert
Hi

I have several classes derived from a base class. Each derive class contain an ID with a class specific value, so I have defined this attribute in the base class as an abstract attribute. How can I model the class specific ID in the derived classes and make it visible on a class diagram?

Example:
BaseClass
  +ID: int <<abstract>> <<readonly>>
  +isActive: boolean

Class1 -----|> BaseClass
  +ID: int = 0x0000
  +otherAttribute: char


Class2 -----|> BaseClass
  +ID: int = 0x0001
  +someOtherAttribute: long

...


Best regards
Ralf Ebert

Please Log in or Create an account to join the conversation.

1 year 11 months ago #5321 by ebr
Hi Ralf,

For this you have to model an attribute on each specific derived class and specify their value by using the "Value" field cf below.

Attachments:

Please Log in or Create an account to join the conversation.

1 year 11 months ago #5323 by Ralf Ebert
Hi ebr,

yes but unfortunately I don't see the value in the diagram which is the only part which I can use in a documentation ...

Best regards
Ralf Ebert

Please Log in or Create an account to join the conversation.

1 year 11 months ago #5324 by ebr
Hi Ralf,

Actually it is not possible to show the "Value" content inside the diagram taht's would be a Modelio enhancement...

Best,
EBR

Please Log in or Create an account to join the conversation.

1 year 11 months ago #5325 by Ralf Ebert
Thank you for your information

Please Log in or Create an account to join the conversation.

1 year 11 months ago #5326 by Ralf Ebert
Sorry, but I must reopen the topic :-/

If I follow your suggestion I get a warning:
SMI.MASTER_IDENT|R1990|The Classifier 'SMI.MASTER_IDENT' has a duplicated name from its inherited Attributes and Roles : ArgBlockID

So I have two questions:
  1. Is this a bug in modelio
  2. I know, I can disable the rule, but in this case I will get no warnung if an attribute is really more than one time defined. Is it possible to disable a rule selectively for this case

I've attached a screenshot with the definition of the two classes.

Used version of modelio:
  • Version 3.7.01
  • Build: 201803142330
  • System: win32 (10.0)
  • Architecture: x86_64
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: tma
Time to create page: 14.647 seconds
^ Back to Top