Author Topic: Nesting /  Deviding of UML Profiles possible?  (Read 6768 times)

Stephanie

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Nesting /  Deviding of UML Profiles possible?
« on: June 07, 2007, 03:03:24 am »
Hi,

I modelled a rather big UML Profile, it contains almost 100 elements and is not clear (enough) anymore. Therefore I wanted to split it in several sub profiles.
When clicking on "Save package as UML Profile" on the "top"-profile package I would have expected that the stereotrypes of the top package and of all its subprofile packages are exported. But no.

As soon as I move a stereotype in a nested profile it is not included in the profile file during export (and therefore can not be used for modelling).

It seems that

(1)the UML metaclass element has to be in the same profile package as the stereotypes that extend it. Otherwise the stereotypes are not exported.

(2) UML profiles can not be nested at all, i.e. when I export a profile only the stereotypes of this package are exported, subpackages are omitted.

Am I right? Is there any way to improve the structure of big profiles?


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #1 on: June 07, 2007, 03:10:25 am »
I don't know Stephanie,

We see something like what you want in the BPMN add-in (at least up to version 1.3, and the 1.4 preview).

Have you tried exporting and importing them together, or perhaps exporting them as a Technology (capital meant to indicate the EA context for the word)? What about moving the root profile, then the child, in two separate operations?

If this is a hard limitation of EA then you should be filing a bug report, since this is quite likely to bite anyone who needs to work with a profile that is not fairly simple.

David
No, you can't have it!

Stephanie

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #2 on: June 07, 2007, 05:11:04 am »
Quote
Have you tried exporting and importing them together, or perhaps exporting them as a Technology (capital meant to indicate the EA context for the word)?


I tried to export it as technology, but failed. I am not so familiar with this but as far as I uderstood I would have to specify the path to my UML Profile (.xml) file for it. However  this requires that the modelled uml profile is fully exported to the profile xml file. However this is not the case.

Quote
What about moving the root profile, then the child, in two separate operations?


Does not work either, because of problem (1). The exported profile is empty because the meta class the stereotypes are derived from is in the parent folder (only). I even tried to add a link to the meta class in this subprofile, but this did not help either.

I have not investigated the BPMN add-in you mentioned yet. I will write a bug report about it, or better a feature request.


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Nesting /  Deviding of UML Profiles possible?
« Reply #3 on: June 07, 2007, 07:17:30 am »
I think this is worth a bug report, since it works for Sparx and does not work for us. Of course I could be wrong, but you have my permission to blame it on me.

If you get a workaround, or anything else useful from Sparx please publish it here.

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #4 on: June 07, 2007, 01:54:00 pm »
The recommended approach (EA 6.5 and earlier) for dividing large profiles is to create a number of small profiles, then use the command "Tools > Generate MDG Technology File" to bundle them together. You can either keep all your <<stereotype>> and <<metaclass>> elements in the one <<profile>> package and spread them amongst several diagrams (save the profiles by opening and right-clicking each diagram) or you can have several different <<profile>> packages with one diagram each. I prefer the former approach.

For EA 7.0, the approach will be to create a single large "Stereotypes profile" (if you used the approach with one <<profile>> package with several diagrams, then all you need to do is save the profile by right-clicking the package not the diagram and everything will be saved to a single profile) and a number of "Toolbox profiles" and bundle them into a single technology file as above. At least that will be the approach as soon as the documentation is finished (hopefully some time next week).
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #5 on: June 07, 2007, 02:44:36 pm »
Thanks Neil,

Sounds like you've made some real progress there.

David
No, you can't have it!

Stephanie

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #6 on: June 07, 2007, 11:11:43 pm »
Quote
save the profiles by opening and right-clicking each diagram


That's the solution for me. It never came to my mind to rightclick the diagram for saving it as a profile (EA is sometimes to complex for one single brain ;) ). Thanks a lot for the tip.

Stephanie

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #7 on: June 10, 2007, 04:23:47 am »
Quote
That's the solution for me.


