设计一个系统,以presentation层和基于Web服务的API [英] Designing a system with a presentation layer and a web service-based API

查看:100
本文介绍了设计一个系统,以presentation层和基于Web服务的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在设计一个系统,其具有的功能,其基本上相同于presentation层和露出API层。我的问题是技术/策略,使用什么,所以我们可以得到最重用了我们的code在考虑性能?

We are designing a system that has functionality that is essentially the same at the presentation layer and the exposed API layer. My question is what technique / strategy to use so we can get the most reuse out of our code with performance in mind?

下面是一个简单的例子:

Here's a simplified example:

一个用户可以通过网络的形式添加的客户。这将触发Customer.Create()方法。

A user can add a Customer via a web form. This will fire the Customer.Create() method.

这是API消费者/用户可以通过SOAP / HTTP-POST到Web服务,将调用Customer.Create()方法中添加一个客户

An API consumer / user can add a Customer via a SOAP / HTTP-POST to a web service which will call the Customer.Create() method.

想象一下,这些层:

PRESENTATION
|
|
WEB SERVICE API (Customer.Create() is available here
|
|
FACADE Business Object Interface - Customer.Create() signature is here
|
|
BUSINESS Business object - Customer.Create method() is fleshed out here
|
|
DATA ACCESS - Writes data

在presentation层SOAP调用创建()Web方法,它调用门面的Create()方法调用该业务对象的Create()方法,通过数据访问层的电线。

The presentation layer SOAP calls the Create() web method, which calls the facade's Create() method which calls the business object's Create() method which wires via the data access layer.

问题:

是否有关于表现在我们presentation层使用API​​的Web服务的关注,还是有替代的presentation层直接连接到立面?如果是这样,什么样的技术来使用(WCF,远程处理,Web服务等)?

Is there a concern about performance in using the API's web services in our presentation layer, or are there alternatives to connect the presentation layer directly to the facade? If so, what technology to use (WCF, Remoting, Web Services, etc)?

请让我知道如果你需要更多的澄清。我有麻烦找出来,如果​​是很常见的消耗你的API在presentation层,还是你去解决它性能的原因。

Please let me know if you need any more clarification. I am having trouble finding out if it is common to consume your API in a presentation layer, or do you "go around it" for performance reasons.

这是我可能没有看到任何其他问题?

Any other concerns that I may not be seeing?

谢谢!

推荐答案

有一个在这个问题给出答案(一矿):

Have a look at this question and answers given (one mine):

<一个href="http://stackoverflow.com/questions/3867978/wcf-and-n-tier-architecture-and-serialization-performance">http://stackoverflow.com/questions/3867978/wcf-and-n-tier-architecture-and-serialization-performance

我觉得你的层次都很好,如果他们都是逻辑虽然我个人不会使用门面,而是我会使用ORM连接到数据库。

I think your tiers are fine if they are all logical although I would personally not use Facade and instead I would use an ORM for connecting to database.

至于技术,WCF和ASP.NET MVC这么多更好的选择了这是老ineffecient现在的Web服务。在远程所取代WCF和不应该被现在使用。

Regarding technologies, WCF and ASP.NET MVC are so much better choices over web services which is old and ineffecient now. Remoting was superceded by WCF and should never be used now.

这篇关于设计一个系统,以presentation层和基于Web服务的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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