3 ms·
Yeah, 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
by lmm 14y ago
Yeah, 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.