Composed Method

This is a pattern from SmalltalkBestPracticePatterns by KentBeck:

Divide your program into methods that perform one identifiable task. Keep all of the operations in a method at the same level of abstraction. This will naturally result in programs with many small methods, each a few lines long.

When you use ExtractMethod a bunch of times on a method the original method becomes a ComposedMethod.

ComposedMethod is NOT a synonym for ExtractMethod.

So the key difference is keeping all the operations in a method at the same level of abstraction? I can see where that might involve more than just a simple method refactoring. You might even generate whole new classes.

ComposedMethod then would be what you have after the code has been refactored mercilessly, whether the refactorings are ExtractMethod, ExtractClass, something else or some combination thereof.

See also: ContractiveDelegation, MethodObject

EditText of this page (last edited January 15, 2005)
FindPage by browsing or searching

This page mirrored in WikiPagesAboutRefactoring as of April 29, 2006