Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Wormholes Date: Tue, 04 Sep 2012 07:08:45 +0200 Lines: 31 Message-ID: References: <0ska4895k2mp2j5fb5p4qnue7lsbdpoeoo@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net XJLLl27lxeWrcxLALgnsdwODa26MPgJYRyGrTai6VfSn7kcRycNKbGQ6y+GThqpCw= Cancel-Lock: sha1:wtFZrXicJUJD250JxxqqXKTKW+4= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:18527 On 04.09.2012 06:00, markspace wrote: > On 9/3/2012 6:12 PM, Roedy Green wrote: >> I run into this sort of problem fairly often. That sounds like a warning sign for the way you structure code. >> I have a method x that calls method y through a long chain of >> intermediate calls. > I'm thinking that if your methods have to pass data through a long chain > of calls, then the code is badly structured period. You might as well > use the opportunity to refactor rather than trying to invent a "wormhole." If there are public library methods involved the situation is much worse: then Roedy probably cannot refactor but has to add functionality... > I can think of at least one way to implement a wormhole. I'm just not > going to go there because it's a terrible idea. I am pretty confident I know what you mean. I would even go as far as to calling usage of that "opening a can of worms". There are also negative side effects on testability... Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/