El abr 3, 2011 4:52 a.m., "Hezi Stern" <
hezis@delegatecom.com> escribió:
> Hi all,
>
>
>
> I have a general question regarding best practice or perhaps better put as
> right architecture design.
>
>
>
> We are using Drools (Expert in particularly) to model and execute the
> behavior aspects of our service, which revolves around meeting scheduling
> between various users.
>
>
>
> My main challenge is how to properly structure the rules so that they
> provide the desired flexibility to both modify and control over time.
>
>
>
> Following is a small example which illustrates my question:
>
> I need to determine a specific execution time and it is based on many
> conditions and in general about 15 scenarios where I create a rule per
> scenario. I find that there is a wide set of conditions that are common to
> all scenarios.
>
> So for example a rule would look like:
>
>
>
> when
>
> a1 == X1
>
> a2 == X2
>
> a3 == X3
>
> a4 == X4
>
> b1 == Y1
>
>
>
> Then
>
> Something .
>
>
>
> Another rule would be
>
>
>
> when
>
> a1 == X1
>
> a2 == X2
>
> a3 == X3
>
> a4 == X4
>
> b2 == Y2
>
>
>
> Then
>
> Something else .
>
>
>
> As you can see I am duplicating the a' conditions which are the common
> conditions and the b' is a new unique condition. It seems to me like a
> poorer code maintainability and possibly performance reduction (but I may be
> wrong, perhaps this is how rules should be written).
>
> I assume this is a common case in rules so my question is what would be the
> best way (architecturally wise) to implement such cases (e.g. insert a new
> class that indicates that conditions a' are set and base the rules on the
> existence of such a class)
>
>
>
> Thanks
>
> Hezi
>
>
>
>
>
>
>