Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved issue #1323 Two-Step View pattern #3106

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sharara6
Copy link

@sharara6 sharara6 commented Dec 3, 2024

created a two-step view design pattern for more details check the read-me file

close issue #1323

@sharara6
Copy link
Author

sharara6 commented Dec 8, 2024

@iluwatar may you review this PR ?

@sharara6
Copy link
Author

Dear @iluwatar may you check my PR?

@sharara6
Copy link
Author

This is a gentle follow up.

two-step-view/README.md Outdated Show resolved Hide resolved
two-step-view/pom.xml Outdated Show resolved Hide resolved
two-step-view/pom.xml Show resolved Hide resolved
@sharara6
Copy link
Author

Thank you for your review. I am in the midst of final exams right now. May I work on it next week?

@iluwatar
Copy link
Owner

Thank you for your review. I am in the midst of final exams right now. May I work on it next week?

Sure, no problem. Good luck with the exams 😄

Copy link

github-actions bot commented Jan 22, 2025

PR Summary

This PR implements the Two-Step View pattern, separating data preparation from presentation. It includes a new module (two-step-view) demonstrating this pattern with a Book and BookStore example, and updates to existing test files for improved test coverage.

Changes

File Summary
microservices-idempotent-consumer/src/test/java/com/iluwatar/idempotentconsumer/AppTest.java Updated the file header to include the MIT license information and added a description of the project.
microservices-idempotent-consumer/src/test/java/com/iluwatar/idempotentconsumer/RequestStateMachineTests.java Updated the file header to include the MIT license information and added a description of the project.
pom.xml Added the two-step-view module to the project.
two-step-view/README.md This file provides a comprehensive explanation of the Two-Step View pattern, including its intent, real-world examples, a programmatic example in Java, when to use it, tutorials, real-world applications, benefits, trade-offs, related design patterns, and references.
two-step-view/pom.xml This is the pom.xml file for the two-step-view module. It defines the project dependencies and build configurations.
two-step-view/src/main/java/com/iluwatar/App.java This is the main application class that demonstrates the Two-Step View pattern using Book and BookStore objects.
two-step-view/src/main/java/com/iluwatar/Book.java Represents a Book object with properties like name, price, discount, and stock. Includes input validation.
two-step-view/src/main/java/com/iluwatar/BookStore.java Represents processed book data for presentation, including discounted price and stock status.
two-step-view/src/main/java/com/iluwatar/DataPreparation.java Prepares book data by calculating discount prices and checking stock availability.
two-step-view/src/main/java/com/iluwatar/Presentation.java Generates an HTML representation of the book details.
two-step-view/src/test/java/com/iluwatar/BookStoreTest.java This file contains unit tests for the DataPreparation and Presentation classes, covering various scenarios including discount, stock status, and edge cases.
update-header.sh Updated the script to include the MIT license information in the header of all files.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (3)
Files Processed (12)
  • microservices-idempotent-consumer/src/test/java/com/iluwatar/idempotentconsumer/AppTest.java (1 hunk)
  • microservices-idempotent-consumer/src/test/java/com/iluwatar/idempotentconsumer/RequestStateMachineTests.java (1 hunk)
  • pom.xml (1 hunk)
  • two-step-view/README.md (1 hunk)
  • two-step-view/pom.xml (1 hunk)
  • two-step-view/src/main/java/com/iluwatar/App.java (1 hunk)
  • two-step-view/src/main/java/com/iluwatar/Book.java (1 hunk)
  • two-step-view/src/main/java/com/iluwatar/BookStore.java (1 hunk)
  • two-step-view/src/main/java/com/iluwatar/DataPreparation.java (1 hunk)
  • two-step-view/src/main/java/com/iluwatar/Presentation.java (1 hunk)
  • two-step-view/src/test/java/com/iluwatar/BookStoreTest.java (1 hunk)
  • update-header.sh (1 hunk)
Actionable Comments (0)
Skipped Comments (8)
  • microservices-idempotent-consumer/src/test/java/com/iluwatar/idempotentconsumer/AppTest.java [1-24]

    best practice: "License header too verbose."

  • microservices-idempotent-consumer/src/test/java/com/iluwatar/idempotentconsumer/RequestStateMachineTests.java [1-24]

    best practice: "License header too verbose."

  • two-step-view/src/main/java/com/iluwatar/App.java [1-27]

    best practice: "License header too verbose."

  • two-step-view/src/main/java/com/iluwatar/Book.java [1-24]

    best practice: "License header too verbose."

  • two-step-view/src/main/java/com/iluwatar/BookStore.java [1-24]

    best practice: "License header too verbose."

  • two-step-view/src/main/java/com/iluwatar/DataPreparation.java [1-24]

    best practice: "License header too verbose."

  • two-step-view/src/main/java/com/iluwatar/Presentation.java [1-24]

    best practice: "License header too verbose."

  • two-step-view/src/test/java/com/iluwatar/BookStoreTest.java [1-24]

    best practice: "License header too verbose."

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants