Book a Demo

Author Topic: Best Practices for dealing with profiles and technologies  (Read 4072 times)

csoltenborn

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Best Practices for dealing with profiles and technologies
« on: September 13, 2020, 06:33:35 pm »
Hi,

I have developed an MDG technology which uses an enumeration to type some custom fields (and have done that within an own EA project). Now, I also would like to use that enumeration within my model (which will describe some data structures, but will also contain examples, thus the enumeration is indeed need within the profile and within the model).

Thus, I'm thinking about storing my profiles in a dedicated package of my actual model. I could then re-use my enumeration, and exporting profiles/technology in case of changes should not be affected.

My question is: Are there any drawbacks of doing this? Are there even best practices for dealing with profiles/technologies?

Related to this, dealing with technologies sucks: Paths are stored absolute, MDG technologies dialog does not remember selection of last MTS file, exporting a technology is a pain (manually export all profiles, then click through the MDG technologies dialog, then import updated version into target project). Am I missing something here? How are we supposed to do shared development of technologies? Is there a way to script this stuff, or even to integrate generation and deployment of the technology into some CI server such as Jenkins?

Thanks
Christian

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Best Practices for dealing with profiles and technologies
« Reply #1 on: September 13, 2020, 06:57:08 pm »
I think that you should make use of patterns here. You can export the enumeration and make it available as a pattern from the toolbox.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Best Practices for dealing with profiles and technologies
« Reply #2 on: September 13, 2020, 07:42:33 pm »
Yes, you can script stuff.
Here's an example of such a script that exports UML profiles and generates the MDG technology.
I tried to make it import my technology as well, but that didn't work.

With regards to shared development, all the developers use a mapped drive, that is version controlled. (Github/Azure Devops)
So the path to a file would be something like H:\GIT\MyMDG\Images\myStereotypeIcon.bmp

The only "real" problem is the searches. When including a search in an MDG you have to have that search in your profile.
If you don't then the search is not included. We make a habit of checking the differences in the MTS file to make sure nothing was accidentally left out.

Code: [Select]
'[path=\Framework\Tools\UML Profile]
'[group=UML Profile]
option explicit

!INC Local Scripts.EAConstants-VBScript
!INC Wrappers.Include

'
' Script Name: Generate UML profiles
' Author: Geert Bellekens
' Purpose: Generate the SAP UML profiles and then the KUL Modelling MDG
' Date: 2020-05-29
'
const outPutName = "Generate KUL Modelling MDG"

sub main
'create output tab
Repository.CreateOutputTab outPutName
Repository.ClearOutput outPutName
Repository.EnsureOutputVisible outPutName
'set timestamp
Repository.WriteOutput outPutName, now() & " Starting Generate KUL Modelling MDG", 0
'do the actual work
'SAP profile
Repository.WriteOutput outPutName, now() & " Generating SAP UML profile", 0
Repository.SavePackageAsUMLProfile "{3568ECD9-954A-4c00-A553-9BE406375B27}", ""
'SAP diagram profile
Repository.WriteOutput outPutName, now() & " Generating SAP diagram profile", 0
Repository.SavePackageAsUMLProfile "{7163EA81-3F15-4829-A3B0-48EFB4DBDAD8}", ""
'SAP toolbox profile
Repository.WriteOutput outPutName, now() & " Generating SAP toolbox profiles", 0
Repository.SaveDiagramAsUMLProfile "{0D8C2F43-E18B-4bd5-8F57-A3CD4B166018}", "" 'authorizations
Repository.SaveDiagramAsUMLProfile "{11F1B9B8-9B73-40bf-9170-189CBD2D8592}", "" 'BOPF
Repository.SaveDiagramAsUMLProfile "{2932FC32-C884-4379-8ADD-3728399862EA}", "" 'Application Components
'MDG file
Repository.WriteOutput outPutName, now() & " Generating MDG file", 0
Repository.GenerateMDGTechnology "G:\My Drive\Klanten Bellekens IT\KUL\MDG\KUL Modelling.mts"
'import technology (doesn't seem to work)
' dim mdgfile
' set mdgfile = new TextFile
' mdgFile.FullPath = "G:\My Drive\Klanten Bellekens IT\KUL\MDG\KUL Modelling MDG.xml"
' mdgfile.LoadContents
' dim mdgstring
' mdgstring = mdgFile.Contents
' dim success
' success = Repository.ImportTechnology(mdgFile.contents)
' if not success then
' Repository.WriteOutput outPutName, now() & "ERROR: importing KUL Modelling MDG" , 0
' end if
'set timestamp
Repository.WriteOutput outPutName, now() & " Finished Generate KUL Modelling MDG" , 0
end sub

