Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Access EMF generated classes from JEE remote client
Access EMF generated classes from JEE remote client [message #638070] Tue, 09 November 2010 15:28 Go to next message
Patrick is currently offline Patrick
Messages: 17
Registered: August 2010
Location: Rome
Junior Member
Hi All,

I have a probably silly question about a EMF usage scenario in a distributed JEE environment. Suppose I used EMF to generate Java classes from a XSD grammar; now I would like to use these classes also remotely, from a Java EE client application. The problem is that generated classes are not Serializable by default so I'm wondering if this scenario is somewhat supported by the framework and, if not, which is the recommended way to implement a usage scenario where generated domain model classes are of for both the server BL and the client UI

Thanks a lot for the clarification

Best Regards,
Patrick
Re: Access EMF generated classes from JEE remote client [message #638133 is a reply to message #638070] Wed, 10 November 2010 01:06 Go to previous messageGo to next message
Patrick is currently offline Patrick
Messages: 17
Registered: August 2010
Location: Rome
Junior Member
Digging in bugzilla I found this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=245014

so it appears that a plan to introduce support for Java serialization is on the table... but in the meantime? what do you think is the best approach to overcome this limitation ? could it make sense to use the XML/XMI serialization of EMF and transfer it (as a byte[]) on the wire ?

Thanks a lot for any suggestion

Regards,
Patrick
Re: Access EMF generated classes from JEE remote client [message #638271 is a reply to message #638133] Wed, 10 November 2010 09:59 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25999
Registered: July 2009
Senior Member
Patrick,

Even if that bug is addressed, I think it will be far more efficient to
serialize as XML. You could define a wrapper/container class that has a
reference to an EObject and specialize its serialization code so that
the whole containing resource is serialized as XML... If you're going
to transfer just bytes, you'd be way more efficient to use
BinaryResourceImpl.


Patrick wrote:
> Digging in bugzilla I found this bug:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=245014
>
> so it appears that a plan to introduce support for Java serialization
> is on the table... but in the meantime? what do you think is the best
> approach to overcome this limitation ? could it make sense to use the
> XML/XMI serialization of EMF and transfer it (as a byte[]) on the wire ?
> Thanks a lot for any suggestion
>
> Regards,
> Patrick
Previous Topic:Creating Children You Didn't Know Existed revisited
Next Topic:Explicitly storing default values in XML resources
Goto Forum:
  


Current Time: Thu Aug 21 04:32:56 EDT 2014

Powered by FUDForum. Page generated in 0.01899 seconds