I am writing class
CollectingClass which collects much data in private members and prints them out later.
To encapsulate all the private members, I decided to create a struct
Data, keeping all the members (which also enables me to return the struct to the calling class, which is very useful).
I decided that it would be great to move all the print commands to the struct as well (since they don't belong to
CollectingClass anymore, according to my feeling of code style)
The printing code is about 150 lines of code. Moving this in the struct seems to be horrible code smell to me (as the header gets huge).
Here are the options and I don't know, which one is the best
- Keep the printing code in
- Move the printing code as well as the members of the struct to a new class
DataClass. Make all members public to allow fast access by
- As #2 but create getters and setters for the members, which will probably slow down the execution
What do you think will be the best design? Do you have any other idea?