为什么要使用WCF服务 [英] Why to use WCF service

查看:61
本文介绍了为什么要使用WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Windows应用程序。当我运行它时,它将详细信息保存到数据库。



我看到一些帖子,他们正在使用WCF服务来执行此操作...



有谁能告诉我在这种情况下使用WCF服务的原因是什么..



我有什么试过:



我创建了一个Windows应用程序,当我点击提交按钮时,它会将数据保存到数据库中。

解决方案

有几个原因。这种方法隐藏了可能不安全的SQL接口,隐藏了直接访问,身份验证等等......更重要的是,如果隐藏了对不需要的功能的访问,并且通常会创建一个façade抽象出数据库功能。此外观可能与通常的SQL接口(或其他数据库模型)非常不同,通常是特定数据库项目的特定数据库项目。首先,它可以完全是语义,或面向域的(意思是:应用程序字段域)。在产品/服务的发展过程中,可以完全替换数据库,对于WCF接口用户来说,这仍然是完全不可察觉的。请参阅:门面模式 - 维基百科,免费的百科全书 [ ^ ]。



数据库层和WCF层变得不同的。换句话说,此解决方案的好处来自于多层架构的一般优势。请参阅:多层架构 - 维基百科,免费的百科全书 [ ^ ]。



-SA

I created a windows application. When I run it, it saves the details to the database.

I saw some posts that they are using WCF Service to do this...

Can anyone tell me what is the reason for using WCF Services in this scenario..

What I have tried:

I created a windows application, and when i hit submit button, it saves data into database.

解决方案

Several reasons. This approach hides the potentially unsafe SQL interface, hides direct access, authentication, and so on… More importantly, if hides the access to unwanted functionality, and more generally creates a façade abstracting out database functionality. This façade can be very different from the usual SQL interface (or other database models), both general and specific to a particular database project. First of all, it can be totally semantic, or domain-oriented (meaning: application-field domain). During the evolution of the product/service, the database can be completely replaced which still will be completely not noticeable for the WCF interface users. Please see: Facade pattern — Wikipedia, the free encyclopedia[^].

Database layer and WCF layer become different tiers. In other words, the benefits of this solution comes as the general benefits of multitier architecture. Please see: Multitier architecture — Wikipedia, the free encyclopedia[^].

—SA


这篇关于为什么要使用WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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