November 2017
Intermediate to advanced
670 pages
17h 35m
English
A parameter object contains only fields and crude methods for accessing them (getters and setters). It is a dead data structure used only to transfer data.
If we are passing a lot of unrelated data items into a function, then what are the odds that our function would fail the Single Responsibility Principle?
What if we wanted to add logic that could modify a data value based on our runtime context?
However, if we have a set of parameters that describe a new customer, we could consider grouping them into a data objects. Something like the following could be considered a reasonable thing to do:
We grouped the FullName attributes (salutation, firstName, middleName, lastName ...