Parameter Objects
Using a parameter object makes the method signature a single named parameter with self-documenting fields. A data class holds fields and getters without meaningful behavior of its own. The data class smell comes from dependent logic being…
2 sources - 6 claims
Using a parameter object makes the method signature a single named parameter with self-documenting fields. A data class holds fields and getters without meaningful behavior of its own. The data class smell comes from dependent logic being scattered outside the class, not from simplicity alone. Parameter objects group related parameters into a single object. A parameter object can replace several separate arguments with one dedicated data class or struct.