[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.uml2] Re: Question about extending classes with multiple stereotypes

Hi Alex,

I think you are right when you say: For I guessed multiple stereotypes for 
metaclasses are only possible if you make an extension for each one?
The Element.isStereotypeApplicable(), is implemented that way and I also 
confirmed this by playing around with the UML editor.

You are correct in creating a required stereotype by setting the lower bound 
of the extension end to 1.  Extension::isRequired() checks the lower bound 
of the first owned end.

So I'm not sure why you can succesfully apply the second stereotype as you 
mention.

Can you post a small piece of your profile and model so I can see what 
exactly is going on.

Cheers,
- James.




"Alex " <eistoeter@xxxxxx> wrote in message 
news:99faa26dde1e9bb59c698d7f755fc70e$1@xxxxxxxxxxxxxxxxxx
> Hi
>
> I made a custom uml profile for our models. At the moment it only contains 
> three stereotypes. One is abstract and the other two inherit from this 
> abstract stereotype.
>
> I then established an extension for uml::Class and linked it with the 
> abstract stereotype. I also made it be a required extension, so the 
> multiplicity of the extension end ist 1...1
>
> Now I assumed this means that any class in my model must ALWAYS HAVE 
> EXACTLY ONE stereotype that inherits from my abstract stereotype.
>
> But still it is possible to say:
>
> umlClass.applyStereotype(ConcreteStereotype1);
> umlClass.applyStereotype(ConcreteStereotype2);
>
> Then my umlClass will have both stereotypes assigned. Is this a bug? For I 
> guessed multiple stereotypes for metaclasses are only possible if you make 
> an extension for each one?
>
> Can someone bring light into this?
>
> Best regards
>