Reputation: 165207
What is the term/pattern for a class which has no functionality of its own, it just has public data?
I use this pattern all the time as step one of extracting a class. I create a class which only has data attributes. I then refactor the target functions to use an instance of it instead of whatever storage it was using, usually a hash. Then the function can be moved to the new class with much less change.
Here is an example of this in Perl.
Upvotes: 3
Views: 285
Reputation: 8562
I usually call these data transfer objects, DTOs, as their responsibility is usually carrying data from one tier to another.
Upvotes: 2