Best programming tutorial series on the web. Derek, you helped me get my first job out of college. The knowledge I knew that got me my job I learned from your tutorials... not school (which I payed $$$ for).
Rob L I'm very happy to hear that I could help that much :) Thank you for taking the time to tell me. Messages like this are the reason I keep making videos.
Derek Banas I totally agree with Rob. Whenever I use or recognize some of the design patterns which I've learned through your video series, I immediately remember you and I'm feeling thankful. I'm also recommending these tutorials to everyone who needs help understanding design patterns. Greetings from Zagreb ,Croatia!
+Derek Banas Yeah these tutorials are amazing Derek. These and your algorithms tutorials are basically the equivalent of a computer science course at a prestigious university.
14:08 The usage of observer pattern with threads is usually intended to allow subscribing/registering on a different thread from the one running the observer code i.e ensuring observer and subject/publisher don't run on the same thread. This wasn't demonstrated here (The threads were used for concurrency but both observer and subject execute in the same thread) and that confused me for some time. However the video still helped me in other ways.
That is all I could ever ask for :) I'm just providing a service that I wish I had years ago. Thankfully the internet (UA-cam) allows me to do what I do
I'm working my way through this series and I found this particular tutorial difficult to follow because the UML didn't match the actual code. Even for this small project it really helps to have a matching UML(it has a some 'implements' and 'has a' relationships). Once I updated the UML I rewatched the video and was able to follow along just fine.
I'm an electrical engineer with a background in hardware design and low level device driver and systems programming, mostly in ARM assembly and C. I was recently tasked with writing a much higher level OO project in C++ and have found that your tutorials are the only ones that thoroughly explain design patterns and other higher level software concepts. Thank you for these videos, they've helped me no end with my job.
Hi, Sure I have links to the code for every design pattern on this one page newthinktank. com/videos/design-patterns-tutorial/ I'm glad you enjoyed them :)
My Object Oriented Design tutorial may help you solve this problem. The first 2 videos should be enough. That is the process I follow for solving everything
You could do that. The design patterns aren't set in stone. There are many variations of them, so always feel free to do whatever makes your code most understandable
Always feel free to ask questions. The UML tutorial is done and the object oriented design one is almost done as well. Refactoring and Algorithms will follow to complete just about everything for software engineering
I welcome criticism and you are indeed correct. Sometimes, or even most of the time it is hard to provide a perfect example that both explains the pattern and is easy to understand. That may say something about my own personal skills. I need to work harder to make better tutorials and I try to improve with each video.
Derek, i have a exam tomorrow about design patterns, and your channel/videos saved my life. Thank you so much man. You're make magic with your videos! Hope my channel about android help videos get cool like yours one day! Salutes from Brazil/Argentina!
I'm using a pseudo UML notation. I did this tutorial before I made my UML tutorial so I wanted to make sure people understood what I was doing. Sorry if that was confusing. If I could go back, I would have made the UML tutorial before this one
You can store the observers in any way. You just need to maintain a list in one way or another. The patterns are just a guide. You can manipulate them in any way that works for your specific program
a slight improvement to register, unregister if i may, use an extra map String, Integer to store indexes, ArrayList index of complexity is N, map's get is 1. you can also use this map to send private messages by accessing indexes in the iterable quickly.
Derek, thank you for these videos. I used to watch your videos long ago before I started school. Now your design pattern videos are now helping me study for a final exam!
Sorry about that. Sometimes I struggle with whether I should just cover the pattern, or whether I should include an interesting example that makes the topic less boring. I revisit the observer pattern later using an easier to understand example
Merry Christmas and Happy New Year to you :) I'm going to make a Design Pattern cheat sheet so they are easier to pick. I'll be covering a bunch more aside from those covered by the GOF.
These videos really helped me quick revise design patterns before interviews. Even when i play at 2x speed i can clearly understand what Derek is saying. All examples are fun and easy to remember. Thanks for such amazing tutorial.
Hey Derek. I'm a software engineer my self and just wanna say I really enjoy you videos. They are really well made and you really know your stuff :) Please keep it going, because this is great stuff. I know you will help a lot of coders out there. So a million thumbs up for the great job :)
I just wanted to mention that I still draw insight from your work after all these years. I code for a living but in my spare time I'm writing a video game. I wanted levers in the game (of whatever shape or form) to notify their observers such that any lever could trigger any number of devices in the game and for multiple levers to be able to trigger the same device. Sure enough, out came the Observer Pattern and it did just the job :) I continue to refer people to your superb tutorials!
That’s awesome :) Thank you for taking the time to tell me! Sometimes I feel like I’m talking to myself in my basement, but messages like yours keep me going
I don't use design patterns at the beginning of the coding process, but instead add them in increments when I add features or guess that features are needed in the future. I'll be showing my process in my code refactoring tutorial which will start tomorrow. I also cover the process in my finished object oriented design tutorial. I hope they help
It is he view part of Model View Controller. Some people call MVC the Observer pattern, but that isn't by the book correct. Yes I have a separate tutorial on just the MVC pattern
That is a very good point. Thank you for the input. I mainly write these programs out of my head and that is the reason why my naming isn't always perfect. I'm constantly trying to get better :)
To be honest I hated being a stock broker. I actually quit after I became a chartered financial analyst. I was more then likely in a bad office, but my experience was so terrible I left the industry. One reason why I left was my office / the home office lost me a $4 Million muni account because they wouldn't print up the portfolio! I love being in business for myself. I don't rely on anyone and I still get to play around with investing
Hello Derek, I am an experienced java developer who from time to time needs to refresh his core knowledge. Thank you very much for your work. your videos really help me see things in a better and easy way. You really clear some doubts I had before... Thank you mate.
Thank you very much :) I have a link to all the code in the description for the video. Feel free to do anything you'd like with it. I don't require you to even mention that it is my code.
Just found your channel and liking it so far! A fun variation of this pattern is to do a Pull instead of a Push to the observers. For instance, say if every observer had a time or resource intensive operation every time a value is updated. You may not care about all the changes that happen, such as a daily report. At the end of the day, you want the final stock price of all stocks that had movement. You would send a flag to all of the observers that a change occurred. Then, each observer can call back up to get the current value of what was changed on its own timetable. After retrieving the value, it resets the flag and waits for the next day to check again. Quick example, AAPL and GOOG price changes 100 times an a day, and the observers for those 2 stocks are sent a stockChanged flag. End of day, iterate over all your observers and check the flag. AAPL and GOOG come back true, so call back to get the price, add it to the report, and set the flag back to false. IBM didn’t have a price change, so it is skipped. Not sure if you ever cover this variation in a different video, but it’s pretty neat!
Yes I should never use == for string comparison even when it would work. I'm sure at the time I had a weird reason to do it this way, but it was still wrong. Sorry about that
Thank you :) I definitely don't hear that very often. Ill do an Eclipse shortcut tutorial as soon as the address book app is finished. I have been wanting to do that. Thanks for the request
GREAT VIDEOS. Almost a month trying to understand from the book, but it wasn't clear in my mind until now. THANK YOU. It will indeed help me for my final coming up in two days
Thank you :) I do my best to cover topics that nobody has even if they will never get many views. The social network tutorial wasn't made by me, but I was asked to give a shout out for it. I'm normally willing to do things like that. Just click the green link in the video to be sent there. I hope it works for you, but I haven't looked at its progress in over a month
You would want to definitely save this information to a database. I'm not sure if you are looking for info on using java for example to do this or not? You need to scrap the information using regular expressions, or some other solution. Then you'll need to store the information in a database. The GUI is probably going to be the hardest part. I'll make a stock screening tool in my Android tutorial using SQLite very soon
Java is a fabulous language that is made perfect when combined with c / c++. PHP is good for what it does, but it definitely is not an oop language like people keep trying to tell me :)
Awesome tutorial. I liked the way you used "publisher" and "subscriber" as opposed to "subject" and "observer". It makes so much more sense with publisher and subscriber. I guess it's because subject and observer are more abstract names.
The best tutorial series. I can definitely say that the Software architecture class I learned in college( Master Level) was useless!!! This by far the best explanations on software design patterns. Thank you sir!
This is crazy. So awesome. I had never learnt design patterns and used to fail in tech interviews. After the videos I can implement the factory and observer patterns so easily. Thanks a lot Derek.
One more thing, I noticed a small mistake, just wanted to let you know, you already updated the price by doing price = Double valueOf(..).... You know which line I'm talking about and then when you just wanted to print out the price change at the end, you printed out price + randNum Which resulted the randNum being added in the price twice when you are printing it out and it doesn't match with prices set. I was just wondering why the numbers are not matching and found this bug. Thank you Derek.
This is the first educational video which made me laugh. ;D When you said "pubic" followed by "blah blah blah" I laughed harder than I should have :D Love your work! Keep it going! :)
In the GetTheStock class, its better to use: `stock.equals("IBM")` than `stock == "IBM"`. Also in the StockGrabber class' unregister method, it makes more sense to print the "deleted" message after the observer is removed.
19:50 println(stock + ": " + df.format((price + randNum))... should be println(stock + ": " + df.format((price))... since you already add the price at this line price = Double.valueOf(df.format((price+randNum))); otherwise the terminal output will be misleading.
Great series of course. I am super confused about one thing. This question is for Derek or anyone who knows. How do you do the auto-fill thing he's doing here with fields and the if statements at the end. Like he writes out "private double ibmPrice" but then does some shortcut to auto generate the other fields for the other stocks. That's a huge time saver obviously and I'd love to know how he did that. 4:34, 8:20 for example
You have the best programming tutorials I have seen on UA-cam! You have a way of speaking that makes everything extremely easy to understand. Keep up the good work :)
To be honest this is my fav channel right now. Btw could you make a video or answer here on how to write fast in Eclipse? Plugins, shortcuts etc etc.. Thank you very much for your videos.
continuing from my previous comment....Rather than adding specific stocks, I'd like to be able to observer any number of stocks and possibly get stocks based on different properties such as user entered conditions (daily range, sector, etc...). Just throwing out some ideas and would like to hear your general thinking...thank you again.
Thank you :) Yes in this situation you could do away with it. It is there so you can create numerous classes that would implement the Subject interface though. Maybe I should have taken it a bit further?
You're very welcome :) I have a java tutorial. Technically this is a java tutorial. I haven't covered JEE, but I definitely will. I hope to cover everything there is to know about java
Thank you :) Android pretty much uses MVC already. The interface is setup completely using the xml layout files. The Activity files act as the controllers. I code do a better job of modeling the Model better and separating everything better. Thank you for the input
Thank you so much for this series of videos. You have saved me from failing at university, and I learned more in 20 minutes of your video than 2 hours in a lecture at uni.
Best tutorial series ever. I lost some classes (at college) cause I had to travel. So I started searching and ended on Derek's channel. Just got a college work finished by watching the Android for Beginners Tutorial. I just wanna say: Thank you Bro, for taking your time and making this AWESOME, extreme good quality material to us and for free! Regards, Rafael - from Brazil.
Wow! That's even better! I'll definately keep a copy of that around the corner. It can be real handy when you just want to refer something, or trying to match your problem with design pattern for a solution. Very, very handy indeed :)
In some books it is written that the subject does not send updates to observers, but it inform them that it has change the state and is the duty of interest observers to get the new state(or updates). So can you please clarify if this is how observer pattern works or there are different form of implementation?
I have a doubt: if observers are passed reference of subject object, then the observers (or any one in particular) can use the subject's notifyobserver() method. This will wrongly notify all the observers. Any help in better understanding this is appreciated. Thank you..
great video. In a long time, I thought the class for observer and the class for subject resides on different machines, but after reading tutorials and seeing codes, I find they are implemented together and run on one same machine.
I hope you did not find my criticism of your Strategy Pattern video too hard. I appreciate your videos very much, I refer other devs too them as well. Its been about 17 years since I've used UML, used your videos to brush up on syntax
I know this isn't new, but great job. I think they could be a bit shorter (depends the level at which the viewer is I guess), however for me 1.25 speed with occasional breaks to stare at code is perfect. I rarely feel I have outstanding questions about the patterns after watching (watched a few), I guess all I have left is practice them... but the concepts are super well explained. Great job.
Funny how thanks to your set of tutorials I managed to go over all of the programming which will be covered during the 4 years of my education in just few months...Wish my university professors would explain things like you and provide similar examples...
Learn in One Videos for Every Programming Language
Subscribe to Bookmark them: bit.ly/2FWQZTx
C++ : ua-cam.com/video/Rub-JsjMhWY/v-deo.html
Python : ua-cam.com/video/N4mEzFDjqtA/v-deo.html
Java : ua-cam.com/video/n-xAqcBCws4/v-deo.html
PHP : ua-cam.com/video/7TF00hJI78Y/v-deo.html
MySQL : ua-cam.com/video/yPu6qV5byu4/v-deo.html
JavaScript : ua-cam.com/video/fju9ii8YsGs/v-deo.html
C# : ua-cam.com/video/lisiwUZJXqQ/v-deo.html
HTML5 : ua-cam.com/video/kDyJN7qQETA/v-deo.html
CSS3 : ua-cam.com/video/CUxH_rWSI1k/v-deo.html
JQuery : ua-cam.com/video/BWXggB-T1jQ/v-deo.html
TypeScript : ua-cam.com/video/-PR_XqW9JJU/v-deo.html
ECMAScript : ua-cam.com/video/Jakoi0G8lBg/v-deo.html
Swift : ua-cam.com/video/dKaojOZ-az8/v-deo.html
R : ua-cam.com/video/s3FozVfd7q4/v-deo.html
Haskell : ua-cam.com/video/02_H3LjqMr8/v-deo.html
Handlebars : ua-cam.com/video/4HuAnM6b2d8/v-deo.html
Bootstrap : ua-cam.com/video/gqOEoUR5RHg/v-deo.html
Rust : ua-cam.com/video/U1EFgCNLDB8/v-deo.html
Matlab : ua-cam.com/video/NSSTkkKRabI/v-deo.html
Arduino : ua-cam.com/video/QO_Jlz1qpDw/v-deo.html
Crystal : ua-cam.com/video/DxFP-Wjqtsc/v-deo.html
Emacs : ua-cam.com/video/Iagbv974GlQ/v-deo.html
Clojure : ua-cam.com/video/ciGyHkDuPAE/v-deo.html
Shell : ua-cam.com/video/hwrnmQumtPw/v-deo.html
Perl : ua-cam.com/video/WEghIXs8F6c/v-deo.html
Perl6 : ua-cam.com/video/l0zPwhgWTgM/v-deo.html
Elixir : ua-cam.com/video/pBNOavRoNL0/v-deo.html
D : ua-cam.com/video/rwZFTnf9bDU/v-deo.html
Fortran : ua-cam.com/video/__2UgFNYgf8/v-deo.html
LaTeX : ua-cam.com/video/VhmkLrOjLsw/v-deo.html
F# : ua-cam.com/video/c7eNDJN758U/v-deo.html
Kotlin : ua-cam.com/video/H_oGi8uuDpA/v-deo.html
Erlang : ua-cam.com/video/IEhwc2q1zG4/v-deo.html
Groovy : ua-cam.com/video/B98jc8hdu9g/v-deo.html
Scala : ua-cam.com/video/DzFt0YkZo8M/v-deo.html
Lua : ua-cam.com/video/iMacxZQMPXs/v-deo.html
Ruby : ua-cam.com/video/Dji9ALCgfpM/v-deo.html
Go : ua-cam.com/video/CF9S4QZuV30/v-deo.html
Objective C : ua-cam.com/video/5esQqZIJ83g/v-deo.html
Prolog : ua-cam.com/video/SykxWpFwMGs/v-deo.html
LISP : ua-cam.com/video/ymSq4wHrqyU/v-deo.html
Express : ua-cam.com/video/xDCKcNBFsuI/v-deo.html
Jade : ua-cam.com/video/l5AXcXAP4r8/v-deo.html
Sass : ua-cam.com/video/wz3kElLbEHE/v-deo.html
Might I add.. gasp.
7 years later and this content is still making a huge difference! Thank you, Derek!
10 years later and still making a huge difference.
11 years and it still makes a difference
12 years, and it's still as good
@@israelperezmasle6673 13
Best programming tutorial series on the web. Derek, you helped me get my first job out of college. The knowledge I knew that got me my job I learned from your tutorials... not school (which I payed $$$ for).
Rob L I'm very happy to hear that I could help that much :) Thank you for taking the time to tell me. Messages like this are the reason I keep making videos.
Derek Banas I totally agree with Rob. Whenever I use or recognize some of the design patterns which I've learned through your video series, I immediately remember you and I'm feeling thankful. I'm also recommending these tutorials to everyone who needs help understanding design patterns.
Greetings from Zagreb ,Croatia!
+Derek Banas Yeah these tutorials are amazing Derek. These and your algorithms tutorials are basically the equivalent of a computer science course at a prestigious university.
I am at a prestigous University and i am still watching this, top :)
TheBondilein Can you confirm what The Humanity said? :)
7:57 "It's public not pubic" lol I cracked there.
14:08 The usage of observer pattern with threads is usually intended to allow subscribing/registering on a different thread from the one running the observer code i.e ensuring observer and subject/publisher don't run on the same thread. This wasn't demonstrated here (The threads were used for concurrency but both observer and subject execute in the same thread) and that confused me for some time. However the video still helped me in other ways.
That is all I could ever ask for :) I'm just providing a service that I wish I had years ago. Thankfully the internet (UA-cam) allows me to do what I do
I'm working my way through this series and I found this particular tutorial difficult to follow because the UML didn't match the actual code. Even for this small project it really helps to have a matching UML(it has a some 'implements' and 'has a' relationships). Once I updated the UML I rewatched the video and was able to follow along just fine.
I'm an electrical engineer with a background in hardware design and low level device driver and systems programming, mostly in ARM assembly and C. I was recently tasked with writing a much higher level OO project in C++ and have found that your tutorials are the only ones that thoroughly explain design patterns and other higher level software concepts. Thank you for these videos, they've helped me no end with my job.
Hi, Sure I have links to the code for every design pattern on this one page newthinktank. com/videos/design-patterns-tutorial/
I'm glad you enjoyed them :)
I'm extremely happy to hear that I was able to help :)
Thank you :) I love covering the niche topics everyone else ignores. I'm glad you liked it!
Yes indeed. You have to register the observers so you can easily alert them to changes
I'm very happy to have been of help with this topic that I really enjoyed covering :)
You're very welcome. AOP is implemented through the decorator pattern which I cover. I hope it helps
My Object Oriented Design tutorial may help you solve this problem. The first 2 videos should be enough. That is the process I follow for solving everything
You could do that. The design patterns aren't set in stone. There are many variations of them, so always feel free to do whatever makes your code most understandable
Always feel free to ask questions. The UML tutorial is done and the object oriented design one is almost done as well. Refactoring and Algorithms will follow to complete just about everything for software engineering
Thank you :) Yes I agree. I wish I would have shown both. I was just doing my best to explain everything as simple as possible.
I welcome criticism and you are indeed correct. Sometimes, or even most of the time it is hard to provide a perfect example that both explains the pattern and is easy to understand. That may say something about my own personal skills. I need to work harder to make better tutorials and I try to improve with each video.
Derek, i have a exam tomorrow about design patterns, and your channel/videos saved my life. Thank you so much man. You're make magic with your videos! Hope my channel about android help videos get cool like yours one day! Salutes from Brazil/Argentina!
I'm using a pseudo UML notation. I did this tutorial before I made my UML tutorial so I wanted to make sure people understood what I was doing. Sorry if that was confusing. If I could go back, I would have made the UML tutorial before this one
Thank you for taking the time to tell me that :) It means a great deal to me that I was able to help!
You can store the observers in any way. You just need to maintain a list in one way or another. The patterns are just a guide. You can manipulate them in any way that works for your specific program
a slight improvement to register, unregister if i may, use an extra map String, Integer to store indexes, ArrayList index of complexity is N, map's get is 1. you can also use this map to send private messages by accessing indexes in the iterable quickly.
Derek, thank you for these videos. I used to watch your videos long ago before I started school. Now your design pattern videos are now helping me study for a final exam!
Sorry about that. Sometimes I struggle with whether I should just cover the pattern, or whether I should include an interesting example that makes the topic less boring. I revisit the observer pattern later using an easier to understand example
You could strip out the commas using a regular expression if it is found. Sorry I didn't cover that
Thank you :) I'm very happy you're enjoying the videos. I would have never thought a design patterns tutorial would be this popular
Yes the Observer pattern is used heavily in the Swing framework.
Merry Christmas and Happy New Year to you :) I'm going to make a Design Pattern cheat sheet so they are easier to pick. I'll be covering a bunch more aside from those covered by the GOF.
These videos really helped me quick revise design patterns before interviews. Even when i play at 2x speed i can clearly understand what Derek is saying. All examples are fun and easy to remember. Thanks for such amazing tutorial.
I'm very happy that they helped :)
Hey Derek. I'm a software engineer my self and just wanna say I really enjoy you videos. They are really well made and you really know your stuff :)
Please keep it going, because this is great stuff. I know you will help a lot of coders out there. So a million thumbs up for the great job :)
I just wanted to mention that I still draw insight from your work after all these years. I code for a living but in my spare time I'm writing a video game. I wanted levers in the game (of whatever shape or form) to notify their observers such that any lever could trigger any number of devices in the game and for multiple levers to be able to trigger the same device. Sure enough, out came the Observer Pattern and it did just the job :) I continue to refer people to your superb tutorials!
That’s awesome :) Thank you for taking the time to tell me! Sometimes I feel like I’m talking to myself in my basement, but messages like yours keep me going
@@derekbanas My pleasure ^_^ thank you again!
Not many people know about me. I'm glad you found me and enjoy the videos :)
I don't use design patterns at the beginning of the coding process, but instead add them in increments when I add features or guess that features are needed in the future. I'll be showing my process in my code refactoring tutorial which will start tomorrow. I also cover the process in my finished object oriented design tutorial. I hope they help
It is he view part of Model View Controller. Some people call MVC the Observer pattern, but that isn't by the book correct. Yes I have a separate tutorial on just the MVC pattern
Thank you for taking the time to tell me I helped so much. I appreciate that :) I wish you the best on your exam and with your UA-cam channel!
That is a very good point. Thank you for the input. I mainly write these programs out of my head and that is the reason why my naming isn't always perfect. I'm constantly trying to get better :)
To be honest I hated being a stock broker. I actually quit after I became a chartered financial analyst. I was more then likely in a bad office, but my experience was so terrible I left the industry. One reason why I left was my office / the home office lost me a $4 Million muni account because they wouldn't print up the portfolio! I love being in business for myself. I don't rely on anyone and I still get to play around with investing
Hello Derek, I am an experienced java developer who from time to time needs to refresh his core knowledge. Thank you very much for your work. your videos really help me see things in a better and easy way. You really clear some doubts I had before... Thank you mate.
+davicho12345 Hello, Thank you :) I'm very happy that you find the videos useful.
Thank you very much :) I have a link to all the code in the description for the video. Feel free to do anything you'd like with it. I don't require you to even mention that it is my code.
Just found your channel and liking it so far!
A fun variation of this pattern is to do a Pull instead of a Push to the observers. For instance, say if every observer had a time or resource intensive operation every time a value is updated. You may not care about all the changes that happen, such as a daily report. At the end of the day, you want the final stock price of all stocks that had movement. You would send a flag to all of the observers that a change occurred. Then, each observer can call back up to get the current value of what was changed on its own timetable. After retrieving the value, it resets the flag and waits for the next day to check again. Quick example, AAPL and GOOG price changes 100 times an a day, and the observers for those 2 stocks are sent a stockChanged flag. End of day, iterate over all your observers and check the flag. AAPL and GOOG come back true, so call back to get the price, add it to the report, and set the flag back to false. IBM didn’t have a price change, so it is skipped.
Not sure if you ever cover this variation in a different video, but it’s pretty neat!
Yes I should never use == for string comparison even when it would work. I'm sure at the time I had a weird reason to do it this way, but it was still wrong. Sorry about that
Thank you :) I definitely don't hear that very often. Ill do an Eclipse shortcut tutorial as soon as the address book app is finished. I have been wanting to do that. Thanks for the request
GREAT VIDEOS. Almost a month trying to understand from the book, but it wasn't clear in my mind until now. THANK YOU. It will indeed help me for my final coming up in two days
Thank you :) I do my best to cover topics that nobody has even if they will never get many views. The social network tutorial wasn't made by me, but I was asked to give a shout out for it. I'm normally willing to do things like that. Just click the green link in the video to be sent there. I hope it works for you, but I haven't looked at its progress in over a month
Je parle un peu français et utiliser un traducteur pour ce que je ne comprends pas. Merci d'avoir regardé :)
You're very welcome :) It is my privilege to make them. It is very nice to help people
You would want to definitely save this information to a database. I'm not sure if you are looking for info on using java for example to do this or not? You need to scrap the information using regular expressions, or some other solution. Then you'll need to store the information in a database. The GUI is probably going to be the hardest part. I'll make a stock screening tool in my Android tutorial using SQLite very soon
Java is a fabulous language that is made perfect when combined with c / c++. PHP is good for what it does, but it definitely is not an oop language like people keep trying to tell me :)
I was looking for an example in observer patterns and i got to say yours is really good! thanks mate.
Awesome tutorial. I liked the way you used "publisher" and "subscriber" as opposed to "subject" and "observer". It makes so much more sense with publisher and subscriber. I guess it's because subject and observer are more abstract names.
Not yet, but everything done in java can be done in c++ and c#. A c and c++ tutorial is in the works
The best tutorial series. I can definitely say that the Software architecture class I learned in college( Master Level) was useless!!! This by far the best explanations on software design patterns. Thank you sir!
+Ontime Alarms Thank you for the nice compliments :) I'm glad I could help.
This is crazy. So awesome. I had never learnt design patterns and used to fail in tech interviews. After the videos I can implement the factory and observer patterns so easily. Thanks a lot Derek.
I'm happy I was able to help :) You're very welcome.
I'm watching these 7 years later and still this tutorial is the best one on Observer pattern. Thank you Derek
Thank you for the nice compliment :)
One more thing, I noticed a small mistake, just wanted to let you know, you already updated the price by doing
price = Double valueOf(..).... You know which line I'm talking about and then when you just wanted to print out the price change at the end, you printed out
price + randNum
Which resulted the randNum being added in the price twice when you are printing it out and it doesn't match with prices set. I was just wondering why the numbers are not matching and found this bug. Thank you Derek.
Thank you :) I do my best to make everything understandable even if I have to divert from normal teaching styles
This is the first educational video which made me laugh. ;D When you said "pubic" followed by "blah blah blah" I laughed harder than I should have :D
Love your work! Keep it going! :)
+Kaushik Sundar That's funny :) I'm happy you could find humor in my videos.
In the GetTheStock class, its better to use: `stock.equals("IBM")` than `stock == "IBM"`.
Also in the StockGrabber class' unregister method, it makes more sense to print the "deleted" message after the observer is removed.
19:50
println(stock + ": " + df.format((price + randNum))...
should be
println(stock + ": " + df.format((price))...
since you already add the price at this line
price = Double.valueOf(df.format((price+randNum)));
otherwise the terminal output will be misleading.
Dude, I agree though I had to find hard to get to your comment!
Great series of course. I am super confused about one thing. This question is for Derek or anyone who knows. How do you do the auto-fill thing he's doing here with fields and the if statements at the end. Like he writes out "private double ibmPrice" but then does some shortcut to auto generate the other fields for the other stocks. That's a huge time saver obviously and I'd love to know how he did that. 4:34, 8:20 for example
You have the best programming tutorials I have seen on UA-cam! You have a way of speaking that makes everything extremely easy to understand. Keep up the good work :)
Thank you very much :) I try to do my best.
Design pattern was a Rocket science to me till now. After your videos its just a cake walk for me :)
No man i got it 100% i just mentioned that for you to be aware !
Again thanks for the great series of design patterns tutorials !
To be honest this is my fav channel right now. Btw could you make a video or answer here on how to write fast in Eclipse? Plugins, shortcuts etc etc.. Thank you very much for your videos.
7:57
continuing from my previous comment....Rather than adding specific stocks, I'd like to be able to observer any number of stocks and possibly get stocks based on different properties such as user entered conditions (daily range, sector, etc...). Just throwing out some ideas and would like to hear your general thinking...thank you again.
Thank you :) Yes in this situation you could do away with it. It is there so you can create numerous classes that would implement the Subject interface though. Maybe I should have taken it a bit further?
You're very welcome :) I have a java tutorial. Technically this is a java tutorial. I haven't covered JEE, but I definitely will. I hope to cover everything there is to know about java
Thank you :) Android pretty much uses MVC already. The interface is setup completely using the xml layout files. The Activity files act as the controllers. I code do a better job of modeling the Model better and separating everything better. Thank you for the input
Vocals, Visuals,Insight:all superb. Nice tutorial!
Thank you so much for this series of videos. You have saved me from failing at university, and I learned more in 20 minutes of your video than 2 hours in a lecture at uni.
Thank you for taking the time to tell me I helped :) I greatly appreciate it
I'm usually don't comment on video , special on programming video , but your tutorial is the best i have seen. thank you
Thank you very much :) I appreciate you taking the time to tell me you liked it.
Derek, next to your name, there is nothing better in this world than these videos.
That's funny :) Thank you for the compliment
Thank you :) You guys asked for them so I'm delivering
Yes that is one of the things it is commonly used for
I hope they help :) You're very welcome
You're very welcome :) I'm glad it helped
Thank you very much :) I'm trying to provide a complete software engineering degree online, but I still have a way to go. I'll keep at it
I think you are looking for the Factory pattern. You use the Factory design pattern when you want to define the class of an object at runtime.
Dude these tutorials are awesome. I feel like I should be paying you.
Thank you :) I'm very happy to have been able to help.
Thank you :) I have those files some place, but I'll have to dig them up. Do you just want the one for the observer pattern for now?
It wouldn't be that different since C# looks almost exactly the same as Java. I plan on covering C# asap
Best tutorial series ever. I lost some classes (at college) cause I had to travel. So I started searching and ended on Derek's channel. Just got a college work finished by watching the Android for Beginners Tutorial. I just wanna say: Thank you Bro, for taking your time and making this AWESOME, extreme good quality material to us and for free! Regards, Rafael - from Brazil.
Thank you for the nice compliment :) I'm very happy that you found the videos useful. You're very welcome
Thanks a lot, Dude!
At 19:40, why are == being used to compare strings? Shouldn't equals method of String class be more appropriate?
Thank you :) Im glad you found it useful.
I don't know why, but this guy just explains everything perfectly.
thanks Derek!!!
Thank you for the compliment :)
Wow! That's even better! I'll definately keep a copy of that around the corner. It can be real handy when you just want to refer something, or trying to match your problem with design pattern for a solution. Very, very handy indeed :)
Genius, thanks for this. Even before finishing this video, I already understand the pattern. Keep it up mate.
Thank you :) I'm glad i could help.
You're very welcome :) Best of luck on the exam
In some books it is written that the subject does not send updates to observers, but it inform them that it has change the state and is the duty of interest observers to get the new state(or updates). So can you please clarify if this is how observer pattern works or there are different form of implementation?
I have a doubt: if observers are passed reference of subject object, then the observers (or any one in particular) can use the subject's notifyobserver() method. This will wrongly notify all the observers. Any help in better understanding this is appreciated. Thank you..
great video.
In a long time, I thought the class for observer and the class for subject resides on different machines, but after reading tutorials and seeing codes, I find they are implemented together and run on one same machine.
I hope you did not find my criticism of your Strategy Pattern video too hard. I appreciate your videos very much, I refer other devs too them as well. Its been about 17 years since I've used UML, used your videos to brush up on syntax
best tutorial for observer design pattern i'ever read. thx a lot :)
I know this isn't new, but great job. I think they could be a bit shorter (depends the level at which the viewer is I guess), however for me 1.25 speed with occasional breaks to stare at code is perfect.
I rarely feel I have outstanding questions about the patterns after watching (watched a few), I guess all I have left is practice them... but the concepts are super well explained. Great job.
Funny how thanks to your set of tutorials I managed to go over all of the programming which will be covered during the 4 years of my education in just few months...Wish my university professors would explain things like you and provide similar examples...
Exam on tuesday! This has really helped!! Thank you!!
The best videos on UA-cam EVER.