# Runtime Concepts

Xtext itself and every language infrastructure developed with Xtext is configured and wired-up using dependency injection. Xtext may be used in different environments which introduce different constraints. Especially important is the difference between OSGi managed containers and plain vanilla Java programs. To honor these differences Xtext uses the concept of ISetup-implementations in normal mode and uses Eclipse’s extension mechanism when it should be configured in an OSGi environment.

## Runtime Setup (ISetup)

For each language there is an implementation of ISetup generated. It implements a method called createInjectorAndDoEMFRegistration(), which can be called to do the initialization of the language infrastructure. This class is intended to be used for runtime and for unit testing, only.

The setup method returns an Injector, which can further be used to obtain a parser, etc. It also registers the ResourceFactory and generated EPackages at 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.