13.07.2015 Views

Smalltalk Best Practice Patterns Volume 1: Coding - Free

Smalltalk Best Practice Patterns Volume 1: Coding - Free

Smalltalk Best Practice Patterns Volume 1: Coding - Free

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MessagesMessages are the heartbeat of a <strong>Smalltalk</strong> program. Without messages, there would be no program.Deftly managing this heartbeat is the first skill of the expert <strong>Smalltalk</strong> programmer. When youlearn to see your program in terms of patterns of messages and you learn what can be done to thatstream of messages to solve problems, then you will be able to solve any problem you can imaginein <strong>Smalltalk</strong>.Procedural languages make choices explicitly. When you code up a case statement, you say onceand for all what all the possibilities are. In <strong>Smalltalk</strong>, you use messages to make choices for you.The extra added bonus is that the set of choices is not set in concrete. You can come along later andadd new choices without affecting the existing choices just by defining a new class.This section talks about the tactical ways you can use the message stream. It gives you a toolbox oftechniques for solving problems by manipulating the communication between objects.<strong>Coding</strong> <strong>Patterns</strong> page 36 of 147 9/30/2006

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!