Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to serialize an EMF model instance?

I have an Eclipse RCP application with an instance of an EMF model populated in memory. What is the best way to store that model for external systems to access? Access may occur during and after run time.

Reads and writes of the model are pretty balanced and can occur several times a second.

I think a database populated using Hibernate + Teneo + EMF would work nicely, but I want to know what other options are out there.

like image 353
John Avatar asked Jun 26 '09 22:06

John


1 Answers

I'm using CDO (Connected Data Objects) in conjunction with EMF to do something similar. If you use the examples in the Eclipse wiki, it doesn't take too long to get it running. A couple of caveats:

  1. For data that changes often, you probably will want to use nonAudit mode for your persistence. Otherwise, you'll save a new version of your EObject with every commit, retaining the old ones as well.

  2. You can choose to commit every time your data changes, or you can choose to commit at less frequent intervals, depending on how frequently you need to publish your updates.

  3. You also have fairly flexible locking options if you choose to do so.

My application uses Derby for persistence, though it will be migrated to SQL Server before long.

There's a 1 hour webinar on Eclipse Live (http://live.eclipse.org/node/635) that introduces CDO and gives some good examples of its usage.

like image 115
Steve Robenalt Avatar answered Oct 13 '22 00:10

Steve Robenalt