Author Topic: How do you organize your MDG?  (Read 5673 times)

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
How do you organize your MDG?
« on: February 12, 2014, 03:22:37 am »
Hi,

I started developing an MDG last year based on the fairly few and very rudimentary tutorials I found lingering the internet. Well, and a lot of help for here.

Now I wonder, how should you organize your MDG when it grows in size?

I have the following, simplified, set-up:
(package)Metamodel
«profile»Metaclasses
«profile»SystemView
«profile»StrategicView
«profile»RequirementView
...

(package)Toolbox
«profile»SystemView
«profile»StrategicView
«profile»RequirementView

(package)Diagram
«profile»Diagram


In total I have around 200 stereotypes sorted in 7 different profiles in the profile package. The reason I have them divided is because of the amount and I felt it would be quite cumbersome to have it all in the same packge. This is though not without drawback. I will return to this later.

For example in the metaclass-profile I have sorted all the metaclasses I use to avoid having duplicates all over the place. The other profiles have each their own purpose and are fairly seperated, but not totally. I also uses several diagrams (1-5) for each profile.

The toolbox is also divided in several profiles matching the profiles the metamodel. At the moment I don't really know why, except to keep it tidy.

When I generate a new MDG version I do a "Save package as UML" in the project browser for each of the profiles (quite tedious if I have changed several, because of the not-so-smart file dialog not rembering the last used name of that profile).

The main problem I have with this setup is:
EA don't fully support connection betweens different profiles when generating UML profiles this way. Extensions are fine, but not generalizations. You can't generalize a stereotype from another profile, unless you create the UML profile from the diagram instead of the profile-package.  With rougly different 20 diagrams I'm really not keen on generating profiles that way, not with the current file dialog forcing me change the name every time (you think it would learn after hundreds of times!  ;) I wish we had some AI in EA... ).

I'm thinking about looking into the possibility to create one massive autogenerated diagram including everything - just to create the needed xml-file for the MDG-generator. Any ideas how to generate such a beast? I guess I could script such a function, if there is no more elegant (e.g. pre-developed) solution.

Any thoughs/comments? How do you do? And do you know of any help/hints for the more advanced MDG developer anywhere (the sparx website isn't really helpful at times)?

Cheers!
« Last Edit: February 12, 2014, 03:23:38 am by Sorno »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How do you organize your MDG?
« Reply #1 on: February 12, 2014, 03:50:13 am »
I almost can follow your elaboration - but can't give a good advise. What I did once was to support the generation of the MDG via a script that saved all the profiles automatically to the [highlight]right[/highlight] file. EA still does not remember where I saved a profile the last time and eventually (often) you save the wrong profile at a wrong location. And you only find out that the whole MDG is no longer working. No indication where what went wrong.

What you should think off right now is: what happens when I have to change a profile. What happens to tagged values? How does  change reflect in the model? That can become a real nightmare.

q.

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: How do you organize your MDG?
« Reply #2 on: February 12, 2014, 04:02:50 am »
If its a nightmare I better not think about it right now, time to go home for the night. :)

Anyway, a script that save the profiles sounds neat. I didn't think about that.. if you could automatically generate profiles for each diagram I reckon the issue with generalizing between profiles is solved. (Thank god that the MDG generater remember which files to include.)

Is it in the reference/your book how to generate profiles from script?

Thanks for the hints (and heads up).

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How do you organize your MDG?
« Reply #3 on: February 12, 2014, 04:16:57 am »
No reference. That would have taken things too far. I'm planing to write up MDG in a separate book, but that will take some time to be finished.

You may mail me privately and I can try to find the script (actually it was written in Perl). That might give you some pointers.

q.
« Last Edit: February 12, 2014, 10:49:19 am by qwerty »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: How do you organize your MDG?
« Reply #4 on: February 12, 2014, 09:12:27 am »
Quote
You can't generalize a stereotype from another profile, unless you create the UML profile from the diagram instead of the profile-package.
Actually you can. What you need to do is create, in your local profile, a stereotype class named like "AnotherProfile::Stereo" and create the generalization to that. I think you also need to make it abstract, but I'm not sure on that. You do need to make sure that the local stereotype class has its own Extension to a Metaclass though.
The Sparx Team
[email protected]

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: How do you organize your MDG?
« Reply #5 on: February 12, 2014, 07:06:04 pm »
KP, To clarify:

When I add a Stereotype from another profile it automatically get the name AnotherProfile::Stereotype. Is that how you mean, or do I create a local stereotype and manually name it AnotherProfile::Stereotype?

I have got the following reply from Simon at support earlier:
Quote
Our developers advised that storing the metaclasses elsewhere should not be a problem.  The "Save as Profile" command iterates through stereotype elements on a diagram or in a package, depending on where you call the save from, so it is important that the stereotype elements are in the right place. EA is able to traverse any extension connectors it finds to wherever in the model the target metaclass elements are. You may experience issues however if you define stereotypes which generalize another stereotype from a different package.

But if I understand you correctly it would be allright, if the Anotherprofile::stereotype is connected to its extention in the external profile aswell? As in:
Code: [Select]
LogicalDataModel --generalize --> SystemView::DataModel --Extends-->Metaclasses:Package
A quick test I just did seems to support this, and thus the issue I was having was that I had not included the extension in the external profiles.

I can't get it to work... The only way I manage is by Save UML profile from the diagram.
« Last Edit: February 13, 2014, 02:59:20 am by Sorno »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: How do you organize your MDG?
« Reply #6 on: February 13, 2014, 09:10:00 am »
Quote
When I add a Stereotype from another profile it automatically get the name AnotherProfile::Stereotype. Is that how you mean, or do I create a local stereotype and manually name it AnotherProfile::Stereotype?
You need to create a local stereotype and it has to be given the fully-qualified name. It's the same as if you want to extend a stereotype from, say, SysML or BPMN. To see if it works, have a look at the XML that is created and find the generalizes attribute: it needs to contain the fully-qualified name.
The Sparx Team
[email protected]

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
Re: How do you organize your MDG?
« Reply #7 on: February 13, 2014, 07:07:39 pm »
I got it!

Thank you for the clarification. The parallell with using stereotypes form other MDG is even logical.  ;D I havn't thought of different profiles that way before.  (I tried a zillion different ways yesterday, and today I relized that I at the end didn't bother creating the full MDG bust using just the UML profile as is, which of course didn't work. Which explains my confusion why I thought it did work and then suddenly didn't.)

Cheers, that solved a heap of headache for me!
« Last Edit: February 13, 2014, 07:10:49 pm by Sorno »