java-design-patterns
java-design-patterns copied to clipboard
Two Step View pattern
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:
- 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.
- 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:
- Martin Fowler's Catalog on Two Step View
- Patterns of Enterprise Application Architecture by Martin Fowler (Page 303)
- Ranjitha Balaraman's Blog on Two Step View
- Thierry Roussel's Notes on HTML Renderer
Acceptance Criteria:
- Implement the Two Step View pattern by creating a distinct data preparation phase and a presentation phase in the web application.
- Ensure that the data preparation logic is separated from the presentation logic to promote modularity and maintainability.
- Provide unit tests to verify the correctness of both the data preparation and presentation phases, ensuring that they work correctly independently and together.
Can I take this issue
To work on
Ok @maheshsv
@maheshsv are you still working on this?
This issue is free for taking again.
Hi, I would like to work on this issue. Could you assign it to me?
Ok @steph88ss
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.
@steph88ss, hopefully you can address the review comments and we can complete this issue?
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.