One size does not fit all ... that's why in Tapestry there are different ways of accomplishing the same thing ... such as defining component types in the template (t:component-type OR t:type="component-type") OR in the Java class (@Component annotation).
I don't strongly object to simple expressions, such as the example, living directly in the template, it's just not supported yet. Yes, you can make life difficult for yourself if you use such a feature too much. On the other hand, sometimes an expression is used just once, and introducing machinery (a boolean getter method on the Java class) is just so much extra work. I want Tapestry to be pragmatic above all. I want Tapestry to be useful to architecture astronauts (who will embrace mixins, meta programming, annotations and byte-code manipulation) and duct-tape programmers (who'll throw the comparisons in the template and the Hibernate queries in the page class) and even allow both to coexist, within reason, on the same project! On Sat, Sep 26, 2009 at 4:07 PM, Alfonso Quiroga <alfonsose...@gmail.com> wrote: > Wow! Sergey Kashin, you like having expressions in tml like > "ognl:playersOnline > 100", and tomorrow can be a 600 character > expression string, you think it's a good idea? If so, you can go back > to struts2, where you can completely do a JSP with java scriptlets. > But in T5 world, I prefer clean TML files, delegating to it's java > class all this things, while having class reloading I don't have any > problems > > On Sat, Sep 26, 2009 at 12:30 AM, Josh Canfield <j...@thedailytube.com> wrote: >>> Stop on ognl, prop is not powerful. >>> >>> Creating java method >>> public boolean isSufficientPlayers() { return playersOnline > 100; } >>> instead >>> ognl:playersOnline > 100 >>> is not good idea >>> >>> 1. You move presentation in to java code >>> 2. You lost control on viewable presentation code, 100 or 50 or 1000 >>> palyersOnline... >>> 3. Less usability >>> 4. Don't wait future release of tapestry, maybe it will be in 2010 or >>> 2011 :), but feature have needed yesterday >> >> >> Hmm... I have to disagree. The method is a much better idea than using >> inline expressions. >> >> 1. "playersOnline > 100" sounds a lot like business logic that may get >> used elsewhere and changed in the next release. Do you want that >> floating around in the template? >> >> 2. You now have central control of a number that is likely to change. >> magic numbers should be avoided in your all of your code, including >> your templates. >> >> 3. <t:if test="sufficientPlayers"> takes much less brain power to >> process than the inline expression. Almost like you are documenting >> what playersOnline > 100 is supposed to mean (was that the bonus chips >> magic number?) >> >> 4. Ok, here I agree. Don't wait to code until all the features you >> want are in the product. That's just silly... >> >> Josh >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org