Design pattern for multiple output formats

后端 未结 7 2045
清酒与你
清酒与你 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.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题