Iterator Pattern - Design Patterns (ep 16)

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ •

  • @roybenabraham3589
    @roybenabraham3589 6 років тому +137

    Chris, I just want to say that your your passion for the subject and kindness in sharing your knowledge has touched me deeply. You bring so much LOVE to the subject. Not only is that inspiring to see, it also makes me feel AT HOME when watching your videos. Your thorough pedagogy and light humor make me feel like I have "big programming brother" looking out for me. I used to regard design patterns as these "scary super-hard things" and after going through most of your videos that view has begun to shift to "fascinating and natural" :). So, a big thank you from the bottom of my heart. Please continue sharing your knowledge, I truly believe that it changes the world for the better. At least, it has made my life a bit better:)
    Hugs from Israel!!

  • @pascalampere6098
    @pascalampere6098 7 років тому +64

    Please make these videos as extensive as necessary, no need to hurry. The way you do them, makes it really clear what is going on, which is super helpful.

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому +3

      Thank you for the feedback. This information is very appreciated. ⭐️⭐️
      I can see what you mean. Thanks for watching 🙂

  • @existentialdemo
    @existentialdemo 5 років тому +31

    Everyone is commenting that his videos are too long, but I love how many examples he gives.

  • @Mohamed-im3lq
    @Mohamed-im3lq 4 роки тому +7

    2 hours before the sleep, watch a movie or this episode ? OK I chose the second option and I don't regret it, super super good, I hope one day you finish this series

  • @jacktom1409
    @jacktom1409 4 роки тому +4

    You are a legend my friend, would love to see you explain WHEN you needed to use the pattern you are explaining in a real life scenario you faced yourself. Makes it easier for us new to Design Pattern to decide on which pattern we need to use

  • @gaofan2856
    @gaofan2856 2 роки тому

    Mr. Abdul Bari's Algorithms and DS + Mr. Povilas Korop about Laravel framework + your videos about Design Patterns are the best what I have seen in programming world

  • @LavGupta08
    @LavGupta08 7 років тому +9

    You are awesome. Thank you so much for spending your time in this series :)
    I don't think you should make these videos shorter. There is so much to learn here.

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому +2

      Thank you very much for the encouragement and the feedback! Super valuable. And thanks for sticking with the channel 😄

  • @ambarishkapil8004
    @ambarishkapil8004 4 роки тому +4

    Your passion rubs off, I will say that much. Keep it up.

  • @harshsanghavi6188
    @harshsanghavi6188 2 роки тому +3

    dude i just discovered him and his passion towards this subject is so good we need more teachers like this i wont miss a single day n my class if he is my teacher. Can someone tell me why did he stop posting???

  • @ChristopherOkhravi
    @ChristopherOkhravi  7 років тому +2

    Some technical difficulties earlier. Ping me if you can't see the video!

  • @radu5log76
    @radu5log76 7 років тому +4

    Definitely not to be viewed in one sitting at lunchtime :)
    I do see that you have provided direct links to sections which is great.
    Thank you

  • @giveexamples
    @giveexamples 7 років тому +2

    Your videos are incredible. Your presentation is perfect. Please continue your way, because I like to binge watch your videos. Thanks a billion

  • @ariasalmeida
    @ariasalmeida 6 років тому

    Putting the important sections of the video in the description is an excellent idea, thanks a lot !

  • @anantghodekar7520
    @anantghodekar7520 5 років тому +1

    Your efforts in creating Detailed Videos appreciated.......Some of your videos were better than what i have seen elsewhere like pluralsight,etc....Keep it up! Thanks Once Again!

  • @andrewrobertson1473
    @andrewrobertson1473 5 років тому

    50:55
    That is exactly what I was thinking. Personally I would say it is perfectly fine to have a method which is both a command and query if:
    A) The method clearly indicates that it changes the object's state
    B) The return value can also be retrieved by some other method which does not change the object's state ("peek" in the case of a stack)
    particularly if it is significantly more efficient to both modify the object and return the value in the same call.

  • @techposo
    @techposo 3 роки тому

    Not only do I enjoy watching your videos, I actually learn from them.

  • @jamesyour
    @jamesyour 4 роки тому +1

    Initally, i thought 1 hr 40Min video is too much for iterator pattern. Once i started watching it really made sense.
    While watching this i felt it is very complicated but by the time i reached the end it became clear and simple.

    • @ChristopherOkhravi
      @ChristopherOkhravi  4 роки тому

      I’m very glad to hear that! And I apologize for the length of the video 😊😊

  • @danielaudipoy2350
    @danielaudipoy2350 7 років тому

    I like it because that is more or less the solution that we found at work. The language that we work with doesn't support for each instruction so, that is the only way to have this benefits.
    It's a bit long video but because it's explained over and over the same thing in with different points of view it's easy to understand.
    Please keep doing. :)

  • @katyayanvedant4827
    @katyayanvedant4827 4 роки тому +1

    I really like your videos. I have come to such level of understanding that I can guess what your next step will be in explaining the structures and I believe that in that way I am really learning. Eventually, they also helped me a lot in interviews. Thanks a lot! This channel has become my reference channel for Design patterns other than the books. :)

  • @kieranthompson171
    @kieranthompson171 8 місяців тому

    These vidoes are fire. Rewatching again as a refresher, forgot how good they are.

  • @ChristopherOkhravi
    @ChristopherOkhravi  7 років тому +13

    Too long video? Too short? What do you think? Are the side-tracks (e.g. command query separation, single responsibility principle, mutation, etc.) useful or distracting?

    • @williamcory4689
      @williamcory4689 7 років тому +8

      I like how long it is. Really gives all the ideas a lot of time to peculate when I listen.

    • @B-Billy
      @B-Billy 7 років тому +1

      All videos are really good... If I can GOT All sessions why cannot this video ... hahaha

    • @dustharvesting
      @dustharvesting 7 років тому +1

      Why not both? You can concentrate on important bits in the beginning and then delve deeper.

    • @anasfcb
      @anasfcb 7 років тому +2

      First, thank you so much Christopher for your time and effort !
      Coming to your question about the video length, I believe that people who are following your channel for a reasonable time, me included, know you well enough to trust you and to get used to your (unique) pedagogic style.
      But people looking for a quick answer may feel overwhelmed by the quantity of (valuable) explanations.
      In my humble opinion, your explanations are deep enough to get the whole picture of each DP (I've been struggling with the Command pattern for years untill I watched your (deep but simple) explanation weeks ago), and the fact of talking about related principles (SRP, CQS...) let us feel and touch the concreteness of some abstract/theoritical concepts and how they are connected and share the same purpose.
      Thanks sir !

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому +4

      Ah! Both was an excellent idea! How come I never thought about that before! Omg. Will try my best to approach it that way in the remaining videos (already recorded the coming 2 videos by after that). Thanks a lot and thanks for watching! 😀😀

  • @michaelyahyaev6747
    @michaelyahyaev6747 2 роки тому

    Great videos! Thank you for describing subjects so detailed. It simply leaves you with no chance to not understand the patterns

  • @simondavis1303
    @simondavis1303 3 роки тому

    Generators in JavaScript seems to implement the iterator pattern by letting you start and stop the function and allow for infinite iterations. One example would be creating infinite amount of ids just by calling next and getting the new, current value.
    I like thinking about the inventory from Zelda: Ocarina of time, how we have an inventory section, map section, and song section. We can use a section iterator that has previous() and next() methods to get to the previous or next section but also we have the section's items we can iterate through such as the inventory. The inventory items iterator can call left(), right(), up(), and down(). Almost close to finishing up this playlist and feeling accomplished from it. Thanks for this video and hope you make more in the future when you aren't busy with life stuff!

  • @CharletteLin
    @CharletteLin 7 років тому +3

    Thank you so much for these videos! I'm reading the Head First Design Patterns book now, and I feel like it helps me understand the concepts better by seeing your explanations in addition to reading the book.
    Random note: when you switched hasNext() to isDone(), I think we should have changed the inequality to this.index >= 2. (Not sure; I make mistakes every day.)

  • @dscheme4427
    @dscheme4427 6 років тому +1

    I think it's a good example - and I enjoyed the length... It covers pretty much everything. I have both books you mention, and a couple of others, and the best way to use the books you mention is dive into head-first design patterns, see where that takes you, then look up the Gof book, and see how they compliment each other. And then probably what I like to do is watch this kind of site to see how they are explained....cover all the bases, dude.

  • @trevorskillman9946
    @trevorskillman9946 3 роки тому +1

    Great video, it was long but it was needed for me to understand more clearly and I do now. Thank you! I have subscribed and look forward to more of your videos
    sincerely a beginner programmer :)

  • @indswaraj2475
    @indswaraj2475 3 роки тому

    Hi Chris , The way you put and explain the pattern with a real time example in the end got the crux of the pattern. thanks

  • @nikeshsingh4787
    @nikeshsingh4787 2 роки тому

    i love ur entries man!! content and energy in ur videos is fabulous. I got an interview in 2 hrs but i am stuck on your videos and not revising other stuff. Pretty sure does not matter what question interviewer will ask, I am gonna talk about your channel and opinions.

  • @Popart-xh2fd
    @Popart-xh2fd Рік тому

    1:20:42 Next() comes from the idea that is the method that returns the Item. So you should have another method instead of Current() like Remove()!

  • @guilhermemallmann2251
    @guilhermemallmann2251 5 років тому

    Best video man, new brazilian fan here :)
    You really got excited explaning everything, surely I'll watch these series more than once.

  • @محمدبنسراجالدين
    @محمدبنسراجالدين 5 років тому +6

    Incredible series. I wish I’ve found it much earlier.

    • @ninakoch1799
      @ninakoch1799 3 роки тому

      same!! found it one week before my exams rip

    • @m0-s7
      @m0-s7 3 місяці тому

      bro u found it 2y later , i found that 7y later :)

  • @DavidArevaloJimenez
    @DavidArevaloJimenez 4 роки тому +2

    Excelent series Chris!
    Just a dumb comment regarding the IsDone() method. I think we should change the < 2 condition to something like > 1 (difference from HasNext()) to follow the logic of the naming.
    Cheers!

  • @tobiasleitner7940
    @tobiasleitner7940 5 років тому +2

    Shared it with my whole class btw (we have to do presentations about design patterns)

  • @shinemperor8950
    @shinemperor8950 6 років тому

    Side note, excellent work on your quick refactor at the 1:10:00 mark. We gotta be consistent. :)

  • @Rajmanov
    @Rajmanov 4 роки тому +1

    Man, your videos are awesome, all of them I have watched them and I’m very happy with your content, the problem is that you just stop, there are hundreds of people like me trying to reach you to tell you, please do more, even if they are paid videos I will give you my money, you can sell them Udemy, patron or UA-cam itself. I will be very grateful, but not only me, a lot of people.
    Thanks!

  • @ОлегТокмачев-в9ц
    @ОлегТокмачев-в9ц 6 років тому

    Hello! Thanks so much for videos. I am new to programming and so all the tangential notes are very usefull for me so i stark to make sense of whats going in in the world of programming

  • @saeedmirzaei1
    @saeedmirzaei1 4 роки тому +1

    Thank you Christopher. Very useful.

  • @danielpaulino8521
    @danielpaulino8521 4 роки тому

    Thanks Chris ! this is brilliant!. I've been following all these videos, and it was so easy to learn!

  • @nglars
    @nglars 3 роки тому

    I'm here in 2021 and Daaaaaaamn are your videos awesome, thanks so much man!

  • @boblim623
    @boblim623 9 місяців тому

    I find a way to learn design pattern quickly and effectively: memorize the defination first, just read and remember it. And below is my memory: The Iterator pattern provide a way to assess the elements of an aggregate object without exposing its representation.It defines a common interface to iterate different types of collections.To implement this pattern, typically you need two components, an iterator interface and a ConcreteIterator class, the interface defines method like next(), hasNext(), currentItem, and the class implement these to iterate over the elements based on specific type of collection

    • @boblim623
      @boblim623 9 місяців тому

      and I find the more you learn, you better and faster learn, so go ahead, just do it

  • @pargyropoulos
    @pargyropoulos 5 місяців тому

    Amazing! You just earned another subscriber.

  • @voiddeepstorage6533
    @voiddeepstorage6533 3 роки тому

    15:56 Great, now i have a image of a magician throwing apples in me for the rest of my life

  • @ismailraju19
    @ismailraju19 6 років тому +1

    I Like Your Teaching Technique. Thank You for Your Dedication.

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

    Helpful! Helped me to understand this pattern and clear things up.

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

    Thank you so much for sharing your time and knowledge.

  • @syedmuhammadsajjad3393
    @syedmuhammadsajjad3393 5 років тому +1

    The timestamps were a life saver

    • @ChristopherOkhravi
      @ChristopherOkhravi  5 років тому +1

      Thanks for letting me know 😊😊 Much appreciated 😊 But I assume you mean a “time saver” rather than a “life saver” 😊🤪

    • @syedmuhammadsajjad3393
      @syedmuhammadsajjad3393 5 років тому

      @@ChristopherOkhravi Oh yeah! 😅😅

  • @sonayec
    @sonayec 6 років тому +6

    Awesome explanation. I couldn't stop listening once I started.
    Just one query.
    Is the function implementation
    public bool IsDone() { return this.index < 2 } right?
    I think it should be -
    public bool IsDone() { return this.index >= 2 }. (as once index reaches 2 means we have iterated through both inventories and so we are done).

    • @emskiee5330
      @emskiee5330 5 років тому

      I think so too (regarding your IsDone correction).

    • @hasnifaical6589
      @hasnifaical6589 5 років тому

      You are right! first he used a hasNext() function but once he changed the name to isDone he forgot to change the logic. But anyway the idea of iterator pattern is clear.

  • @eugenesidelnyk4600
    @eugenesidelnyk4600 4 роки тому +3

    You forgot to change < with >= when changed method name to isDone

  • @2005bgva
    @2005bgva 3 роки тому

    Christopher thank you super super super much for this video!

  • @ofpcwcef
    @ofpcwcef 5 років тому

    At 01:23:38 the implementation of the "current" method, in this case we only have to options, so it is easy to put them in a switch case, what if we have a flexible number of items, like the items in the back-bag inventory, how can we implement it ?
    Also I suggest that the default value of the index = -1, I don't know why but I saw it somewhere in c++ I think :D

  • @dertzi
    @dertzi 7 років тому +4

    Thanks again for a great video!
    You mentioned a playlist at 28:00 about design patterns in different game elements. I can't seem to find the videos you mentioned, any chance you have the link close by?
    Keep up the good work! Looking forward to possible live streams of you coding :)

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому +1

      Ah! Thanks for the reminder! Here's the video I was talking about:
      ua-cam.com/video/nuS591k75NY/v-deo.html
      Example from Assassin's Creed 🙂🙂
      And here's the full playlist (actually, channel):
      ua-cam.com/channels/4O5IoqW_cfRgV_ZNrM6eEA.html
      Thanks for subscribing on Twitch! 🙂 The format is still super informal but as I get better at streaming I'll start doing some "let's code" style streams that will be saved as videos.

    • @dertzi
      @dertzi 7 років тому +1

      Thanks for the quick response.
      I've been watching Daniel Shiffman's (super goofy) Coding Train streams on youtube ( ua-cam.com/channels/vjgXvBlbQiydffZU7m1_aw.html ). It's a nice format to see how he thinks through his coding problems and its fun to try and figure it out "together". Great way to learn more!
      This is quite offtopic, but I was wondering if you could shed some light on the matter. I watched Miško Hevery's Clean Code talks you had linked in a previous video. He was talking about how calling the new keyword inside a class is bad and it's better to give the object through the constructor. I'm guessing this doesn't apply to everything? In cases where I'm using java's built in data structures like Lists, Maps and so on, does it make sense to instantiate these earlier and send them through the constructor to be used or just instantiate them when I have a need to use them?

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому

      The Coding Train channel is indeed awesome. Crazy guy 😀 Thanks a lot for the parallel. I'll have a closer look at the format of his live streams. Thanks. 🙂
      About the concept of the "new" keyword being "dangerous". The problem, in my understanding, is coupling. So whenever you instantiate something you couple to a concrete class. But if you instead dependency inject, e.g. pass something through the constructor, then you can choose to couple to an interface instead. If the thing that you then at runtime pass happens to be an instance of the concrete class that we talked about first that's all fine and dandy as long as it implements the interface, but now you also have the ability to accept other stuff. Generally I guess I would think that it, as you say, does not apply to basic data structures like lists, maps and so forth. But it might depend so I'm not sure I'm ready to use the world "always" 🙂
      Either way, maybe you already found this, but Misko also has a blog and here are some posts on the topic that might be relevant:
      misko.hevery.com/2008/09/30/to-new-or-not-to-new/
      misko.hevery.com/2008/09/10/where-have-all-the-new-operators-gone/
      misko.hevery.com/2008/07/08/how-to-think-about-the-new-operator/
      I hope this gives some further direction :)
      Thanks a lot for watching and for the great question 😀

  • @reyazahmed9320
    @reyazahmed9320 6 років тому +3

    Hi Christopher, thanks for your awesome video. One thing I notice here is that in the isDone() method, it should be (return index > =2), instead of (return index

    • @sofyanmahmoud4776
      @sofyanmahmoud4776 2 роки тому

      You are right
      I was about to write the same comment

  • @karimel-shindy9655
    @karimel-shindy9655 7 років тому

    It is too long video, but the side-tracks were very useful for me.
    I suggest writing the whole code examples before recording the lesson on your computer and explaining it directly from your computer.
    thus you will save the writing code time and corrections while explanation and the example code will be more clear. also you could attach it with the video.

  • @arthuran4361
    @arthuran4361 4 роки тому

    The example explains everything!

  • @devoders2237
    @devoders2237 3 роки тому

    All of your lectures were amazing. I love the way you explain. I learned a lot. but this lecture little bit,,,,,,,,, may be tough :)

  • @nunemm3668
    @nunemm3668 4 роки тому +2

    I think isDone should be {index >=2}

  • @cliid4355
    @cliid4355 4 роки тому +2

    Hi Chris, I think(maybe) there is a typo... in the class HandHeldInventoryIterator, the method isDone() should return this.index > 1, not this.index < 2, because of the naming.

  • @srivatsarameshjayashree8085
    @srivatsarameshjayashree8085 4 роки тому

    @Christopher Regarding the discussion at 52:30 , Why cant the arrows be something like in the observer pattern? An iterable has an iterator (iterable get iterator duing concrete class definition), while a concrete iterator has a iterable (it gets it as dependency injection while initializing / instanciating a concrete iterator, which happens in the getIterator () method of the iterable). Am i wrong? please clarify

  • @MeisamAlifallhi
    @MeisamAlifallhi 3 роки тому

    wow!!!!you are amazing bro. super useful content , super presentation. thanks a lot .

  • @sthoyyeti
    @sthoyyeti 6 років тому

    UML starts @35:00

  • @우대철
    @우대철 6 років тому

    thank you for your passionate explanation! I snapped some part of the video, cuz it was long time, but it was very understandable to me! bbb

  • @vishalpoddar
    @vishalpoddar 11 місяців тому

    This looks very similar to bridge pattern , just that there is "hasA" relationship between the concretion in Iterator pattern whereas , the Bridge pattern has a "hasA" relation between the abstractions. Ofcourse the intent are very different.

  • @JeanJacquesUzabumuhire
    @JeanJacquesUzabumuhire 5 років тому

    Let me start by thanking you for the time you took to realize these series which are really enjoyable to watch. Your videos has helped me a lot to understand the design patterns but also has motivated to dig deeper revisit my knowledge of object oriented programming. I am considering buying the two books you have recommended about design patterns.
    I have a question regarding the HandHeldInvetoryIterator class :
    What does the HandHeldInventoryIterator instance does when the HandHeldInventory instance is empty, that is contains no Item instances in the Right and Left ?
    How can the index of the HandHeldInventoryIterator instance points to the first instance in the case it is empty ?
    Wouldn't be easy if HandHeldInventory had a Count property for the number of Items contaitned in it ?
    Then wouldn't it be simple for IsDone in the HandHeldInventoryIterator to first check if Count == 0 and then return this.index < this.inventory.Count ?

  • @alokdubey9638
    @alokdubey9638 7 років тому

    Great video, need not to worry about long videos as long as after watching person is able to think from them-self. But I do have one request would it be great if you add some real life example (i.e. system design) which uses these kind a design pattern; in that way person can co-relate with other application.

  • @CobeinCobein
    @CobeinCobein 7 років тому

    Great videos, keep up the exelent work. They are really easy to follow! Just as many on the comments I'll have to say it's a bit lengthy.

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому

      Thank you very much for the encouragement! 🙂 And also, thanks for the feedback on video length. Much appreciated ⭐️⭐️

  • @phanCAbe
    @phanCAbe 7 років тому +11

    I really like your videos, but in general (and this one specifically) they are FAR too long for the amount of information you're presenting. IMHO the constant abstract spoken examples are less helpful than one screen cast/ fully written example program.

  • @cirosantos0
    @cirosantos0 6 років тому

    dude, fantastic explanation!! thanks for sharing

  • @adilakshminagiri5871
    @adilakshminagiri5871 2 роки тому

    hi chris, can you please cover left over design patterns mentioned in head first design patterns book

  • @elainechesoni3318
    @elainechesoni3318 3 роки тому

    I would love to see a video on how you generalize the iterator pattern :)

  • @ddarkeh6677
    @ddarkeh6677 7 років тому +1

    Personally I love length and the iteration of the idea, some of these concepts are advanced and 10-20 min wouldn't justify them imo, oh btw are you still doing the code walks love them.

  • @EvilConCarne
    @EvilConCarne 7 років тому +1

    Damn, i needed this video a week ago ;-; Definitely still going to watch though thank you so much

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому

      Sorry to hear 😔 Hopefully whatever you had to do went well regardless 🙂 Do ask if you have any questions. Thank you for watching and for commenting! 😀

  • @2005bgva
    @2005bgva 3 роки тому

    Hi Christopher, thanks for this video. I only have one questions: In minute 20:30 what are you dinking? ;-)

  • @B-Billy
    @B-Billy 7 років тому

    These days I eagerly wait for GOT S8 and Your next DP Video... Awesome!!!
    As I've already requested "FLY Weight".. Please create video on "Repository DP" also.

  • @SerenoFabio
    @SerenoFabio 3 роки тому

    Blooming awesome! :-)

  • @harshsaini3180
    @harshsaini3180 3 роки тому

    Can we use iterator design pattern for designing an elevator system to iterate the floors requested, thus keeping it open to have an even complicated lift circuit?

  • @lyonyan
    @lyonyan 6 років тому +8

    Exactly! Videos are sooo long, and i have to set playback speed x2 :)

    • @anthonylhoward
      @anthonylhoward 6 років тому

      Same here. It cuts the time in half

    • @doghosuedean
      @doghosuedean 5 років тому +2

      Learning takes time, instead of 5 episodes of Friends on netflix learn about the iterator pattern.

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

    Best Explanation Thanks you...

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

    Hi Chris, honestly speaking Super 👌 duper thanks to you , you are putting your more than 100% and providing us with great in depth content.
    I would want to connect with you on LinkedIn. You are truly amazing 👏
    Personally to me I like the way you explain the things going into depth of the concept that makes us capable enough to understand how things would have been implemented internally such as this one. (Iterator Pattern)
    Hats off to you Chris.

  • @kokolenne
    @kokolenne 7 років тому

    Awesome videos. Wished I had found these videos sooner. Even though the video is long, it's definitely worth watching. Please continue to do video like these as they are really helpful, and thank you for breaking the code down using the whiteboard instead of IDE. Do you have videos on Java head first from O'Reilly? Thanks for the referencing the books as I purchased head first design patterns a few months back.

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому

      Thank you for the kind words. I’m glad to hear that the content is appreciated. And thanks for the detailed feedback. I’m not planning a series specifically on Java but there will be lots of more stuff coming on everything from OOP to FP and between 😀 Also, glad to hear that the videos complement the book 😀 Thanks!

  • @sthoyyeti
    @sthoyyeti 6 років тому

    If possible, you can get more hits if videos are separated short and long like Bridge pattern. :-) short video acts like a reference the essence. the long video covers the concepts around it and comparisons.

  • @jojojojo483
    @jojojojo483 4 роки тому

    Great Lesson!

  • @muhammadalfat984
    @muhammadalfat984 3 роки тому

    i love your energy

  • @Zariondrio
    @Zariondrio 5 років тому

    O que eu entendi: você tem uma lista e quer um elemento desta lista, ao invés de pedir a lista toda, você pede a um iterator para percorrer a lista e entregar o elemento desejado, ou seja, não precisa carregar toda lista para obter um elemento.

  • @basesperanca
    @basesperanca 7 років тому

    Could you point to the part where you talk about a composite iterator? Thanks.

  • @FabioMartignoni
    @FabioMartignoni 5 років тому

    Do the GetIterator method breaks the Single Responsibility Principle of the Iterable concrete object? For example: the HandHeldInventory has two reasons to change. The first is a change in a requirement for the Inventory logic, may be now you can have a third weapon in your mouth (like Zoro from One Piece). The second is that, being GetIterator a factory method, it can contain the logics to instantiate different ConcreteIterators, may be in some cases you want to get the right hand item first, in other cases you want to get it last. It seems to me that the Iterable has two responsibilities, or may be i'm just confused :P

  • @elpako24
    @elpako24 3 роки тому

    Amazing. Thank You.

  • @harishjalandra5257
    @harishjalandra5257 7 років тому

    I wish I had teachers like you in my graduation...awesome!
    Please post the link which you talks about DP in games. Thanks

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому

      Thank you very much for your kind words! :) :) :) And sorry about forgetting the link!
      ua-cam.com/channels/4O5IoqW_cfRgV_ZNrM6eEA.html
      It's now also in the description. Thanks for the reminder!

  • @UberDurable
    @UberDurable 7 років тому +37

    As informative as it is, it's too long, would be nice to compress these videos to 10-20 minutes, most people don't have that much attention span.

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому +14

      Thanks for the feedback. Makes sense. I guess I need to learn to control my urge to share interesting details :D :D Thanks for watching! :)

    • @basesperanca
      @basesperanca 7 років тому +2

      People with short attention spans can pause the video when they feel they are not paying attention any more and do something else for a few minutes. That's actually a good skill to train.

    • @JohnReloaded
      @JohnReloaded 6 років тому +1

      I don't think that a design pattern, that on the book is like 15-20 pages, can be compressed in a 20 min video. I mean, someone are really self explanatory (in fact there are some 30 min videos) BUT not all of them.
      I would suggest, instead, to do more jokes like the one at 20:35
      P.S. I'm one of those who really struggle to pay attention for too long :)

    • @rdelargeable
      @rdelargeable 6 років тому +3

      I think Christopher takes his time to explain cool details and examples. I think his videos are totally worth the time investment :)

    • @filcondrat
      @filcondrat 6 років тому

      guess programming in general is about some good amount of attention span

  • @yunli1333
    @yunli1333 4 роки тому

    In the inventory example, how does left/right come in the play in this example? why not just use a collection?

  • @narayanadhurti1603
    @narayanadhurti1603 7 років тому

    Chris this is good,just wanted to know if the values are only for read only purpose(Meaning collection is encapsulated?)

  • @yasserskillful7040
    @yasserskillful7040 3 роки тому

    Awesome video and playlist, thanks a lot Chris.
    I might be mistaken, but after refactoring hasNext to isDone the method should return true if the index is >= 2
    By the way, hope you have plans to create new videos to cover more design patterns. :)

  • @mitz2156
    @mitz2156 6 років тому

    I have a doubt, what do you mean by " i am not going to give you the whole list" in 14:06. I am sort of confused here who is giving to whom in the context of programming. Please can you explain or any one who knows here !
    And thanks for these wonderful design pattern tutorials. Cheers !!

    • @ChristopherOkhravi
      @ChristopherOkhravi  6 років тому +1

      Thanks for the great question and thanks for watching :) What I mean is that with iterator pattern we are not simply exposing the internal collection (e.g. a list), i.e. we are not passing it out "by reference" since that would compromise the collection in the sense that other pieces of the code could change the contents of the list. Instead we simply supply (actually: "yield") one item at a time. And if you happen to want all of the items then we will have in effect duplicated the list by passing every single item in the list one by one. Not sure if I'm actually helping or if I'm just making it more confusing. Does it make sense? Ask again if not.

    • @mitz2156
      @mitz2156 6 років тому

      Christopher Okhravi Thanks for replying, it makes sense now.

  • @belneste
    @belneste 5 років тому

    The conclusion in the last minute is wrong. Although you can while()-loop over any of the iterators, they both contain completely different items (e.g. the handheld- and the house-inventory-iterators). The items returned from the iterators are not interchangeable. A handheld or a house-item have completely different and specific properties and methods. Won't you still end up having to switch or conditional for the returned type and act accordingly?

  • @tobiasleitner7940
    @tobiasleitner7940 5 років тому

    Amazing video! Without u my school presentation would be fucked hahaha

  • @acronis536
    @acronis536 6 років тому

    could we say that getIterator is a factory method? andm aybe in a concrete iterator could we implement a composite pattern for traversing smth like a tree?

  • @nickbarton3191
    @nickbarton3191 6 років тому

    I'm 1/3 rd thru and yes it's too long.
    BTW you mentioned that an advantage is being able to iterate part way thru, stop, then carry on to the next iteration. The .NET Igetenumerator doesn't allow this, the next 'for each' reinitialises the pointer/index/something; just saying.

  • @Ranjith_P
    @Ranjith_P 5 років тому +1

    I am a big fan of the design pattern series and have learned quite a lot from this web series .
    However one must add this one you missed the mark .Too Long and too many times we are circling around discussion rather than make a point . It would help if content was shorter and more to the point .

  • @pedrolobo1081
    @pedrolobo1081 7 років тому +1

    I'II cancel one the movies I want to watch this week to allow myself some time to watch this video. Haha

    • @ChristopherOkhravi
      @ChristopherOkhravi  7 років тому

      Haha :) Sorry about that! But thank you very much for the dedication! 🎉👍🔥🎊

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

    Bit lengthy,,,,I would suggest a short tutorial 20min with core concepts and then rest of video with example discussion....???? However ever, So far , best series i have watched.....Thanks christopher....You gave something to world ,,,Good karma ...

  • @dmitryoleynik3710
    @dmitryoleynik3710 2 роки тому

    Thank you!