Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext2: Java Beans is standard - but only .ecore generated?
Xtext2: Java Beans is standard - but only .ecore generated? [message #754450] Wed, 02 November 2011 15:07 Go to next message
Johnnyboy  is currently offline Johnnyboy Friend
Messages: 39
Registered: September 2011
Member
Hello everyone,

A little question: It was said to me that Java Beans is the standard format for metamodels. I am wondering why Xtext2 than generates the .ecore/.xmi and the genmodel file - but no Java Beans? Or do the generated interfaces and Impl classes are the Java Beans presentation (just wondering - I thought JBeans have to be serializable but I did not found the key word serializable).
And as second question - how can I say that I want to generate JBeans?

Thanks in advance for any answer
Jonnyboy

[Updated on: Wed, 02 November 2011 15:35]

Report message to a moderator

Re: Xtext2: Java Beans = standard but only .ecore generated? [message #754470 is a reply to message #754450] Wed, 02 November 2011 16:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Comments below.

On 02/11/2011 4:07 PM, Johnnyboy wrote:
> Hello everyone,
>
> A little question: It was said to me that Java Beans is the standard
> format for metamodels.
Who said that? Beans on their own don't specify sufficient interesting
metadata. I.e., there's no notion of containment nor of bidirectional
references.
> I am wondering why Xtext2 than generates the .ecore/.xmi and the
> genmodel file - but no Java Beans?
Because EMF models are far more powerful than plain old Java Beans.
> Or do the generated interfaces and Impl classes are the Java Beans
> presentation
In a sense, yes.
> (just wondering - I thought JBeans have to be serializable but I did
> not found the key word serializable).
No, EMF models aren't generally java.io.Serializeable. But then can be
serialized as XMI/XML, binary, or of course in any arbitrary textual way
by defining an Xtext grammar.
>
> Thanks in advance for any answer
> Jonnyboy


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Xtext2: Java Beans = standard but only .ecore generated? [message #754935 is a reply to message #754470] Sat, 05 November 2011 12:59 Go to previous messageGo to next message
Johnnyboy  is currently offline Johnnyboy Friend
Messages: 39
Registered: September 2011
Member
Hello,

Thank you for the answer.

An active member of this forum told me that. But "there's no notion of containment nor of bidirectional references" is truely a know out criteria. That is why I will decide to use ecore instead and the thread can be closed.

Thanks again
Jonnyboy
Re: Xtext2: Java Beans = standard but only .ecore generated? [message #754936 is a reply to message #754935] Sat, 05 November 2011 13:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

you are mixing Xtext and the good old Xtend(1)/Xpand. Xpand supports different kinds of metamodels. E.g. the EMFMetamodel (which uses EMF reflective) or the "JavaBeans Metamodel" which uses Java Classes (aka Java Beans). => For Ecore Based Stuff the Java Interfaces.
Xpands Generator Component uses the "JavaBeans Metamodel" as default.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sat, 05 November 2011 13:12]

Report message to a moderator

Re: Xtext2: Java Beans = standard but only .ecore generated? [message #755093 is a reply to message #754936] Mon, 07 November 2011 11:14 Go to previous messageGo to next message
Johnnyboy  is currently offline Johnnyboy Friend
Messages: 39
Registered: September 2011
Member
Hello Christian
Thanks for your answer. I asked that because I wanted to use the EMFMetamodel (.ecore) but after you said to me that JavaBeans would be the standard It was told me to get to know more about this.

Ok, XPand use Java Beans as default. But what is with the disadvantage "there's no notion of containment nor of bidirectional references"?

Thanks again for any answer
Jonnyboy
Re: Xtext2: Java Beans = standard but only .ecore generated? [message #755097 is a reply to message #755093] Mon, 07 November 2011 11:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
I still do not understand what your problem is.
Noone is forced to use JavaBeans Metamodel in Xpand. If you have just JavaClasses and no ecore you have to use it Wink or built your own Metamodel Contributor for Xpand. If you have ecore it is no problemto use JavaBeans since the ecore java classes have Conainer/Contents relations explicitely.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext2: Java Beans = standard but only .ecore generated? [message #755108 is a reply to message #755097] Mon, 07 November 2011 12:27 Go to previous messageGo to next message
Johnnyboy  is currently offline Johnnyboy Friend
Messages: 39
Registered: September 2011
Member
THX again for your answer Smile

My last problem was that "there's no notion of containment nor of bidirectional
references" for JavaBeans" (which was said above).
If you say that this is no problem because "JavaBeans since the ecore java classes have Conainer/Contents relations explicitely" than that should be ok. My team leader says that we should use the standard if there is no problem. With model annotaion and type/containment attributes you can specify the containment relationship I think.

Ok, that should be it for now and thanks again
Jonnyboy
Re: Xtext2: Java Beans = standard but only .ecore generated? [message #755128 is a reply to message #755108] Mon, 07 November 2011 13:29 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Ähm, dont mix standard with default Wink in this case standard case means the default case Wink

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[xtend2] sope of create function cache
Next Topic:[Xtend] constructors with arguments, class methods?
Goto Forum:
  


Current Time: Sun Sep 22 05:57:16 GMT 2024

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

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

Back to the top