main

Geert

csoltenborn

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Best Practices for dealing with profiles and technologies
« Reply #3 on: September 14, 2020, 04:19:30 pm »
Thanks, qwerty and Geert!

Pattern: I seem to understand that this would allow to transfer a set of classes from my Technology to my Model project - is that the idea here? However, I would still have to do that every time I perform changes on the classes contained in the pattern. Why would you not include the Technology part into the Model repository? Are there any technical reasons for that? After all, it's maybe a bit smelly to mix up model and metamodel hierarchies within one repository, but I also see benefits such as being able to quickly look at the definition of one tool I'm going to use on my model...

Scripting: thanks, Geert - works like a charm :-) Concerning working in teams - that's pretty close to what I'm going to do: I will just work on C:\<my technology>, which obviously is a Git repository.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Best Practices for dealing with profiles and technologies
« Reply #4 on: September 14, 2020, 04:49:03 pm »
I'm not sure about enumerations, but usually you need to have model elements needed for the profile in the same package. And exposing the profile definition itself to regular users will most likely cause more confusion than it will help. Via patterns you can just offer those parts needed by the stakeholders in a somewhat handy portion.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Best Practices for dealing with profiles and technologies
« Reply #5 on: September 14, 2020, 11:31:56 pm »
Hello,


I'm not aware of any published best practices regarding MDG Technologies. It's more along the lines of working it out as you go along and try to understand why what you tried didn't work. This forum is really your best source for guidance.

The main drawback of keeping the technology source model in [one of] the same project as end-use models is simply safety: someone might accidentally change or delete things, or inappropriately use elements from the technology source model in some other model. It also makes it possible for the modellers in that project to create new versions of the same technology, because they have access to the source model. If the source model is in a different project, they can't.
Whether these are concerns in your case, well that all depends. If it's only you then it probably doesn't matter, but you might get stuck on something and rage-delete the project, with unintended consequences. In general it is good practice to keep to one (possibly large and complex) goal for the modelling in each project; MDG technology authoring is one such goal, and I for one prefer keeping that stuff separate.

When you start working with scripts, you will find that those are much easier to manage if the authoring is done in a separate project. Otherwise it gets hard to see which is the source version of the script and which is the deployed version. Not impossible or anything, it just makes life that little bit harder.

The case you describe where you want to reuse an enumeration in both the source and target projects is in my opinion not strong enough, and in fact bad practice. A technology is such a fundamental underpinning of a model that if you make changes to it along the lines of redefining an enumeration (which can include adding and deleting values), you don't want that to automatically affect existing models. Such changes must be carefully considered, not auto-cascaded (and EA doesn't support such auto-cascading anyway).
Remember, the enumeration you use in your technology source model is not part of the technology. The technology instead contains a tagged value definition with those same values, but that is not the same thing (this sentence is Paolo bait). If you want to reuse a tagged value definition, that's perfectly doable but you'll have to create it as such in the source project and pass it along explicitly (Tagged Value Types in the technology creation wizard). You can use a tagged value definition instead of the enumeration in your source project, and the resulting technology will be identical.

MTS management is a bit of an annoyance, I agree. But if EA does not remember your MTS files, there is something wrong. It remembers up to 10 MTS files if memory serves, they're stored in the Windows registry under HKCU\Software\Sparx Systems\EA400\EA\MTS Recent File List. But perhaps you mean it doesn't remember the single most recent one and you're right, it doesn't do that.

The way to do shared development of a technology is to keep at least the MTS file, and preferably all the "published" profiles, on a file share. In addition, if you include search definitions in your technology, those must be managed because the source for those is in fact the user's %AppData%. EA does not provide any help with synchronizing search definitions between the members of a technology development team. But I believe that is the only gotcha; everything else works from a shared directory.

You could use a version control system, but the problem with that, as you've noted, is that paths are absolute. UNC paths are supported, but if you're using drive letters you need to synchronize those across the team as well.

If I may take a moment for a shameless plug, I have been working on an Add-In to help with MDG technology development, and the issues you raise are among those addressed in that Add-In. It doesn't fix everything, but it does make things easier.
I'm working on other things at the moment, but am expecting to release this before the end of the year. Won't be free, but won't cost much either.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Best Practices for dealing with profiles and technologies
« Reply #6 on: September 15, 2020, 12:11:29 am »
I should also add that continuous integration in any form is unlikely to work, because EA doesn't do server-side automation: the Object Model API requires an interactive session (although you can hide the main window if you need to).

/U
My theories are always correct, just apply them to the right reality.