This article is participating in the Java Theme Month – Java Debug Notes Event, see the event link for details

Apache Tapestry: The difference between Apache Tapestry and Apache Wicket? >

Ask questions

Apache Wicket (wicket.apache.org/) and Apache Tapestry (wicket.apache.org/)

Both are component-oriented Web frameworks

As opposed to the Apache Foundation’s strip-based action-based framework.

Both allow you to build applications from Java components. They both look very similar to me.

What is the difference between the two frameworks? Does anyone have experience with both?

To be specific:

  • How do they perform? How much state processing can you customize and use stateless?
  • What are the differences in their component models?
  • What would you choose for which applications?
  • How do they relate toGuice.Spring.JSR 299Integration?

Edit: I have read both documents, and I use them both.

Reading the documentation is not enough to answer these questions, but the experience of using them over time,

For example, how to use Wicket in stateless mode on high-performance sites. thank you

Answer a

Some of the relevant differences I see:

  • Tapestry uses a semi-static page structure where you can use conditions and loops to achieve dynamic behavior. The door is completely dynamic; You can load components dynamically, replace them at run time, and so on. The result is that Tapestry is easier to optimize and Wicket is more flexible to use.

  • The efficiency of both frameworks is roughly the same, but Wicket relies on server-side storage (current pages in the session by default, and past pages in the “second level cache,” temporary files in the file system by default). If this bothers you, consider how many concurrent sessions you would like to have at peak times, and calculate at a rate of about 100KB per session (which is probably high). This means that you can support roughly 2GB of 20K concurrent sessions. I say 15K because you also need that memory to store other things. Of course, one disadvantage of storing state is that it only works well with session affinity, so this is a limitation when using Wicket.

  • Wicket’s goal is to maximize static typing support, while Tapestry is more about saving lines of code. Therefore, with Tapestry, your code base is likely to be smaller, which is useful for maintenance; With Wicket, your code base is statically typed, which makes navigation with the IDE and checking with the compiler much easier, which is also good for maintenance.

So far, I’ve read several times that people think Wicket can work a lot through inheritance. I want to emphasize that you have a choice. Components have a hierarchy, but Wicket also supports composition through structures like IBehavior on which Wicket’s Ajax support is built.

Answer two

Wicket’s goal is to try to make Web development similar to a desktop GUI. They manage to do well at the expense of memory usage (HTTPSession).

Tapestry 5 aims to make a very optimized (for CPU and memory) component-oriented Web framework.

To me, the biggest pitfall is “Wicket supports stateless components!” Parameter “Wicket out of memory”.

Although Wicket does support stateless components, they are not “the focus of Wicket development.”

My advice:

  • When the page structure is very dynamic and you can afford to spend per user10-200 KbstheHttpSessionMemory (these are rough numbers), please useWicket.
  • If you need to use resources more efficiently, useTapestry 5.

Answer three

I think Wicket is a simpler framework to use.

In addition, Wicket allows classes to be reloaded through the IDE’s hot code replacement system.

This is all Wicket needs to run the modified version of the currently running application class.

The usual restrictions apply to hot code replacements, such as having to run in debug mode (Eclipse) and not changing structural aspects of a class (that is, class names, changing method signatures, and so on).

The article translated from Stack Overflow: stackoverflow.com/questions/6…