<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-3512250994270159512.post3954986121245179862..comments</id><updated>2008-08-12T19:58:04.367+01:00</updated><title type='text'>Comments on Andy P: Refactoring / Design: Composed Method</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://andyp-tw.blogspot.com/feeds/3954986121245179862/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3512250994270159512/3954986121245179862/comments/default'/><link rel='alternate' type='text/html' href='http://andyp-tw.blogspot.com/2008/02/refactoring-design-composed-method.html'/><author><name>Andy</name><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3512250994270159512.post-3853221947025348393</id><published>2008-08-12T19:58:00.000+01:00</published><updated>2008-08-12T19:58:00.000+01:00</updated><title type='text'>That's looking good :-)The point of the post was t...</title><content type='html'>That's looking good :-)&lt;BR/&gt;The point of the post was that the first thing we should do is get to a consistent detail level.&lt;BR/&gt;I rolled up the "how we wash our hands" into a "what are we doing?" washHands method.&lt;BR/&gt;My feeling is that washing hands is nothing to do with the making of the base. The chef should make sure he washes his hands before he starts making the base, but we'll get there eventually :-)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3512250994270159512/3954986121245179862/comments/default/3853221947025348393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3512250994270159512/3954986121245179862/comments/default/3853221947025348393'/><link rel='alternate' type='text/html' href='http://andyp-tw.blogspot.com/2008/02/refactoring-design-composed-method.html?showComment=1218567480000#c3853221947025348393' title=''/><author><name>Andy</name><uri>http://www.blogger.com/profile/15414690619832854980</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09913086440638805390'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://andyp-tw.blogspot.com/2008/02/refactoring-design-composed-method.html' ref='tag:blogger.com,1999:blog-3512250994270159512.post-3954986121245179862' source='http://www.blogger.com/feeds/3512250994270159512/posts/default/3954986121245179862' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3512250994270159512.post-8272658553906056000</id><published>2008-08-11T00:10:00.000+01:00</published><updated>2008-08-11T00:10:00.000+01:00</updated><title type='text'>I'm not a fan of a CheeseCake taking in a chef and...</title><content type='html'>I&amp;#39;m not a fan of a CheeseCake taking in a chef and a sink and instructing the chef to wash his hands, but perhaps I&amp;#39;m jumping ahead in your story. Anyway, I think I would rather see an initial refactoring look more like this:&lt;BR/&gt;&lt;BR/&gt;public makeBase(Ingredients... ingredients) {&lt;BR/&gt;    chef.washHandsIn(sink);&lt;BR/&gt;    bowl.add(ingredients);&lt;BR/&gt;    chef.mixIngredientsOf(bowl);  &lt;BR/&gt;    cake.addContents(bowl);&lt;BR/&gt;}&lt;BR/&gt;&lt;BR/&gt;I&amp;#39;m not claiming this is perfect, but would be more in-line with a first phase refactoring:&lt;BR/&gt;&lt;BR/&gt;1. Washing hands is a behaviour between the chef and sink. The details of which should not be exposed to the cheesecake.&lt;BR/&gt;&lt;BR/&gt;2. The ingredients getting added to a bowl pushes the loop as a single operation into a single method.&lt;BR/&gt;&lt;BR/&gt;3. Might as well move the construction of all the objects but allow them to be injected.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3512250994270159512/3954986121245179862/comments/default/8272658553906056000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3512250994270159512/3954986121245179862/comments/default/8272658553906056000'/><link rel='alternate' type='text/html' href='http://andyp-tw.blogspot.com/2008/02/refactoring-design-composed-method.html?showComment=1218409800000#c8272658553906056000' title=''/><author><name>Kris</name><uri>http://www.blogger.com/profile/17169486069763932973</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://andyp-tw.blogspot.com/2008/02/refactoring-design-composed-method.html' ref='tag:blogger.com,1999:blog-3512250994270159512.post-3954986121245179862' source='http://www.blogger.com/feeds/3512250994270159512/posts/default/3954986121245179862' type='text/html'/></entry></feed>