Design pattern for multiple output formats

后端 未结 7 1996
清酒与你
清酒与你 2021-01-05 04:41

I have a class structure which represents (internally) the data I wish to output to a file.

Some of the member variables are private to the data class so that it ca

相关标签:
7条回答
  • 2021-01-05 05:35

    I think the problem you have here is one of design. Serializing to a file shouldn't be modifying that data in anyway, so why should those functions be private? If all you are doing is examining data and writing it out, you should have an adequate public interface.

    0 讨论(0)
提交回复
热议问题