In this part of the code refactoring tutorial I will answer another challenge I recently received. This tutorial is all about the Visitor Design Pattern.
You use the visitor design pattern when you want to perform a similar calculation on many different objects. It seems to confuse people, but I hope to solve that here. If you understand the concept of method overloading and the passing of objects back and forth for data access I don’t think you’ll have a problem. The code that follows should answer any questions you have.
If you like videos like this, it helps to tell Google+ [googleplusone]
Code From the Video
SalesTrainee.java
Salesman.java
Boss.java
Visitable.java
Visitor.java
YearlyBonusVisitor.java
QuarterlyBonusVisitor.java
TestBonusCalculator.java
Hey Derek, plz change the variables names on QuarterlyBonusVisitor.java, it says yearlyBonusAmount.
I fixed it. Thanks for pointing that out. You have a very good eye for my mistakes 🙂
to create youtube video
I have a bunch of videos on how to make YouTube videos. How to Video Blog, Become a YouTube Partner, Get More Views on YouTube, and How I Make YouTube Videos. I hope they help.