如何编写代理方法?
首先,我不知道“代理方法”这个术语是否是描述我需要的真正方法,但让我告诉我实际上真正想知道的是什么:
假设我有一个名为 Proxy Class 的类,其中包含代理方法,
class ProxyMethods
{
public void CallHelloWorld();
}
实际上这是一个镜像,实际代码存储在网络服务器中。那么这个方法如何在不使用webservices的情况下调用位于Web Server中的真实方法呢?
这种方式可以保护我自己的代码,如果重构软件重构位于客户端计算机中的dll,那么它只会显示基本方法签名和一些用于连接位于Web服务器中的真实类的连接数据。
那么我该如何实现呢?
也许远程处理?
First I don't know the term of "Proxy Methods" are true way to describe what I need is but let me tell what I really want to know actually :
Suppose I have a class, named Proxy Class containing proxy methods
class ProxyMethods
{
public void CallHelloWorld();
}
actually this is a mirror, actual codes are storing in a web server. So how would this method call the real method that is locating in Web Server without using webservices ?
This way would secure my own code, if a refactoring software refactors the dll located in client's computer, then only thing it would show is that basic method signatures and some connection data which is used to connect the real classes located in Web Server.
So how would I accomplish it ?
Maybe Remoting ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道你为什么要试图避免网络服务。性能问题?无论如何,WCF 是当今的最佳选择。远程处理几乎完全过时了。如果您愿意,使用 WCF 可以通过配置更改从传统的 SOAP over HTTP Web 服务传输转变为二进制加密传输。有很多选项可以根据您的需求调整流量、安全性等。
I'm not sure why you are trying to avoid web services. Performance concerns? Regardless, WCF is the way to go these days. Remoting is nearly totally obsolete. With WCF, it is a config change to go from traditional SOAP over HTTP web service transport to a binary, encrypted transport if you wish. There are so many options to tune the traffic, security, etc. to your needs.