Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Association End Name
Association End Name [message #1745885] Tue, 18 October 2016 20:20 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 3
Registered: August 2010
Junior Member
Hi,

Currently I'm using Papyrus with Acceleo on Eclipse 4.4.2.
When i create an association, Papyrus automatically names association ends with the name of each Class (lower case only first letter) (For Instance : if Class "FirstTest" the association will be called "firstTest").

In the next version of Papyrus (Eclipse 4.5.2, 4.6.1), it automatically converts the name to lower case.

How can i do to have the previous working ?

Thanks

Sebastien
Re: Association End Name [message #1745907 is a reply to message #1745885] Wed, 19 October 2016 08:32 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Presumably your second paragraph contains a typo since it repeats the first.

The earlier behavior was an over enthusiastic reading of the UML style guide as a specification that was echoed by the OCL 2.0 specification. It was corrected in OCL 2.3.

Autogenerated names use unchanged spelling. Manually generate names may choose to change case as is the case for many names in the UML specification. You can only get the wrong old behavior reliably by manually specifying case converted names.

Regards

Ed Willink
Re: Association End Name [message #1745920 is a reply to message #1745907] Wed, 19 October 2016 10:33 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 3
Registered: August 2010
Junior Member
I found this on OCL 2.3.1 :

Missing Association End names
The name of an association-end is never missing. If no explicit name is available an implicit name is taken from the name
of the class to which the end is attached.
NOTE: To tool vendors: this is a non-normative change from OCL 2.2, where the UML style guidance of converting the first
letter of the implicit name to lowercase was endorsed. The normative text has never defined how implicit names are obtained.
Object Constraint Language, v2.3.1 19
Tool vendors may wish to provide backward/forward compatibility warnings for this change.

I suppose that's the text you refer in your message.

Suppose i have two classes : FirstTest (firstTest) 1 ---- * (secondTest) SecondTest.
If i want to have generated code from this model i will have :

public class FirstTest {

// Name is generated form association end (uppercase first letter)
public List<SecondTest> getSecondTest() {
...
}

}

public class SecondTest {

// Name is generated form association end (uppercase first letter)
public FirstTest getFirstTest() {
...
}

}

For me, the original behavior was the good one ; it respects java convention.

Is it possible to have a new feature in Papyrus for specifying how Papyrus will deal with autogenerated names ?
"Autogenerate Association Name" choice LOWERCASE/LOWERCASEFIRSTLETTER

Thanks,

Sebastien
Re: Association End Name [message #1745921 is a reply to message #1745920] Wed, 19 October 2016 10:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I think that you are confusing technologies.

UML is a language neutral technology that may be used with Java, so it should not be unnecessarily incompatible with Java, but certainly should not regard Java as its primary influence.

Your problem is in getXXX methods that are nothing to do with UML or Java. They are related to the autogenerated EMF API. But from your examples I am unclear what your problem is. getFirstTest seems like a good name to me.

Eclipse UML performs a number of name adjustments during UML2Ecore to improve the Java naming. Perhaps you need to tweak one.

Regards

Ed Willink
Re: Association End Name [message #1745991 is a reply to message #1745921] Thu, 20 October 2016 09:20 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 3
Registered: August 2010
Junior Member
I will take a look in the differents ways you give me to have a correct solution.

Thanks you for your time

Sebastien
Previous Topic:State Machine connector labels
Next Topic:Generating a diagram for Papyrus
Goto Forum:
  


Current Time: Fri Apr 19 15:38:42 GMT 2024

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

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

Back to the top