I have to correct myself: This would be the solution for me, if it worked!
I have one single profile package that includes three diagrams and all of my stereotypes and metatypes (no subpackage).
When I rightclick on one of the diagrams that include only (links to) stereotypes but no metaclasses and say "Save as Profile", the saved profile is empty.

As soon as I include also the metaclasses the stereotypes extend in this diagram, then saving this diagram as profile works fine.

In other words, it seems that the metaclasses have to be in the same diagram as the stereotypes in order to have the stereotypes included in the profile.

Is this now a bug?


« Last Edit: June 10, 2007, 04:27:19 am by Stephanie »

Oliver Michalski

  • EA User
  • **
  • Posts: 116
  • Karma: +0/-0
    • View Profile
Re: Nesting /  Deviding of UML Profiles possible?
« Reply #8 on: June 10, 2007, 06:01:33 am »
Hi Stephanie,

>In other words, it seems that the metaclasses have to be in the same diagram as the stereotypes
in order to have the stereotypes include in the profile.

>Is this now a bug?

no it is not a bug, it is the normal proceeding. You can read some more information by searching
"Creating Profiles" in the EA Help File.

If you want to dividing a large profiles the best approach is:

1. Create a solution like this

<<profile>> MyProfile
-- <<profile>> MySubProfile1 (eg. Core)
   -- <<stereotype>> MyStereotype1
-- <<profile>> MySubProfile2 (eg. Utilities)
   -- <<stereotype>> MyStereotype2

2. Save each SubProfile (Save Package as UML Profile) in one Folder
3. Click Generate a new MDG Technology File (Main Menu Tools)
4. The name for the new Technolgy is MyProfile
5. Bundle the SubProfiles  and save the new Technology as MyProfile.xml in the same Folder
   like the SubProfiles
6. Import the Technology(Main Menu Tools)

Now you have the new Technology in the Resource View from EA. In the Context Menu you can found a
Command "Show Technology in UML Toolbox".

Regards Oliver

Stephanie

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #9 on: June 10, 2007, 08:56:00 am »
I comprehend your approach however it does not fully solve my problem regarding the "reusage" of one metaclass in several profiles. Your approach explains how to bundle several profiles together however there nothing like a "hierachy" inside.

In my opinion it lacks the following usecase:

I would like to express in my profile that an Action is either a "Function" or a "Message".

<<profile>> Main
- <<metaclass>> Action
- <<stereotype>> Function (extends Action)

<<profile>> Messages
- <<stereotype>> AbstractMessage (extends Action)
- <<stereotype>> Message1
- <<stereotype>> Message2
...

With your appproach I have to add the metaclass Class in both profiles. Otherwise the stereotypes of the profile <<Messages>> are not exported, right?
However then I loose relation between Messages and Functions, because there is no hint anymore that they extend the same metaclass (Action).

Did you get my point?

Oliver Michalski

  • EA User
  • **
  • Posts: 116
  • Karma: +0/-0
    • View Profile
Re: Nesting /  Deviding of UML Profiles possible?
« Reply #10 on: June 12, 2007, 07:40:44 am »
Hi Stephanie,

I believe you think in the wrong direction:

1.Action is a part from the UML-Metamodel and not a part from your profile. In your profile
  you define a special type from action (Message or Function) as a new object. In this sense there is no re-use from the object   action available

2.There is no relationship between function and message. Both a specializations (extensions) from the same basicobject and   nothing more.

3.Yes you must include the metaclass in your profile definition otherwise it does not function

Regards Oliver  ;)
« Last Edit: June 12, 2007, 07:41:25 am by olmich »

Stephanie

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #11 on: June 12, 2007, 01:25:29 pm »
You are right, in my little example "Function" and "Message" have nothing in common, but what if they had.

Let's say we introduce an abstract stereotype in between (this is actually what happens in my profile).

So the example would look like the following:

