English 中文(简体)
Should I choose Apache Click or Tapestry 5?
原标题:

I am to decide whether to use Apache Click or Apache Tapestry 5 framework. Which one I should choose? I m looking for a framwork that I could use for building Java EE web applications for the next few years. The next few days I ll be testing them both running sample and custom projects, but I d like to know in advance if one of them is not stable or big enough for large scale enterprise applications. I need it to work without any difficulties with Maven, various AJAX and Eclipse.

Thank you in advance, StackOverflow comunity :)

问题回答

Well, thanks Dragan. I think the essential question is are you comfortable with a component oriented framework (Tapestry) vs. an action-oriented framework (Click). The nature of components, as least the Tapestry way, is that the framework can take over lots and lots of work from you; thing like how to form URLs, what to name query parameters, or session attribute names. In addition, Tapestry has a lot of room for meta-programming, and the general programming model, which centers on mutable objects rich with data and operations, is a lot more fun than dealing with typical servlets. I don t know enough about Click to say how or if it addresses these issues, but I m very comfortable recommending Tapestry over any other framework I m aware of.

Tapestry is THE web framework for complex JavaEE projects. I ve been using it fro 3 years now and it just never fails.

You can be effective in Tapestry5 quickly, but if you are new to IOC concepts etc. it may take a while to get used to.

I would say tapestry has some moderately steep learning curve, but it has no limits in what you can do, and pretty much all things are done quite elegantly, with the framework helping you in many ways and not stepping your feet.

Cheers

I have been using Tapestry for a little over a year now, and following are some points that I thought I would throw in that haven t been mentioned here:

Pros:

  1. Tapestry needs very little xml configuration, so if xml is not your cup of tea, you will be very pleased. For example, no more defining tons of navigation rules in xml, if you want to send your user to a page, just return the page class from the action handler and you are done.
  2. Since you mentioned "Enterprise" apps, it is worth noting that Tapestry 5 plays very well with Spring and Hibernate. You can easily inject Spring beans into tapestry pages and Tapestry services into Spring beans. If you need to inject EJBs, you could wire them up as Spring Beans and inject them the same way you would inject a Spring bean.
  3. Tapestry is really fast, with response times in the tens of milliseconds even with moderate load.
  4. Plenty of components available from various sources, so you can just plug and play instead of re-inventing the wheel, saving you tons of time.
  5. Very helpful and responsive community.
  6. Works well with eclipse, and code completion is available for templates when setup right.

Cons:

  1. Its takes a little more effort to learn the finer points of the framework than say, Struts, but is IMO much easier than JSF.
  2. Rapid development causes older versions to get obsolete too quickly, although promises have been made (yet again) to maintain backwards compatibility this time around.

I don t have much to say about Click as I have never tried it, but do let us know what you decided on!

I ve used Apache Click, and was rather disappointed... simple things were difficult to do, and while I initially found the framework elegant in concept, in reality it quickly became anything but elegant to use -- basic state management of components was awfully cumbersome in anything but the simplest cases.

I also was disappointed to learn that Click s claim of "full JSP support" was simply not true -- for example, their Panel component, one of their central components used for layout, cannot be used with JSP templates, it only supports Velocity or FreeMarker (true as of Click 2.3, the last version I evaluated). Furthermore, they are not interested in fixing this -- I actually submitted a patch to allow Panels and other components to work with JSP templates, but they expressed limited interest and never took it in.

I cannot speak knowledgeably about Tapestry, but I can say that the day I abandoned Click in favor of the Play! 1.x framework was a happy one (though incidentally now after the disappointing Play! 2.0 was released I m once again in search of a decent statically compiled web framework).

I would suggest that you try them both. Start with apache click. It will take your a couple of days if not a few hours to get started and write an application. After doing a small application , now turn to tapestry. This may take your quite sometime to learn. you may or may not like it. apache click is very simple and you can get going very fast. Tapestry is very complex and may have more features . In between them is wicket. Am more experienced with wicket and i have done several applications with it. I have tried tapestry5 several times. I have given up on it then went back to it later and given up again. Am now trying out apache click and it seems quite good. My point, spend sometime with the frameworks and you will pick the one that best suites your. Wicket, tapestry, click and JSF are among the most popular component based java web frameworks.

Tapestery is such a great framework that I wish I go back in time and redo all my web projects using Tapestry. Just try the sample application and play with it. You will realize quickly why Tapestery is so awesome!





相关问题
Recommended way to develop using Jetty and Eclipse

I am currently developing a J2EE application and I would like to use Jetty. I would like to have iot integrated with Eclipse, so I could debug the appliaction. I ve tried out couple of plugins (...

Call function periodically in Java

we need run one function periodically in Java web application . How to call function of some class periodically ? Is there any way that call function when some event occured like high load in server ...

Why make an EJB rather than a Web Service?

I would have thought that there is a lot of information out there on this, but I haven t found anything that really answers my question. What are the advantages of making an EJB rather than a web ...

Where should I put this configuration setting?

I m designing a fairly small web application which will run on a Sun application server (v9.1). It only has a few pages, no database of its own, and will retrieve/update data via web services. There s ...

JNDI Names -- Is Prefix "jdbc/" needed?

What s up with JNDI names? I m trying to get a javax.sql.DataSource using the new annotations feature of Java 5. It s not working for me, so I want to ask... I have a in my web.xml, inside of it is ...

hibernate interceptors : afterTransactionCompletion

I wrote a Hibernate interceptor : public class MyInterceptor extends EmptyInterceptor { private boolean isCanal=false; public boolean onSave(Object entity, Serializable arg1, Object[] arg2, String[]...

热门标签