Skip to content

Commit f718f9d

Browse files
committed
added diagrams
1 parent 72268f6 commit f718f9d

File tree

6 files changed

+28
-4
lines changed

6 files changed

+28
-4
lines changed

README.md

+26-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
1-
# DesignPatternsJava9
2-
This repo consists Gang of Four Design patterns code on Java 9. Each branch in the repository has code of 1 design pattern. Switch repository to try out different design patterns.
1+
# What is Visitor Design Pattern
2+
Visitor design pattern uses a visitor class which changes the executing algorithm of an element class. By this way, execution algorithm of element can vary as and when visitor varies.
3+
4+
## Diagram
5+
![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/visitor-pattern/diagrams/Visitor-Pattern-class-diagram%20.png "Diagram")
6+
7+
![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/visitor-pattern/diagrams/visitorPattern-generic.jpeg "Diagram")
8+
9+
![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/visitor-pattern/diagrams/VisitorSequenceDiagram.png "Diagram")
10+
11+
### When to use Visitor Design Pattern
12+
Visitor pattern is used when we have to perform an operation on a group of similar kind of Objects. With the help of visitor pattern, we can move the operational logic from the objects(Elements) to another class (Visitor class).
13+
14+
### Learn Design Patterns with Java by Aseem Jain
15+
This repository contains working project code used in video Course by Packt Publication with title "Learn Design Patterns with Java " authored by "Aseem Jain".
16+
17+
### Course link:
18+
https://www.packtpub.com/application-development/learn-design-patterns-java-9-video
19+
20+
### Authors blog on design patterns:
21+
https://premaseem.wordpress.com/category/computers/design-patterns/
22+
23+
### Software Design pattern community face book page:
24+
https://www.facebook.com/DesignPatternGuru/
25+
26+
Note: This code base will work on Java 9 and above versions.
297 KB
Loading

diagrams/VisitorSequenceDiagram.png

148 KB
Loading

diagrams/visiting faculty.JPG

129 KB
Loading

diagrams/visitorPattern-generic.jpeg

278 KB
Loading

patternBonus/src/com/premaseem/ClientFile.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public static void main(String[] args) {
1313
int repeatRunFlag = 1;
1414
while (repeatRunFlag == 1) {
1515
System.out.println("Which party do you want to host ");
16-
System.out.println("press 1 for Week end party ");
17-
System.out.println("press 2 for Week day party ");
16+
System.out.println("press 1 for Loud party ");
17+
System.out.println("press 2 for Silent party ");
1818
int tvType = scan.nextInt();
1919
if (tvType == 1) {
2020
party = new LoudParty();

0 commit comments

Comments
 (0)