Structurally, your approach in general makes proper testing easier (each class deals with a specific part of the overall problem, makes fewer assumptions, and each needs just one mock). That said, it's not necessarily a bad idea to have something that's more like a data transformer or, as Ewan suggested, a converter (that just produces the output data structure), and do the actual write elsewhere - I guess this is what your teammate was thinking. You guys are going to have to discuss it and decide what to do (and perhaps arrive at a third option).
↧