没有建立服务层企业应用 [英] Build enterprise application without service layer

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

问题描述

有这么多的教程,教我们使用例如一些ORM直接与数据库,但在现实生活中我不记得一个大的项目,直接与数据库,而不是与服务工作,使教程的量似乎有些奇怪给我。结果
 直接连接的应用程序在数据库和应用程序之间的数据转换的速度实实在在的好处,而且他们不具备的功能出现,因为服务层的限制(例如让我们实体框架和WCF数据服务(使用相同的本身的实体数据模型))。在另一边的服务解决方案是更安全,更灵活,这就是为什么我(我想很多其他的程序员),通常选它为建设有某种共同的业务逻辑的大型应用程序... BUT!有时失去速度高达10倍!那只是伤心,应用程序变得敏感不到它可能是。结果
所以我要问的问题是:你可以分享自己构建企业应用程序,而使用Web /服务层的经验,当它是一个不错的选择。

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天全站免登陆