4 ms·
Thanks for your comments. I am looking for a Java framework to learn. And Tapestry seems like a good candidate. I have just written a hello-world application in
by rohshall 14y ago
Thanks for your comments. I am looking for a Java framework to learn. And Tapestry seems like a good candidate. I have just written a hello-world application in Tapestry. And I have no experience in developing using tapestry. My understanding from tapestry 5.2 docs is
1. Tapestry retains the state of the pages and components. (you need to annotate your state variables though). So, I am surprised that you need to reinitialize the field every time.
2. Tapestry provides parameter blocks to pass parameters to a component. It looks similar to a function call. What am I missing here?
- lmm 14y agoYeah, you can annotate fields to make them work, I'd forgotten that. If you're writing good OO code then you write objects whose state gets set on creation. In wicket, if I want to redirect the user to another page (say after a form submission) passing in a parameter I can do setResponsePage(new MyOtherPageClass(parameter)). In tapestry that looks like randomAnnotatedField.magicMethod(parameter); return MyOtherPage.class . IIRC. There's no type safety; if you misspell a tapestry magic method name it will just silently not be called. You can't step through your components in a debugger because your fields won't show up properly. It's particularly bad if you're just learning, because it seems to actively discourage good OO design, and because tapestry classes have subtly and not-so-subtly different semantics from real Java.
- rohshall 14y agoYes, I understand the problems with "magic". One good thing about magic is that it reduces verbosity though. I have been programming in Rails for a few months now. I still prefer Python explicitness over Ruby magic.