[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby Blocks and Template Method Pattern

bcparanj@gmail.com

2/5/2007 7:33:00 PM

I was reading the Programming Ruby book yesterday and the explanation
for Ruby blocks sounded very similar to Template Method pattern that I
used in other object-oriented languages.

Is my understanding correct? TIA

1 Answer

Avdi Grimm

2/5/2007 7:41:00 PM

0

On 2/5/07, bcparanj@gmail.com <bcparanj@gmail.com> wrote:
> I was reading the Programming Ruby book yesterday and the explanation
> for Ruby blocks sounded very similar to Template Method pattern that I
> used in other object-oriented languages.
>
> Is my understanding correct? TIA

Yes, that's one way of looking at it. Using blocks can be like
"filling in the blank" in a template method.

--
Avdi