architect-handbook

Software Architect Handbook

View on GitHub

Two Step View

Turns domain data into HTML in two steps: first by forming some kind of logical page, then rendering the logical page into HTML.

Overview

You often want a consistent look and organization to the site. You may also want to make global changes to the appearence of the site easily, but common approaches using Template View or Transform View make this difficult because presentation decisions are often duplicated across multiple pages or transform modules.

Two Step View deals with this problem by splitting the transformation into two stages:

  1. Transform the model data into a logical presentation without any specific formatting.

  2. Convert the logical presentation with the actual formatting needed.

This way you can make a global change by altering the second stage, or you can support multiple output looks and feels with one second stage each.

How It Works

When to Use It