Fundamental Concepts of Object Oriented Programming

  Рет қаралды 984,285

Computer Science Lessons

Computer Science Lessons

Күн бұрын

Пікірлер: 608
@dariusz.9119
@dariusz.9119 2 жыл бұрын
"An employee of a business is also a person" - that's a bold statement right there
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
That's what I keep telling myself! :)KD
@beltusbenz6911
@beltusbenz6911 Жыл бұрын
exactly ! very outlandish .
@Wida85
@Wida85 Жыл бұрын
😂😂
@anointingdaniel216
@anointingdaniel216 Жыл бұрын
For real 🤣
@renren_27
@renren_27 Жыл бұрын
🤣🤣🤯
@laurastephenson5169
@laurastephenson5169 Жыл бұрын
I'm a university professor myself, and I have to say that is the most crystal clear, explanation I've ever seen for computer science concepts.
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
Delighted to help. Thank you :)KD
@MatthewTipton2
@MatthewTipton2 2 жыл бұрын
Absolutely brilliant. Simple, clear, concise. The whole concept in my mind started as a soft blur and sharpened to crystal clarity.
@trevoro.9731
@trevoro.9731 Жыл бұрын
A lot of BS actually, the author didn't pay attention to correct definitions. But useful to find out common misconceptions.
@darianxd5508
@darianxd5508 Жыл бұрын
why is it BS?@@trevoro.9731
@notyournormaldev1419
@notyournormaldev1419 2 жыл бұрын
The clarity and simplicity is unparalleled.
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you :)KD
@SithLord2066
@SithLord2066 Жыл бұрын
So you're saying it's serial? Since it's not parallel
@notyournormaldev1419
@notyournormaldev1419 Жыл бұрын
@@SithLord2066 lame.
@SithLord2066
@SithLord2066 Жыл бұрын
@@notyournormaldev1419 I'll be here all week
@AndrewSinclair
@AndrewSinclair Жыл бұрын
Thanks.This is the best OO explanation ever.
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You're very welcome. And thank you so much :)KD
@sandrakyoutube
@sandrakyoutube Жыл бұрын
Remarkable. Remarkable simplicity, clarity, and conciseness. Transformed my vague understanding into clarity without overwhelming me. Thank you!
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You are most welcome. Thanks for the lovely comment :)KD
@benediktkraas8576
@benediktkraas8576 2 жыл бұрын
Probably the most useful 10 min of learning OOP so far. I never really understood those 4 principles and now they seem a) sorta easy (both to use and memorize) and b) I was already applying some of them without knowing. Amazing! Thank you kindly
@hunterjiang5894
@hunterjiang5894 3 жыл бұрын
This video is the most helpful and concise one I 've ever seen so far among those about the fundamental terms and concepts. Thanks a lot!
@brayanrc4432
@brayanrc4432 11 ай бұрын
The clearest and simplest explanation of OOP. Thanks!
@ComputerScienceLessons
@ComputerScienceLessons 10 ай бұрын
You're welcome :)KD
@BrainConduit123
@BrainConduit123 Жыл бұрын
I learned OOP from a video that Philippe Kahn made about the subject when Borland’s Turbo Pascal first introduced this new way of programming. It took awhile to understand and master the concepts, but after that, I absolutely loved it and it made large, complicated projects so much more manageable. The ability to start with a base class and do inheritance was extremely powerful. It literally enabled us to program our products in a fraction of the time and with fewer programmers than the old spaghetti code ways of coding.
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
I agree. It's a great way to manage large projects. I worked for a number of years in software development (albeit as an educator) and OOP allowed hundreds of developers, in different parts of the world, with a range of skills, to work together effectively on very complex applications. :)KD
@robf5684
@robf5684 4 жыл бұрын
The clearest and simplest explanation of OOP I've ever seen. Many thanks.
@ComputerScienceLessons
@ComputerScienceLessons 4 жыл бұрын
Thank you :)KD
@alm5966
@alm5966 2 жыл бұрын
Always good to get a refresher on what OOP is.
@dkdavidkent
@dkdavidkent 2 жыл бұрын
Thanks
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you so much :)KD
@marktahu2932
@marktahu2932 3 жыл бұрын
Wow - sometimes the algorithm really does turn up 'gems'. Many many thanks!! As a visual learner this 'gem' is invaluable.
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
You're very kind. Thanks for the comment. :)KD
@NickHope
@NickHope 3 жыл бұрын
This is excellent. Very clear and precise. I'm going to re-watch it a couple of times to really drive the concepts home.
@toolittletoolate3917
@toolittletoolate3917 2 жыл бұрын
OOP was THE hot topic when I was a developer. Took me a little study to understand its foundational concepts. I couldn’t understand why everyone seemed to think that it was THE way to create programs. Sanity eventually prevailed, as it usually does, and it certainly has its place, but if your design does not utilize inheritance and polymorphism, then use another language type. Don’t force a particular model into an OOP design just because your CompSci instructor loved Java.
@SnakeEngine
@SnakeEngine Жыл бұрын
You can do (real) OOP in C, and do it better than in Java.
@onyemanwokolo441
@onyemanwokolo441 Жыл бұрын
I keep coming back to this video. The OOP concepts are well explained in simplest and clearest way.
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
Delighted to help :)KD
@SosetaFurioasaJr
@SosetaFurioasaJr 3 жыл бұрын
I have finally found a concise, 1 line definition of polymorphism. Thank you very much, big thumbs up.
@rubykanima
@rubykanima Жыл бұрын
better would be "A subclass can morph / change an inherited method"
@deei5130
@deei5130 3 жыл бұрын
This was a very clear and understandable video. Thanks for that man. This channel needs more attention
@reenal.upadhayayay
@reenal.upadhayayay 2 жыл бұрын
Life saving explanation, better than having to sit through a 2 hour video to understand it. Brilliant!
@jex4400
@jex4400 Жыл бұрын
This channel is actually phenomenal it needs to be more popular
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You are very kind :)KD
@RVlDER
@RVlDER 3 жыл бұрын
Finally a concise and clear explanation about these fundamentals. The amount of interchangeable terms (that still have different meaning(s) under certain context's) is ridiculous - and near impossible to find a video/documentation that explains them without convolution.
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
I'm a great believer in keeping things as simple as possible. Delighted to help. :)KD
@achtube85
@achtube85 4 жыл бұрын
This was a very clear and in-depth explanation. Thank you!
@ComputerScienceLessons
@ComputerScienceLessons 4 жыл бұрын
Thank you. Much appreciated :)KD
@gianni499
@gianni499 9 ай бұрын
I'm very very impressed. I'm not a strict Java begineer, but I did need to find videos/resources to understand these OOP concepts better. I had watched already 5-10 sources, but yours is just the most clear. Concise, and clear. Very impressive. Thanks!
@ComputerScienceLessons
@ComputerScienceLessons 8 ай бұрын
You are very welcome and thank you :)KD
@salehhassan6057
@salehhassan6057 2 жыл бұрын
You had a very clear and nice way to describe those concepts. But in my opinion, Polymorphism is much more than just the ability to override a method from a super class. Polymorphism is the ability of an object to take on many forms. Thanks for a great video
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
You welcome. Polymorphism catches a lot of people out - so I wanted to keep it very simple for now. One day I will come up with some other examples which make the point that it does indeed literally mean 'many forms' :)KD
@doughoffman9463
@doughoffman9463 Жыл бұрын
Yes. The video leads one to believe that polymorphism is only used in subclasses to override superclass methods. Duck typing (not always available, depends on the language) is the more general and useful case where the same message name can be used in classes that have no common superclass.
@firepower01
@firepower01 2 жыл бұрын
This is such a good channel for understanding computer science concepts, honestly just the best. Thank you!
@MisterRose90
@MisterRose90 Жыл бұрын
Wow. Someone who could explain inheritance in an intuitive way. It actually makes a lot of sense.
@darianasedkina6340
@darianasedkina6340 Жыл бұрын
This is a new concept fo me and I've watched about a dozen of videos but should have started with this one. The clarity and simplicity of the explanation are unmatched. Thank you!
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You are most welcome, and thank you :)KD
@erlanggaz9105
@erlanggaz9105 14 күн бұрын
Started learning Java without learning what OOP is and was like "what the heck are these terminologies". Glad I came across this video!
@freepboot412
@freepboot412 Жыл бұрын
Will add to the pile of positive comments here and say this is the most concise, informative, and accessible video on the subject I've seen. great work
@opethforlife
@opethforlife Жыл бұрын
One of the few golden channels on KZbin.
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You're very kind. Thanks :)KD
@ultraman6950
@ultraman6950 3 жыл бұрын
Hats off, sir. Thanks a lot for making this well-documented video about OOP.
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
You are very welcome :)KD
@MrDuzen12
@MrDuzen12 3 жыл бұрын
This video needs more views! Great explanation of OOP.
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
Thank you :)KD
@Amy-f3e
@Amy-f3e 7 ай бұрын
Wow this is the best explanation Ive seen!!! I have atechnical interview tomorrow and I only know data and sql and not much about OOP in debt. THANK YOU for this great educational content. Today they always jump to Python or the programming name directly, but I miss the real theory and thinking.
@ComputerScienceLessons
@ComputerScienceLessons 7 ай бұрын
You are most welcome. I hope it all went well. Good luck :)KD
@NormaNsNs
@NormaNsNs Жыл бұрын
wow I ve been searching for this video the whole day !!! perfectly explained !
@ivangutowski-smith6514
@ivangutowski-smith6514 Жыл бұрын
Thank you, I have watched this video about 5 times over the last week, every time... I grasp the concept you are talking about a little more, and then understand another smaller detail you mention. I really, really like that whilst explaining, you animate very clear, sensible, logical examples as you go, so I can see what you mean as you are explaining it. I still need to watch it many more times fully, but it is clever, logical, makes sense and is super interesting. Thank you for taking all the time to put this together.. your time a few years ago, has helped nearly half a million people... or if like me.. helped 100k people 5x. ha ha
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You are very welcome, and thank you :)KD
@manishmalhan9768
@manishmalhan9768 Жыл бұрын
Such Brevity and Clarity !!
@Matt-iy2cf
@Matt-iy2cf 2 жыл бұрын
Wonderfully explained! Have not found a better explanation anywhere online!!!
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you so much. :)KD
@igwe6547
@igwe6547 2 жыл бұрын
Best OOP explanation, simple and straight forward
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you :)KD
@MichaelChin1994
@MichaelChin1994 2 жыл бұрын
5:51 "An Employee is *also* a person" The way this is said with such a straight face, I thought it was a set up for a joke, like: "An Employee is *also* a person, unless they work at a Law-Firm."
@alekseevegor5357
@alekseevegor5357 Жыл бұрын
I have spent several weeks trying to understand the professor till I found this 9 min video. Now I feel like I've been to the moon an back.
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
You haven't been to the moon, yet. If you should ever try OOP in reality you will be disappointed though. It does not do any of the things it promises well. The problem lies in the fact that data dependencies in real world applications have a graph structure (a tree, if you are lucky). OOP is not very good at taking care of that and if you try to use inheritance, in particular, then you will find that you are hard-coding assumptions about that data dependency that may change during the evolution of your project, which will make frequent refactoring necessary. There are better ways of dealing with that problem. Try to learn to think about programs as state machines with as few distinct states as possible. Rather than encapsulating data, control state change. Each state change should be associated with a well defined change of the data. That way your data structures can change freely as the project matures, but the basic flow of the program (as seen by both the user and the programmer) stays the same.
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
I am delighted to help. You will hear a lot of negativity about OOP but please bear in mind that it aims to facilitate collaboration and scalability. :)KD
@lepidoptera9337
@lepidoptera9337 Жыл бұрын
@@ComputerScienceLessons What are you helping with here by distributing your ignorance about proper software engineering? ;-)
@Ahmad_Al-Deeb
@Ahmad_Al-Deeb 2 ай бұрын
"Encapsulation: Data and the programs that manipulate those data are bound together and *their complexity is hidden*." This part was useful since I thought encapsulation is just about bundling related properties & methods together and was missing the fact that it reduce complexity also by hiding data which is a little similar to Abstraction hiding implementation details. Thanks!
@ComputerScienceLessons
@ComputerScienceLessons 2 ай бұрын
You're welcome. Glad to help :)KD
@phoga6463
@phoga6463 2 ай бұрын
Thank you so much! This gets to the point, easy to understand while not oversimplifying it!
@ComputerScienceLessons
@ComputerScienceLessons 2 ай бұрын
You are very welcome :)KD
@stupidfrog
@stupidfrog 3 жыл бұрын
Thank you so much, this was very helpful! My professor and textbook did such a poor job of explaining these basics that I felt like I was falling behind.
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
You are most welcome. Glad to help :)KD
@techwithtee8721
@techwithtee8721 2 жыл бұрын
Closest thing to understand Database management system
@rehanshoaib1648
@rehanshoaib1648 9 ай бұрын
The clearest and simplest explanation of OOP I've ever seen. Many thanks. (2)
@ComputerScienceLessons
@ComputerScienceLessons 8 ай бұрын
You're very welcome. Thank you :)KD
@cd-stephen
@cd-stephen Жыл бұрын
this has been the best video i have ever seen - great analogies and loved how you included all the different terms used to describe the same thing - new sub
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
Thank you :)KD
@STEMdecoded
@STEMdecoded 5 ай бұрын
excellent, could have never understood it so clearly in 9 minutes.
@densmac
@densmac Жыл бұрын
10/10 in explaining OOP concepts.
@MrFroggster
@MrFroggster 2 жыл бұрын
Probably the best and easiest explanation. Thank you.
@patriotir
@patriotir 2 жыл бұрын
This was the best explanation I have ever came across! great job and thanks for the video
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
You are most welcome :)KD
@shreyashkumarthakur383
@shreyashkumarthakur383 2 жыл бұрын
Best video I have seen till now. Attained full conceptual clarity
@cherrynoize
@cherrynoize 11 ай бұрын
It's been said, I know, but you're a really great instructor. Hope (for others) that you do this for a living.
@hadiali5249
@hadiali5249 3 жыл бұрын
very clear, concise , precise and comprehensive video on OOP. thank you for the effort!
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
You are very welcome - and thank you :)KD
@AdrianTregoning
@AdrianTregoning Жыл бұрын
SUCH a good video! Thank you. I wonder why it took me so long to find this channel.
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
Thank you so much :)KD
@justincatterall9597
@justincatterall9597 Жыл бұрын
*Now* I understand polymorphism. Thank you!
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You're welcome :)KD
@shivohamjagat
@shivohamjagat 2 жыл бұрын
One of the coolest videos I have ever watched
@lucasbozdog5922
@lucasbozdog5922 8 ай бұрын
this is one of the best explanations i have seen thank you
@alakhdar100
@alakhdar100 Жыл бұрын
This is so clean and simple, yet informative, thank you so much, please keep uploading!
@jackmiller2518
@jackmiller2518 2 жыл бұрын
that was bloody fanatic mate cheers for that
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
You're welcome :)KD
@bootcamprag
@bootcamprag 2 жыл бұрын
Great breakdown/explanation of the OOP concept. OOP is one of my favorite areas in computer science/programming applications. Its not as an intimidating as it sounds. Next: I would love to see a short video on the application of these four OOP constructs in terms of their application; write a simple program that demonstrates each of the four areas. Thanks.
@dr.SaurabhSingh.D
@dr.SaurabhSingh.D 2 жыл бұрын
The clarity at its peak. 👌
@granand
@granand 2 жыл бұрын
I have seen many as I keep forgetting it but this stands out. Thank you for the creators and the presenter such a clarity and use of just enough visuals. Esp the take away is synonyms which are used, that trips me, After this hopefully not anymore.
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
You are most welcome. :)KD
@itorres008
@itorres008 Жыл бұрын
Amazingly succinct, clear and thorough!
@ongwu1507
@ongwu1507 Жыл бұрын
so clear, and easy to understand, thanks great job
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You're welcome. And thank you :)KD
@christianihechi
@christianihechi 8 ай бұрын
As clear as crystal. Thank you!
@ComputerScienceLessons
@ComputerScienceLessons 8 ай бұрын
You are very welcome :)KD
@NorthernStrider
@NorthernStrider 2 жыл бұрын
If you sped up this video, then you are not worthy of the uploaders precious time. Thank you for the top notch explanation
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you :)KD
@Thermy_
@Thermy_ 10 күн бұрын
what an awesome explanaion, you did it in simple ways that made me understand it, many thanks!!!!!
@getTheSchmack
@getTheSchmack 2 жыл бұрын
Big W. You sir, are brilliant. Just look at how many people are heaping praise and all well-deserved. Thank you!
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
You are very kind. Thank you. :)KD
@zabinoori49
@zabinoori49 Жыл бұрын
The best video explains class and object instance creation in such best way (using graphical representation ).loved that 🤩
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You are most welcome :)KD
@djpe4ka
@djpe4ka 3 жыл бұрын
Definitely th best explanation ever. Subscribed.
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
Thank you :)KD
@michaelcappello2254
@michaelcappello2254 2 жыл бұрын
Very clear explanation of the basics of OOP. Thank you.
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you :)KD
@fuz3266
@fuz3266 6 ай бұрын
Clear and to the point, thank you!
@masterrov1030
@masterrov1030 Жыл бұрын
Thank you for teaching these basic pillars of OOP
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You are most welcome :)KD
@maxanitaku
@maxanitaku 10 ай бұрын
Simple and straight forward. Thanks a lot!
@ComputerScienceLessons
@ComputerScienceLessons 10 ай бұрын
You're welcome, and thank you :)KD
@michellemwangi3963
@michellemwangi3963 3 жыл бұрын
The entire series is really really good! very well explained. Thanks a lot
@Jack-xn5do
@Jack-xn5do Жыл бұрын
Studying for my CISSP and this helped me soo much! Thank you!
@xdebono7613
@xdebono7613 2 жыл бұрын
Brilliant….. concise and awesome clarity….thank you
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you. You are are most welcome :)KD
@AdeoluwadaraAdebanjo
@AdeoluwadaraAdebanjo 19 күн бұрын
His voice is like music to my ears, easing my confused brain. Subcribed 👍
@andregrobler4393
@andregrobler4393 3 жыл бұрын
Very concise and accurate. Most helpful, thanks.
@bryanpepe2395
@bryanpepe2395 Жыл бұрын
Amazing explanation. Good job!
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
Thank you :)KD
@brandonwilcox3307
@brandonwilcox3307 2 жыл бұрын
Clear, concise, and informative. Thanks!
@cbbcbb6803
@cbbcbb6803 10 ай бұрын
Great job! Thanks for saying what a class is really. The word template was close to meaningless to me. But saying that a class is "code written by a programmer" is far more precise and meaningful to me.
@ethandoll
@ethandoll 11 ай бұрын
Simple and fantastic explanation. Thank you.
@markyap4755
@markyap4755 3 жыл бұрын
Thanks so much for a great video ! Helps us to relate and thus makes learning "enjoyable" Learning programming is my current "hobby". Thanks again !
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
You are most welcome :)KD If you enjoy programming - have you seen my video on how to make a GeoGuessr type game? :)KD
@Zeila1
@Zeila1 2 жыл бұрын
i wish i watched this at the start of my OOP subject, the way you explained it made it so much easier to understand, the examples you used and visual effects really helped also. edit: I also remember watching your Dijkstra's Shortest path video back in highschool, that was also amazing.
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
That's great to here. Thanks for commenting. :)KD
@marcuss8454
@marcuss8454 3 жыл бұрын
And just like that, I subscribed to this channel for such a great explanation.
@Wida85
@Wida85 Жыл бұрын
Surprisingly clear and succinct, thanks for clearing this up 🤝. Please do keep up the good work 🙂.
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
You are most welcome and thank you :)KD
@emmamorris1092
@emmamorris1092 2 жыл бұрын
massively useful definitions of OOP terminology - thanks!
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
You're very welcome :)KD
@maycodes
@maycodes 3 жыл бұрын
What an amazing crystal clear explanation, got confused in university
@ComputerScienceLessons
@ComputerScienceLessons 3 жыл бұрын
Thank so much you :)KD
@TheMagicOwL127
@TheMagicOwL127 4 жыл бұрын
I'm so glad I found this channel, i was just thinking i should get more into programming in my free time. thanks it was super easy to follow!
@ComputerScienceLessons
@ComputerScienceLessons 4 жыл бұрын
You are most welcome :)KD
@tirancm
@tirancm 2 жыл бұрын
this is the best and clearest!
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you :)KD
@tuck295q
@tuck295q 2 жыл бұрын
This video is mad with super clear and simplistic yet uber effective explaination. xD
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you :)KD
@samuelclear5322
@samuelclear5322 11 ай бұрын
Thanks for the great review material!
@ComputerScienceLessons
@ComputerScienceLessons 10 ай бұрын
You're welcome :)KD
@ado4969
@ado4969 2 жыл бұрын
Nice and clear never seen before explanation!
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
Thank you :)KD
@MarinaN-kv8qt
@MarinaN-kv8qt Жыл бұрын
you are amazing brother !! thank God !!!🙌🙌
@ComputerScienceLessons
@ComputerScienceLessons Жыл бұрын
Thank you :)KD
@sargata3054
@sargata3054 Жыл бұрын
This is such a clear and concise explanation. Thank you from a beginner dabbler in programming!
@TonyTigerTonyTiger
@TonyTigerTonyTiger 2 жыл бұрын
The part on inheritance has some potential theoretical issues, but it is after all just an introduction. Generally speaking, inheritance should be used to model "is a special kind of" relationship, and should not be used to model as "is a role played by a" relationship. An employee is not a special type of person, it is a role played by a person. Same goes for Customer: that is not a special type of person, it is a role played by a person. For example, Alice could be an Employee of Walmart, but she could also shop there so could also be a Customer of Walmart. So if you are creating an object for Alice, would you create an instance of Employee or Customer? On the other hand, a dog "is a special kind of" animal, not a role played by an animal; and a fish "is a special kind of animal", not a role played by an animal. A dog cannot simultaneously be a fish, nor can a dog quit being a dog and become a fish; and a fish cannot simultaneously be a dog, nor can a fish quite being a fish and become a dog. So here inheritance does not suffer from the above problem. If you have a pet dog named Wolfy or Max, there is no ambiguity in what class you would use to create an instance for your pet: it would be a dog.
@ComputerScienceLessons
@ComputerScienceLessons 2 жыл бұрын
I see what you mean. However, the context of the system you are designing is important. If for example I was building a payroll system, and Alice was an employee, it is probably neither here nor there if she is also a customer (staff discounts excepted). :)KD
@arahn466
@arahn466 4 ай бұрын
"So if you are creating an object for Alice, would you create an instance of Employee or Customer?". what is the answer? u shouldn't create 2 instances should u?
@cspalfi
@cspalfi Жыл бұрын
Fantastic explanation extremely on point. Thanks
@TexasEngineer
@TexasEngineer 2 жыл бұрын
Thank you for your brilliant explaination. I now know why OOP does not work for my type of programming. I deal with mathematical processes and not objects. Data goes in, formulas are applied, results come out, results are stored or presented. OOP fits database problems. My programming fit the chsos of a spreadsheet.
Object Oriented Programming (OOP) in C++ Course
1:30:26
freeCodeCamp.org
Рет қаралды 2,6 МЛН
Python Object Oriented Programming (OOP) - For Beginners
53:06
Tech With Tim
Рет қаралды 3,5 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Object Oriented Programming - The Four Pillars of OOP
11:23
Keep On Coding
Рет қаралды 359 М.
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 1,1 МЛН
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 516 М.
UML class diagrams
12:24
Lucid Software
Рет қаралды 601 М.
Intro to Object Oriented Programming - Crash Course
30:18
freeCodeCamp.org
Рет қаралды 992 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 446 М.
100+ Computer Science Concepts Explained
13:08
Fireship
Рет қаралды 2,7 МЛН
Python Object Oriented Programming in 10 minutes 🐍
10:04
Bro Code
Рет қаралды 450 М.
Learn Java Object-Oriented Programming (with actual code)
29:44
ForrestKnight
Рет қаралды 59 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19