通过网络服务传递类或数据读取器 [英] passing class or datareader via webservice

查看:63
本文介绍了通过网络服务传递类或数据读取器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Web服务和SOA有一个广泛的问题.我有一个数据库,其中包含要公开读取的数据(仅读取,无插入或更新).

I have a broad question about Web Services and SOA. I have a database that contains data I would like to expose for reading (just reading, no inserts or updates). Is it best to expose the data as a class or is it best to expose the information as a datareader?

推荐答案

它必须是一个类.客户端应用程序应该对数据库一无所知.
It must be a class. Client applications should not be knowing anything about database.


仅公开与客户端相关的数据被认为是最佳实践".通常最好不要直接公开数据源(数据库).

如果这是内部的Intranett应用程序,则可以直接访问数据库服务器.开发起来可能更便宜.

问候
Espen Harlinn
It'' considered "best practice" to expose only the data that is relevant for the client. It''s usually a good idea not to expose the data source (database) directly.

If this is an inhouse, intranett application, it can make sense to access the database server directly. It''s probably cheaper to develop.

Regards
Espen Harlinn


这篇关于通过网络服务传递类或数据读取器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