|Re: Sharing EMF objects between views [message #916476 is a reply to message #916280]
||Wed, 19 September 2012 03:54
|| Eike Stepper
Registered: July 2009
Am 18.09.2012 22:55, schrieb Mark Rowe:|
> What I meant is that the application would send a request to the CDO server every time a new object was required. As
> the CDO server is on a physically different machine I assumed this request would be across my (possibly slow) network.
I'm a little confused about this. Your original question was about a master/detail kind of user interface and how to
exchange EObjects between the two. You don't need a server for this, just one EMF ResourceSet to feed the master view
with EObjects. Such a view normally needs read-only access to the model and registers an ISelectionProvider (the JFace
viewer) with the part site. The details view can then directly access the EObject selected in the master view and change it.
If you architecture includes a CDO remote server for other reasons you'll have to consider/tweak the load
characteristics (cache types, demand/partial loading, prefetching, offline replication, ...) anyway, so that's not
master/detail specific. A real use case for CDO would be if both of your view parts are supposed to modify EObjects in
separate concurrent transactions. This is often the implication of long running actions in the popup menus of the master
view. But still, without a primary need for collaboration you'd not set up a remote server but simply embed a CDO
repository into your application.
> Are you saying that the CDO client will keep an in-memory copy of the list of books?
CDO caches all objects individually. In your case the Library (which contains the list of books) is cached, as well as
each individual book in that list. Caches are implemented with SoftReferences by default and of course no eviction
happens for objects your application is holding pointers to.
Powered by FUDForum
. Page generated in 0.03207 seconds