构建无服务层的企业应用 [英] Build enterprise application without service layer

查看:24
本文介绍了构建无服务层的企业应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多教程教我们直接使用例如一些 ORM 与数据库,但在现实生活中,我不记得一个直接使用数据库而不是服务的大项目,所以这些教程的数量似乎很奇怪给我.
直接连接的应用程序在数据库和应用程序之间的数据转换速度方面具有真正的好处,并且它们没有由于服务层而出现的功能限制(例如让我们使用实体框架和 WCF 数据服务(使用相同的实体数据模型本身))).另一方面,服务解决方案更安全和灵活,这就是为什么我(我认为许多其他程序员)通常选择它来构建具有某种通用业务逻辑的大型应用程序......但是!有时速度损失高达10倍!真遗憾,应用程序的响应速度变得不如预期.
所以我想问的问题是:你能分享一下你在没有 web/services 层的情况下构建企业应用程序的经验吗?什么时候是一个好的选择?

There are so many tutorials that teach us to use for example some ORM directly with database, but in real life i cant remember a big project that was working directly with database and not with services, so the amount of that tutorials seems strange to me.
Directly connected applications have real benefits in speed of data transitions between database and the app, and they do not have restrictions in functionality that appear because of service layers(for example lets take Entity framework and WCF Data services(that uses same entity data model itself)). On the other side services solution is more secure and flexible, thats why i(and i think many other programmers) usually choose it for building large applications with some kind of common business logic...BUT! Sometimes lose in speed is up to 10 times! Thats just sad, application becomes less responsive than it could have been.
So the question i want to ask is: can you share your own experience of building enterprise applications without the layer with web/services and when is it a good choice?

推荐答案

企业应用程序 != n 层应用程序.这意味着您无需创建单独的物理中间层(业务逻辑)即可编写企业应用程序.创建单独的中间层必须始终是要求的一部分,因为它会增加很多额外的复杂性 = 很多额外的成本.

Enterprise application != n-tier application. It means that you can write enterprise application without creating separate physical middle tier (business logic). Creating separate middle tier must always be part of requirements because it is a lot of additional complexity = a lot of additional costs.

单独中间层的通常要求是:

Usual requirements for separate middle tier are:

  1. 安全性 - 有时 Web 服务器位于 DMZ 中,中间层必须位于安全网络中
  2. 可重用性 - 您希望在多个应用程序中使用中间层,这也导致了 SOA 需求
  3. 可扩展性 - 中间层可能要复杂得多,因此在前端层上独立扩展它会很有用.如果您想在多个应用程序中使用中间层,您还必须能够独立扩展它.可扩展性要求通常基于性能和可用性要求.

如果您没有任何此类要求,您可以制作多层应用程序,其中前端和业务逻辑位于同一服务器上的同一进程中.

If you don't have any such requirement you can make multilayer application where both front-end and business logic sits in the same process on the same server.

这篇关于构建无服务层的企业应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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