collaborative editing for EMF models
emfCollab is a light-weight solution to let multiple users edit a single EMF model concurrently. emfCollab has a client-server architecture. The client can be integrated into any EMF based Eclipse editor with a some modifications (generative support will be available for generated EMF editors).
In model-driven development based on EMF domain specific models, the collaborative use of model files soon becomes a problem. To tackle this, you can use various strategies:
- File-based Locking of models while editing: this limits the number of concurrent users to one, so this is not the best solution. In practice however, this is the most frequently used, due to the lack of a uniformly available model merging technology for EMF models.
- Merging conflicting changes: finding conflicts in a model and supporting conflict resolution in an editor is a hard task. Unfortunately, up to now there are no good generic and reliable tools for this purpose. You have to develop one for your own domain.
- Collaborative on-the-fly synchronization: emfCollab offers a client-server model to let the users edit the same model at the same time, synchronized over the network.
How does it work?
- On the server, emfCollab stores the master copy of the model. The server has the model loaded into memory all the time.
- On the client, emfCollab stores a slave copy of the master model in the memory. This model is kept in sync over the network, by serializing and distributing the commands affecting the model. All clients see the same master copy over a single command stack.
- Command serialization over network:
- The standard model change listener of EMF is used to capture the commands done on the model.
- Serialization of the commands has a custom format.
- The communication layer we use is CoolRMI.
How to integrate into your own application
On the server side (which can be any Eclipse environment, even a developer PC), you have to run a emfCollab server that has all resources available to load your model:
- EMF metamodel of your domain (.ecore) - models are instantiated with reflection
- Or the generated project that contains EMF Java classes - models are instantiated using the generated factories (necessary for GMF, Eclipse-UML2, etc)
You have to store your model on the filesystem accessible by the server (model files can be under standard version control such as SVN).
On the client side (which can be any Eclipse environment such as a developer workstation), you have to:
- Modify your editor to open EMF models through emfCollab. This can be done by overrriding some methods of your default editor.
- In Eclipse, you need a Workspace resource to open an editor. In the case of emfCollab the file contains the address of the emfCollab server.
- A different file extension (of local model files) is recommended for emfCollab use.
- Add the emfCollab listener to your model.
- Integrate emfCollab with your command stack:
- emfCollab has to know when a command is about to be done and has the right to cancel execution of the command (in case of conflicting commands from other clients at the same instant).
- emfCollab executes all commands that are received from the emfCollab server (commands done by other users of the model).
emfCollab also offers a simple collaborative UI that shows what the users are doing and they can even chat with each other.
Check out the sources from https://opensource.qgears.hu/svn/trunk/emfcollab/
emfCollab is released under the Eclipse Public License v1.0.