我应该公开com实体还是将其包装 [英] Should I expose a com entity or wrap it
本文介绍了我应该公开com实体还是将其包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是想在我遇到的设计问题上征询其他人的意见.
我正在使用第三方COM库(有效地从数据源检索信息),该库包含一组业务对象,这些业务对象的属性需要在表示层和商务层使用.
我应该公开这些本机对象还是应该创建一个有效地封装它们的自定义类?
请投票和/或留下您的首选选项.
5-将实体包装在自定义类中
1-公开本机实体
谢谢
I just wanted to get other peoples opinions on a design issue I have.
I am using a third party COM library (effectively retrieves infromation from a datasource) which contains a set of business objects whose properties I need in the presentation tier as well as the buisness tier.
Should I expose these native objects or should I create a custom class that effectively encapsulates them?
Please vote and/or leave your preferred option.
5 - Wrap the entities in custom class
1 - Expose native entities
Thanks
推荐答案
只有在绝对必要的情况下才为自己创建更多工作.使用com界面(如果可以正常使用),直到遇到问题,然后尝试解决该问题.
Only create more work for yourself if it is absolutely necessary. Use the com interface if it works as is until you have a problem with it then try to fix the problem.
这篇关于我应该公开com实体还是将其包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文