Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Xcore] How can I use *set* keyword
[Xcore] How can I use *set* keyword [message #894422] Mon, 09 July 2012 07:52 Go to next message
Jeeeyul Lee is currently offline Jeeeyul LeeFriend
Messages: 117
Registered: July 2009
Location: Seoul
Senior Member

consider below model:
class Person
{
	String firstName
	String lastName
	
	derived String fullName 
	get	{ 
		firstName + " " + lastName
	}
	set 	{
		var array = fullName.split(" ")
		firstName = array.get(0)
		lastName = array.get(1)
	}
}


Xcore generator seems to do not generate setter for feature in any case.

is it just reserved keyword?

I can define an operation for my purpose, but I don't want to increase pointless feature for readability.

And I want to define setter for non-derived feature too.
Because I want to fire notifications when derive feature value is invalid.


Thanks.
Re: [Xcore] How can I use *set* keyword [message #894441 is a reply to message #894422] Mon, 09 July 2012 09:10 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Comments below.

On 09/07/2012 9:52 AM, Jeeeyul Lee wrote:
> consider below model:
>
> class Person
> {
> String firstName
> String lastName
>
> derived String fullName get { firstName + " " +
> lastName
> }
> set {
> var array = fullName.split(" ")
> firstName = array.get(0)
> lastName = array.get(1)
> }
> }
>
>
> Xcore generator seems to do not generate setter for feature in any case.
Yes, by default we make derived imply transient, volatile, and readonly
but haven't added keywords to specify the inverse of those things.
>
> is it just reserved keyword?
>
> I can define an operation for my purpose, but I don't want to increase
> pointless feature for readability.
>
> And I want to define setter for non-derived feature too.
That's not supported yet either.
> Because I want to fire notifications when derive feature value is
> invalid.
If you open a bugzilla, I'll explore what can be done for the next
release. Even derived multi-valued features are not working so nicely...
>
>
> Thanks.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF Databinding
Next Topic:Copy and Paste from clipboard in EMF
Goto Forum:
  


Current Time: Thu Apr 25 14:09:44 GMT 2024

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

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

Back to the top