Book a Demo

Author Topic: Setting attributes of subclasses  (Read 5679 times)

Gladio

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Setting attributes of subclasses
« on: November 04, 2015, 09:55:16 pm »
Hi Guy's,

I have the following issue and I have no idea how to deal with it.



There is an action "Set Age" which should set the age of the object Mike, where Mike is an object of the Class User.

My question now is: How do I realize this? If I drag&drop Mike into an activity diagram, it will placed as an object and I don't know how to show that the action "Set Age" is setting Mikes age.

Thanks in advance!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Setting attributes of subclasses
« Reply #1 on: November 04, 2015, 11:22:59 pm »
Create and drag the operation setAge onto the AD and see what happens  :)

q.
« Last Edit: November 04, 2015, 11:23:33 pm by qwerty »

Gladio

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Setting attributes of subclasses
« Reply #2 on: November 05, 2015, 06:18:41 pm »
Hi,

Set Age must no be necessarily an operation, I want it to be modeled as an action, so I don't see how this will help me.

What I want to depict is an specific Object-Flow from action item Set Age to Object Mike attribute UserInfo.Age instead of having an Object-Flow to Mike itself

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Setting attributes of subclasses
« Reply #3 on: November 05, 2015, 07:30:33 pm »
Quote
Hi,

Set Age must no be necessarily an operation, I want it to be modeled as an action, so I don't see how this will help me.

What I want to depict is an specific Object-Flow from action item Set Age to Object Mike attribute UserInfo.Age instead of having an Object-Flow to Mike itself
Right-Click on the flow and use the" Link to Element Feature" to link the flow to the attribute  If you then show the attribute on the class, the flow will go there.

HTH,
Paolo
(I think "Link to Element Feature" menu item is available for Flows)
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Setting attributes of subclasses
« Reply #4 on: November 05, 2015, 07:38:54 pm »
From the context menu of the action choose Structural Elements/Add New/ActionPin. Then create an object flow from the pin to Mike.

Additionally you may choose Information Flows Realized from the Object Flow.

q.
« Last Edit: November 05, 2015, 07:40:24 pm by qwerty »

Gladio

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Setting attributes of subclasses
« Reply #5 on: November 05, 2015, 10:07:57 pm »
Thanks for the hint (Link-To-Element feature).

But one final question:
In the project browser, I cant see any attribute of Mike. My assumption was, when I create an Attibute of the type User (Mike is from type User), I should be able to see all the attributes of all Subclasses which are defined in User):
- Address.Address
- Address.City
- Address.ZipCode
- UserInfo.Name
- UserInfo.Surname
- UserInfo.Age

But instead, Mike has no attributes. What is the reason for that. If I use Mike in my AD, and show all attributes, it still looks the same (left side), but I would like to have it like it is on the right side to be able to link my incoming edge.


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Setting attributes of subclasses
« Reply #6 on: November 05, 2015, 10:19:32 pm »
An object does not repeat the properties of its classifier. Instead you use the compartment to show run states of the latter. So the link will not work.

q.

Gladio

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Setting attributes of subclasses
« Reply #7 on: November 05, 2015, 11:02:10 pm »
Do you have any hints for realizing this design or is it usual to use the Object without any further detailed description of which attributes are affected?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Setting attributes of subclasses
« Reply #8 on: November 05, 2015, 11:27:28 pm »
As suggested above use the action pin. That's the common way.

q.