Semantic annotations for UML elements [message #803075] |
Mon, 20 February 2012 17:26  |
Eclipse User |
|
|
|
Hi,
ok, this one is a more conceptual question: I have created a UML model and now I want to add some semantic information. For example: I have a class and an operation X. Now I want to add the information, that X takes 10 seconds to be performed. Furthermore I want to add a description in terms of a long text.
How should this information be added? There are several chances I see:
1. Usage of UML comments/annotations
Advantage: Within the same model
Disadvantage: The model becomes bigger and bigger with more information. The information is informal.
2. Usage of a database that keeps these information
Advantage: The model is only for the model and no additional semantic information. The model does not become bigger. I can create a database schema that conforms to the information I want to store.
Disadvantage: I need to synchronize database and model. When the model changes (class is deleted), the information within the database has to be updated.
3. Creation of a UML profile
I create a UML profile with stereotypes "explanation" and "duration" and create classes with these stereotypes that are referenced by the operation. (I am not sure: is it possible to associate an operation with a class?). Then I could use two associations named "explanation" and "duration" that refer to the semantic information.
Advantage: It is formalized. Within on model. No synchronization needed.
Disadvantage: Additional UML profile, not standardized, big models.
4. Usage of links to other models (OWL classes)
Advantage: The information is formalized and I do not have to synchronize as much information as within a database. There are different types of models with different purposes.
Disadvantage: Again the model size increases. Maybe hard to understand?
What do you think? Where should I store this information?
Thanks
Michael
|
|
|
|
|
|
|
|
|
Re: Semantic annotations for UML elements [message #804569 is a reply to message #804513] |
Wed, 22 February 2012 14:42   |
Eclipse User |
|
|
|
Hi,
hm I am not sure, whether we mean the same 
I have created a UML model (no UML profile) with two classes: "Car" and "Train". Then, each class has an operation "run()". Now, I want to add the information about the duration. But I don't want to create a profile, because maybe later I need more information to be saved. And additionally: When exchanging the model, everybody would need to have my UML profile.
Now, I create an OCL constraint for the operations and def new properties? Is it possible to parse this information with OCL?
Seems to look nice, but the last time I tried to use OCL programmatically (I have to programmatically create and manipulate models) I did not get it working UML and profiles work pretty well, but I will keep trying 
Michael
|
|
|
|
|
|
|
|
Re: Semantic annotations for UML elements [message #809200 is a reply to message #803506] |
Tue, 28 February 2012 10:37   |
Eclipse User |
|
|
|
Michael,
I would suggest using constraints (based on the language of your
choosing, be it OCL, Java, or whatever) if the kind of information
you're looking to add represents rules or conditions on the elements.
Another (less-structured) alternative is to use comments.
Otherwise, I would recommend using profiles/stereotypes because that's
what they are for - to extend UML with additional "non-standard"
information that's meaningful in a specific domain...
Kenn
On 12-02-21 7:36 AM, Michael Bob wrote:
> Hi,
>
> hm, very interesting. But when applying your answers on my question: How
> can I add some textual description or the information that operation X
> takes 10 seconds in OCL?
>
> I create the operation. Then I add an OCL constraint with the content:
>
> 'textual_description = "Hello World"'
>
> And another OCL constraint with:
>
> 'duration = 10'?
>
> What about the usage of alternative 3? I create stereotypes and now
> create a class "<<semantic>> description" with tagged values "textual
> description" and "duration" and set these values?
>
> Regards,
>
> Michael
|
|
|
|
|
Re: Semantic annotations for UML elements [message #814338 is a reply to message #811553] |
Tue, 06 March 2012 05:27  |
Eclipse User |
|
|
|
And one last remark on this...
The information you want to store in the model sounds to me pretty much like
non-/extra- functional requirements. So, UML constraints are definitely more
appropriate than comments or derived OCL properties - althought it'd work.
However, in your case it might be worth to have a look into the MARTE
profile, which is a (huge and sophisticated) UML profile to model, among
other things, non-functional properties qof software-intensive systems
(which doesn't have to be embedded systems necessarily).
Marc-Florian
"Ed Willink" schrieb im Newsbeitrag news:jiqjju$feo$1@news.eclipse.org...
Hi
If you use OCL constraints you can have nested collections and tuples.
Regards
Ed Willink
On 02/03/2012 13:22, Michael Bob wrote:
> Hi,
>
> thanks. I think, I will use stereotyped constraints. Or do I have to use
> stereotyped specifications subordinate to constraints?
>
> However, I have one question: Is it possible to use constraints to add
> Lists of values? Currently, I have only found LiteralInteger
> Specifications etc. But is there a specification that enables list of
> values? Especially references to other elements (List of classes with
> certain stereotype)
>
> Regards,
>
> Michael
|
|
|
Powered by
FUDForum. Page generated in 0.04962 seconds