Runtime Concepts

TMF Xtext itself and every language infrastructure developed with TMF Xtext is configured and wired-up using dependency injection (DI).

We use Google Guice as the underlying framework, and haven’t built much on top of it as it pretty much does what we need. So instead of describing how google guice works, we refer to the website, where additional information can be found: http://code.google.com/p/google-guice/.

Using DI allows everyone to set up and change all components. This does not mean that everything which gets configured using DI (we use it a lot) is automatically public API. But we don’t forbid use of non-public API, as we think you should decide, if you want to rely on stable API only or use things which might be changed (further enhanced ;-)) in future. See Xtext API Documentation.

Runtime setup (ISetup)

For each language there is an implementation of ISetup generated. It implements a method called doSetup(), which can be called to do the initialization of the language infrastructure.

This class is intended to be used for runtime and unit testing, only.

The setup method returns an Injector, which can further be used to obtain a parser, etc.

The setup method also registers the ResourceFactory and generated EPackage with the respective global registries provided by EMF.

So basically you can just run the setup and start using EMF API to load and store models of your language.