Author Topic: Using Composite Element as a Stereotype in MDG  (Read 4405 times)

ZuluTen

  • EA User
  • **
  • Posts: 56
  • Karma: +0/-0
    • View Profile
Using Composite Element as a Stereotype in MDG
« on: August 10, 2014, 03:56:25 am »
Using EA v11 I have successfully used patterns to build a number of behavioural and structural constructs – I have also embedded them in the toolbox of my MDG.

As an example, but not to be taken too literally, I have a generic DesktopComputer (of stereotype <<component>>) which is comprised of the following items which are of significance to my model:
MS Office <<Application>>
Skype <<Application>>
Windows 7 <<Operating System>>
Optical Disk Drive <<Interface>>
Gigabit LAN <<Interface>>
USB Socket #1 <<Interface>>
USB Socket#2 <<Interface>>
KVM<<Interface>>

Initially I built a single diagram showing the DesktopComputer<< component>> and inside it I placed the various interfaces and components.

I then saved the diagram as an xml pattern, listed it in the appropriate Toolbox Page Extension and combined it into the MDG.

That works fine:  My MDG Toolbox shows DesktopComputer as a stereotype, which when dragged and dropped onto a diagram (let’s call it the Generic_IT_Repository_Diagram) and named as “My_Company_Standard_Desktop_Design_Type_1” works fine, and the Project Browser shows that the ‘primary’ component contains all the relevant internal components.

Unfortunately however, when I then take instances of this component onto a deployment diagram, by dragging and dropping and using Paste As Instance, only the top level DesktopComputer appears on diagram, and the Project Browser shows it has not having the lower level components.

A bit of internet research revealed the concept of the Composite Element, so I re-built one of my patterns as a Composite Element complete with chain symbol, saved that as a pattern, incorporated in the Toolbox, but this time dragging from the Toobox fails to generate anything other than the single top level component, so that is worse than before.

I did, by the way, try simply dragging the Composite Element from the Project Browser and that works fine.

I’m unsure whether the problems are as a result of (a) my failure to use the correct elements, or; (b) an attempt on my part to use EA for something for which it was not intended, or; (c) an attempt on my part to breach the rules of UML.

Any help in resolving which would be much appreciated.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Using Composite Element as a Stereotype in MDG
« Reply #1 on: August 10, 2014, 05:13:36 am »
As I see it a composite element is still a sole element. It just has a diagram which shows how it binds a set of different (other) elements that collaborate. So making an instance of this compound will only instantiate the element itself.

If you want instances of other (embedded or via diagram means related) elements you have to write an add-in that will do this for you.

q.

ZuluTen

  • EA User
  • **
  • Posts: 56
  • Karma: +0/-0
    • View Profile
Re: Using Composite Element as a Stereotype in MDG
« Reply #2 on: August 10, 2014, 08:46:04 pm »
Thanks very much. Add In writing now in progress...