工厂和绘图员的职责是否重叠?
我对地图绘制者应该承担哪些责任感到有点困惑。您能否为我提供有关对象工厂和对象映射器之间相互依赖关系的更深入的描述。对象映射器应该使用对象工厂还是应该自己创建结果对象?
I am a bit confused as to what responsibilities should a mapper hold. Could you please provide me with more in-depth description of mutual interdependence between object factory and object mapper. Should object mapper make use of object factory or should it create result objects on its own?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
工厂(或 IoC/DI 容器)的工作是创建新对象。
映射器的工作是创建现有对象的副本。
话虽这么说,映射器确实必须有一个对象来启动,并且您有 3 个选项...
The job of a factory (or an IoC/DI container) is to create new objects.
The job of the mapper is to create copies of existing objects.
That being said, the mapper does have to have an object to start with, and you've got 3 options there...