Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 487 Bytes

Replace Function with Command.md

File metadata and controls

12 lines (8 loc) · 487 Bytes

Replace Function with Command

Tags: refactor, refactoring api Inverse: Replace Command with Function

Untitled

Motivation

There are times when it’s useful to encapsulate a function into its own object, which I refer to as a “command object” or simply a command. Such an object is mostly built around a single method, whose request and execution is the purpose of the object.