- Scala Design Patterns.
- Ivan Nikolov
- 56字
- 2021-08-27 19:09:48
The visitor design pattern
The visitor design pattern represents an operation to be performed on the elements of an object structure. It allows developers to define a new operation without changing the original classes. Scala can minimize the verbosity of this pattern compared to the pure object-oriented way of implementing it by passing functions to methods.