Pros and cons with Jaxer

白昼怎懂夜的黑 提交于 2019-11-30 13:27:13

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

Pros

  • Write the frontend and backend in the same code. Especially nice for writing validation logic.
  • "Seamless" AJAX communication back to the server - it's just like calling a JS function.
  • The ability to use JavaScript frameworks like jQuery to manipulate the DOM.
  • The ability to generate or manipulate images using the Canvas API.
  • You get to write your server JavaScript using whizzy new JavaScript 1.8 features like Array extras and getters/setters.

Cons

  • I found their API to be unstable (they were transitioning to 1.0 when I was trying it so that kinda made sense) and the documentation was confusing, missing, or didn't match with changed functionality. I also found that it was very hard to debug my Jaxer server-side code, and when I got in trouble the error messages weren't very helpful.
  • You don't get real MVC or even MVP (ASP.NET-style) separation between your presentation and your logic.
  • I personally couldn't get E4X (xml in JavaScript) working, which was supposed to be a big draw.
  • There's not a lot of framework built around it for building a whole application. You're starting from some pretty basic building blocks.
  • It's not really providing any help in your view, so forget all the templating or reusable components you might use elsewhere. Not that you can't replicate that, but it's more difficult than having it out of the box.

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.

I did come across this set of performance benchmarks.

It looks as though Jaxer performs better than Rails, but not as well as php...

@BRH: Great insight. I would echo all of the "Pros" and "Cons" 2, 4, & 5 and your final overview. I kind of get the sense that they didn't intend to displace any of the market for upstream frameworks ... but if they could do so and keep it as tight and comprehensible as it is, I hope they do! I like the way they think!

P.S. I don't know if it is new, but there is a <jaxer:include tag that injects fragments into the page prior to server-side script execution that might be a help in some code-reuse scenarios. There may be more for me to discover along those lines.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!