Skip to main content



      Home
Home » Modeling » Papyrus » Some questions on Papyrus Software Designer
Some questions on Papyrus Software Designer [message #1816317] Sat, 26 October 2019 14:12 Go to next message
Eclipse UserFriend
Today I took some time to evaluate the Papyrus Software Designer (Java),. An overall positve experience, but I got stuck with some issues.

1. for a read-only, private property of a class code got generated that allows to update that property. I expect an
private final <type> <id>
instead of
private <type>  <id>
to reflect the property is read-only.
Is there some way to achieve that?

2. Associations with visibility private result in code that presents them public.
Is there some way to make these private?

3. I would like to be able to specify an one-to-many association to be represented as a set rather than as an array.
Is there some way to achieve that?

4. Association classes seem to be ignored at all.
Is there some way to generate code reflecting association classes?

Best regards
Carsten

Re: Some questions on Papyrus Software Designer [message #1816345 is a reply to message #1816317] Mon, 28 October 2019 04:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Carsten,

1. read-only attributes are currently not treated specifically. If you want a final qualifier, use the "Final" stereotype. It is arguable that "read-only" could be mapped to final, so this could be an enhancement

2. This is apparently a bug, please post a bugzilla report

3. This is recently supported via the stereotype "ListHint", but only for C++. See bug 546545 and the discussions in this thread . The stereotype is from the common code generation profile, the effort to support Java as well is low, but we haven't had the time to do it.

4. Association classes are not supported right now.

Best

Ansgar

Re: Some questions on Papyrus Software Designer [message #1816346 is a reply to message #1816317] Mon, 28 October 2019 04:12 Go to previous messageGo to next message
Eclipse UserFriend
Hello,
I don't use Papyrus SD to generate Java so I can't fully answer your questions but I have a hint for the point 3.
In C++, to use collections (vector, list...) instead of arrays, the "ListHint" stereotype (from CodeGen profile) have to be set on the owning package (can be the root package). In this stereotype, there are some fields which can be set to adress this setting. For example, to use a list for a collection with variable size, we can set the "variable" field as follows:
std::list<[typeName]>
I don't know if this way is working with Java code generator.

HTH.

Yoann.
Re: Some questions on Papyrus Software Designer [message #1816350 is a reply to message #1816317] Mon, 28 October 2019 05:22 Go to previous message
Eclipse UserFriend
Many thanks to Yoann and Ansgar for the help.

A remark on association classes. An association class is either an additional information or a constraint.


In the first case I would expect to get an operation like

get<associatinId>Data() : <associationClass> []

on the association source lto get the additional information.


In the second case in my opinion the operation the be like

get<associatinId>Target(in <associationClass> constraint) : <AssociationTargetClass> []

on the association source to search all targets fulfilling the constraint.


Wether the association class is to be interpreted can be specified using stereotypes.

In both cases a set of classes is returned, because in the first case several associations between a given source and a given target may exist and in the second case several targets may fulfill the constraints.

The second case also has another difficulty. Given the example a person with a given login is operator for all sites of a company, but chief operator for two sites. Assuming that the role chief operator includes the role operator for the two sites only the association attributed with chief operator will exist. When requesting all sites the person has the operator role the to sites will not be selected, if referenceRole. equals(role) simply triggers on object equality. Given that a compare is sometimes required.

/Carsten


Edit: corrections & clarifications

[Updated on: Mon, 28 October 2019 06:39] by Moderator

Previous Topic:How to hide the element between << >> on diagrams?
Next Topic:Palette Customization
Goto Forum:
  


Current Time: Sun Jul 06 00:52:28 EDT 2025

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

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

Back to the top