Author Topic: Extending the Model with a new Element  (Read 4716 times)

zxxz

  • Newbie
  • *
  • Posts: 9
Extending the Model with a new Element
« on: April 02, 2017, 18:09:18 PM »
Hello,

This old post: Adding New Elements and Relationships to Archi refers to Extending the Model with a new Element which is even older.

Before I get my hopes up, what would be the most up to date way to extend the Model with a new Element?
Is there any documentation that I can follow?

Thanks!
zxxz

Jean-Baptiste Sarrodie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 647
  • Archi Evangelist and Contributor. Visionary.
    • About me...
Re: Extending the Model with a new Element
« Reply #1 on: April 02, 2017, 19:10:33 PM »
Hi,

I'll let Phil provide a technical answer, but my question would be: why would you want to do that? This would no more be archimate and models created thus way could no more be opened without the "hacked" Archi.

JB
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

zxxz

  • Newbie
  • *
  • Posts: 9
Re: Extending the Model with a new Element
« Reply #2 on: April 02, 2017, 19:20:01 PM »
Hello JB,

Referring to Chapter 15 Language Customization Mechanisms in the specs it would still be (valid) Archimate  8).

I am aware of the portability issue that this would entail in regards to Archi but for the moment I can live with it and I have something in mind that might be portable (at the moment just an idea though...).

zxxz

Jean-Baptiste Sarrodie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 647
  • Archi Evangelist and Contributor. Visionary.
    • About me...
Re: Extending the Model with a new Element
« Reply #3 on: April 02, 2017, 19:28:54 PM »
Hi,

