The Observer Design Pattern in C++ - Part 1 of n - A simple implementation

Поділитися
Вставка
  • Опубліковано 21 лип 2024
  • ►Software Design and Design Patterns Playlist: • C++ Software Design an...
    ►Find full courses on: courses.mshah.io/
    ►Join as Member to Support the channel: / @mikeshah
    ►Lesson Description: In this lesson I present to you the basics of the Observer Design pattern in C++ with the theory and a first implementation. We will implement the most naive version of the observer pattern so that you understand from scratch exactly how to create this pattern. I'm going to do this in an object oriented manner, but it need not be limited to just object oriented programming.
    00:00 Introduction
    01:00 Theory of where to use Observer Pattern
    10:20 Implementation of Observer Concrete Class
    12:30 Implementation of Subject Concrete Class
    16:30 Creating a simple test
    20:30 Review of our simple implementation
    21:53 Conclusion
    ►UA-cam Channel: / mikeshah
    ►Please like and subscribe to help the channel!
    ►Join our free community: courses.mshah.io/communities/...
  • Наука та технологія

КОМЕНТАРІ • 37

  • @nikhilbhandary7153
    @nikhilbhandary7153 Рік тому +9

    Arguably one of the best introductions to Observer pattern. Thanks Mike! Looking forward to your next videos on these topics.

    • @MikeShah
      @MikeShah  Рік тому

      Cheers, thank you for the kind words!

  • @k0185123
    @k0185123 5 днів тому +1

    Hello Prof. Shah, thank you again for sharing these invaluable insights and help the very new beginners to learn CPP!

    • @MikeShah
      @MikeShah  4 дні тому

      Cheers, you are most welcome!

  • @kulasekhar
    @kulasekhar Рік тому +2

    Wow! whatever I search for and wish to learn, find your week old video for that same concept! Thank you

    • @MikeShah
      @MikeShah  Рік тому +1

      Cheers, thank you for the kind words

  • @Andrew_Guerrand_
    @Andrew_Guerrand_ Рік тому

    Hi Mike! Just wanted to thank you for all your videos. They are of high quality and greatly appreciated!

  • @tonym5857
    @tonym5857 Рік тому +1

    Observer is a usefull pattern for example web dev in Angular used it, every time action happen in object doom is updated. Patterns is the next level I recommend the Book Design Pattern. Thank you for this great video, I will follow it to learn more 💪🙏.

  • @Southpaw101
    @Southpaw101 Рік тому +1

    Great explanation. Nice title ... Part 1 of n... cool

    • @MikeShah
      @MikeShah  Рік тому +1

      Cheers! It's at least 2 parts ;)

  • @pedrolobo9835
    @pedrolobo9835 Рік тому +2

    Very interesting! Thanks for this video!

  • @shreyabisen4729
    @shreyabisen4729 Місяць тому +1

    Thanks for the explanation!

    • @MikeShah
      @MikeShah  Місяць тому

      Cheers, you are most welcome!

  • @thestarinthesky_
    @thestarinthesky_ Рік тому +2

    Would you please have a video on object pool too? Thank you. Love your channel.

    • @MikeShah
      @MikeShah  Рік тому +1

      Cheers! That is a great pattern, will add it to the wishlist!

    • @thestarinthesky_
      @thestarinthesky_ Рік тому +1

      @@MikeShah thank you Mike 😍

  • @santiagozamora914
    @santiagozamora914 Рік тому +4

    Can you make a video of Data Oriented Design??

  • @user-ql7pw7ld1n
    @user-ql7pw7ld1n 3 місяці тому +1

    U have made it very easy to understand, thanks ~Mike();

    • @MikeShah
      @MikeShah  3 місяці тому

      Cheers!

    • @Dazza_Doo
      @Dazza_Doo 9 днів тому +1

      did you just deconstruct Mike? 🙈🙉🙊

    • @MikeShah
      @MikeShah  9 днів тому

      @@Dazza_Doo 🤣

  • @philtoa334
    @philtoa334 Рік тому +1

    Thanks.

  • @grenadier4702
    @grenadier4702 Рік тому +1

    Does that the same as the pattern "pub/sub" and "event emitter"? Sounds so

    • @MikeShah
      @MikeShah  Рік тому +1

      pub and sub is the same idea here. I haven't used EventEmittter in javascript, but conceptually it seems similar (Not sure on technical details of what eventemitter otherwise provides in addition to this pattern).

    • @grenadier4702
      @grenadier4702 Рік тому +1

      @@MikeShah got it, cheers

  • @ghulam2545
    @ghulam2545 Рік тому +1

    👌👌👌

  • @ssaadhussain902
    @ssaadhussain902 Рік тому +1

    Thanks man. When's the next part coming?

    • @MikeShah
      @MikeShah  Рік тому

      Cheers! Next part coming in 2 to 4 days ;)

  • @ArturasDruteika
    @ArturasDruteika Рік тому

    Very good channel on cpp tuts. Are you planning on making the adapter pattern video as well?

    • @MikeShah
      @MikeShah  Рік тому +1

      Yes, will eventually add 🙂

  • @bsdooby
    @bsdooby Рік тому

    Do you also intend to present "higher order" (compound) design patterns (like MVC)?
    And you can spare yourself a few key strokes by not writing `return 0;` in `main` ( it is not mandated by the C++ standard) 😜

    • @MikeShah
      @MikeShah  Рік тому +1

      Probably will add MVC at some point :) And neat :)