iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
90.02k stars 26.6k forks source link

Two Step View pattern #1323

Open iluwatar opened 4 years ago

iluwatar commented 4 years ago

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.
maheshsv commented 4 years ago

Can I take this issue

maheshsv commented 4 years ago

To work on

iluwatar commented 4 years ago

Ok @maheshsv

iluwatar commented 3 years ago

@maheshsv are you still working on this?

iluwatar commented 2 years ago

This issue is free for taking again.

steph88ss commented 2 years ago

Hi, I would like to work on this issue. Could you assign it to me?

iluwatar commented 2 years ago

Ok @steph88ss

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

iluwatar commented 1 year ago

@steph88ss, hopefully you can address the review comments and we can complete this issue?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.