EMF Dos and Don´ts #1

EMF is a very powerful framework and with power comes…responsibility. You can achieve great things with a minimum of effort using EMF. But, if something goes wrong you can also spend hours trying to find out why. This blog post is the pilot of a series on things you should do and things you should not do when using EMF. The series will present the content of my talk at Eclipse Con North America 2013 as blog posts.

Consider the following: you have defined a model in Ecore, you’ve generated code from the model and you’ve written a small RCP application to edit the data based on EMF Databinding or the EMF Client Platform. However, you find that the application tends to get very slow over time and certain values get lost in the model if it is stored and reloaded. Any of these problems might be caused by a small mistake such as forgetting about the disposal of a ComposedAdapterFactory, adding or removing content adapters to/from the model or changing EMF Factory code to implement a default initialization for an EObject. It can take hours or days until you find the cause of your problem. With this blog, series I hope to save you at least a few hours of searching for a problem…given you follow my advice ;). Currently my list includes 25 items. Let´s start with the first.

EMF Dos #1: RTFM – a.k.a. please read the manual

Manual? There is no manual. Well, there is kind of a manual. In fact, there are a couple of different manuals. This is what I found most useful when starting with EMF:

  • Follow a tutorial on EMF.  If you happen to attend an EclipseCon, join an EMF Tutorial. Otherwise, try an online tutorial. In my opinion, it is always better to try things out before reading a book about them.
  • Having said this, read the EMF book. For me, the book was very helpful for looking up things I came across, e.g. “What are feature maps?”.
  • Read the EMF source code to understand how something works. It helped me to better understand how the overall framework works.
  • Finally and most importantly, search the EMF newsgroup. There is almost no problem that has not been encountered by someone else before you, and answered by Ed Merks. After all, the framework is named after him…E.M.F.
  • Alternatively or additionally, hire a consultant 😛

Stay tuned for more Dos and Don´ts in my next blog!

You can also directly jump to the available posts on EMF Dos and Don´ts:

Jonas Helming and Maximilian Koegel

Jonas Helming and Maximilian Koegel

Jonas Helming and Maximilian Kögel lead the EclipseSource office in Munich and work as a consultants and software engineers for Eclipse technologies. They are Eclipse experts with a focus in Eclipse Modeling, project leads and committers to various Eclipse projects including EMF Forms, EMFStore, Edapt, e4 and the EMF Client Platform and regular EclipseCon speakers on these topics. Furthermore they are dedicated to teach Eclipse and open source technology not only to professionals but also to talented university students in an Eclipse lab course.

Email: munich@eclipsesource.com

Jonas Helming and Maximilian Koegel

Latest posts by Jonas Helming and Maximilian Koegel (see all)

No Comments

Sorry, the comment form is closed at this time.