Author Topic: Stereotype inheritance  (Read 2595 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1288
  • Karma: +95/-8
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Stereotype inheritance
« on: July 30, 2007, 08:36:19 pm »
Hello gurus,

If I in a UML profile define a prototype for a class, say, can I generalize it and have that work in f'rinstance code generation?
In other words, is prototype inheritance possible?
I've done some tests and they seem to indicate the answer is no, but then again I simply might not be getting it. It's happened before once.

Cheers,


/Uffe
« Last Edit: August 02, 2007, 09:16:29 pm by Uffe »
My theories are always correct, just apply them to the right reality.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Prototype inheritance
« Reply #1 on: July 31, 2007, 02:50:32 am »
I really don't know. But try this while you're waiting.

Try to read the MetaType property - this property applies to elements, connectors and diagrams. The documentation describes this as the "domain-specific meta type, as defined by an MDG Technology." This property is available through the API, and can also be captured (and displayed) by shape scripts (via #classifier.metatype# and similar). Perhaps this will give you the clue you need to solve the problem.

Please let us know if this gets you anywhere, or what the real solution is if you find it elsewhere.

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2652
  • Karma: +41/-2
    • View Profile
Re: Prototype inheritance
« Reply #2 on: July 31, 2007, 02:17:57 pm »
Uffe, I really don't understand the question, but I suspect the answer might be Patterns, not Profiles. Search for "UML Patterns" in the EA user guide, and if that doesn't help, describe what a "prototype for a class" looks like and what you want to do with it and I can try to give a better answer.
The Sparx Team
support@sparxsystems.com

Uffe

  • EA Practitioner
  • ***
  • Posts: 1288
  • Karma: +95/-8
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Stereotype inheritance
« Reply #3 on: July 31, 2007, 04:24:26 pm »
Hi again,


I am most dreadfully sorry - what was I drinking thinking? I meant stereotype, of course.

What I want to do is define a profile where a class stereotype S contains a tagged value of stereotype A (in the same profile).
I then want to create a stereotype B as a generalization of A (still in the same profile), and (in a class diagram that uses the profile) be allowed to use both <<A>> and <<B>> classes as values for the tagged value in an <<S>> class. This doesn't seem physically possible.

Sorry about the confusion, which I have now probably only added to. But the question remains: is there a way around this?

Cheers,


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

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2652
  • Karma: +41/-2
    • View Profile
Re: Prototype inheritance
« Reply #4 on: July 31, 2007, 05:02:36 pm »
I will describe a profile diagram that works on EA 7.0.814 (I'm sure it would be easier to include a diagram if only I knew how...)

So, "<<stereotype>> A" extends "<<metaclass>> Class", "<<stereotype>> S" extends "<<metaclass>> Class", "<<stereotype>> B" has a generalize connector to "<<stereotype>> A", and "<<stereotype>> S" has a <<tagged value>> association to "<<stereotype>> A" which has the Target Role name set to the name of the tagged value you want to create.

Now, if you save that profile and import it and drop one each of <<A>>, <<B>> and <<S>> onto a diagram, you will notice that <<S>> has a tagged value. Select the tagged value and click the "..." button on the right-hand side of its value field and the dialog that pops up will show both the <<A>> and <<B>> classes.

HTH :)
The Sparx Team
support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6852
  • Karma: +143/-103
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Prototype inheritance
« Reply #5 on: July 31, 2007, 06:50:43 pm »
Quote
I will describe a profile diagram that works on EA 7.0.814 (I'm sure it would be easier to include a diagram if only I knew how...)
Well, you could start by providing a place on the Sparx site to store diagrams related to the forums...  8)

Paolo

Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Prototype inheritance
« Reply #6 on: July 31, 2007, 08:17:13 pm »
Hello.... want to add images to your postings? Easy guys

    1. Pop along to http://www.imageshack.us
    2. Click sign up and register

That will get you a store to keep your images... free with no spam, ads or unpleasantnesses.

   3. Use EA or whatever to construct your diagram.
   4. Use Windows Snipping Tool to cut out your image.
   5. Pop along to imageshack, and upload your new cutting
   6. Grab the appropriate image URL
   7. Use forum's "Insert Image" tool, and then paste the URL in ya posting
[size=10] Vola!!! [/size] Pictures.

I've been using them for over a year, and all me little snips are still visible... They provide a number of Styles of Url, some with image Shack logo, but one is just the image.

Have fun, I expect to see much more engaging posts

Kevin


Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Prototype inheritance
« Reply #7 on: July 31, 2007, 08:30:48 pm »


It's the last one in the list, 'direct link to image'

Now do I get ago with ya MDG for VS 2k8 ?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2652
  • Karma: +41/-2
    • View Profile
Re: Prototype inheritance
« Reply #8 on: July 31, 2007, 08:33:35 pm »
Thanks Kevin. Let's see if this works then...


Well, it appears to. On my previous efforts to sign up for free picture hosting sites, it's only after I've gone through the long and laborious sign up process that I find out they only allow indirect linking.
The Sparx Team
support@sparxsystems.com

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6852
  • Karma: +143/-103
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Stereotype inheritance
« Reply #9 on: August 01, 2007, 01:13:01 am »
Quote
I am most dreadfully sorry - what was I drinking thinking? I meant stereotype, of course.
Hi Uffe,

Would you mind changing the title on the first post (To: Stereotype inheritance)?  This allows the Topic to display correctly in the Category.

You can use the Modify link to do it.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6852
  • Karma: +143/-103
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Prototype inheritance
« Reply #10 on: August 01, 2007, 01:17:34 am »
Quote
Hello.... want to add images to your postings? Easy guys
Hi Kevin,

My original request to Sparx to provide an area was so that the availability of the image location and the forum location would be more closely aligned.  Often, we see images unrendered because there's no path to the image site at that time.  If the text and images were collocated, this would be reduced...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Prototype inheritance
« Reply #11 on: August 01, 2007, 03:55:14 pm »
Hi Paolo... hope you're still good and happy

I've had that problem with other hosting sites,but ImageShack don't seem to do that (no limits on the number or duration of availability)... no real assurance that they wont at some stage, so it would be better if EA did something.

I suspect that most postings have a comparatively short useful life time

Kevin