<<profile>> Main
- <<metaclass>> Action
- <<stereotype>> AbstractAction (extends Action)
- <<stereotype>> Function (derived from AbstractAction)

<<profile>> Messages
- <<stereotype>> AbstractMessage (extends AbstractAction)
- <<stereotype>> Message1 (extends AbstractMessage)
- <<stereotype>> Message2 (sxtends AbstractMessage)

There is no way to make this working, right?
The only way is  to "dublicate" Action and AbstractAction for the profile Messages, however I can not "share" the AbstractAction between the profiles and by this "inherit" the metaclass Action.

aeiben

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #12 on: November 06, 2007, 05:24:09 am »
Hi!

I have a similar problem as Stephanie had in June:

I want to define an abstract base-profile for architectural-styles and concrete profiles for concrete styles which have a "profile-application" relationship to the abstract base-profile, so that for each abstract stereotype at least one concrete stereotype needs to be created in the concrete style-profile and all constraints for the abstract stereotypes also apply to the concrete stereotypes:

<<profile>> AbstractStyle
<<metaclass>> Component
<<stereotype>> myAbstractComponent (extends Component)

<<profile>> ClientServerStyle
<<stereotype>> Client (derived from myAbstractComponent)
<<stereotype>> Server (derived from myAbstractComponent)

<<profile>> PipeAndFiltersStyle
<<stereotype>> Filter(derived from myAbstractComponent)

Now these profiles are not nested in one profile, but related by "profile-application":

<<profile>> ClientServerStyle
-<<apply>>->
<<profile>> AbstractStyle

<<profile>> PipeAndFiltersStyle
-<<apply>>->
<<profile>> AbstractStyle

I would have expected that after realising the "profile-application" relation between the concrete and the abstract profile and deriving the concrete stereotypes from the abstract stereotypes, I could create a concrete profile which include the concrete stereotypes with their constraints and the constraints of the abstract stereotypes, but the profiles are empty...

So my question is:
Has there been any process since June which helped to find a solution for the above described problem?

Best regards
Angela

Stephanie

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Nesting /  Deviding of UML Profiles possi
« Reply #13 on: November 06, 2007, 06:58:34 am »
No new improvements as far as I know.

I did a (terrible) workaround:

I moved the abstract stereotype from the astract profile to the concrete profile, saved it as UML profile, and then moved it back to the abstract profile. Awful, I know but the only way.

Moreover there is another bug that may cause profile problems (at least in 6.5). Here is the copy of the bug description (workaround included) I posted on EA bug report page:

ISSUE DETAILS
>
> Subject:  
>
> Inheritance of attributes in exported UML Profile
>
>
> Details:  
>
> It may happen that a super stereotype is written below its
> sub stereotype in the exported UML-Profile.
>
> If this is the case then the values of the super type are set
> for instances of the sub stereotype instead of applying the
> value of the substereo type.
>
> An Example:
>
> Stereotype <<Parent>>
>   attr1 = ""
>
> Stereotype <<Child>> generalises <<Parent>>
>   attr1 = "childvalue".
>
> In the case of error if this profile is saved and used later  
> for modelling, an element of stereotype <<Child>> has an
> empty tagged value "attr1". Expected is attr1 = "child".
>
> A soon as you "manipulate" the exported profile in such a way
> that the element of stereotype <<Parent>> is above <<Child>>
> in the xml structure, and reimport this profile, everything works fine.
>
> However I could not find out, why (suddenly) my <<Parent>>
> stereotype is not on top of <<Child>> anymore.
>
> I know that one cna change the order of stereotypes before
> export however this applies for "concrete" stereotypes only,
> not for abstract one (my case).
>
>
>
> Steps to Reproduce:  
>
> Create a profile as described in the example above, if
> <<Child>> is below <<Parent>> change the order manually in
> the xml file and then Import it  in EA.
>
> Create an element with the stereotype <<Child>> and check its
> tagged values.
> Error is succsessfully reproduced if attr1 as no value.