What about refactoring the whole code into a State pattern (removing the 
Booleans and instead introduce individual states as state classes). I don't 
know if it is acceptable in your situation but at least you can consider it.

David.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 14, 2007 8:33
To: [email protected]
Subject: [patterns-discussion] Design pattern recommendation

Hello,
         If I had a class that has a lot of boolean flags and I have an IF 
condition that requires me to do a lot of AND/OR among these boolean conditions 
is there a design pattern that will help me to refactor this code ? Currently I 
have a piece of code that I am working with that has 6 boolean checks and its 
very hard to understand what its trying to do.
Any suggestions appreciated,
Thanks,
Aswin.



________________________________
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it 
now.<http://us.rd.yahoo.com/evt=51731/*http:/mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ%0d%0a>
_______________________________________________
patterns-discussion mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/patterns-discussion

Reply via email to