Quantcast
Channel: Steve Freeman » Smalltalk roots
Viewing all articles
Browse latest Browse all 2

Smalltalk cascades

$
0
0

Jay Fields writes about using chaining for object initialisation.

One of the inspirations for the fluent interface style in jMock was a Smalltalk construct called cascade, which sends multiple message to the same object.

aThing one: 'one';
  two: 'two';
  other.

I just got fed up having to redeclare the same object

thing.setOne("one");
thing.setTwo("two);

Viewing all articles
Browse latest Browse all 2

Trending Articles