Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [xtend2] instancefactory
[xtend2] instancefactory [message #755928] Thu, 10 November 2011 08:52 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Hi there,

is the new object creation strategy in xtend2 already available in the
nightlies? Sven mentioned a keyword 'instancefactory' (see below) but I
did not find it in the nightly v.2.2. Is there or will there be
something similar?

Cheers,
Hauke


Am 31.08.2011 15:50, schrieb Sven Efftinge:
> For
> instance Xtend allows to have a field declared with a keyword 'instance
> factory'. In that case any operations with null arguments serve as
> factory methods. That allows for using this approach with EMF:
>
> // Xtend and EMF
>
> instancefactory LibraryFactory f
>
> def Library createLibrary() {
> :{ authors += :{
> name = "Leo Tolstoj"
> }
> }
> }
Re: [xtend2] instancefactory [message #755929 is a reply to message #755928] Thu, 10 November 2011 08:55 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Hi Hauke,

we implemented another approach. See recent blog entries about the
builder syntax.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 10.11.11 09:52, Hauke Fuhrmann wrote:
> Hi there,
>
> is the new object creation strategy in xtend2 already available in the
> nightlies? Sven mentioned a keyword 'instancefactory' (see below) but I
> did not find it in the nightly v.2.2. Is there or will there be
> something similar?
>
> Cheers,
> Hauke
>
>
> Am 31.08.2011 15:50, schrieb Sven Efftinge:
>> For
>> instance Xtend allows to have a field declared with a keyword 'instance
>> factory'. In that case any operations with null arguments serve as
>> factory methods. That allows for using this approach with EMF:
>>
>> // Xtend and EMF
>>
>> instancefactory LibraryFactory f
>>
>> def Library createLibrary() {
>> :{ authors += :{
>> name = "Leo Tolstoj"
>> }
>> }
>> }
>
Previous Topic:read preferences of eclipse-ide
Next Topic:How to write correct parser rules using JavaVMTypes
Goto Forum:
  


Current Time: Tue Mar 31 14:21:12 GMT 2020

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

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

Back to the top