Re: Re: Ambiguous Refactoring Solution
Ron Jeffries <[email protected]>
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <[email protected]> |
Hello, bryanedds. On Tuesday, September 22, 2009, at 4:19:12 PM,
you wrote:
> The only reason I'm looking at the class is its violation of SRP.
> It contains no duplication, causes no duplication, its average
> method size is 2 - 3 lines, it's pretty clear what it does even if it does two things.
> The problem is that there are many ways to address a violation of
> SRP. The realization of an SRP violation does not seem to provide
> enough context to disambiguate a refactor from its applicable subset.
So it has at least two responsibilities. One thing to do is:
Imagine what a class would be like that handled just one of those
responsibilities. At a guess it would have a subset of the members
and a subset of the methods. Create a null class to handle that
responsibility. Start pushing responsibility to it from the
original. See Sprout Class in WELC.
Ron Jeffries
www.XProgramming.com
www.xprogramming.com/blog
The work teaches us. -- Richard Gabriel
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/refactoring/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/refactoring/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/