O'Reilly logo

Implementing Domain-Specific Languages with Xtext and Xtend by Lorenzo Bettini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required