architect-handbook

Software Architect Handbook

View on GitHub

Template View

Renders information into HTML by embedding markers in an HTML page.

Overview

For working with dynamic Web pages, those that take results of something like database queries and embed them into the HTML, a good approach is to compose the dynamic Web page as you do a static page but put in markers that can be resolved into calls to gather dynamic informationi.

How It Works

When to Use It

Weaknesses

* You need good discipline to keep the page simple and display oriented, putting logic in the helper.

Avoid Scriplets & Conditionals When Possible

<!-- Avoid this! -->
<IF expression="isHighSelling()"><BOLD></IF>
<property name="price"/>
<IF expression="isHighSelling()"></BOLD></IF>

<!-- Do this instead -->
<highlight condition="isHighSelling" style="bold">
  <property name="price"/>
</highlight>