[patterns-discussion] About the Collecting Parameter pattern
Jesús Alonso
kenchoweb at hotmail.com
Mon Apr 18 03:35:19 CDT 2005
Thanks for your help. I understand a little better this pattern.
About the book, can't have access to it right now, and I would have to buy
it for just that pattern...
Thanks again for your help
>Hi,
>
>this pattern solves the problem of how a series of operations can all
>contribute to a collection of results. You could of course have the
>operations return a collection and accumulate the results in the loop that
>calls them, but in e.g. Java methods can have only one return value and
>that may be "in use" for other things.
>
>A typical use is the gathering of messages, especially error messages. The
>return value of the operations is often in use for the actual "business"
>part of the operations, and the use of exceptions would mean that every
>operation can contribute at most one message.
>
>Therefore: pass a collection to each operation so that it can contribute
>all the messages. This parameter "collects" the messages, hence the name of
>the pattern. It is useful e.g. for collecting messages to be displayed in a
>UI.
>
>It is documented in Kent Beck's "Smalltalk Best Practices" book, wich
>contains a lot of very helpful patterns that are applicable to other
>languages as well.
>
>- Arno
>
>
>
>Jesús Alonso wrote:
>>Hello.
>>
>>I need information about the Collecting Parameter design pattern, but all
>>I could find was the info in this page:
>>http://c2.com/cgi/wiki?CollectingParameter
>>
>>The fact is that the information given there about the pattern isn't
>>enough for me to understand very well the pattern.
>>I would find helpful any information about what this pattern does exactly,
>>some examples, and maybe a concrete context where it could be applied
>>successfully and why.
>>
>>Thanks in advance.
>>
>>Best regards,
>> Jesús Alonso
>>
>>
>>_______________________________________________
>>patterns-discussion mailing list
>>patterns-discussion at cs.uiuc.edu
>>http://mail.cs.uiuc.edu/mailman/listinfo/patterns-discussion
>>
>
>
More information about the patterns-discussion
mailing list