Composing instances of a used-defined type [message #493701] |
Tue, 27 October 2009 11:39  |
Eclipse User |
|
|
|
Hello,
Is it possible to create and fill instances of a user-defined type?
For example: The user-defined type Person is composed of the following two attributes:
- name : string
- age : integer
Further a Class is defined with two attributes:
- p : string
- a : integer
and one operation:
- ComposePerson : Person
The idea is to define an OCL body expression for the operation that returns a single instance of type Person, filled with the values of the 'p' and 'a' instance values of the class instance.
So if p = "John" and a = 15, then the result of the operation shall be: { "John", 15 } (of type Person).
With kind regards,
Bjorn
|
|
|
|
|
Re: Composing instances of a used-defined type [message #494046 is a reply to message #493902] |
Wed, 28 October 2009 17:51  |
Eclipse User |
|
|
|
Hi Bjorn
I had a quick play at a modified grammar. With Issue 14583 making Tuple
partially reserved, there is no syntactic prpblem with the extension.
It's just a matter of sorting out default values, and a treatment for
uninitialised values.
We might get a prototype in for Helios.
Watch https://bugs.eclipse.org/bugs/show_bug.cgi?id=293622 to see when
something's available.
Regards
Ed Willink
Bjorn wrote:
> Hello Edward,
>
> Thank you for your quick response. The issue you mention is exact that
> what I need. So this means I need to be patient ;) For now I will try to
> work-around this issue.
>
> Kind regards, Bjorn
>
|
|
|
Powered by
FUDForum. Page generated in 2.02879 seconds