Skip to main content



      Home
Home » Modeling » Papyrus » Difference between PrimitiveType and <EPackage,ModelLibrary > EDataType
Difference between PrimitiveType and <EPackage,ModelLibrary > EDataType [message #1834663] Sat, 14 November 2020 19:30 Go to next message
Eclipse UserFriend
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 07:05 Go to previous messageGo to next message
Eclipse UserFriend
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 07:57 Go to previous message
Eclipse UserFriend
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: Tue Jul 08 02:53:25 EDT 2025

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

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

Back to the top