Entity lazy loading strategy from remote client [message #880560] |
Sat, 02 June 2012 05:31  |
Eclipse User |
|
|
|
Hi,
I'm developing a remote client with Eclipse RCP and Glassfish with EclipseLink on the server side.
Can anyone tell me about strategies to use when I need lazy loaded fields in an entity on the client side?
Let's see a use-case: when I want to show the user a list of somethinBean. SomethingBean has many lazy-loaded fields like collections which I don't show in the list, but when the user wants to change one list item, the fields need to be loaded over the network.
Are there any known strategies, patterns for this? In other forum I got the answer:
"Consider the domain objects, at client-side, exactly as you would consider DTOs or JSON objects: objects containing some incormation coming from the server and seralized over the wire." [...] " If you are on some "list" screen and want to see the detailed view of one of the elements of the list, for example, call another service which loads the entity again from the database"
Is this the right approach?
Thank you for your answers!
|
|
|
Re: Entity lazy loading strategy from remote client [message #881940 is a reply to message #880560] |
Tue, 05 June 2012 10:22   |
Eclipse User |
|
|
|
That is probably the best approach.
EclipseLink supports Load Groups on queries, that allows you to specify exactly which attributes you want instantiated. You can also use the copy() API to force the instantiation of an Attribute Group.
EclipseLink does have a RemoteSession feature from way back in the fat client CORBA/RMI days, before Java EE, JSPs, web services. It allows remote access, but it only supports the EclipseLink native API, not JPA, and although it is still tested, no new development has been done on it for quite some time. If fat clients start to make a big come back, maybe it would be worth adding JPA support to it.
|
|
|
|
Powered by
FUDForum. Page generated in 1.03897 seconds