Author Topic: UML profile and composite structure(s)  (Read 6554 times)

Martin Merkel

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
UML profile and composite structure(s)
« on: September 24, 2021, 08:42:14 pm »
Hi,
I'm researching a bit on UML profiles again and wonder if the following is possible with EA, respectively compliant to UML:

I create a profile with metaclass and a stereotype that extends the metaclass. I now add attributes to the stereotype that will end up as tagged values later when the stereotype is used in a model importing the profile.

I would however also like to add a complex structure to the stereotype (or the metaclass if this would be the way) similar to a composite structure diagram where I can model that one element consists of a certain number of parts.

At the end I would like to end up with a stereotype that when used enforces the individual parts of the element to be created as well.

Thanks,
Martin

qwerty

  • EA Guru
  • *****
  • Posts: 12814
  • Karma: +366/-295
  • I'm no guru at all
    • View Profile
Re: UML profile and composite structure(s)
« Reply #1 on: September 24, 2021, 09:31:12 pm »
Not sure if I got the point, but it looks like you should look into the creation of Patterns. Works ok, though I never though it a good idea to create UML patterns physically.

q.

Martin Merkel

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: UML profile and composite structure(s)
« Reply #2 on: September 28, 2021, 09:38:45 pm »
Hi,
sorry for the late reply.
What I'm trying to do is to build profiles for the object models of some industrial communication systems, this might be the CIP, Ethernet/IP or the CANopen, EtherCAT world.
In a regular class or composite structure diagram I could do something like this:



I have a class data object with a couple of attributes, but also properties with a multiplicity 1..255 that themselves are of type data element. I can do this in a class or composite structure diagram, but I did not figure out if something like this if possible within an UML profile.

Thanks,
Martin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11849
  • Karma: +460/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: UML profile and composite structure(s)
« Reply #3 on: September 28, 2021, 10:14:20 pm »
I don't see a reason why this would be problematic.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 12814
  • Karma: +366/-295
  • I'm no guru at all
    • View Profile
Re: UML profile and composite structure(s)
« Reply #4 on: September 28, 2021, 10:27:43 pm »
Looks like you need to look into Patterns (as said before).

q.

Modesto Vega

  • EA User
  • **
  • Posts: 821
  • Karma: +23/-8
    • View Profile
Re: UML profile and composite structure(s)
« Reply #5 on: September 29, 2021, 06:02:02 pm »
Looks like you need to look into Patterns (as said before).

q.
I guess it depends on how you use the term pattern. If you mean patterns as described in the GoF classic book, Design Patterns: Elements of Reusable Object-Oriented Software, I am not sure this is a design pattern. I interpret what Martin is describing as encapsulating levels of abstraction with the data element perhaps describing the (internal) physical data structure of the data object. I have encountered this problem, capturing levels of abstraction, with Sparx  and other tools before and I am still not clear how to tackle it.

P.S.: Nesting is also part of the levels of abstraction problem.

qwerty

  • EA Guru
  • *****
  • Posts: 12814
  • Karma: +366/-295
  • I'm no guru at all
    • View Profile
Re: UML profile and composite structure(s)
« Reply #6 on: September 29, 2021, 06:36:16 pm »
I mean the Sparx-term pattern. This will create a defined set of elements which will be part of your MDG / toolbox.

q.

Modesto Vega

  • EA User
  • **
  • Posts: 821
  • Karma: +23/-8
    • View Profile
Re: UML profile and composite structure(s)
« Reply #7 on: September 29, 2021, 08:07:20 pm »
I mean the Sparx-term pattern. This will create a defined set of elements which will be part of your MDG / toolbox.

q.
Perhaps I am missing something but I do not see how what Martin is proposing can be done through an MDG.

Martin seems to be proposing something like:
  • Have a data object extending the class metatype, with 3 properties (index, name and object type) and a collection/array of anywhere between 1 to 255 data elements
  • Have a data element extending the class metatype (or another metatype), with also 3 properties (subindex, name and data type)
  • Have a composite diagram in the MDG like the one shown in his September 28, 2021, 09:38:45 pm post.
If this can be done with an MDG I am missing a trick and would love to know how.

Martin Merkel

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: UML profile and composite structure(s)
« Reply #8 on: September 29, 2021, 08:40:45 pm »
Hi,
Modesto is describing pretty much what I would like to do. The reason why I used the profile approach is that I am able to use the attributes in my stereotype as tagged values when I later import the profile into another model. In fact there will be/are more attributes of type enumeration which enables me to nicely select for example a category mandatory, optional, or conditional later on via a drop down menu. However I did not manage to describe the additional composite structure that one object contains a number of elements with their own attributes (with the actual parameter values). Using a composition with attached multiplicities in the profile has no effect to the exported profile xml file. That's why I tried to use the composite structure approach, which appears not to solve the problem either.
Patterns I never used, so here I need to read. Also the profile approach seems to be described better in the EA literature (for example the training compendium).
Thanks,
Martin

qwerty

  • EA Guru
  • *****
  • Posts: 12814
  • Karma: +366/-295
  • I'm no guru at all
    • View Profile
Re: UML profile and composite structure(s)
« Reply #9 on: September 29, 2021, 11:05:20 pm »
Well, I know the Sparx docs are not the best read, but here you are: https://sparxsystems.com/enterprise_architect_user_guide/15.2/guidebooks/tools_ea_patterns.html

Basically you create some template and export that as pattern. Then you can use that XML export to be referenced in your toolbox (like any element or connector). Dragging that to the diagram will import the XMI as a new copy under the hood. There some wizard dialog which can be supressed so the copy is created in one piece.

q.

Martin Merkel

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: UML profile and composite structure(s)
« Reply #10 on: September 29, 2021, 11:33:51 pm »
Thanks for the link, I first started off with the EA user guide looking for patterns, but found a page further down which was more the usual dry EA documentation style.
Thanks, Martin
« Last Edit: September 29, 2021, 11:35:51 pm by Martin Merkel »

qwerty

  • EA Guru
  • *****
  • Posts: 12814
  • Karma: +366/-295
  • I'm no guru at all
    • View Profile
Re: UML profile and composite structure(s)
« Reply #11 on: September 30, 2021, 05:12:48 am »
I do have a chapter about patterns in my MDG book. It might be an easier read than the Sparx docs. Has a sample profile with a pattern to.

q.

Martin Merkel

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: UML profile and composite structure(s)
« Reply #12 on: September 30, 2021, 06:44:27 am »
That"s the one I don't have yet... Might change

qwerty

  • EA Guru
  • *****
  • Posts: 12814
  • Karma: +366/-295
  • I'm no guru at all
    • View Profile
Re: UML profile and composite structure(s)
« Reply #13 on: September 30, 2021, 08:07:09 am »
It did, as I noticed. If you have any feedback, please let me know. I'm about to extend/rewrite that book but that will take some time still...

q.