Chapter 3. DSL-driven application development

 

This chapter covers

  • Integrating internal and external DSLs in a core application
  • Managing errors and exceptions
  • Optimizing performance

In the two previous chapters, we’ve looked at many of the user- and implementation-level perspectives of DSLs. You’ve seen how expressive abstractions lead to an easier understanding of the code base and reduce the feedback cycle from the domain experts. But at the end of the day, however expressive the DSL is that you design, you need to integrate it with the model of your core Java application. (Your application might not be in Java; I’m using that as an example.) You’re also going to need to take care of certain aspects related to the integration upfront. In this chapter, we’ll talk about those issues, as well as others that you need to address when you consider developing a whole application that uses DSLs.

You develop your main application using a primary language of the platform, like Java. For some of the business rules or configuration specifications, you might decide to use DSLs written in languages that can be more expressive than Java. How can you integrate them seamlessly within your core application? Because DSLs tend to evolve independently of the main application, your architecture needs to be flexible enough to compose the changing DSLs with minimal impact on the running application. Figure 3.1 shows how I’m going to address these issues as you progress through the chapter.

3.1. Exploring DSL integration

3.2. Internal DSL integration patterns

3.3. External DSL integration patterns

3.4. Handling errors and exceptions

3.5. Managing performance

3.6. Summary

3.7. References

sitemap