Low Level Design 105 | Single Responsibility Principle in SOLID | 2022 | System Design

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ต.ค. 2024
  • Learning system design is not a one time task. It requires regular effort and consistent curiosity to build large scale systems. Moreover, every system has different requirements and meeting them requires expertise and people with varied and specific knowledge. There are a lot of resources to learn through videos. But not everyone enjoys that mode of learning. Instead some people understand things better by reading and thinking on the points put forward by the author. Such people can access these in different ways - blogs, articles and books. We have come up with this video to put light on one such aspect, that is - Single Responsibility Principle
    Important links and resources:
    ✒ github.com/top...
    ✒ Quick summary: docs.google.co...
    ------------------------------------------------------------------
    Recommendations
    ------------------------------------------------------------------
    Our full courses on youtube:
    ✒ System Design Primer Course: • System Design Primer C...
    ✒ REST APIs made easy: • REST APIs MADE EASY
    Some paid courses that we recommend:
    ✒Educative.io: bit.ly/3qnW5ku
    ✒Interviewready.io: get.interviewr... (Use coupon code SUDOCODE for extra discount)
    ------------------------------------------------------------------
    About Us
    ------------------------------------------------------------------
    Created and Instructed by:
    Yogita Sharma
    ✒ LinkedIn - / yogita-sharma-83400b55
    ✒ Instagram - / sudo.code1
    ✒ Facebook - / sudo.code
    ✒ Medium - / yogita088
    Post-production(editing, thumbnail etc) managed by:
    CiKi
    ✒ Website: www.ciki.co.in
    ✒ LinkedIn: / 74735937
    Colors and design by:
    Naini Todi
    ✒ LinkedIn - / nainitodi
    Both Arpit and Yogita are software engineers and want to help other software engineers become better by providing high quality and well researched content by adding their creativity and teaching twist.
    ------------------------------------------------------------------
    Join Us
    ------------------------------------------------------------------
    Hangout with sudoCode:
    ✒Discord Server: / discord
    For business:
    ✒Email: sudocode.yogita@gmail.com

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

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

    Yogita, you're just amazing! Thank you for bringing such content to us. The way you explain so much in a limited amount of time is commendable.

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

    I understood SRP clearly for the first time. What an amazing explanation! Your examples are really good too, thanks for giving two examples with slightly different perspectives

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

    Loving this LLD series. Patiently waiting for the Open/closed principle! 🙏🏽

  • @shiveshpandeyiiitbhopal5463
    @shiveshpandeyiiitbhopal5463 11 วันที่ผ่านมา +2

    Hi Yogita
    Thanks for the amazing explanation
    I have a doubt:
    1) Instead of making different classes for each responsibility, why can't we make different private methods in the same class for different actors. Like getRegularHoursForCFO(), getRegularHoursForHR(). This will solve the problem in the example you mentioned.
    In case of contructors, we can do overloading.

  • @Mohamed-pu7so
    @Mohamed-pu7so 2 ปีที่แล้ว

    You are the smartest person I have ever seen explaining Low-Level Design. Thank you very very very much 😍😍♥♥♥♥

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

    I am addicted to your way of teaching.It gives me more and simple ways of learning topics.Thank you.

  • @amolmandlik
    @amolmandlik 9 หลายเดือนก่อน

    Thanks, Yogita excellent explanation, but I can't see the video for the Open-closed principle in the playlist.

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

    Hi Yogita,
    First, You are doing great job and I am learning something new in the end after watching every video of yours. Keep up the work!
    Second, I have doubt in the both the examples. Even though we decomposed the methods to different classes, still impact is there when change happens. For example, getCalculateHours is still needed for both CFO and HR. where this method will sit? and when change is required, still both classes have impact, right?
    In another example , if Bill Store class required new param like isPaid, anyway that should be sent by Bill class as that new param is relevant to Bill object. Again, change is needed on Bill class.
    Please correct if my understanding is wrong.

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

      Same question im having if you got the answer plz comment.

    • @SakshiSingh-arcane05
      @SakshiSingh-arcane05 ปีที่แล้ว +1

      method getCalculateHours would reside on both classes, would be private to those particular class, hence any change done for getCalculateHours of calculateHours wont affect implementations in calculateSalary.

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

    The best graphics, I've seen in any video so far! Literally graphics are one of the USP of this series.
    Thanks for putting such great quality content!

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

    Good job! So many people get this wrong, especially other content creators.
    Thank you for helping debunk the dogma around S.R.P. 🎉

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

    The best explanation on this topic on youtube

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

    Thanks a lot ma'am for explaining in easiest way

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

    Yogita thank you so much for bringing such a great content. I’m an aspiring technical architect this will surely help me.

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

    This is an AMAZING explanation. I have been looking for a really good explanation of the single responsibility principal for years to truly understand it, and this takes the cake!

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

    You are a gem. Thanks for explaining it in the best possible way while breaking the myth. Appreciate your efforts. It helps a lot in preparing the LLD preparation.

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

    Hi yogita, can you pls upload videos more frequently so that i can stick to your playlist.. ideally if you can upload 3+ videos per week it would be really great for prepping for interview.

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

    Yogita, your videos are well researched, well narrated and well presented!
    I feel so much comfortable watching videos, because I can trust whatever you're saying.

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

    The explanation was crystal clear, especially for the Hotel example.
    if isPaid is added with the getter and setter method instead of constructer, how would that break?

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

    Honest efforts in making these videos. Very helpful !!

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

      Glad you like them!

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

    Yogita. you are amazing on the explanation. Do we have 2nd design principle Open Close?

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

    Can you give an example where srp is followed and the class has more than one method.
    Thanks.
    Loved the video :)

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

    well this was quite clearly explained , really thanks for this

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

    Such a great explanation of this concept. Thank you!

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

    But if both calculateSalary and calculateHours methods use the same getRegularHours (maybe it will be a little different for each type), but if you separate it, will the code be duplicated? And although the editing is independent, if additional operations are needed, do we have to edit it in 2 places instead of editing it in 1 place?

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

    Great video and breakdown of SRP. I don't know who out there thinks one public method on a class is a good practice, but they definitely have their wires crossed.

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

    Then in this case one class can have mostly one pulblic method when it comes to real time implementation.
    Can't argue with your explaination, very clear....

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

    Thanks yogita for amazing content, would it also be possible for you to make a video on open closed principle. Rest all the solid principles are covered really well in great detail

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

    Couple of correction for the viewers of this video from my point of view,
    - Clean code book has no dedicated topic or chapter for SOLID.
    - Uncle Bob[Robert Martin]'s other two books Agile Software development PPP and Clear architecture are talking on this topic in detail.
    - SRP can be viewed from different level like Functions and Classes, Component and architecture. At each level same principle is sharing some insight. This video is presenting one view of it however, it doesn't mean that There should be a single reason to change a class is incorrect and that's not what SRP is. People who are confused can Read SRP principle from both the books that I mentioned above.
    By heart I am appreciating author's good quality work and commitment to sharing with community however, above points are extension and slight correct to guide users on further reading.

    • @Dino-yw1td
      @Dino-yw1td 2 ปีที่แล้ว +1

      In fact, in the Agile Software Development PPP book, at the beginning of the SRP chapter, it explicitly states "A class should have only one reason for change."

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

    Hi @sudocode, Thanks for the explanation, but one doubt here by seeing the explanation - how a developer will know beforehand that who the different stakeholders can modify the code?? For ex in a class having different methods, how will a developer know while designing that needs to segregate the methods to different classes based on stakeholders beforehand?

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

    Does applying object oriented design to real world models come with experience?, thanks a lot for replying.

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

      I would highly appreciate your reply

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

      Not completely through that. It's more like you should have an understanding of oops concepts well. And then of course, the more you practice, the better you would get at it.

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

      @@sudocode thanks a lot! I love watching your content!

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

    awesome explanation.. there is no other video which explains this principle so clearly...

  • @anikmahmud1748
    @anikmahmud1748 5 หลายเดือนก่อน

    Does the additional method of subclass violate the LSP which is not present in the parent class?

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

    A small doubt, if we separate also, still CalHours need to used by CalSalary need to know regularHours(), so where do we need to place this ? If it write in two classes are we not violating DRY ? Please comment

  • @YouTubers-rj9xv
    @YouTubers-rj9xv 2 ปีที่แล้ว +1

    Hey excellent teaching love you please don't stop uploading

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

    amazing graphics, very nicely explained and a very well delivered video, thanks for your hardwork, I got to learn something useful today

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

    Ma'am, please, also explain the other parts of SOLID principle.
    Really, awesome 😊

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

    Thank you for the quality content.Please make more videos in the LLD series.

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

    Finally I found a best vdo in TH-cam ❤️

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

    Thats the idea behind common closure principle (CCP) & Applying DDD (Domian Driven Design) - The basic idea behind microservices

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

    very very helpful for me for learning LLD

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

    Seriously , great explanation

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

    Thanks Yogita. I can learn very well.

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

    Great Content. thanks yogita

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

    amazing. waiting for next vids in course

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

    amazing logical explanation

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

    Hey,
    Could you please explain how in the first example decomposition to different class would help us if for CFO we need to make changes in common getWorkingHours method?
    Also in 2nd example if we need to add more fields in db, even if we create new store class, we would still need to pass isPaid from bill class to store it.
    Eagerly waiting for your response for clarification on these.
    Thank you

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

    Thanks Yogita for sharing such useful content !! You are an inspiration...
    I sometimes get confused while breaking the classes and end with lot many classes like models(with mainly properties and getters setters), service classes (service class for model classes to perform certain tasks like play, save, move, etc) and repositories (for saving objects in memory).
    Could you help me understand if this approach is correct or not?
    Is it fine to have separate service classes for having the business logic instead of putting a lot in model classes.
    If yes, should I create it as a singleton class, class with static methods or like a normal class, because it will be mostly performing business logic without maintaining any state.

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

      It is okay to break classes into multiple model classes. If there are N entities (credit card, user, cart,classes etc..) you can create different model for each of these like (credit card model, user model...ETC). You can use get;set methods to wisely encapsulate the porperties of the model class also. If you look at MVC architecture. This is how it is done. Model classes hold data and service classes are used to apply bussiness logic on top of these models.
      Making all the methods static and using singleton is not a good idea. As you practice solving LLD problems and multiple design patterns you will understand the beauty of OOP. If your not using OOPS to max ability then your just using Functional programming with model classes.

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

    Top notch explanation, thank you very much!

  • @Mohamed-uf5jh
    @Mohamed-uf5jh 2 ปีที่แล้ว +1

    Hi . It's very helpful courses for OOP ,OOD and more, thanks for your efforts

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

      👍🙂

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

      @@sudocodeMam please complete remaining video of solid principles. Your explanation is amazing 👍

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

    thanks for nice tutorial ,
    but what happen for the "getRegularHours()" method in first example after separation classes? how can fix share code in two class ? duplicate code or using interfaces?

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

    Great explanation. Thank you

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

    Amazing Superb explanation. thanks from my heart :)
    Happy teacher's day guru ...🙏

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

      Thank you so much for the wish. At least I got one wish on teachers day. I will keep it. Thanks again.

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

    crystal clear explanation

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

    Superb explanation !!!

  • @TheMR-777
    @TheMR-777 ปีที่แล้ว +1

    Oh, I was looking for something else, and saw your thumbnail!
    You look so like *NAIROBI* from _La Casa de Papel_ :)

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

      Hahaha thanks. I get that a lot.

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

    Could you make video for second principle of solid ie. o - open/closed principle?

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

    Amazing explaination! Learning a lot here

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

    Thanks for this, it really helps me as a student hehe can't wait to watch the Open/closed principle :)

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

    Super content! Please increase the upload frequency Yogita! :(

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

    Videos in this series are very good . If it is possible could you please upload more content

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

    Awesome... Lucid ...

  • @harsimratkour3135
    @harsimratkour3135 9 หลายเดือนก่อน

    Good explanation ❤....

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

    Awesome explanation.

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

    Informative video and nice animation...keep posting 😊

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

      Thanks Anek

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

    Very good explanation 🤩

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

    Great 👍

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

    Great explaination! Thanks for such amazing content!

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

    Mam, where is the open close principle? You lecture 106 is not open close principle.I dont want to move to L without knowing O. If anybody has the title,please let me know

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

    Can't wait to see your next video

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

    Waiting for more videos didi 😄

  • @MahmoudJaber-kw
    @MahmoudJaber-kw 10 หลายเดือนก่อน

    Where's Open Closed principle? It's not existing in your list

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

    appreciate your work.

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

    So, can we make it a thumb rule that - If there are more than one actors for a method then just make it a class?

  • @a.nk.r7209
    @a.nk.r7209 2 ปีที่แล้ว +1

    Thanks for this video

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

    Congratulations mam u got a new subscriber
    it's me 😁

  • @JayanthNaidu-w5e
    @JayanthNaidu-w5e ปีที่แล้ว

    Thanks for the great content!

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

    Now when i give this ans to interviewer. Hoping he would have read uncle Bob too or have seen your explanation😊

  • @samiranroyy1700
    @samiranroyy1700 29 วันที่ผ่านมา

    mam thanks really

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

    I am bca first semester student,after I will also do MCA than Can I eligible for FANG company.

  • @atindiansafar
    @atindiansafar 4 หลายเดือนก่อน

    This is true layman terms from coding perspective that everyone seeks. Thanks for not following the traditional bookish knowledge.

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

    Brilliant !

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

    Amazing 😍

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

      Thank you! Cheers!

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

    When are you uploading open close principle?

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

      It will take some time.

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

    Why more video are not comming now days and this particular series of lld

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

      Will come soon.

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

    Thank u

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

    When you will cover design patterns?

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

      After solid principles

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

      @@sudocode will be waiting for that,

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

    Thank you❤

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

      Thanks backlogbatch 😇

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

    Understood

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

    Hey mam wonderful explanation mam thank you so much mam 🤗🤗🤗................................................
    :-)

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

    I thought I'd seen the most beautiful programmer but I was wrong.

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

    ma'am please make more videos

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

    Wow.

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

    Please share the contents in slow way. Most of the things will go to out of our mind

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

      I am really sorry for the speed. Please bear with few more videos as those are record. Will make sure doesn’t happen in new ones.

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

      Yes, that is one of the problems with the videos like too much content in a single sentence. Despite this, the content is good and the teaching is also good.

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

    I'm literally falling in love with you

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

    I m in love with u maam😍

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

    Hi Yogita,
    I am loving the content you are posting on TH-cam. In one of your Low level design videos (th-cam.com/video/FbQYifw9Be8/w-d-xo.html) , you mentioned Obect oriented design is hard, what do you mean by that, does it mean it is really hard to grasp low level design, could you clarify that. Your response will be highly appreciated!

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

      I appreciate your persuasion skills but you have exhausted every possible way of communication to get answer for this question. Yes it is hard to convert real world models to object oriented design due to its subjectivity and the requirements in place. It’s not hard to grasp, it’s hard to apply.
      Please try to be patient while asking questions. Attention seeking never helped anyone progress.

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

      @@sudocode thanks a lot and I understand, I wont bug a lot in future

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

      @@sudocode just one last question,Does applying object oriented design to real world models come with experience?, thanks a lot for replying.

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

    You are not actually teaching for interviews it seems - I mean, that could be a side effect, but not the target.
    what I have seen in TH-cam is things been spit out and asked to be remembered. This is far from it.

  • @abidkhan.10
    @abidkhan.10 2 ปีที่แล้ว

    Aap ko hindi nahi aati

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

      Aati hai. Aur aapko english?

    • @abidkhan.10
      @abidkhan.10 2 ปีที่แล้ว

      @@sudocode yes mujhe english nahi aati aap hindi english mix kro please