本文介绍了Jquery vs Google Closure va GWT Pros&用于大型Web应用程序开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



网站访问量在网站上的流量可能还会变得非常高。

所以我在这里有点困惑,我应该使用jquery / jquery ui或谷歌封闭或GWT。



我熟悉jquery,我在这方面做了很多工作,但对于GWT& Google Closure这是我第一次。



我在java中也很舒服,所以我可以使用GWT,但我已经提到过这是我第一次使用GWT。



所以请向我推荐这个优点&在跨浏览器兼容性,易于理解,代码维护,丰富的用户界面支持等方面,所有这三方面的优点都是相同的。

- 提前感谢



如果这个问题是重复的,不仅仅是发布链接。

解决方案

我认为这取决于您想要创建什么样的网站。

GWT可能最适合所谓的(面向服务UI)和(面向服务的前端架构)。

在GWT网络应用程序中,您有一个HTML主机页面,由您的后端以及所有UI工作流程和是由GWT在客户端完成的。
因此,如果你想实现类似桌面的应用程序,GWT可能是你的最佳选择,因为它是一个很好的工具包,它允许开发复杂的桌面应用程序,并提供JAVA开发(测试,重构等)的所有优点。 对于传统web 2.0ish网站,GWT可能不是最好的选择,因为它比JS框架(jQuery,dojo等)具有更大的学习曲线。 。
此外这些网站有多个页面,Javascript用于UI增强,而不是完全接管流同步,而只是使页面更具交互性。对于这些网站,您通常会拥有一个良好的后端(Grails,Spring MVC),它负责流同步,而JS框架只负责使UI更加交互和更改一些UI。


这种网站的例子是stackoverflow。如果你点击一个链接,它会加载一个新的HTML页面。如果您点击收件箱链接,它将使用jQuery打开弹出窗口并检索您的通知并显示它们。

Google Closure可能更接近于jQuery,而不是GWT。我认为Google Closure最大的卖点是客户端和服务器端的HTML模板。我对Google Closure没有多少经验,但Google大量使用它们的网络应用程序。

因为我主要使用GWT,所以这里列出了我可以想到的有关GWT的优点和缺点:$ b​​
$ b 优势


  • 强大的工具包
  • 开发工具(测试,重构,日食,实时调试)
  • 跨浏览器兼容性(注意一些注意事项)

  • 第三方库的可用性(DTO序列化,MVP框架等)

  • 只有使用的代码被下载到客户端(使用JS框架,即使只使用一个特定的函数,也可以下载整个框架) li>
  • GWT-RPC和RequestFactory与JAVA后端进行通信(无需序列化或反序列化)。



缺点


  • 更大的学习曲线

  • 可能不适合小型UI增强功能

  • 如果代码库很大,且浏览器不同,编译可能需要一些时间和语言必须被支持

  • 生成的Javascript可以在复杂的应用程序中变得很大(解决方案:代码分割)


    作为一个侧面说明:每个新的GWT版本都会因为每个新的GWT版本在编译时间和代码大小方面的改进而变得不那么成问题。 应该是在这方面有一些非常好的改进。总结一下:如果你想开发一个像交互式Web应用程序这样的桌面,我认为GWT可能是你的最佳选择。

    然而,如果你想开发更传统的web 2.0ish网站jQuery / Google Closure可能是更好的解决方案。

    I am about to start developing a large web application.Which contains media(video,audio & images) and a large user base.

    The traffic on website may also goes very high.

    So here i am a little bit confused the should i use jquery/jquery ui or Google closure or GWT.

    i am familiar with jquery and i worked a lot into that but for GWT & Google Closure this is my first time.

    I am also comfortable in java so i can use GWT but i already mentioned the it's my first time with GWT.

    so please suggest me the pros & cons of all these three in terms of cross browser compatiblity,ease of understanding,maintenance of code,rich ui desing support etc.

    -Thanks in advance

    if this question a duplication of some other than just post the link.

    解决方案

    I think it really depends on what kind of web-site you want to create.
    GWT is probably best suited for so called SOUI (Service Oriented UI) and SOFEA (Service Oriented Front End Architecture).
    In GWT web-applications you have one HTML host page which is served by your backend and all the UI workflow and flow synchronisation is done on the client side by GWT.So in case you want to achieve a desktop like app GWT is probably your best choice because it is a great toolkit which allows developing complex desktop like applications and provides all the advantages of JAVA development (testing, refactoring, etc).

    For "traditional" web 2.0ish web-sites GWT might not be the best choice because it does have somehow bigger learning curve than JS frameworks (jQuery,dojo, etc).
    Furthermore these web-sites have multiple pages and Javascript is used for UI enhancements and not for completely taking over flow synchronisation but just making the page more interactive. For these web-sites you usually have a good backend (Grails, Spring MVC) which takes care of flow synchronisation and the JS framework is just responsible for making the UI more interactive and for some UI changes.

    An example for this kind of web-sites is stackoverflow. If you click on a link it will load a new HTML page. If you click on your inbox link it will use jQuery to open a popup and retrieve your notifications and display them.

    Google Closure is probably closer to jQuery than to GWT. I think the biggest selling point of Google Closure are the client- and server-side HTML templates. I don't have much experience with Google Closure but it is heavily used by Google for their web-apps.

    Because I have worked mostly with GWT here is a list of advantages and dis-advantages I can think of regarding GWT:

    Advantages:

    • Robust toolkit
    • Development tools (testing, refactoring, eclipse, live-debugging)
    • Cross browser compatibility out of the box (with some caveats)
    • Availability of third party libraries (DTO serialization, MVP frameworks, etc)
    • Only code which is used is downloaded to the client (with JS frameworks you download the whole framework even if you only use one specific function)
    • GWT-RPC and RequestFactory for communication with a JAVA backend (no need to serialize or de-serialize yourself).

    Disadvantages:

    • Bigger learning curve
    • Might not be suited for small UI enhancements
    • Compilation can take some time if code base is big and different browser and languages must be supported
    • Generated Javascript can become big in complex applications (solution: code splitting)

    As a side-note: with each new GWT version the disadvantages become less of an issue as each new GWT version improves in compilation time and code size. GWT 2.5 is supposed to have some really good enhancements in this area.

    To summarize: if you want to develop a desktop like interactive web-application I think GWT is probably your best choice.
    However if you want to develop a more traditional "web 2.0ish" web-site jQuery/Google Closure might be a better solution.

    这篇关于Jquery vs Google Closure va GWT Pros&用于大型Web应用程序开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 18:09