Single page Web App in Java framework or examples? [closed]

我们两清 提交于 2019-12-03 05:15:23

I have built quite a large "single-page" javascript website, that generats all HTML on the client. Server provides JSON only responses. I used Google Closure tools for the following reasons:

  • Google Closure Templates allows designing templates in high level templating language (named soy) which is compiled either to pure javascript functions to run on the client or java code to run on the server site.

  • Google Closure Compiler, which allows separating javascript code to modules and provides autmatic dependency injection for uncompiled mode. Good program structure and modularisation is necessary for any project exceeding simple html decoration. This is hard to achieve with frameworks like jQuery or dojo. In advanced compiled mode it transforms your javascript to shorter an more efficient equivalent, eliminates dead code and do dramatic reduction in size, which can shrink the original codebase to few % of the original size.

  • Google Stylesheets is meta css language which works great with closure compiler.

  • Google Closure Library is huge and well tested javascript library and with closure compiler, you only take what is needed.

To streamline the development, I'm using plovr, written by Michale Bolin, a former googler, one of the members of the original Closure Compiler Team.

I can recommend reading Michale's book: Closure, the Definitive Guide.

I must but warn, the initial leraning curve might be quite steep, but it is well worth the pain. Google used this tools to write almost all their web projects.

Just one more thing

If you feel really adventurous, and want to peep in to the future, I recomend upgrading the former strategy with Clojure/ClojureScript. For the start, watch this very persuasive talk of Rich Hickey and make sure to check Clojurescript one project.

I recommend AribaWEB for its advanced AJAX usage.

http://aribaweb.org/

Take a look to ItsNat, is a Java framework focused on Single Page Interface SEO compatible websites.

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