Hi Guys
I've got a problem where I need to generate a Word based reports on object “Customer”.
I usually do this by passing Customer to a class which knows how to create a Word document, insert bookmarks etc.
The problem with this, is that I find myself placing the logic for retrieving and formatting information about the Customer object in this class.
I understand this is bad and violates the single responsibility principal.
I though about creating another class like “CustomerReportInfo” which accepts a Custom and has all the logic concerning the formatting and retrieving of data, that way, the Word generating class is small and the two can change irrespective of one another.
I'm just wondering what this class should be called? I've gone through a list of patterns and I can't really see anything which fits the description. It doesn't sound like a strategy, or proxy... It sounds like DTO, but DTOs are usually dumb classes with no functionality, aren’t they?
Any ideas on which pattern this resembles?