in reply to Display logic is driven by business rules IMHO

this tt code is an example of a business requirement that is not business logic:
[% IF age < 10 %] Hello [% name %], does your mother know you're using her AOL account? [% ELSIF age < 18 %] Sorry, you're not old enough to enter (and too dumb to lie about your age) [% ELSE %] Welcome [% name %]. [% END %]
I always considered that business logic because deciding on how to deal with potential consumers based on age would certainly be decided by the business department.

But I think Corion clarified this already.

Replies are listed 'Best First'.
Re: This is Display logic, not business logic
by jplindstrom (Monsignor) on Jan 08, 2009 at 15:29 UTC

    Yes, and it has no (well, little) to do in the presentation layer.

    Business logic concepts will always leak out to the presentation layer. Otherwise, how would it know what to display?

    But the details, the implementation, of those concepts should stay in the model layer (if we talk MVC) or wherever the business logic is implemented.

    In your example, it's suitable for the presentation layer to know that there are three levels of access, because it needs to display different things for the three cases.

    But what are those hard coded age comparisons doing in a template??? That's the business logic which should be in the model layer. And those should be exposed as abstractions on a higher level than age comparisons.

    That way other presentation modes can make use of these abstractions as well, so you don't repeat "age < 18" when you display this on a phone or in an email.

    /J