So there is some ununderstanding: Metamodel extension in Archi is not what ArchiMate call Language Customisation. There is currently no real way in Archi to match what Chapter 15 describe, but If you want to be close I'd suggest to simply use existing concepts and use the <<stereotype>> notation (or whatever you want) and add the stereotype name in a property (e.g. named stereotype). This way you'll be able to quickly identify concepts (through label) and also search them (through property). Of course, you wont have these new types in the palette, but you can easily create a small model containing only one view in which you put all these pre-set elements, and then open this view aside other views (just drag'n drop it where you want). Then using those elements is just a matter of doing a copy/paste. Bonus: in addition to properties and label, you'll also copy/paste visual attributes (color, font...) which can make sens in this contexte.

Regards,

JB
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

zxxz

  • Newbie
  • *
  • Posts: 9
Re: Extending the Model with a new Element
« Reply #4 on: April 02, 2017, 20:19:18 PM »
Hello,

I understand the <<stereotype>> approach (and the notation proposed by Gerben) but that's not what I am looking for.

I am curious to see if I can create new elements as specialisations of existing ones; for example creating Concern as specialisation of Driver, or Mobile Device from Device, or Threat from Assessment, etc.
The specialised elements would just have a different icon and inherit all relation rules from the parent one: this way there would be no portability issue (at least in theory) because a "vanilla" Archi would just show the default icon.

This is just a "pet project" I have in mind, and if I can make it happen I would gladly share it with the community (if there is any interest of course).

Thanks for your support.
zxxz

Jean-Baptiste Sarrodie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 647
  • Archi Evangelist and Contributor. Visionary.
    • About me...
Re: Extending the Model with a new Element
« Reply #5 on: April 02, 2017, 20:33:28 PM »
Hi,

What you describe is the same as the stereotype. The only difference being that you want different icon istead of the <<stereotype>> label. In Archi you can't do what you want because extending the model will not work the way you think: there will be no inheritance, so (e.g.) a Threat will not share allowed relationships with Assessment.

What would be more aligned with what you want would be to change the code responsible for drawing shapes and icons to draw custom icons depending on whether or not a property named stereotype exists. That's an approach that would not require any metamodel change but would have the effect you want. And in this case the model could be opened on a "vanilla" Archi without issues.

That's something we have in mind as part of a more profond redesign of the way figures are being drawn, so any help welcomed ;-)

Regards,

JB
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

zxxz

  • Newbie
  • *
  • Posts: 9
Re: Extending the Model with a new Element
« Reply #6 on: April 02, 2017, 20:47:47 PM »
Hello,

Indeed, rendering a different icon according to the value of a stereotype property seems a good idea  :D
Moreover, expanding on that, controlling how an element is rendered using property values would enable the notation proposed by Gerben and avoid a "multi-line" editor.

I would happily help, is there a dedicated area I can read to get up to speed with your reasoning?

zxxz

Jean-Baptiste Sarrodie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 647
  • Archi Evangelist and Contributor. Visionary.
    • About me...
Re: Extending the Model with a new Element
« Reply #7 on: April 02, 2017, 21:01:10 PM »
I think the first thing woujld be to read this issue : https://github.com/archimatetool/archi/issues/170

Then maybe share on this forum your ideas so that we could build the full vision.
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

zxxz

  • Newbie
  • *
  • Posts: 9
Re: Extending the Model with a new Element
« Reply #8 on: April 02, 2017, 21:16:40 PM »
cedepz already looked into the code, it looks promising!

I will follow the Developer Resources and explore the code next week.

Phil Beauvoir

  • Archi Guy
  • Hero Member
  • *****
  • Posts: 1501
  • Archi Guy
    • Archi
Re: Extending the Model with a new Element
« Reply #9 on: April 03, 2017, 09:54:14 AM »
I agree with JB. You could make additions to the code and re-compile but your app would be an island unless you distributed your version as well.

To support this kind of thing properly is not trivial and would require many additional "hooks" for the model and for UI behaviour, and a description of the extended metamodel that would ship with the model instance so it could be opened (icons, colours, metamodel beahviour, relationship rules, drawing code to draw the icons, etc, etc).

Phil
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate

zxxz

  • Newbie
  • *
  • Posts: 9
Re: Extending the Model with a new Element
« Reply #10 on: April 03, 2017, 12:27:59 PM »
Hello Phil,

JB suggested to start here : https://github.com/archimatetool/archi/issues/170

Do you have any additional info I can look at?

Thanks,
zxxz

ChampagnePerry

  • Member
  • **
  • Posts: 11
Re: Extending the Model with a new Element
« Reply #11 on: April 12, 2017, 14:03:18 PM »
Hi,
Sorry if this is a bit late but I have a fairly detailed description of how to do this, can't post it today but I'll try to remember to do it tomorrow.

zxxz

  • Newbie
  • *
  • Posts: 9
Re: Extending the Model with a new Element
« Reply #12 on: April 13, 2017, 18:01:21 PM »
Hi,
Sorry if this is a bit late but I have a fairly detailed description of how to do this, can't post it today but I'll try to remember to do it tomorrow.

Hello,

Any chance you could share your detailed description  8) ?

Thanks!

Hervé

  • Hero Member
  • *****
  • Posts: 487
Re: Extending the Model with a new Element
« Reply #13 on: April 14, 2017, 22:19:25 PM »
I am also very interested on extending the model for technical elements (differentiating physical servers, virtual servers, routers, firewalls, san storage, and so on ...).

The eclipse framework allows to override classes, especially factories (i already use this functionality in my database plugin). I haven't looked at this part in detail yet, but the icons are managed by UIProvider classes that expose a getImage() method. As those classes are factories, they should be easily overridden to get the icon from a property.

If this is developed through a plugin, then people who will have the plugin will see the new icon. People who do not have the plugin will see the standard icon. I personally like plugins because it is much easier to maintain rather than forking the whole Archi code.

I'm available to discuss this further if you wish.

Best regards
Hervé

Koos

  • Newbie
  • *
  • Posts: 3
Re: Extending the Model with a new Element
« Reply #14 on: May 17, 2017, 08:25:20 AM »
+1

My use case is detailing a system architecture with a messaging model. If you want to do it the proper way, the de-facto standard is to use the Enterprise Integration Patterns from Gregor Hohpe (here and here). I think EIP would make a great addition to system architecture models.

The actual question on EIP in Archi has been asked already separately, but I think it's great value adder, and worth mentioning once more.

And ofcourse, as a Linux user I have nowhere else to go ;-(

Lastly: Enterprise Architect has an add-on for EIP.

Koos