Decorating our objects in memory
We've seen examples where we modify the working memory whenever we detect that a specific condition is happening. We might remove objects, modify existing ones, and even delete them to trigger other rule executions. We've also seen that, sometimes, these elements make sense mostly within the rule executions and used declared types for these cases.
Whether we use declared types of external classes, most of the cases imply one of the following two strategies:
We add new objects (declared types or Java classes) to the working memory, representing some inference about our domain model
We modify attributes of existing objects in the working memory, adding the inferred data to these properties
These strategies have a few disadvantages when it comes to decorating an existing model. The first case (adding new objects) might imply having to keep a reference between the domain model object and the new inferred object in some form. The second case (modifying attributes...