-
- Notifications
You must be signed in to change notification settings - Fork 27.4k
Issue#1264: Implemented Composite-View Pattern #1923
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
Conversation
…d private fields. Created test file for JavaBeans.
…o composite-view to allow the JSP to run on a local Tomcat container. Wrote unit tests for Java-bean class, working on JSP pages.
…reated atomic sub-view components in businessNews.jsp, header.jsp, localNews.jsp, scienceNews.jsp, sportsNews.jsp, worldNews.jsp. Composite view page renders correctly, atomic views are inserted in and substituted in the template page depending on request parameters.
…ed to .equals() for string comparison.
…ensure writers are closed.
composite-view/src/main/java/com/iluwatar/compositeview/ClientPropertiesBean.java Outdated Show resolved Hide resolved
composite-view/src/test/java/com/illuwatar/compositeview/JavaBeansTest.java Outdated Show resolved Hide resolved
| In addition, SonarCloud code analysis is failing due to insufficient test coverage. Try to add more tests. |
| for the code coverage, I'm not sure what tools/libraries there are to unit test HTTP servlets, do you have any suggestions? |
composite-view/src/test/java/com/illuwatar/compositeview/JavaBeansTest.java Show resolved Hide resolved
… to reduce boilerplate setters and getter, updated README.md with better grammar, appropriate tags and links to related patterns. Updated pom.xml to get rid of superfluous lines.
composite-view/README.md Outdated
| title: Composite View | ||
| folder: composite-view | ||
| permalink: /patterns/composite-view/ | ||
| categories: structural |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| categories: structural | |
| categories: Structural |
composite-view/README.md Outdated
| * Increases potential for display errors | ||
| | ||
| ## Related patterns | ||
| * [Composite (GoF)](../composite) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest linking to the website https://java-design-patterns.com/patterns/composite/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apologies, I was busy for the holidays, I have added these changes in my latest commit.
| Excellent, thank you for adding this pattern! |
| I've put up a pull request to add @Kevinyl3! 🎉 |
| Kudos, SonarCloud Quality Gate passed! |
…#1923) * initial commit, created package, README, pom, and directory structure. * Issue#1264, continue working on JavaBeans, added getters, setters, and private fields. Created test file for JavaBeans. * set up junit for tests folder. * Issue#1264, set up local server and added web-application framework to composite-view to allow the JSP to run on a local Tomcat container. Wrote unit tests for Java-bean class, working on JSP pages. * Issue#1264, Added forwarding functionality to servlet and main composite view page. * Issue#1264, Finished composite view template in newsDisplay.jsp and created atomic sub-view components in businessNews.jsp, header.jsp, localNews.jsp, scienceNews.jsp, sportsNews.jsp, worldNews.jsp. Composite view page renders correctly, atomic views are inserted in and substituted in the template page depending on request parameters. * Issue#1264, Added all views, updated README.md with documentation. * Issue#1264, updated README.md, moved images folder into etc folder. * Issue#1264, removed build artifacts from tracked files. * Issue#1264, updated README.md * Issue#1264, updated README.md * Issue#1264, removed unused import, made AppServlet class final, changed to .equals() for string comparison. * Issue#1264, in AppServlet, put the output writing into try blocks to ensure writers are closed. * Issue#1264, added tests for Servlet, coverage up to 100%, used lombok to reduce boilerplate setters and getter, updated README.md with better grammar, appropriate tags and links to related patterns. Updated pom.xml to get rid of superfluous lines. * Issue#1264, made changes as requested in README.md. Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>








Issue#1264: Composite-View Pattern
Pull request description
composite-viewdirectory/module for the patternsrc\maincontains the javabean class for view management, and the Servlet classsrc\testcontains the tests for the methods in the javabean classwebcontains the all the JSP files and the web.xml file