From: Meinrad Recheis Date: 2008-04-10T04:10:38+09:00 Subject: Re: syntax request ------=_Part_18804_29364516.1207768230186 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Apr 9, 2008 at 10:54 AM, Martin Duerst wrote: > At 00:02 08/04/09, Paul Brannan wrote: > > >I do sometimes use method chaining to silently pass state from one > >operation to another without explicitly creating an object. When I do, > >however, it often feels that there should be a better way to accomplish > >that goal. > > When I do method chaining, it mostly feel exactly the right thing > to do (at least to me :-). In many cases, what I do is something similar > to a Unix pipe, e.g. take some data, filter it, sort it, filter it again, > change it,..., group it,... > That's exactly what you do in C# (or .NET in general) with LINQ operators. While in business logic it sometimes indicates breach of encapsulation, method chaining is kind of a design pattern for transforming collections. -- henon ------=_Part_18804_29364516.1207768230186 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Apr 9, 2008 at 10:54 AM, Martin Duerst <duerst@it.aoyama.ac.jp> wrote:
At 00:02 08/04/09, Paul Brannan wrote:

>I do sometimes use method chaining to silently pass state from one
>operation to another without explicitly creating an object.  When I do,
>however, it often feels that there should be a better way to accomplish
>that goal.

When I do method chaining, it mostly feel exactly the right thing
to do (at least to me :-). In many cases, what I do is something similar
to a Unix pipe, e.g. take some data, filter it, sort it, filter it again,
change it,..., group it,...

That's exactly what you do in C# (or .NET in general) with LINQ operators. While in business logic it sometimes indicates breach of encapsulation, method chaining is kind of a design pattern for transforming collections.

-- henon
------=_Part_18804_29364516.1207768230186--