Welcome to my Chain of Responsibility Design Pattern Tutorial! Wow, that was a mouthful!
This pattern has a group of objects that are expected to between them be able to solve a problem. If the first Object can’t solve it, it passes the data to the next Object in the chain. In this tutorial, I’ll use it to make the right calculations based off of a String request. While that is pretty simple the capabilities of this pattern are endless.
The code follows the video to help you learn.
If you think videos like this are nice, it helps to tell Google with a button click [googleplusone]
Share if you think others may like this [nttfblike]
Code from the Video
CHAIN.JAVA
NUMBERS.JAVA
ADDNUMBERS.JAVA
SUBTRACTNUMBERS.JAVA
MULTNUMBERS.JAVA
DIVIDENUMBERS.JAVA
TESTCALCCHAIN.JAVA
i didnt back again. i was always here. cos i have learned a lot from you. your recent topic is java so i am little bit irregular in this blog. i like your php, wp, css tutorials. Thanks.
That’s nice to hear. Are you able to access YouTube yet? Do you know of any other video sites that you can access? Maybe I can put them there. I only use YouTube because I never got much attention on the other sites. youTube has gone out of its way to help me
would you help me to know how to use email template ?
I’m not sure what you mean? Give me a bit more information and I’ll try to help
There is a coding error.
In class Numbers method is misspelled.
So in some classes there is an error.
Could you correct getcalcWanted to getCalcWanted, please?
And thank you for material. 🙂
I fixed that. Thank you for pointing out the error. I have no idea how I did that?
Note to add:
getCalcWanted is spelled differently in various class so you have errors. 😉
and btw Great Material and presentation. 😀
Even my english not very well I find that your presentation and material are very good and perfect and easy to understund. We are waiting and waiting for other courses to explore and to understand Java and design pattern.
Thank you very much 🙂 I have many other videos in the works
You are great! I love your tutorials! But mabe I’m stupid, but I wonder how you know how meny classes you need for this pattern to work out? Is it always this many?
Thank you 🙂 The design patterns are rather flexible and they are by no means always exactly like I describe here. If you ever need to try and solve a problem by passing it off to a list of objects, then this is one way to accomplish that. I hope that helps