Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Confusing Property Types(Papyrus, how to set property types)
Confusing Property Types [message #1764060] Wed, 24 May 2017 13:21 Go to next message
Philip Schröder is currently offline Philip SchröderFriend
Messages: 25
Registered: January 2017
Junior Member
Hello everybody,
and thank you for your help.

I am trying to understand how to set class property types in Papyrus class diagrams.
I want something like this

List<E> Attribute1
Map<K> Attribute2

As you see in the picture, I created a new class with a property Attribute1 and already tried the same as with Attribute2 with type <<ModelLibrary>> Ecore Primitive Types -> List.

Next with Attribute2 I tried with Map

index.php/fa/29430/0/

But somehow the type becomes E or likewise K not List<E> and Map<K>.

What I got to understand is, that when chosing a type, you can chose to set several properties (not in the sense of class diagrams) of the typed element.
So I don't have to chose one of the blue lined things under the type but can set all.

Appart from that, I didn't understand much, I can set the package and namespace like in object oriented languages, the owner is the element in which context the property appears, I guess, which seems somehow useless here since it already is a property of the class, so the context should be clear.
I guessed ownedElement is an Element in a bin of the Map as a key value pair,
but when I open it, the only thing I can only chose Redefinable Template Signature, no idea, what ownedElement is supposed to be now.
But what I wanted is to set a template signature anyway.
But I want the type to be the whole thing on the traversed tree, not just the template parameter.

What do I need to do to achieve that?

Thank you for your time and trouble.


Best regards

Philip.
Re: Confusing Property Types [message #1764244 is a reply to message #1764060] Sat, 27 May 2017 07:37 Go to previous messageGo to next message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 126
Registered: March 2011
Location: Paris Saclay, France
Senior Member
If you use template types, you can't bind to an actual during the setting of the type (as you do when you use a programming language). You need to create a bound element first, i.e. a new class (named for instance List_E) with a template-binding relationship having a parameter substitution that replaces E with a concrete type. The number of steps is quite high, therefore it is planned to provide a wizard supporting this, but it has not been implemented yet. I understand you figured that out in your other thread related to the topic (https://www.eclipse.org/forums/index.php/t/1083587/)
It's not so clear what your remarks related to ownedElement relate to. If its the template signature, a formal parameter might be owned by that signature (defined by it) or refer to a formal defined in another template signature. The latter is a rather rare case if one template signature extends another one.
Re: Confusing Property Types [message #1764358 is a reply to message #1764244] Mon, 29 May 2017 07:28 Go to previous messageGo to next message
Philip Schröder is currently offline Philip SchröderFriend
Messages: 25
Registered: January 2017
Junior Member
Sorry,
I see I was unclear concerning owned Element, what I ment was Map -> owned Element.

I would think since Map is a container for (key, value) pairs, one of those would be an owned Element of Map.

Concerning the main problem, instead of in my other thread, here I don't want something like Map<Int> or Map<String>, in this case here I want the template not be bound, it should remain variable in its template parameter like Map<E: Class> or something like that, do I still need a parameter substitution?

Thank you for your time and trouble.

Best

Philip.

[Updated on: Mon, 29 May 2017 07:29]

Report message to a moderator

Re: Confusing Property Types [message #1764371 is a reply to message #1764358] Mon, 29 May 2017 09:31 Go to previous message
Ansgar Radermacher is currently offline Ansgar RadermacherFriend
Messages: 126
Registered: March 2011
Location: Paris Saclay, France
Senior Member
HI Philip,

you can type properties of your template class with the formal template parameters, e.g. with the E, K (or T in my example). Map -> <Classifier Template Signature> -> <Classifier Template Parameter> T -> T. There is no need for the advanced model explorer.

HTH (not sure, if I understood the problem)

Ansgar
Previous Topic:User Model for C++ Template Containers
Next Topic:C++ function parameter types reset to <Undefined> on every save
Goto Forum:
  


Current Time: Fri Apr 20 03:29:09 GMT 2018

Powered by FUDForum. Page generated in 0.01779 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software