将类库公开为“WCF 数据服务”
是否可以通过WCF数据服务公开.NET(类)库?这种情况有意义吗?或者在这种情况下使用纯 WCF 是最好且唯一的方法?
背景:我有几个(旧的)C# 类库(封装了对不同数据源的访问),我想将它们与 Ajax 和 Silverlight 一起使用。我不能也不应该直接访问数据源,而必须使用库(因为向后兼容性)。
Is it possible to expose a .NET (class) library through a WCF Data Service ? Makes this scenario sense ? Or is the usage of pure WCF the best and only way in this case ?
Background: I have several (old) C# classlibraries (which encapsulate the access to different datasources), which I want to use with Ajax and Silverlight. I cannot and should not access directy to the datasources and have to use the libraries (because of backward compatibility).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
值得注意的是,对象的 XML 序列化不符合代码中的 OO 构造,即 XML 没有继承的概念。如果你的类库在这方面很复杂,我建议不要这样做。
您不能创建一个仅使用您的类库的独立服务吗?我的意思是创建一个新的服务和服务接口,而不是把你的类库变成一个服务接口。
Its worth noting that the XML serialization of objects does not conform to the OO constructs you have in code, ie XML has no notion of inheritence. If your class library is complicated in this regard, I would advise against it.
Can you not create an independent service that simply uses your class library underneath? By this I mean creating a new service and service interface, not turning your class library into a service interface.