Observer Design Pattern

Поделиться
HTML-код
  • Опубликовано: 13 окт 2024
  • Get the Code: goo.gl/EYGnQ
    Best Design Patterns Book : goo.gl/W0wyie
    MY UDEMY COURSES ARE 87.5% OFF TIL July 16th ($9.99)
    www.udemy.com/
    ➡️ Python Data Science Series for $9.99 : Highest Rated & Largest Python Udemy Course + 56 Hrs + 200 Videos + Data Science bit.ly/Master_...
    ➡️ New C++ Programming Bootcamp Series for $9.99 : Over 23 Hrs + 53 Videos + Quizzes + Graded Assignments + New Videos Every Month bit.ly/C_Cours...
    Welcome to my Observer Design Pattern Tutorial. I cover a lot in this tutorial including the Observer pattern, how to use it with threads and much more.
    The Observer pattern is a software design pattern in which an object, called the subject (Publisher), maintains a list of its dependents, called observers (Subscribers), and notifies them automatically of any state changes, usually by calling one of their methods.

Комментарии • 644

  • @derekbanas
    @derekbanas  5 лет назад +15

    Learn in One Videos for Every Programming Language
    Subscribe to Bookmark them: bit.ly/2FWQZTx
    C++ : ruclips.net/video/Rub-JsjMhWY/видео.html
    Python : ruclips.net/video/N4mEzFDjqtA/видео.html
    Java : ruclips.net/video/n-xAqcBCws4/видео.html
    PHP : ruclips.net/video/7TF00hJI78Y/видео.html
    MySQL : ruclips.net/video/yPu6qV5byu4/видео.html
    JavaScript : ruclips.net/video/fju9ii8YsGs/видео.html
    C# : ruclips.net/video/lisiwUZJXqQ/видео.html
    HTML5 : ruclips.net/video/kDyJN7qQETA/видео.html
    CSS3 : ruclips.net/video/CUxH_rWSI1k/видео.html
    JQuery : ruclips.net/video/BWXggB-T1jQ/видео.html
    TypeScript : ruclips.net/video/-PR_XqW9JJU/видео.html
    ECMAScript : ruclips.net/video/Jakoi0G8lBg/видео.html
    Swift : ruclips.net/video/dKaojOZ-az8/видео.html
    R : ruclips.net/video/s3FozVfd7q4/видео.html
    Haskell : ruclips.net/video/02_H3LjqMr8/видео.html
    Handlebars : ruclips.net/video/4HuAnM6b2d8/видео.html
    Bootstrap : ruclips.net/video/gqOEoUR5RHg/видео.html
    Rust : ruclips.net/video/U1EFgCNLDB8/видео.html
    Matlab : ruclips.net/video/NSSTkkKRabI/видео.html
    Arduino : ruclips.net/video/QO_Jlz1qpDw/видео.html
    Crystal : ruclips.net/video/DxFP-Wjqtsc/видео.html
    Emacs : ruclips.net/video/Iagbv974GlQ/видео.html
    Clojure : ruclips.net/video/ciGyHkDuPAE/видео.html
    Shell : ruclips.net/video/hwrnmQumtPw/видео.html
    Perl : ruclips.net/video/WEghIXs8F6c/видео.html
    Perl6 : ruclips.net/video/l0zPwhgWTgM/видео.html
    Elixir : ruclips.net/video/pBNOavRoNL0/видео.html
    D : ruclips.net/video/rwZFTnf9bDU/видео.html
    Fortran : ruclips.net/video/__2UgFNYgf8/видео.html
    LaTeX : ruclips.net/video/VhmkLrOjLsw/видео.html
    F# : ruclips.net/video/c7eNDJN758U/видео.html
    Kotlin : ruclips.net/video/H_oGi8uuDpA/видео.html
    Erlang : ruclips.net/video/IEhwc2q1zG4/видео.html
    Groovy : ruclips.net/video/B98jc8hdu9g/видео.html
    Scala : ruclips.net/video/DzFt0YkZo8M/видео.html
    Lua : ruclips.net/video/iMacxZQMPXs/видео.html
    Ruby : ruclips.net/video/Dji9ALCgfpM/видео.html
    Go : ruclips.net/video/CF9S4QZuV30/видео.html
    Objective C : ruclips.net/video/5esQqZIJ83g/видео.html
    Prolog : ruclips.net/video/SykxWpFwMGs/видео.html
    LISP : ruclips.net/video/ymSq4wHrqyU/видео.html
    Express : ruclips.net/video/xDCKcNBFsuI/видео.html
    Jade : ruclips.net/video/l5AXcXAP4r8/видео.html
    Sass : ruclips.net/video/wz3kElLbEHE/видео.html

    • @123456wei
      @123456wei 4 года назад

      Might I add.. gasp.

  • @nathanbivens2394
    @nathanbivens2394 5 лет назад +89

    7 years later and this content is still making a huge difference! Thank you, Derek!

  • @robl655
    @robl655 9 лет назад +308

    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).

    • @derekbanas
      @derekbanas  9 лет назад +222

      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.

    • @LukaPostruzin9
      @LukaPostruzin9 9 лет назад +24

      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!

    • @thehumanity0
      @thehumanity0 9 лет назад +6

      +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.

    • @TheBondilein
      @TheBondilein 7 лет назад +8

      I am at a prestigous University and i am still watching this, top :)

    • @curiousSloth92
      @curiousSloth92 4 года назад

      TheBondilein Can you confirm what The Humanity said? :)

  • @javierguerrero9486
    @javierguerrero9486 8 лет назад +81

    7:57 "It's public not pubic" lol I cracked there.

  • @derekbanas
    @derekbanas  12 лет назад +9

    That is all I could ever ask for :) I'm just providing a service that I wish I had years ago. Thankfully the internet (RUclips) allows me to do what I do

  • @derekbanas
    @derekbanas  11 лет назад +2

    Yes indeed. You have to register the observers so you can easily alert them to changes

  • @derekbanas
    @derekbanas  12 лет назад +1

    Thank you :) I love covering the niche topics everyone else ignores. I'm glad you liked it!

  • @derekbanas
    @derekbanas  11 лет назад +1

    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.

  • @angryantaus8550
    @angryantaus8550 11 лет назад

    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.

  • @raulzuniga4382
    @raulzuniga4382 9 лет назад +59

    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.

  • @derekbanas
    @derekbanas  11 лет назад +1

    You're very welcome. AOP is implemented through the decorator pattern which I cover. I hope it helps

  • @hiteshsachdev3649
    @hiteshsachdev3649 4 года назад

    I'm watching these 7 years later and still this tutorial is the best one on Observer pattern. Thank you Derek

    • @derekbanas
      @derekbanas  4 года назад

      Thank you for the nice compliment :)

    • @hiteshsachdev3649
      @hiteshsachdev3649 4 года назад

      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.

  • @derekbanas
    @derekbanas  11 лет назад +1

    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

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад +3

    I'm extremely happy to hear that I was able to help :)

  • @NerdPowah
    @NerdPowah 3 года назад +1

    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!

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @bratttn
    @bratttn 8 лет назад +1

    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.

  • @Deco1789
    @Deco1789 11 лет назад

    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!

  • @PecPur
    @PecPur 2 года назад +2

    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.

  • @derekbanas
    @derekbanas  11 лет назад +1

    I'm very happy to have been of help with this topic that I really enjoyed covering :)

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) I'm very happy you're enjoying the videos. I would have never thought a design patterns tutorial would be this popular

  • @vaibhavpathak3228
    @vaibhavpathak3228 7 лет назад +1

    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.

    • @derekbanas
      @derekbanas  7 лет назад

      I'm very happy that they helped :)

  • @derekbanas
    @derekbanas  11 лет назад

    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 :)

  • @munchymcmouthington298
    @munchymcmouthington298 2 года назад

    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!

    • @derekbanas
      @derekbanas  2 года назад +2

      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

    • @munchymcmouthington298
      @munchymcmouthington298 2 года назад

      @@derekbanas My pleasure ^_^ thank you again!

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @altlash5731
    @altlash5731 4 года назад

    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!

  • @derekbanas
    @derekbanas  12 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад

    Yes that is one of the things it is commonly used for

  • @derekbanas
    @derekbanas  11 лет назад

    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.

  • @davicho12345
    @davicho12345 8 лет назад

    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.

    • @derekbanas
      @derekbanas  8 лет назад

      +davicho12345 Hello, Thank you :) I'm very happy that you find the videos useful.

  • @derekbanas
    @derekbanas  11 лет назад

    You're very welcome :) It is my privilege to make them. It is very nice to help people

  • @derekbanas
    @derekbanas  12 лет назад

    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 :)

  • @derekbanas
    @derekbanas  11 лет назад +1

    Yes the Observer pattern is used heavily in the Swing framework.

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) I do my best to make everything understandable even if I have to divert from normal teaching styles

  • @derekbanas
    @derekbanas  11 лет назад

    Not many people know about me. I'm glad you found me and enjoy the videos :)

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад

    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.

  • @BarunKharel
    @BarunKharel 7 лет назад +1

    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.

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @miquelstrippoli2286
    @miquelstrippoli2286 Год назад

    2022 and is, by far, the best tutuorial to learn about design pattern.

  • @ulyssis
    @ulyssis Месяц назад

    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.

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад

    I hope they help :) You're very welcome

  • @derekdejonge2521
    @derekdejonge2521 5 лет назад +1

    Derek, next to your name, there is nothing better in this world than these videos.

    • @derekbanas
      @derekbanas  5 лет назад

      That's funny :) Thank you for the compliment

  • @derekbanas
    @derekbanas  11 лет назад +1

    Thank you for taking the time to tell me that :) It means a great deal to me that I was able to help!

  • @derekbanas
    @derekbanas  12 лет назад

    Thank you :) You guys asked for them so I'm delivering

  • @xdiepx
    @xdiepx 11 лет назад

    I was looking for an example in observer patterns and i got to say yours is really good! thanks mate.

  • @ravitaurus88
    @ravitaurus88 10 лет назад

    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.

    • @derekbanas
      @derekbanas  10 лет назад +1

      I'm happy I was able to help :) You're very welcome.

  • @istainblack
    @istainblack 8 лет назад +13

    I like the pace in these videos. I feel like a lot of other Comp Sci tutorials go very slow and I have trouble keeping interest. But never with Derek's videos!

    • @derekbanas
      @derekbanas  7 лет назад +1

      +istainblack Thank you :) I do my best to be different and not waste peoples time.

    • @istainblack
      @istainblack 7 лет назад

      I salute you for that sir!

    • @greg77389
      @greg77389 7 лет назад

      You don't consider 22 minutes slow?

  • @squidgeypea
    @squidgeypea 4 года назад

    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.

    • @derekbanas
      @derekbanas  4 года назад

      Thank you for taking the time to tell me I helped :) I greatly appreciate it

  • @TheRajmoney
    @TheRajmoney 6 лет назад

    I don't know why, but this guy just explains everything perfectly.
    thanks Derek!!!

    • @derekbanas
      @derekbanas  6 лет назад

      Thank you for the compliment :)

  • @talhumy
    @talhumy 10 лет назад

    I'm usually don't comment on video , special on programming video , but your tutorial is the best i have seen. thank you

    • @derekbanas
      @derekbanas  10 лет назад

      Thank you very much :) I appreciate you taking the time to tell me you liked it.

  • @derekbanas
    @derekbanas  11 лет назад +1

    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 RUclips channel!

  • @yoismelperez2744
    @yoismelperez2744 11 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад

    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?

  • @derekbanas
    @derekbanas  11 лет назад

    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?

  • @derekbanas
    @derekbanas  11 лет назад

    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

  • @derekbanas
    @derekbanas  11 лет назад

    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.

  • @logiconabstractions6596
    @logiconabstractions6596 7 лет назад

    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.

  • @armelmaemble4558
    @armelmaemble4558 9 лет назад

    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!

    • @derekbanas
      @derekbanas  9 лет назад

      +Ontime Alarms Thank you for the nice compliments :) I'm glad I could help.

  • @georgegeorgiev4005
    @georgegeorgiev4005 9 лет назад

    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...

  • @bertobertoberto3
    @bertobertoberto3 11 лет назад

    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.

  • @derekbanas
    @derekbanas  11 лет назад

    Not yet, but everything done in java can be done in c++ and c#. A c and c++ tutorial is in the works

  • @666drinking666
    @666drinking666 7 лет назад

    Hey Derek,
    Ancient video I know but afaik you don't need a "private Subject stockGrabber" in the StockObserver.
    You can simply do the following:
    public StockObserver(Subject stockGrabber){
    ...
    stockGrabber.register(this);
    }
    this way you don't need to save a reference of the Subject in each observer. unless you have another reason to hold a reference of the Subject in the Observer AND a reference of the Observers in the List in the Subject ?
    But anyway, nice video

  • @ryanlarke2618
    @ryanlarke2618 10 лет назад

    You have the best programming tutorials I have seen on RUclips! You have a way of speaking that makes everything extremely easy to understand. Keep up the good work :)

    • @derekbanas
      @derekbanas  10 лет назад

      Thank you very much :) I try to do my best.

  • @derekbanas
    @derekbanas  11 лет назад

    You're very welcome :) I'm glad it helped

  • @cm9446
    @cm9446 9 лет назад

    Derek, thanks so much for all these super helpful videos! One quick question, how do you auto complete so many codes this fast? Where should we learn the shortcuts?

  • @DigitalScorp
    @DigitalScorp 11 лет назад

    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 :)

  • @derekbanas
    @derekbanas  11 лет назад

    You're very welcome :) Best of luck on the exam

  • @derekbanas
    @derekbanas  12 лет назад

    I have to make an MVC tutorial. I'll do that by next week. Thank you for the request :) It is already pretty much in the design patterns tutorial, but I should have cleared it up and made a proper tutorial

  • @jonjohannson9536
    @jonjohannson9536 4 года назад

    Derek, I appreciate so much the effort you put in your videos! I love the pace of them and that you mention the bigger context that was so often lost on the power point slides of university. I have started my first job and will have my (hopefully) last exam next week. Didn't even bother with the slides, when I saw that you have a series on design patterns.

    • @derekbanas
      @derekbanas  4 года назад

      Thank you for the great compliments :) Congratulations on your last exam!

  • @cas7449
    @cas7449 5 лет назад +1

    Hey Derek! Question, in GetTheStock you're using == to compare strings, isn't it better practice to use .equals()? And why did you opt for == instead? (:
    Cheers!

    • @sangyeopha9555
      @sangyeopha9555 5 лет назад

      I agree too, "IBM".equals(stock); is the better than `==`

  • @arbra1188
    @arbra1188 10 лет назад

    Hey again thanks for the video. It is advantageous to declare first a List like this List observers; and then initialize it with observers = new ArrayList(); That's how I learned it..

  • @derekbanas
    @derekbanas  11 лет назад +1

    That would be a great topic to cover once I get into game development. Thank you for bringing it up :) I also plan on making an extended algorithm tutorial that comes out every once in awhile. I can add this topic there as well

  • @KruszonTv
    @KruszonTv 11 лет назад

    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.

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) Im glad you liked it

  • @roynunez9580
    @roynunez9580 5 лет назад

    HI Derek! Your videos are awesome! In this video you mentioned some more videos on stocks, mentioning videos 19 and 32. Now I went through those videos and in the java tutorial and many others as well as some of your refactoring videos, but can't find anymore videos using stocks as examples as you did in the Observer design pattern. Can you share what playlist I can find java tutorial videos using stocks as examples? I am a decent stock trader and am working on a program to automate some of my trades while improving on my Java.

  • @vinuthaprem
    @vinuthaprem 11 лет назад

    Design pattern was a Rocket science to me till now. After your videos its just a cake walk for me :)

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) Im glad you found it useful.

  • @waterflowzz
    @waterflowzz 11 лет назад

    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.

  • @rafaelbressan2700
    @rafaelbressan2700 7 лет назад

    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.

    • @derekbanas
      @derekbanas  7 лет назад +1

      Thank you for the nice compliment :) I'm very happy that you found the videos useful. You're very welcome

    • @rafaelbressan2700
      @rafaelbressan2700 7 лет назад

      Thanks a lot, Dude!

  • @derekbanas
    @derekbanas  11 лет назад

    You could definitely check if the observer is valid.

  • @tivmego
    @tivmego 11 лет назад

    Thank you so so much. Now, I am confident, I will master DP after watching all of your DP tutorials. Do you have video tutorials on Java and Jee6?

  • @Geek3mr
    @Geek3mr 5 лет назад

    i have been lost in the design patterns but you guided me, thanks man thanks alot.

  • @alexandrgajdosh6565
    @alexandrgajdosh6565 7 лет назад

    Very nice tutorial, thanks.
    Just as side note, I would suggest to use ruby to describe design patterns, just to come out with less code, and more focused on pattern :)

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you :) I hope to cover more on DPs soon. Maybe I'll use Ruby

  • @derekbanas
    @derekbanas  12 лет назад

    God bless you as well :) Thank you for the kind words. They mean a lot

  • @matt-g-recovers
    @matt-g-recovers 5 лет назад

    So simple!
    What an awesome pattern. I know it's used all the time, I have worked within Systems built on this principal but first time designing my own. Great video!!
    I love software development pattern / best practices tutorials

    • @derekbanas
      @derekbanas  5 лет назад

      Thank you :) I'm happy you enjoyed it

  • @coreymagin
    @coreymagin 10 лет назад +27

    7:57

  • @rockYhre
    @rockYhre 11 лет назад

    Thanks for another awesome video. A question: what have you enjoyed more, being in IT or finance? I'm thinking about these two career paths and will probably combine them but I wonder what you think as you were/are in both. Thanks!

  • @MrPisacaca
    @MrPisacaca 6 лет назад

    Excellent video. I love the way you explain the pattern with threads. you make the explanation very clear and simple (which is a hard job considering that threads are a concept not very easy for beginners).

    • @derekbanas
      @derekbanas  6 лет назад

      Thank you very much :) I did my best

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you very much :) I do my best

  • @derekbanas
    @derekbanas  11 лет назад

    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.

  • @Bignatefrogg
    @Bignatefrogg 12 лет назад

    Great video again Derek! I love your tutorials and appreciate that you teach more advanced topics, not just the basics. I was curious about the social network tutorial you mention at the end of this video, you said there is a link to it but I can't find one. Am I just being dumb?

  • @MrPapermic
    @MrPapermic 9 лет назад

    Sorry Derek for my bad english, but I wonder if you know the design pattern with the repository! Do you have something similar on the serie? Because I learn so much when I watch and listen your tutorial and I also want to understand this pattern! Thank you!

  • @btcstealth
    @btcstealth 11 лет назад

    Exception in thread "Thread-0" java.lang.NumberFormatException: For input string: "197,01"
    at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1241)
    at java.lang.Double.valueOf(Double.java:504)
    at Observer2.GetTheStock.run(GetTheStock.java:63)
    at java.lang.Thread.run(Thread.java:724)
    And likewise for Thread 1 and 2.

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) I'm very happy to have been able to help.