[rules-users] [rules-user] problem with private members (no getters)

Swindells, Thomas TSwindells at nds.com
Fri Feb 10 06:26:26 EST 2012



> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> bounces at lists.jboss.org] On Behalf Of ehmkey
> Sent: 10 February 2012 11:18
> To: rules-users at lists.jboss.org
> Subject: Re: [rules-users] [rules-user] problem with private members (no
> getters)
>
> I have a big switch case construction and i want to replace that with a rule
> based system.
>
> In the switch case are functions and they have parameters. Some of this
> parameters are private.
> The only idea i had was that i can create methods and call the methods with
> the rules.
>
> e.g the key of the switch-case is private, and i dont need and wont a getter
> for this
[Swindells, Thomas] you need it if you are going to use it in rules in any sensible way,
My advice is just to make a public getter and if necessary shove a big DO NOT USE in the javadoc.
If you try you may be able to get away to limiting the scope to package as long as the rules
file is also in the same package.

Depending on how the objects are created/used in the rest of your application you
may be able to write an interface to define the public methods and only your drools code
uses/has access to the actualy implementation class

Thomas


**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster at nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************




More information about the rules-users mailing list