Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Specialization - Set values for inherited properties
Specialization - Set values for inherited properties [message #1772498] Mon, 11 September 2017 14:35 Go to next message
Ursula Kirchgaessner is currently offline Ursula KirchgaessnerFriend
Messages: 18
Registered: July 2017
Junior Member
Hello,

I am trying to use specialization in my SysML model in Papyrus Neon. However, I cannot figure out how to access the properties defined for the superclass in order to define corresponding values to the subclass.

I have, for example, defined a Block "Camera" with parameters for the vertical and horizontal field of view. "Cam One" and "Cam Two" are each a specialized "Camera" for which I want to define a specific field of view each. Below my example. How can I assign values for each of the two subclasses? Do I need to define the attributes in a particular way, as Value, Property, Parameter...?

/Ursula
Re: Specialization - Set values for inherited properties [message #1772520 is a reply to message #1772498] Mon, 11 September 2017 20:23 Go to previous messageGo to next message
Klaas Gadeyne is currently offline Klaas GadeyneFriend
Messages: 165
Registered: July 2009
Senior Member
You need to create a new property which 'redefines' the base property (it would be nice to have helper functions for this in papyrus, not sure if there is already a feature request for this)...

HTH,

Klaas
Re: Specialization - Set values for inherited properties [message #1772538 is a reply to message #1772520] Tue, 12 September 2017 08:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi

Derived/overloaded/overriding properties are not supported by mainstream languages and even in UML there is a nonsence that an uninitialized property may be magically implemented by its same-named operation.

In contrast derived/overloaded/overriding operations are the bread and butter of OO.

I recommend that you define your variation as a family of operations and if you really want to access it as a property define a derived property at the root that redirects to the operation.

Regards

Ed Willink
Re: Specialization - Set values for inherited properties [message #1772540 is a reply to message #1772520] Tue, 12 September 2017 08:37 Go to previous messageGo to next message
Ursula Kirchgaessner is currently offline Ursula KirchgaessnerFriend
Messages: 18
Registered: July 2017
Junior Member
Thank you Klaas. I think I need a bit more detail. If I add a new property to the subclass, I can well list the inherited one in the redefined property list. But I still have to set manually the type and everything for the new property. So what is the point of defining a superclass if for each subclass I have to redefine everything? For the subclass, I would like to simply set the value for each property defined in the superclass. (And ideally see the value listed in the block's property compartment. Is this possible with Papyrus?)

Yes, a helper function would be great. There are many things I see in textbooks or the OMG standard and I simply don't know how to realize this in Papyrus.

/Ursula
Re: Specialization - Set values for inherited properties [message #1772551 is a reply to message #1772540] Tue, 12 September 2017 09:49 Go to previous message
Ursula Kirchgaessner is currently offline Ursula KirchgaessnerFriend
Messages: 18
Registered: July 2017
Junior Member
After playing around a bit trying to get the values displayed, I found that I could in fact display the inherited propoerties: right click on the block, select filters and then 1. Show/Hide Compartments: show the attributes and 2. Show/Hide Contents: show the Contents. In the contents, the inherited properties are listed and will show up in the attributes compartment when selected. Selecting such an inherited property, its value can be set easily in the properties tab.

Unfortunately, this value is still not shown in the diagram, any help welcome!

@ Ed, currently I am just concerned with properties representing characteristics of physical objects in SysML. I think the problem is different from operations in UML.

/Ursula
Previous Topic:How to Control Display of Custom Stereotype Attributes?
Next Topic:How to creat Block Instance
Goto Forum:
  


Current Time: Tue Sep 25 20:31:56 GMT 2018

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

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

Back to the top