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