iluwatar / iluwatar/java-design-patterns

Two Step View pattern

Open
#1,323 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

epic: pattern info: help wanted type: feature
Dominant language
Java
Stars
94.7k
Forks
27.4k
Avg merge
3d 4h
Merged PRs (30d)
10

Description

Description:

The Two Step View design pattern is used to separate the process of generating dynamic web content into two distinct phases: data preparation and data presentation. This separation allows for more modular, maintainable, and testable code. The pattern is particularly useful for web applications with complex presentation logic, where it can help to simplify the development and maintenance of views.

Main Elements of the Pattern:

  1. Data Preparation Phase: In this phase, the raw data is collected and processed into a form that is suitable for rendering. This usually involves gathering data from various sources, performing necessary computations, and organizing it into a structured format.
  2. Presentation Phase: This phase takes the prepared data and applies a template to generate the final HTML or other output formats. The template defines how the data should be displayed, separating the concerns of data structure and visual presentation.
References:

Acceptance Criteria:

  1. Implement the Two Step View pattern by creating a distinct data preparation phase and a presentation phase in the web application.
  2. Ensure that the data preparation logic is separated from the presentation logic to promote modularity and maintainability.
  3. Provide unit tests to verify the correctness of both the data preparation and presentation phases, ensuring that they work correctly independently and together.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are identified in the issue. Start by reviewing the referenced Two Step View materials and the repository structure to locate the web application and its presentation code. Done means separate data preparation and presentation phases exist, with unit tests covering each phase independently and their integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.