Drools and beyond: extending our functionality
We've seen in this chapter, and throughout the whole book, a lot of different ways to use Drools. Whether we use it as an embedded library, a service, or a closed product, the main goal is to enable our applications to grow in a manageable way. We must consider our design, inside and around business rules, to achieve this. We will try to cover a few tricks that have facilitated growing our Business Rule-enabled applications in the past.
One of the first extensions of functionality we've seen for Drools components has been global variables. If we define them as interfaces or abstract classes, we can define them by using different classes for different runtime components (that is, test cases, local versus QA, or production environments, and so on). They are a very simple way of providing ease of extensibility because of their pluggable nature.
Global variables also provide a very useful feature that sometimes gets overused; because we can keep a...