Open/Closed Principle Explained - SOLID Design Principles

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

ความคิดเห็น •

  • @davidduvernay7302
    @davidduvernay7302 5 ปีที่แล้ว +140

    Please keep going with SOLID. So useful actually and I'm improving on my code so much!

    • @WebDevSimplified
      @WebDevSimplified  5 ปีที่แล้ว +21

      I am planning to record the next letter tonight!

    • @davidduvernay7302
      @davidduvernay7302 5 ปีที่แล้ว

      Wonderful!

    • @carminetambascia6355
      @carminetambascia6355 4 ปีที่แล้ว +2

      @@WebDevSimplified I would also recommend to put a playlist link, so it's clearer which videos are about that

    • @arod3295
      @arod3295 2 ปีที่แล้ว

      @@WebDevSimplified hey, how are you able to reassign the variables in the class that aren’t ever declared? @6:07 I see ‘this.description’ and ‘this.options’ but declared no where. Is it that in that one line, it’s being created as a member variable for the class and instantiated without any declaration keywords??
      Thank you 🙏🏽

  • @developedbyed
    @developedbyed 5 ปีที่แล้ว +151

    100k LETS GOO

    • @JasimGamer
      @JasimGamer 5 ปีที่แล้ว

      Ed? 😮

    • @MrMangkokoo
      @MrMangkokoo 4 ปีที่แล้ว

      Vi

    • @sfoxj
      @sfoxj 4 ปีที่แล้ว

      Only 2K right now :(

    • @grishonnganga
      @grishonnganga 7 หลายเดือนก่อน +2

      Was at 100k 4 years ago? Wow!
      I'll leave this here, for the next person 4 years from now.
      1.5M LETS GOO

  • @rustyutb
    @rustyutb 2 ปีที่แล้ว +2

    you, my friend, has just reached the next level of teaching...

  • @siberiokhovonick
    @siberiokhovonick 4 ปีที่แล้ว +3

    I love your videos. I get so relaxed I fall asleep and have to re-watch. You're not boring, it's your voice I'm so in love with it.

  • @dylanroberts6217
    @dylanroberts6217 3 ปีที่แล้ว +44

    It may be good to note that in Java you should program to an interface. This means that each of the question types would implement that interface (Let's say Question interface). Implementing the interface creates a "contract" which states that each of the implementing classes MUST have a "printQuestionChoices()" method, regardless of how that implementing class chooses to implement it.
    Then your printQuiz() method would take an object of the Question type as a parameter. By implementing the interface, each implementing class becomes of that type and therefor can be passed to printQuiz()

    • @danielmyers9580
      @danielmyers9580 ปีที่แล้ว

      what about having a Question class, and then Boolean extends Question, MultiplChoice extends Question, TrueFalse extends Question, etc.

    • @danielmyers9580
      @danielmyers9580 ปีที่แล้ว

      Question would be closed to modification but open to extension

    • @64imma
      @64imma ปีที่แล้ว +3

      @@danielmyers9580 An interface might make more sense in this scenario than a base Question class. Sure, it can work, but an interface would likely be a lighter weight and simpler way of achieving the same thing. The choice between using a base class and an interface depends heavily on the requirements of the program.
      An interface simply states which methods an inheriting class must implement, without any requirements on how to run that method (outside of the method signature. Those have to match in order for it to be valid).
      A base class can work better if inheriting classes are going to share similar or the same implementation details. If the implementation is going to vary quite a bit, an interface might make more sense. A base class can still inherit from an interface to help guide its implementation.
      I hope that helps. I don't know the specifics of the java language, but I'm speaking from my limited experience working with c#, which has many of the same features as java.

  • @Mickey_McD
    @Mickey_McD 4 ปีที่แล้ว +38

    As someone else pointed out below, it might be better to have a base QuizQuestion class that has a description property and a default implementation of the printQuestion() function.. All the question types can extend from that base QuizQuestion class and provide a custom implementation of the printQuestion() function inherited from the base class.

    • @jc13OM
      @jc13OM 3 ปีที่แล้ว

      It has to be an interface.

    • @GreenMarkoulis13
      @GreenMarkoulis13 2 ปีที่แล้ว

      nope, it doesn't

    • @colinb8332
      @colinb8332 2 ปีที่แล้ว +3

      Seems to me he’s going by the pattern of composition over inheritance here

  • @chanlito_
    @chanlito_ 4 ปีที่แล้ว +69

    Clients be like can this be done by Friday?
    Me: There goes my SOLID principle.

    • @XavierGoncalves89
      @XavierGoncalves89 4 ปีที่แล้ว +6

      that's what happens when project managers are yes men/women

    • @galzi123
      @galzi123 3 ปีที่แล้ว

      @@XavierGoncalves89 Could not possibly agree more

  • @linuxdeveloperuy
    @linuxdeveloperuy 4 ปีที่แล้ว +5

    This question is really common on job interviews. Thanks for this. Keep up the good work.

  • @64imma
    @64imma ปีที่แล้ว

    I'm glad you're taking the time to cover all of these principles. I've just learned about SOLID today, so I'm taking the time to learn about it. The biggest struggle I always have when working on new projects is deciding how to structure things. What often happens is I'll get halfway through a project, decide to add/remove some functionality, and have to spend so much time sifting through my code to correct all the errors that inevitably pop up.

    • @vampbat
      @vampbat 10 หลายเดือนก่อน

      I am running into this, too. I typically try to restart, and get 20% farther and then it happens all again.

  • @szabolcsjobbagy30
    @szabolcsjobbagy30 11 หลายเดือนก่อน

    After many videos, I found the best explanation and best teaching for this principle,
    I have seen a lot of your videos,
    and your teaching method and enthusiasm is at the highest level,
    thank you Kyle!

  • @EL_WAFI_CHERKAOUI
    @EL_WAFI_CHERKAOUI 2 หลายเดือนก่อน

    two months ago i made a project using php and js for stock managing , the result i was satisfied with but i had to remake the project like four times , the longer i code the more complicated the code gets and i reached the point of forgetting what code i am writing while i am writing it , and it was exactly the SOLID design principles what i was missing
    writing a function that takes data, process it, do the logic, and modify the dom and even sending queries is nutttttts , i figured that out the hard way , if only i read about this before

  • @justinleong2589
    @justinleong2589 3 ปีที่แล้ว

    Thank you for showing on top of my search result and NOT speaking Hindi. You deserves my like and subscription.

  • @willmeow00
    @willmeow00 5 ปีที่แล้ว +1

    I'm so glad you're going over the SOLID principles. One is pretty much guaranteed to be asked about one in a software dev interview.

  • @romuloabrao
    @romuloabrao 3 ปีที่แล้ว

    I'm Brazilian, and man it's easy to understand even with my low fluency in english contratulations! When you choose to explain the OCP with an example makes the knowlegde of this complex *#&@#& more palpaple.
    Thx again

  • @sOuriukas
    @sOuriukas 5 ปีที่แล้ว

    I've never heard about these SOLID design principles but they are simply great. Thank you!
    Could not find is some asked this already. But if question object, in questions array, contains all neccessary messages that need to be printed (like question.type, question.description there could be question.answers). This would allow us to skip entirely creating new classes and whole script would be made out of two parts: question array and function that prints out questions with answer fields.
    tl;tr. Add question.answers field that contains all expected answer messages (remove questions.type no use at this point). In printQuiz() function loop through array: print question description and print expected answers.

  • @computersurgeon_
    @computersurgeon_ 5 ปีที่แล้ว +5

    These videos are priceless. I totally understand the open closed principle now. Perfect explanations. But for me the Liskov principle is just as difficult to understand. Please do a vid about that. Thank you again.

  • @jffrysith4365
    @jffrysith4365 2 ปีที่แล้ว

    thank you so much, that makes it so much easier to understand.
    If I understand correctly, that means your program should be able to be extended without modifying it. As modifying a class can modify it's functionality with other dependencies, but if we just extend the class, it will not affect those dependencies.

  • @RameenFallschirmjager
    @RameenFallschirmjager 5 ปีที่แล้ว +1

    hands down one the best no bullshit programming channels!

  • @Halston.
    @Halston. ปีที่แล้ว

    I think I finally understand this principle after reading about it numerous times over the years and watching other videos. Good example, thanks!

  • @ArsalanRKhan
    @ArsalanRKhan 3 ปีที่แล้ว

    This is the best explanation of this principle on the internet. Thank you so much man!!!

  • @Kim-by5uy
    @Kim-by5uy 2 ปีที่แล้ว

    this channel and net ninja have changed my programming life

  • @gillianbc
    @gillianbc 3 ปีที่แล้ว

    For YEARS I've been trying to understand this one, finally I do! Makes perfect sense now, especially for use with interfaces in Java. Thanks very much, Kyle

  • @himbary
    @himbary 4 ปีที่แล้ว +4

    I was always doing the switch statement but it felt so wrong! I watch your videos daily, THANKS 🙏

  • @RegisZaleman
    @RegisZaleman 3 ปีที่แล้ว

    Best Open/Closed explanation and example I have seen. So simple! Thanks!

  • @young4ever100
    @young4ever100 3 ปีที่แล้ว

    I wanna cry how beuatiful you explained all of it

  • @meowthemmd
    @meowthemmd 8 หลายเดือนก่อน

    Thank you Kyle you'r vids are perfect I encourage you to never stop teaching, hope the best.

  • @silmunia
    @silmunia 8 หลายเดือนก่อน +2

    In 10 minutes you succeeded in what a college teacher failed to do in 6 months. Thanks!

  • @Alex-ii3tv
    @Alex-ii3tv 5 ปีที่แล้ว +1

    Excellent Video! This is the best O/C principle video I have seen. Please continue making Design Pattern videos.

  • @eddiejaoude
    @eddiejaoude 5 ปีที่แล้ว +40

    Good example 👍. If it was typescript, I would have interfaces to make sure the question classes obey the right structure / signature 🤓 - similar to the Adapter pattern you have share before

    • @wingman__7
      @wingman__7 2 ปีที่แล้ว

      @Eddie Jaoude how is this related to adaptor pattern ?

  • @rebelmachine88
    @rebelmachine88 5 ปีที่แล้ว +1

    Nice! Good, simple explanation. Sometimes the definitions of concepts like this assumes so much about the user's existing knowledge, so breaking things down like this is very helpful. Thanks!

  • @waelchorfan6314
    @waelchorfan6314 4 ปีที่แล้ว +1

    so underrated !! this is great and really useful in complex projects

  • @vrojak7636
    @vrojak7636 ปีที่แล้ว

    Best explanation of the concept, and I searched quite a bit.

  • @stith_pragya
    @stith_pragya ปีที่แล้ว +1

    Thank You So Much for this wonderful video................🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @jasonwelsh417
    @jasonwelsh417 4 ปีที่แล้ว +18

    Question: would a reducer function in Redux or React's useReducer be breaking this principle if we are using a switch statement for the action types?

    • @jorgesepulveda8380
      @jorgesepulveda8380 4 ปีที่แล้ว +1

      I have the same question

    • @DioArsya
      @DioArsya 2 ปีที่แล้ว +1

      interesting

    • @CottidaeSEA
      @CottidaeSEA 2 ปีที่แล้ว

      Yes, it does. You'd have to do some other things to make it obey the SOLID principles. There are some videos on SOLID in React if that's of interest.

    • @HamdiRizal
      @HamdiRizal 2 ปีที่แล้ว

      Yes.
      But but these principles are not strict rules. They are there to help us to organize code. It is Ok to break those principles if the benefit outweighs the disadvantages.
      The reducer's switches usually have very minimum logic, so it is preferable compared to writing separate classes for each of them.

  • @software-egineering-be-tounsi
    @software-egineering-be-tounsi 5 ปีที่แล้ว +10

    1:06 that moment when you are so confident that you say about wikipedia's definition "sucks" XD
    keep up the good job mate :D

    • @sfoxj
      @sfoxj 4 ปีที่แล้ว +1

      Like he wanted us to use THIS tutorial

  • @yahayaoyinkansola8258
    @yahayaoyinkansola8258 2 ปีที่แล้ว

    This was really well explained, thank you so much for the clear explanation. I am definitely going to watch the remaining videos you did on SOLID

  • @aminuabdulsalami4325
    @aminuabdulsalami4325 2 ปีที่แล้ว

    You are an excellent teacher.

  • @zuzukouzina-original
    @zuzukouzina-original 2 ปีที่แล้ว

    This is a good explanation of O/C principle

  • @pastorfred2543
    @pastorfred2543 5 ปีที่แล้ว

    Wow.. 100K.. Congrats Sir Kyle. I'm happy for you and thanks for the content.

    • @WebDevSimplified
      @WebDevSimplified  5 ปีที่แล้ว +1

      Thank you so much! I cannot believe so many people find my videos useful and educational.

  • @SanojKumar-os6xr
    @SanojKumar-os6xr 3 ปีที่แล้ว

    Thank u so much for explaining in simple ways👍

  • @mohamedali-dx6zi
    @mohamedali-dx6zi 3 ปีที่แล้ว

    great explanations , but I think it would be better to have a super class Question with the common constructor and extend other classed from that class , this will be better .
    Great efforts , thanks a lot for your time and efforts

  • @AdamFraserKruck
    @AdamFraserKruck 3 ปีที่แล้ว

    Another way to handle this would be with the visitor pattern. It has the added benefit of separating data and rendering which is really handy if you want to have multiple ways of rendering output for different user interfaces.
    I'm still new to applying the open/closed principle consciously. The visitor pattern allows the outer rendering loop to stay the same (open/closed), but everytime a new type is added, the visitor needs updating too which violates open/closed in my understanding.

  • @talkatar
    @talkatar ปีที่แล้ว

    wow the best ive seen so far !

  • @daryladhityahenry
    @daryladhityahenry 3 ปีที่แล้ว +4

    Hi! Thanks for easy explanation! It's really great.. But, I have question.. When I see the code in array, it make sense. But... When I try to think about the data from database. How do we process this?
    I mean... When we receive data from database, it's not class based, but type based. And we need to convert that type into our class like in your tutorial. And on that process, we still use if / switch statement right? Am I wrong?
    And.... If we still use if / switch to declare the class, is it still labeled as open close? Because we directly modified the code even if it's just converting the data.
    Thank you...

  • @caiquevallim2209
    @caiquevallim2209 ปีที่แล้ว

    I understood and I liked how you explained with js and one bad point that I can see with js is because we cannot declare interfaces to be implemented and then we need to make sure that the name of the method is really the same between those classes and having an interface to declare this method would be better because we could create RangeQuestion class implementing idk "PrintableOption" class in order to not worry about writing the method with the same name

  • @franco-cespi
    @franco-cespi 4 ปีที่แล้ว

    These videos are great. I am just sorry that there are no repos as there were for the design patterns series. Thanks a lot Kyle.

  • @pranavbhat29
    @pranavbhat29 3 ปีที่แล้ว

    The idea is when we have heterogeneous types of output paths in our code for a given function, by definition of open-close principle, this function should be open to adding more paths, but closed from the code being modified.
    The idea is to make a class for each of the different path, but all the classes are based on a common contract ( printAnswrChoices() in this example ), which is something used in the original function on which the Open close principle applies to. All these classes also adhere to the Single Responsibility pattern :)
    Essentially inheritance in Java is a very good example of the same.

  • @omersoncruz1081
    @omersoncruz1081 3 ปีที่แล้ว

    Great explanation and the example shown here. Love it

  • @brunocasstiel
    @brunocasstiel 3 ปีที่แล้ว

    you was amazing, very easy to learn with your explanation, congrats bro.

  • @yellowbonbon1
    @yellowbonbon1 4 ปีที่แล้ว

    This exactly the problem i am having. Thank you so much.

  • @tuttodev
    @tuttodev 4 ปีที่แล้ว

    Excelent video, now I understand better.

  • @clodoaldoivanfavarosobrinh8384
    @clodoaldoivanfavarosobrinh8384 2 ปีที่แล้ว

    Awesome! You explained it in a way that is easy to understand. Thanks!

  • @vimtor
    @vimtor 5 ปีที่แล้ว +3

    Great work! Love when people use useful examples instead of cars, toys or shapes 😂
    I have a question however. Whenever this example of the switch statement arises, or other open/close example, usually we reach out for classes to solve the problem. Following the "Single Responsibility" principle, the question itself should be responsible for doing whatever it wants. I was wondering how this will be solved when dealing with a more functional approach. Would you use callbacks or something similar?

    • @chaos6094
      @chaos6094 5 ปีที่แล้ว

      I thought at first that he was going to add a callback in each question object,
      I think this is the functional way of doing so.

    • @sOuriukas
      @sOuriukas 5 ปีที่แล้ว

      Although Kyle shows great example of OOP via class implementation. On other hand, callbacks, as @Chaos mentioned, I guess would be more functional approach. But do we really need all this "fancy OOP stuff".
      Question object could have another field that could store messages of expected answers and function printQuiz would be only responsible for printing. No classes, no question type checking via switch or ifs (we dont need question type at all), no extra functions (callbacks) just loop through array print question's description and question's expected answers.
      question.description = "Speed limit in your city?";
      question.expectedAnswers = [ "Minimum value: ", "Maximum value: " ];

    • @raindear3181
      @raindear3181 3 ปีที่แล้ว

      What is more, i feel like the OOP solution he used doesn't actually get rid of the switch statement he is talking about, in this example he changed a simple data structure that could be sent via ajax for example into class initializations in the code, but if the questions come from the server, he'd still need to go through a switch statement to initialize each question to its adequate type, i feel like the functional approach would be simpler and cleaner, and there is nothing wrong with a switch statement if placed correctly

  • @paulbilbao4833
    @paulbilbao4833 3 ปีที่แล้ว

    Thank you AGAIN and AGAIN for this simple, understandable video !! ^^

  • @UnclaimedClock
    @UnclaimedClock 5 ปีที่แล้ว +6

    Nice explanation, you could also make each of the individual question classes inherit from a ‘base question’ which inside it would have the print function, meaning you would never forget to include the print as it wouldn’t compile without it.

    • @swarupmahapatra1
      @swarupmahapatra1 5 ปีที่แล้ว

      In Scripting languages , it will not be necessary to do. Duck typing just kicks in.

    • @computersurgeon_
      @computersurgeon_ 5 ปีที่แล้ว

      I'm not sure, but I thought Javascript doesn't support inheritance?

    • @UnclaimedClock
      @UnclaimedClock 5 ปีที่แล้ว

      Alireza M you are kind of right but there is something called ‘Prototype Inheritance’ in JavaScript that will do the job. I probably should of worded my comment better to say that languages that support it could use inheritance, as SOLID is used across many languages not just JavaScript, it just happens to be Javascript that was used in this example.

  • @NeoSlider1st
    @NeoSlider1st 4 ปีที่แล้ว

    Great video, for sure very useful for many 👏👏👏, thanks and keep doing this great work 👏👏👏

  • @samerkayali4525
    @samerkayali4525 2 ปีที่แล้ว

    Best explanation ever!

  • @David-kr7fx
    @David-kr7fx 5 ปีที่แล้ว +14

    CTRL-F
    "switch"
    1309 occurrences found
    🤔

  • @AbdulBasit-ib6by
    @AbdulBasit-ib6by 4 ปีที่แล้ว

    Your Videos are superb.
    Kindly add one thing. Which is publish the code on Github. Before and after SOLID Principles.

  • @yizu7283
    @yizu7283 3 ปีที่แล้ว

    Thank you so much for the clear explanation!

  • @jjnimes
    @jjnimes 4 ปีที่แล้ว

    Another lit explanation! Thanks very much for making it easy to understand!

  • @kiranearle5665
    @kiranearle5665 4 ปีที่แล้ว

    Great approach, only thing I would change is the use of classes. You can can do the same implementation but with currying:
    const textQuestion = (description) => {
    return () => {
    console.log('Answer: _____________')
    }
    }

  • @gyros9162
    @gyros9162 ปีที่แล้ว

    The explanation is brilliant

  • @danielsilvanunes1865
    @danielsilvanunes1865 3 ปีที่แล้ว

    Very good explanation! Thanks, it helped me!

  • @janmichaelbesinga3867
    @janmichaelbesinga3867 2 ปีที่แล้ว

    Everytime i want to make my code cleaner and simplier, I go to WDS. Thanks Kyle!

  • @thestringsguy3608
    @thestringsguy3608 2 ปีที่แล้ว

    That's a genius explanation!!

  • @craigjcowan
    @craigjcowan 11 หลายเดือนก่อน

    Makes me wonder about react bootstraps Form.Control Utility Component. It takes in the "as" property. There must be some underlying if statement to determine the render based on that property....?

  • @MSMRequiem
    @MSMRequiem 4 ปีที่แล้ว

    You are a freaking genius.

  • @aydzz
    @aydzz 2 ปีที่แล้ว

    i thought the extend part is somewhat related to inheritance. thanks for a clear explanation and a very good example.

  • @kphuang
    @kphuang ปีที่แล้ว

    thanks for the great example explaining open closed principle.
    the following question is what about c++ example since c++ cannot put objects of different classes into an array?

  • @RusuTraianCristian
    @RusuTraianCristian 3 ปีที่แล้ว

    This principle can be applied even further in your example.
    For instance, all of your classes are using the same printQuestionChoices() method. So you could make a class with that method, and the rest of your classes should inherit that method by extending from that base class.

  • @usama57926
    @usama57926 5 ปีที่แล้ว +2

    greetings for 100K 🎉🎉🥳🥳🥳

  • @danielregassa9805
    @danielregassa9805 4 ปีที่แล้ว

    Amazing video and amazing series! Definitely earned my sub.

  • @rahimco-su3sc
    @rahimco-su3sc ปีที่แล้ว

    i really appreciate your efforts !! thanks a lot

  • @martapfahl940
    @martapfahl940 11 หลายเดือนก่อน

    Hi Kyle! One Question, your new implementation, to me it looks like a perfect example of the Factory Pattern, am I right with my assumption or would you disagree? I am getting my head around design patterns atm. I guess the only thing missing would be the abstract method of a parent class that would force the child classes to implement the printQuestionChoices method

  • @tjserencio
    @tjserencio 2 ปีที่แล้ว

    This is really good. Thanks for sharing 👌👌

  • @robertobenedit
    @robertobenedit 2 ปีที่แล้ว

    This was really clear, very clever example, Thanks!

  • @ahmedmuhammedelsaid5345
    @ahmedmuhammedelsaid5345 4 ปีที่แล้ว

    I swear it's such a perfect video .. You are cool mate.. Thanks a lot

  • @nastykhan7746
    @nastykhan7746 3 ปีที่แล้ว

    I don't know which is better: your hair or the way you describe SOLID. My thumb goes for both I guess.

  • @ox6542
    @ox6542 3 หลายเดือนก่อน

    Learned a lot, thank you!

  • @codebykeoma
    @codebykeoma 3 ปีที่แล้ว

    This was helpful. Thank you so much!

  • @ttl5842
    @ttl5842 2 ปีที่แล้ว

    your sample code is amazing, I'd really appreciate it's elegant logic.

  • @WOLKsite
    @WOLKsite 2 ปีที่แล้ว

    I figure a case where if statements are not in violation is in, for instance, algorithms, where you may be comparing index or key values, etc. for for instance sorting operations.
    One concern I have in regards to Solid thus far is that it seems to create redundancies, which in turn may lead to more changes being needed. If, for example, two classes use an identical implementation of the same function, if you modify one, you're likely to want to modify the other...

    • @pure4lyfe5
      @pure4lyfe5 ปีที่แล้ว

      Then you would need to change the parent class only

  • @samansinaei1426
    @samansinaei1426 3 ปีที่แล้ว +1

    Hello,
    Maybe I am wrong, but the question array here includes 4 to 5 objects with some types, what if we are fetching this array from a DB then we should switch or somehow check for the type of object in order to know which class or function to use on it?!
    What if we had 100 questions? 🤓

  • @nasirmovlamov
    @nasirmovlamov 2 ปีที่แล้ว

    Great example and explaining

  • @KhoaNguyen-mv2mu
    @KhoaNguyen-mv2mu 4 ปีที่แล้ว

    fantastic explanation. Thanks a lot Kyle!

  • @tannerdolby1361
    @tannerdolby1361 4 ปีที่แล้ว

    Huge thanks! Another great video.

  • @yashsolanki069
    @yashsolanki069 5 ปีที่แล้ว

    Useful as always ! Keep up with more such videos👍

  • @ccmawil20
    @ccmawil20 4 ปีที่แล้ว

    Great explanation, Thanks.

  • @kevingreetham4175
    @kevingreetham4175 2 ปีที่แล้ว

    I have a problem doing this in MVC pattern because a lot of my else if statements target and mutate models in seperate classes, which means my version of the printQuestionChoicr relies on three other classes. It’s a game of monopoly I made. E.g my polymorphic method would each call methods of other objects and since my objects are instantiated inside the controller !

  • @HM_Milan
    @HM_Milan 10 หลายเดือนก่อน

    Woow thanks for the simple explanation.In this scenario do we need to create a base class with printqestionoption method and override that method

  • @NoahNobody
    @NoahNobody 3 ปีที่แล้ว

    I thought I knew the open/closed principle, but I did not. But now I do :)

  • @sebastianvillarpando3109
    @sebastianvillarpando3109 3 ปีที่แล้ว

    Very helpful, thank you!

  • @ilhamaliyudin4779
    @ilhamaliyudin4779 3 ปีที่แล้ว

    Thanks brother. Im was confusing before using this principle. When I add new feature or my project getting bigger, it must be found some little bug as you told, and its hard to realize.

  • @fyfirman
    @fyfirman 3 ปีที่แล้ว

    You help me so much!!!! Thanks for simplified this :))

  • @rizadwiandhika9253
    @rizadwiandhika9253 3 ปีที่แล้ว

    woww, really great exaplanation!! thanksss

  • @aldojordanchoque7512
    @aldojordanchoque7512 7 หลายเดือนก่อน

    Awesome explanation 👍

  • @AmrMekkawy
    @AmrMekkawy 5 ปีที่แล้ว

    Excellent explanation.

  • @mdfaizansiddiqui9517
    @mdfaizansiddiqui9517 4 ปีที่แล้ว +1

    is'nt the code in this lecture kind of also implements polymorphism?

  • @joeldavidcabrera4918
    @joeldavidcabrera4918 ปีที่แล้ว

    very thanks! I understand very well