java Apache Wicket 与 Apache Click
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2168249/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Apache Wicket vs Apache Click
提问by Bob Schellink
What is the difference between Apache Wicket and Apache Click? Is Apache Click maintained? The latest release seems to be from Nov 2008 Thanks Achilleas
Apache Wicket 和 Apache Click 有什么区别?是否维护 Apache Click?最新版本似乎来自 2008 年 11 月,谢谢 Achilleas
回答by Bob Schellink
Click is actively developed and has recently graduated as an Apache Top Level Project. It is currently moving to its new domain at: http://click.apache.org. Once the migration is complete the next version, 2.1.0, will be released.
Click 正在积极开发中,最近作为 Apache 顶级项目毕业。它目前正在转移到其新域:http: //click.apache.org。迁移完成后,将发布下一个版本 2.1.0。
Before comparing Click and Wicket do note that I am a committer at Apache Click but have evaluated Wicket a couple of years ago so have a fairly good idea of how it works.
在比较 Click 和 Wicket 之前,请注意我是 Apache Click 的提交者,但几年前已经评估过 Wicket,因此对它的工作原理有一个很好的了解。
Click is a stateless framework while Wicket is stateful. In Click, pages and components are recreated each request, in Wicket the pages and components are stored in the session and reused in subsequent requests.
Click 是无状态框架,而 Wicket 是有状态的。在 Click 中,每个请求都会重新创建页面和组件,在 Wicket 中,页面和组件存储在会话中并在后续请求中重用。
Wicket is meant for building complex applications (think desktop), where all the GUI state is stored and managed for you. Click is meant for the more traditional web applications where little to no state is necessary to render a page. If you need to store state you have to manage it yourself by adding/removing it from the session. Its worth mentioning that Wicket provides support for stateless pages and Click supports stateful pages, however this isn't the norm for these frameworks.
Wicket 用于构建复杂的应用程序(想想桌面),所有 GUI 状态都为您存储和管理。Click 适用于更传统的 Web 应用程序,在这些应用程序中,渲染页面几乎不需要状态。如果您需要存储状态,您必须通过从会话中添加/删除它来自己管理它。值得一提的是,Wicket 支持无状态页面,Click 支持有状态页面,但这不是这些框架的规范。
Another difference is that in Click controls knows how to render themselves, so you don't have to repeat the markup in your page templates. You can still manually layout your templates if you want, but it is not strictly necessary. In Wicket the markup needs to reflect the components created in the page. The idea in Wicket is that the Java developer doesn't actually create or maintain the templates, instead this is handled by a designer.
另一个区别是 Click 中的控件知道如何呈现自己,因此您不必在页面模板中重复标记。如果需要,您仍然可以手动布局模板,但这不是绝对必要的。在 Wicket 中,标记需要反映在页面中创建的组件。Wicket 中的想法是 Java 开发人员实际上并不创建或维护模板,而是由设计人员处理。
kind regards
亲切的问候
Bob
鲍勃
回答by Karussell
With wicket you use pure html and no template language as velocity or jsp like click does. This is not only handy for the programmer itself which only has to learn html and java, but also for the tooling (debugging etc)
使用 wicket,您可以使用纯 html,而没有像 click 那样使用像速度或 jsp 那样的模板语言。这不仅对只需要学习 html 和 java 的程序员本身很方便,而且对工具(调试等)也很方便
It enforces a better separation of user interface and logic. There is also no xml required in wicket which is IMHO different to click.
它强制更好地分离用户界面和逻辑。wicket 中也不需要 xml,恕我直言,点击不同。
Some more differences: wicket's mailing list traffic is higher; there are more publications (e.g. books) on wicket then on click; there are more developers coding wicket (look thisand this)
还有一些区别:wicket 的邮件列表流量更高;wicket 上有更多出版物(例如书籍),然后单击;有更多的开发人员编码检票口(看看这个和这个)
回答by joshua
Wicket offers more flexibility on how you compose your pages. You can create a single page composed of components for the entire application , or you can create multiple pages as you wish. Click is page based. Wicket has support for ajax out of the box. Most of the the ajax components in wicket fall back to normal page refresh in case the browser doesnt support ajax. Wicket has dozens of components out of the box and dozens of others from related projects. One great feature I find in wicket is its verbosity.. That means the everything my application does is what I created. I write the entire presentation with html and css with nothing being generated. Lack of magic is a big plus for me from experience. Last and least, many large corporations are using wicket. Walmat mobile and wellsfargo mobile are done with wicket.
Wicket 为您撰写页面的方式提供了更大的灵活性。您可以为整个应用程序创建由组件组成的单个页面,也可以根据需要创建多个页面。点击是基于页面的。Wicket 支持 ajax 开箱即用。如果浏览器不支持 ajax,wicket 中的大多数 ajax 组件都会回退到正常的页面刷新。Wicket 有数十个开箱即用的组件以及来自相关项目的数十个其他组件。我在 wicket 中发现的一个很棒的功能是它的冗长。这意味着我的应用程序所做的一切都是我创建的。我用 html 和 css 编写了整个演示文稿,没有生成任何内容。从经验来看,缺乏魔法对我来说是一个很大的优势。最后,许多大公司都在使用 wicket。Walmat mobile 和 wellsfargo mobile 是通过 wicket 完成的。
回答by clarson
the biggest drawback to wicket is its statefull nature. It can be difficult to unit test and debug state issues. its statefull nature means it uses more memory, and could effect your hardware budget. a side effect of the stateful nature of wicket means that it needs to be able to save that state from time to time. to do that, all your objects need to be serializable.
wicket 的最大缺点是其有状态的性质。单元测试和调试状态问题可能很困难。它的有状态特性意味着它使用更多内存,并可能影响您的硬件预算。wicket 的有状态性质的一个副作用意味着它需要能够不时保存该状态。为此,您的所有对象都需要可序列化。
i've just started looking at click. i love its stateless nature. the web is request/reply, which should be stateless ( at least as much as possible).
我刚开始看点击。我喜欢它的无国籍性质。网络是请求/回复,它应该是无状态的(至少尽可能)。
i also like how nicely click integrates with apache cayanne.
我也喜欢 click 与 apache cayanne 的完美集成。

