Chapter 6. Customizations

In this chapter we describe the main mechanism for customizing Xtext components: Google Guice, a Dependency Injection framework. With Google Guice we can easily and consistently inject custom implementations of specific components into Xtext. In the first section, we will briefly show some Java examples that use Google Guice. Then, we will show how Xtext uses this dependency injection framework. In particular, you will learn how to customize both the runtime and the UI aspects.

Dependency injection

The Dependency Injection pattern (Fowler, 2004) is used to inject implementation classes into a class hierarchy in a consistent way. This is useful when classes delegate specific tasks to other classes: messages are simply forwarded ...

Get Implementing Domain-Specific Languages with Xtext and Xtend now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.