简体   繁体   English

企业Web应用程序体系结构问题

[英]Enterprise Web Application Architecture Question

I am wondering if it would be possible to develop an enterprise-level web application without the use of a standard MVC structure and application server by carrying the business/flow logic and session data to the client-size Javascript and make it talk to REST data services directly...maybe we could make use of an authorization/authentication layer and a second validation layer sitting on top of the data services. 我想知道是否有可能通过将业务/流逻辑和会话数据传递到客户端大小的Javascript并使其与REST数据进行通信而无需使用标准MVC结构和应用服务器来开发企业级Web应用程序直接服务...也许我们可以利用位于数据服务之上的授权/身份验证层和第二个验证层。 All these services operate on standard HTTP methods, support configurable logging&monitoring, and content or query parameters are all contained in the HTTP request/response body. 所有这些服务都在标准HTTP方法上运行,支持可配置的日志记录和监视,并且内容或查询参数都包含在HTTP请求/响应主体中。 Static HTML and Javascript are served to the browser and the rest is carried out by Javascript functions talking to the HTTP-based authorization/authentication, validation and then data services. 静态HTML和Javascript提供给浏览器,其余的则由Javascript函数执行,这些函数与基于HTTP的授权/身份验证,验证以及数据服务进行通信。 Do you think this kind of an architecture could satisfy enterprise-level web application requirements? 您认为这种架构可以满足企业级Web应用程序要求吗?

Its possible but unlikely; 它可能但不太可能; what are the drivers that suggest this architecture to you? 有哪些驱动程序向您建议该架构? Is it just to be different or are there some specific aspects that this best addresses? 只是有所不同还是最能解决某些特定方面?

by carrying the business/flow logic and session data to the client-side Javascript and make it talk to REST data services directly 通过将业务/流逻辑和会话数据传递到客户端Javascript,并使其直接与REST数据服务对话

In theory you'd still be able to have an appropriately layered solution (Business Logic (BL) script vs UI focused script) but practically speaking it'd be messy; 理论上讲,您仍然可以拥有一个适当的分层解决方案(Business Logic(BL)脚本与针对UI的脚本),但实际上它会很混乱。 and you'd lose the ability to physically separate it into different tiers. 并且您将失去将其物理上划分为不同层的能力。 This could "bite" you at any number of places in the life of the system. 这可能会在系统寿命中的任何地方“咬住”您。

"Enterprise" grade systems are seldom small, I hate to think how much logic you'd be having to send over the wire to support a given action / process. “企业”级别的系统很少这么小,我讨厌考虑您必须通过有线方式发送多少逻辑来支持给定的操作/流程。

Putting all the BL into a scripting language ties you to that platform, and platforms change overtime. 将所有BL放入脚本语言后,您便会与该平台建立联系,并且平台会随着时间的推移而变化。 The bad thing about scripts is that whilst they are stable to a degree I'd suggest they are more exposed to change than server based platforms like Java or .Net. 关于脚本的坏处是,尽管它们在一定程度上是稳定的,但我建议它们比基于Java或.Net的基于服务器的平台更容易受到更改的影响。 In an enterprise scenario the servers will have very tight change control and upgrade paths mapped out for them - where-as browsers are much more open to regular change. 在企业场景中,服务器将具有非常严格的变更控制和为其映射的升级路径-因为浏览器更易于进行定期变更。

There's the issue of compatibility - unless you're tied to a specific browser (to the version level) guaranteeing consistent behavior is going to be harder, and will likely require more development effort. 存在兼容性问题-除非您绑定到特定的浏览器(在版本级别),否则要保证一致的行为将变得更加困难,并且可能需要更多的开发工作。 Let's say you deliver the solution successfully; 假设您成功交付了解决方案; what do you do when the business wants to take advantage of mobile computing - say iPads? 当企业希望利用移动计算(例如iPad)时,您会怎么做? Your only option is going to be a browser - you won't be able to take advantage of any of the native advantages of the platform. 您唯一的选择将是浏览器-您将无法利用该平台的任何本机优势。 "The web and browsers" might seem like they'll be around forever - but then I'm guessing that what MainFrame folks said at the time. “网络和浏览器”似乎永远存在-但是我猜测MainFrame当时所说的话。 A server centered solution is going to give you more life for less expense. 以服务器为中心的解决方案将以更少的费用为您提供更多的使用寿命。

Staffing will be an issue - you'll need very strong JavaScript and server-side developers. 人员配备将是一个问题-您将需要非常强大的JavaScript和服务器端开发人员。

Security: having your core BL out on the client where it's much more exposed sounds very dangerous. 安全性:将核心BL暴露在暴露得多的客户端上非常危险。

EDIT: 编辑:

Web Apps can be sow for many reasons - not many of which are reason enough to put all your BL in JavaScript on the client. 可以播种Web Apps的原因有很多-没什么理由足以将您所有的BL放在客户端的JavaScript中。 Building apps for performance is a whole field of endeavor on its own - I suggest you get more familiar with Architecting and implementing for performance for before you write-off n-tier web apps altogether :) 为性能而构建应用程序是一个整体的工作领域-我建议您在完全注销n层Web应用程序之前更加熟悉为性能设计和实施:)

Regarding keeping your layers separated: there's different ways of doing this but it boils down to abstraction - and more correctly to keeping good design principles in mind; 关于将各层分开:有不同的方法,但可以归结为抽象-更准确地说,是要牢记好的设计原则。 if you haven't heard of SOLID that would be a good place to start. 如果您还没有听说过SOLID ,那将是一个不错的起点。 In terms of implementation start reading up on Dependency Inversion (FYI - self promotion, the articles mine and is .Net focused, but you should have no problem tracking down Java based ones too). 在实现方面,开始阅读Dependency Inversion (FYI-自我提升,这些文章属于我,并且是.Net的,但您也应该不会遇到基于Java的问题)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM