Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: simple StringBuilder proposal Date: Thu, 28 Feb 2013 10:19:44 +0100 Organization: albasani.net Lines: 36 Message-ID: References: <512eab4e$0$294$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net 3xFV/XfamF02bJfeuLTE+684P7WhXkrdns3HoN261KpXtigbzTkert3z8XCxwj2rJbspN8r2pfCnUhn1KeCs1w== NNTP-Posting-Date: Thu, 28 Feb 2013 09:19:40 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="UH9bgKOUFg6+gWJCws1DZZih4IreYZ3+xjOf9a3vaiNlo9ZBFe8PvExGjhOLWxXUYyFtjn67iu7K+gKPeC4SZO+EPwl79EBQO1It+ro5NX4bhaqMNpEFRyJ4wtDNZ087"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0 SeaMonkey/2.16 In-Reply-To: <512eab4e$0$294$14726298@news.sunsite.dk> Cancel-Lock: sha1:o5rOipsOQEaJV4yC6FD5vZMjxzI= Xref: csiph.com comp.lang.java.programmer:22613 Arne Vajhøj schrieb: > No. But GoF never claimed to be complete. > >> But the "pattern" rather feels >> to me like a micro pattern, and not a full fledged pattern. >> Since it doesn't realy solve a problem, its just cosmetics. > > When Fluent interface is fully used, then it is more than just > cosmetics. It almost becomes a DSL. I know more or less what you mean. And probably the pattern also allows returning an object that is different from "this", to model statechanges etc.. But I guess the "this" variant of the pattern only solves a problem when the target expression is complex. So in case I do: a[x].append(b); a[x].append(c); I can replace this by the following, provided a and x are not volatile: a[x].append(b) .append(c); And I get a little performance improvement, since a[x] is only fetched once. But again, I could do this by hand, if the "this" pattern were not implemented: h = a[x]; h.append(b); h.append(c); Bye