[rules-dev] Fine Grained Property Change Listeners (Slot Specific)

Greg Barton greg_barton at yahoo.com
Wed Jan 18 14:34:16 EST 2012


How about having a compiler warning when there's a mismatch between @Modifies and @PropSpecific?  That way both use cases are satisfied.

--- On Wed, 1/18/12, Geoffrey De Smet <ge0ffrey.spam at gmail.com> wrote:

> From: Geoffrey De Smet <ge0ffrey.spam at gmail.com>

> >>     throw new
> IllegalStateException("The factClass (" + factClass + ")
> >> has a property (" + property + ") that has a
> @Modifies annotation, but
> >> the class isn't annotated with @PropSpecific.");
> > Use less words:
> > "In class (" + factClass + ") property (" + property +
> ") is annotated
> > with @Modifies, but the class isn't annotated with
> @PropSpecific."
> +1
> > However, there's a good case for permitting this:
> testing to try both
> > ways, to track down a (user) bug,... Commenting out
> @PropSpecific is
> > just like turning off the main switch. If you get
> errors, you'll have
> > to mess with all the @Modifies, too.
> -1 The other case, where a user adds @Modifies but forgets
> to add 
> @PropSpecific and then sees in production that drools
> doesn't behave as 
> expected (it just ignores the @Modifies) is worse imo.



More information about the rules-dev mailing list