- Scala Design Patterns.
- Ivan Nikolov
- 75字
- 2021-08-27 19:09:47
The command design pattern
This design pattern represents an object that is used to store information about an action that needs to be triggered at a later time. The information includes the following:
- The method name
- The owner of the method
- Parameter values
The client then decides which commands need to be executed and when by the invoker. This design pattern can easily be implemented in Scala using the by-name parameters feature of the language.