构建丰富的 Web 应用程序有哪些选择?
我正在开发一个客户端 Java 应用程序,我想为其创建一个基于 Web 的用户界面(将从本地应用程序提供给浏览器)。冒着过于简单化的风险,它是一个微博工具,将支持类似于 Twitter 和 Facebook 的功能。它是开源的,您可以在我们的 wiki 上阅读更多内容。
重要的是,这个应用程序非常易于使用,而且我也希望它相对于当代的 Web 应用程序看起来不错(例如 Chrome 网上应用店)。由于我不是网页设计师,我希望使用能够为我提供“开箱即用”的有吸引力的 UI 的工具。哦,我需要保持可分发文件相当小(所以我使用的任何东西都需要相当轻量。
到目前为止,我已经研究了 Sproutcore 和 GWT。Sproutcore
应用程序确实具有我所希望的外观,但是我对 JavaScript 不太熟悉,经过一些实验后,我并不完全清楚如何实现我认为我需要的一些更复杂的功能
,GWT 更适合我的舒适区,然而,我花了很长时间才正确设置我的开发环境,似乎 GWT 想要决定我的应用程序的结构,但由于用户界面只是其中的一小部分,我不愿意构建它。 使用
我一直在考虑使用 CoffeeScript(这似乎比 JavaScript 更容易接受,并且有 Maven 构建器),也许与 JQuery-UI 一起
。我应该考虑吗?
I'm working on a client-side Java application for which I want to create a web-based user interface (which will be served up to a browser from the local app). At the risk of oversimplifying, its a microblogging tool that will support functionality similar to Twitter and Facebook. Its open source, and you can read more on our wiki.
Its important that this app is extremely easy to use, and I also want it to look good relative to contemporary web applications (such as the examples available on the Chrome web store). Since I am not a web designer, I'm hoping to use tools that give me an attractive UI "out of the box". Oh, and I need to keep the distributable file reasonably small (un him so whatever I use needs to be reasonably lightweight.
So far, I've looked at Sproutcore and GWT.
Sproutcore apps definite have the appearance I'm hoping for, but I'm not that familiar with JavaScript, and after some experimentation is not entirely clear to me how I will achieve some of the more sophisticated functionality that I think I'm going to need.
Being Java, GWT is more within my comfort zone, however I had a hell of a time just getting my development environment set up properly. It seems that GWT wants to dictate the structure of my application, but since the user interface is only a small part of it I'm not willing to build the entire app around GWT.
Something else I've been thinking about is using CoffeeScript (which seems more palatable him and him him him him him than JavaScript, and there are Maven builders for it), perhaps together with JQuery-UI.
What other options should I consider?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
推荐两个大的javascript框架Sencha和卡布奇诺。
它们具有丰富的开箱即用的 UI 工具包。后者内置了 MVC 框架,前者内置了通用 JavaScript 库。强烈推荐两者。
另外,正如推荐的那样,jQuery UI 是一个合理的工具包。我个人会结合 Sencha 丰富的 UI 工具包和轻量级 MVC 框架,例如 Backbone。恐怕这确实需要学好JavaScript。
您还可以主要从服务器驱动 JavaScript UI 工具包并跳过客户端 MVC。为此,sencha 应该作为 UI 工具包来使用,但如果您想要有意义的功能,您将需要更多的结构。我还推荐 RequireJS 进行模块化文件管理。
To recommend two big javascript frameworks Sencha and Cappuccino.
These have an extensive UI toolkit out of the box. The latter has an MVC framework build in, the former has a general JavaScript library build in. Both come highly recommended.
Also as recommended jQuery UI is a reasonable toolkit. I would personally couple Sencha for its rich UI toolkit and a lightweight MVC framework like Backbone. I'm afraid this does require learning JavaScript well.
You can also instead drive your JavaScript UI toolkit mainly from the server and skip the clientside MVC. For that sencha should surfice as a UI toolkit, but if you want meaningful functionality you will need some more structure. I would also recommend RequireJS for modular file management.
看看 Vaadin,它基于 GWT,但使用起来更简单。我已经使用它两年了,而且我也不是设计师。
Take a look on Vaadin its based on GWT but simpler to use. I use it since 2 years and i'am not a designer too.
看看 jQuery & jQuery UI (jQuery 模块 如果您希望部署到手持设备)
此外,由于您提到您不是设计师,因此您可能希望以 MVVM 模式实现前端,以将 UI 与应用程序的业务逻辑分开。 Knockout 是处理减速数据绑定的好方法
Take a look at jQuery & jQuery UI (jQuery Modile if you are looking to deploy to hand held devices)
Also, since you mentioned that you are not a designer, you might want to implement the front end in an MVVM pattern to separate the UI from the business logic of your applications. Knockout is a nice way to do with with decelerative data binding
我不喜欢编写纯 JavaScript,因此我将向您介绍一些有关基于 Java 的框架的信息。最近,我选择了 Google Web Toolkit。
优点:
缺点:
复杂的感觉:< /em>
一些注意事项:
使用 Vaadin 进行一些原型设计。尝试一些调试。然后尝试GWT 和类似规模项目的调试将调试视为非常重要的决策因素,因为 GWT 调试对我来说是最令人沮丧的事情。
考虑 JSF + 一些不错的 JSF 丰富组件框架,如 RichFaces、IceFaces、PrimeFaces 等(但如果你真的关心的话,你的应用程序将不再是“轻”和“小”)。确保完全适应环境(IDE + 插件),没有什么比 JSF 更好的了(如果可以选择完整的 Java EE,我今天会选择 RichFaces + Seam)。
I don't like writing plain JavaScript, so I'll tell you little bit about Java based frameworks. Recently, I've picked Google Web Toolkit.
Pros:
Cons:
Mixed feelings:
Some considerations:
Do some prototyping with Vaadin. Try some debugging. Then try GWT and debugging on similar sized project. Consider debugging as the VERY important decision factor, because GWT debugging was the most frustrating thing for me.
Consider JSF + some nice rich component framework for JSF like RichFaces, IceFaces, PrimeFaces etc (but you app won't be "light" and "small" anymore if you really care). Be sure to be perfectly comfortable with environment (IDE + plugins), nothing beats JSF there (I'd pick RichFaces + Seam today, if full Java EE is option).
如果您不想学习 javascript,我推荐您使用 GWT 和 Sencha-GWT (GXT),您可以使用 java 语言开发所有应用程序,也可以使用 java 调试代码。
使用这种技术创建网络应用程序非常容易,并且提供了 javascript 版本中几乎所有可用的功能。
您还可以将其与 hibernate 和 giled 混合以保存数据,并且 giled 可以帮助您序列化 hibernate 对象。
If you don't want to learn javascript I recommend you GWT with Sencha-GWT (GXT), you can develop all your app in java language, and also debug your code in java.
It is very easy to create a web app with this technology, and provides almost all funcionality available in javascript version.
Also you can mix it with hibernate and giled to persist your data, and giled helps you to serialize hibernate objects.
我一直在 SproutCore 中为前端和 Java 后端编写一个应用程序。在我看来,这非常有效。
如果请求是 XHR 或普通请求/响应,则后端可以不再担心客户端的 HTML 和 JavaScript 内容。我可以使用普通的旧式 Java Servlet 来实现后端,并且只关心客户端和服务器之间传递的数据(大部分是 JSON)。
客户端变得快速且响应迅速,并且 SproutCore 拥有大量可以混合和匹配的组件。
因此,换句话说,使用 SproutCore(以及 Cappuccino 和其他成熟的 MVC JavaScript 框架),您可以让您的客户端做它最擅长的事情:渲染和显示 HTML、CSS 和 JavaScript,同时让您的服务器担心它最擅长的事情:检索、存储和更新数据。如果您有兴趣,可以通过 GPLv3 许可证获得该项目的源代码: https://github.com/joachimhs /EurekaJ
我在这里写了一篇关于服务器端 MVC 和客户端 MVC 之间不同方法的文章:http://haagen.name/2011/05/24/The_RIA_MVC_Model.html。
SproutCore 还附带 MIT 许可证,因此可以不受任何限制地使用。
I have been writing an application in SproutCore for the front-end and a Java backend. In my mind this works perfectly.
The backend can stop worrying about HTML and JavaScript contents on the client side, if the request is XHR or plain request/response. I can implement the backends using plain old Java Servlets, and only worry about the data that is passed between the client and the server (JSON for the most part).
The client becomed fast and responsive, and SproutCore has a rich amount of components that you can mix and match.
So in other words with SproutCore (and Cappuccino and other full-blows MVC JavaScript frameworks) you can let your client do what it does best : Render and display HTML, CSS and JavaScript, while leaving your server to worry about what it does best: retrieve, store and update data. If you are interested, the source code for this project is available with the GPLv3 licence: https://github.com/joachimhs/EurekaJ
I have written an article about the differnt approaches between server-side MVC and client-side MVC here: http://haagen.name/2011/05/24/The_RIA_MVC_Model.html.
Also SproutCore comes with the MIT licence, so its avaiable for use without (m)any restrictions.