While I agree with both of you - accessor methods in java classes is generally better than (minor) logic in templates, there are cases where some logic in templates is preferable, ie when there are perhaps 10's or more different numeric cases on the same property. having 10+ near identical methods doing a simple numeric equals is less maintainable.

in these cases, i miss ognl!

instead of a new component, i've written a public method:

    isPropertyEquals(int value)
    {
        return myproperty == value;
    }

p.

On 4/08/2012 1:03 PM, Thiago H de Paula Figueiredo wrote:
On Fri, 03 Aug 2012 21:07:27 -0300, Howard Lewis Ship <hls...@gmail.com> wrote:

public boolean isNumberThree() { return numericValue == 3; }

In other words, don't put logic in templates, put them in Java classes, where it can be easily debugged and tested. ;)



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to