Skip to content

Commit

Permalink
added diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
premaseem committed Aug 6, 2018
1 parent 72268f6 commit f718f9d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# DesignPatternsJava9
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.
# What is Visitor Design Pattern
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.

## Diagram
![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/visitor-pattern/diagrams/Visitor-Pattern-class-diagram%20.png "Diagram")

![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/visitor-pattern/diagrams/visitorPattern-generic.jpeg "Diagram")

![Diagram](https://github.com/premaseem/DesignPatternsJava9/blob/visitor-pattern/diagrams/VisitorSequenceDiagram.png "Diagram")

### When to use Visitor Design Pattern
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).

### Learn Design Patterns with Java by Aseem Jain
This repository contains working project code used in video Course by Packt Publication with title "Learn Design Patterns with Java " authored by "Aseem Jain".

### Course link:
https://www.packtpub.com/application-development/learn-design-patterns-java-9-video

### Authors blog on design patterns:
https://premaseem.wordpress.com/category/computers/design-patterns/

### Software Design pattern community face book page:
https://www.facebook.com/DesignPatternGuru/

Note: This code base will work on Java 9 and above versions.
Binary file added diagrams/Visitor-Pattern-class-diagram .png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added diagrams/VisitorSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added diagrams/visiting faculty.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added diagrams/visitorPattern-generic.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions patternBonus/src/com/premaseem/ClientFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public static void main(String[] args) {
int repeatRunFlag = 1;
while (repeatRunFlag == 1) {
System.out.println("Which party do you want to host ");
System.out.println("press 1 for Week end party ");
System.out.println("press 2 for Week day party ");
System.out.println("press 1 for Loud party ");
System.out.println("press 2 for Silent party ");
int tvType = scan.nextInt();
if (tvType == 1) {
party = new LoudParty();
Expand Down

0 comments on commit f718f9d

Please sign in to comment.