Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

II. Practice > 13. Composed Method and SLAP

Chapter 13. Composed Method and SLAP

image with no caption

SLAP stands for the Single Level of Abstraction Principle. While the concept comes from Kent Beck’s Smalltalk Best Practice Patterns (Prentice Hall), my friend Glenn Vanderburg is the one who captured its essence with this great acronym.

Before I talk about SLAP, though, I must talk about the composed method pattern discussed in Beck’s book. Composed method mandates that all public methods read like an outline of the steps to perform. The actual steps are implemented as private methods. Composed method is a way of factoring your code to keep it cohesive and make it easier to spot candidates for code reuse. The best way to understand composed method is to see it in action.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint