Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Difference between PrimitiveType and <EPackage,ModelLibrary > EDataType
Difference between PrimitiveType and <EPackage,ModelLibrary > EDataType [message #1834663] Sun, 15 November 2020 00:30 Go to next message
John Doe is currently offline John DoeFriend
Messages: 70
Registered: October 2020
Member
Hello,

So I am creating a UML profile with Papyrus and I was advised to use PrimitiveType from the Palette.

Let's say I have a property "phone_number", which will be an integer. What is the difference if I create a PrimitiveType and name it INT and on Properties -> Type -> MyPackageName -> INT,

or if I select it from the Properties -> Type -> <EPackage,ModelLibrary > PrimitiveTypes ->. EDataType Integer.

My end goal is to generate an Xtext grammar for this UML profile. What would be some benefits of each approach?

Thank you!
Re: Difference between PrimitiveType and <EPackage,ModelLibrary > EDataType [message #1834668 is a reply to message #1834663] Sun, 15 November 2020 12:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7043
Registered: July 2009
Senior Member
Hi

It depends whether you want tooling to understand the semantics of "INT" such as may-be-zero, can-be-added, cannot divide-by-zero ....

By default you have nothing, not even a defined storage. If you map the Ecore implementation to java.lang.int you get some functionality.

Tools know about the Integer, they know nothing of INT. To remedy this Eclipse OCL provides the OCLforUML profile so that you can apply an Integer/Real/... stereotype to your novelty.

You can also define your own PrimitiveType named Integer. Whether this is or is not the same type as a built-in PrimitiveType named Integer is unclear. Eclipse OCL clarifies by specifying that the package hierarchy of Primitive/Tuple/Collection/Map/Lambda types is to be ignored when determining a singleton type for each such potential ambiguity.

Regards

Ed Willink
Re: Difference between PrimitiveType and <EPackage,ModelLibrary > EDataType [message #1834672 is a reply to message #1834668] Sun, 15 November 2020 12:57 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7043
Registered: July 2009
Senior Member
Hi

See https://www.eclipse.org/forums/index.php/m/1834670/#msg_1834670 on Xtext newsgroup.

Regards

Ed Willink
Previous Topic:Association or property type in UML Profile?
Next Topic:Problems encountered in the model
Goto Forum:
  


Current Time: Fri Feb 26 00:41:10 GMT 2021

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

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

Back to the top