16. OSGi and Groovy

Like we did with Scala, let’s say we want to use a dynamic language to improve the expressiveness and speed with which we develop the calculation implementation. In this case, we’ll replace the Scala version of calc-impl.jar with a Groovy version.

16.1. Getting Started

Similar to what we did for the Scala calculation module, creating a Groovy1 version of the calculation won’t require any modifications to our existing system either. We’ll simply write the Groovy code, bundle the code into a calc-impl-groovy.jar module, and deploy it. Again, we did a good job creating Cohesive Modules with a Default Implementation. Independent Deployment was also a strength of our design. So, now that we want to create the Groovy module, we ...

Get Java Application Architecture: Modularity Patterns with Examples Using OSGi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.