Jaxer 的优缺点 [英] Pros and cons with Jaxer

查看:28
本文介绍了Jaxer 的优缺点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到这个问题已经之前问过,但它有一个月没有像样的回应......我在看 Aptana 的 Jaxer,我发现这个概念非常令人兴奋.

I realize that this question has been asked before, but it has been a month with no decent responses... I'm looking at Aptana's Jaxer and I find the concept to be very exciting.

以下是为不熟悉它的人提供的快速概览:

Here is a quick overview for those who are not familiar with it:

用他们的话说,Jaxer 是世界上第一个真正的 AJAX 服务器".它基于 Mozilla 引擎,因此脚本是用 javascript 编写的,您可以完全访问服务器端的 DOM.

Jaxer is, in their words, "the world's first true AJAX server". It is based on the Mozilla engine so scripts are written with javascript and you have complete access to the DOM on the server-side.

脚本使用 <script> 标签放置在您的页面上,您可以指定 runat 属性(ala ASP.NET)来标记要在客户端上执行的脚本,服务器,两者,或作为服务器代理",使功能在客户端可用,但它们通过 AJAX 在服务器上执行.这也意味着您可以在服务器和客户端上使用您喜欢的客户端库(jQuery、Prototype).

Scripts are placed on your pages with <script> tags and you can specify a runat attribute (ala ASP.NET) to mark scripts for execution on the client, server, both, or as a "server-proxy" which makes the functions available on the client, but they execute on the server via AJAX. This also means that you can use your favorite client-side libraries (jQuery, Prototype) on the server as well as the client.

它还可以用于处理以另一种语言(例如 php、ruby)生成的文档,我认为除了帮助将现有应用程序转换为使用 Jaxer 之外,这并不实用.

It also can be used to process documents that are generated in another language (e.g. php, ruby) which I imagine is not practical except to help in transitioning existing applications to use Jaxer.

  • 优缺点是什么?
  • API 的成熟度/稳定性如何?
  • 性能与其他服务器端 html预处理器?
  • 有人用过 Jaxer 吗?技术(php、pearl、ruby等)你有什么经历?

我发布了另一个关于我在玩 Jaxer 时发现的缺点的问题:Defining使用 Jaxer 时的对象

I've posted another question regarding a drawback I discovered while playing with Jaxer: Defining objects when using Jaxer

推荐答案

我使用 Jaxer 的时间不长,但我发现了以下几点:

I didn't use Jaxer for very long, but here's some things I found:

优点

  • 用相同的代码编写前端和后端.特别适合编写验证逻辑.
  • 无缝"AJAX 通信返回到服务器 - 就像调用 JS 函数一样.
  • 能够使用 jQuery 等 JavaScript 框架来操作 DOM.
  • 能够使用 Canvas API 生成或操作图像.
  • 您可以使用 Array extras 和 getter/setter 等令人惊叹的 JavaScript 1.8 新功能编写服务器 JavaScript.

缺点

  • 我发现他们的 API 不稳定(当我尝试时他们正在过渡到 1.0,所以这有点道理)并且文档令人困惑、缺失或与更改后的功能不匹配.我还发现调试我的 Jaxer 服务器端代码非常困难,而且当我遇到麻烦时,错误消息也不是很有帮助.
  • 您的演示文稿和逻辑之间没有真正的 MVC 甚至 MVP(ASP.NET 风格)分离.
  • 我个人无法让 E4X(JavaScript 中的 xml)正常工作,这应该是一个很大的吸引力.
  • 围绕它构建的框架并不多,可用于构建整个应用程序.您从一些非常基本的构建块开始.
  • 它在您看来并没有真正提供任何帮助,因此请忘记您可能在其他地方使用的所有模板或可重用组件.并不是说你不能复制它,但它比开箱即用更难.

总的来说,我认为 Jaxer 作为另一个 web 框架前面的后处理器最有希望.使用 Jaxer 将所有漂亮的 AJAX 内容分层放置在现有站点之上会很棒.使用服务器和客户端之间共享的验证/页面操作逻辑来创建动态站点将变得更加容易.我认为我不想只使用 Jaxer 编写应用程序.此外,它还很年轻(而且不成熟) - 我很想知道它的结局.

Overall, I think Jaxer has the most promise as a postprocessor in front of another web framewok. It would be great to use Jaxer to layer all the spiffy AJAX stuff on top of an existing site. It would make it a lot easier to make a dynamic site with validation / page manipulation logic shared between server and client. I don't think I would want to write an application using only Jaxer. Also, it's young (and immature) - I'll be interested to see where it ends up.

这篇关于Jaxer 的优缺点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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