Skip to Content.
Sympa Menu

patterns-discussion - Re: [patterns-discussion] Design pattern recommendation

patterns-discussion AT lists.siebelschool.illinois.edu

Subject: General talk about software patterns

List archive

Re: [patterns-discussion] Design pattern recommendation


Chronological Thread 
  • From: David Pokluda <David.Pokluda AT microsoft.com>
  • To: "win_ash12 AT yahoo.com" <win_ash12 AT yahoo.com>, "patterns-discussion AT cs.uiuc.edu" <patterns-discussion AT cs.uiuc.edu>
  • Subject: Re: [patterns-discussion] Design pattern recommendation
  • Date: Wed, 14 Nov 2007 10:05:20 -0800
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/patterns-discussion>
  • List-id: General talk about software patterns <patterns-discussion.cs.uiuc.edu>

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: win_ash12 AT yahoo.com [mailto:win_ash12 AT yahoo.com]
Sent: Wednesday, November 14, 2007 8:33
To: patterns-discussion AT cs.uiuc.edu
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.




Archive powered by MHonArc 2.6.16.

Top of Page