patterns-discussion AT lists.siebelschool.illinois.edu
Subject: General talk about software patterns
List archive
- 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: Thu, 15 Nov 2007 00:01:15 -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>
This code is totally unreadable. Whenever I have a complex condition that is hard to use I try at least ExtractMethod refactoring (http://www.refactoring.com/catalog/extractMethod.html) so
that I can at least read the code. You can further improve readability with ReverseConditional refactoring (http://www.refactoring.com/catalog/reverseConditional.html). You can also take
a look at
http://www.refactoring.com/catalog/consolidateConditionalExpression.html.
David.
From: patterns-discussion-bounces AT cs.uiuc.edu [patterns-discussion-bounces AT cs.uiuc.edu] On Behalf Of win_ash12 AT yahoo.com [win_ash12 AT yahoo.com]
Sent: Wednesday, November 14, 2007 6:36 PM
To: patterns-discussion AT cs.uiuc.edu
Subject: [patterns-discussion] Design pattern recommendation
Hello to all the four who replied (I guess a Gang of Four did reply to my message!!)
Thanks for all the suggestions. I will certainly look at all of them closely. Though it looks I may need the State pattern. I will also buy that book that was recommended.
In any case here is the code thats hard to read
Basically thats the code that I am trying to refactor ( I have relabeled the methods )
if (call.isNothingReturned() && (cCall.hasLockingCondition() || getUtility().usesConfig() )
&& (!call.shouldBuildObject()) && (getUtility().externalWriteUtility() || (!call.hasParameters())) && (!call.isWriteRequired()))
Get easy, one-click access to your favorites. Make Yahoo! your homepage.
Thanks for all the suggestions. I will certainly look at all of them closely. Though it looks I may need the State pattern. I will also buy that book that was recommended.
In any case here is the code thats hard to read
Basically thats the code that I am trying to refactor ( I have relabeled the methods )
if (call.isNothingReturned() && (cCall.hasLockingCondition() || getUtility().usesConfig() )
&& (!call.shouldBuildObject()) && (getUtility().externalWriteUtility() || (!call.hasParameters())) && (!call.isWriteRequired()))
Get easy, one-click access to your favorites. Make Yahoo! your homepage.
- [patterns-discussion] Design pattern recommendation, win_ash12, 11/14/2007
- Re: [patterns-discussion] Design pattern recommendation, David Pokluda, 11/14/2007
- <Possible follow-up(s)>
- Re: [patterns-discussion] Design pattern recommendation, Fernando Cuenca, 11/14/2007
- [patterns-discussion] Design pattern recommendation, win_ash12, 11/14/2007
- Re: [patterns-discussion] Design pattern recommendation, Jesús Alonso, 11/14/2007
- Re: [patterns-discussion] Design pattern recommendation, David Pokluda, 11/15/2007
- Re: [patterns-discussion] Design pattern recommendation, win_ash12, 11/15/2007
- Re: [patterns-discussion] Design pattern recommendation, philbrown, 11/15/2007
- Re: [patterns-discussion] Design pattern recommendation, David Pokluda, 11/15/2007
- Re: [patterns-discussion] Design pattern recommendation, win_ash12, 11/15/2007
Archive powered by MHonArc 2.6.16.