JavaScript Beginners Tutorial 25 | OOP | Abstraction with example
HTML-код
- Опубликовано: 9 сен 2024
- FREE Tutorial - automationstep...
An abstraction is a way of hiding the implementation details and showing only the functionality to the users
Abstraction hides certain details and only show the essential features of the object.
This approach improves understandability as well as maintainability of the code.
FREE Courses - automationstep...
GitHub - github.com/Rag...
Udemy - www.udemy.com/...
Training by Raghav at your venue - raghav.qna@gmail.com
Training schedule - automationstep...
----------- UI TESTING -----------
Selenium Beginners - bit.ly/2MGRS8K
Selenium Java Framework from Scratch - bit.ly/2N9xvR6
Selenium Python - bit.ly/2oyMp5x
Selenium Tips - bit.ly/2owxc50
Selenium Builder - bit.ly/2MKNtlq
Katalon Studio - bit.ly/2wARFdi
Robot Framework with RIDE- bit.ly/2Px6Ue9
Robot Framework with Eclipse - bit.ly/2N8DZxb
----------- API TESTING -----------
Web Services (API) - bit.ly/2MGafL7
SoapUI - bit.ly/2MGahmd
Postman - bit.ly/2wz8LrW
General - bit.ly/2PYdwmV
Katalon Studio API Testing - bit.ly/2BwuCTN
----------- MOBILE TESTING -----------
Appium - bit.ly/2ZHFSGX
Mobile Playlist - bit.ly/2PxpeUv
----------- CI | CD | DEVOPS -----------
Jenkins Beginner - bit.ly/2MIn8EC
Jenkins Tips & Trick - bit.ly/2LRt6xC
Docker - bit.ly/2MInnzx
----------- VERSION CONTROL SYSTEM -----------
Git & GitHub - bit.ly/2Q1pagY
----------- PERFORMANCE TESTING -----------
JMeter Beginner - bit.ly/2oBbtIU
JMeter Intermediate - bit.ly/2oziNVB
JMeter Advanced - bit.ly/2Q22Y6a
JMeter Tips & Tricks - bit.ly/2NOfWD2
Performance Testing - bit.ly/2wEXbLS
----------- PROGRAMMING -----------
Java Beginners - bit.ly/2PVUcXs
Java Tips & Tricks - bit.ly/2CdcDnJ
GROOVY - bit.ly/2FvWV5C
JAVASCRIPT - bit.ly/2KJDZ8o
----------- IDE -----------
Visual Studio Code - bit.ly/2V15yvt
----------- MAVEN -----------
Maven - bit.ly/2NJdDRS
----------- OTHERS -----------
Redis- bit.ly/2N9jyCG
Misc - bit.ly/2Q2q5xQ
Tools & Tips - bit.ly/2oBfwoR
QnA Friday- bit.ly/2NgwGpw
Sunday Special - bit.ly/2wB23BO
Ask Raghav - bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
Keep Learning,
Raghav
Website - automationstep...
LifeCharger - lifecharger.org/
Udemy Courses - www.udemy.com/...
Facebook - / automationstepbystep
Twitter - / automationsbs
RUclips - / automationstepbystep
Instagram - / automationstepbystep
You can support my mission for education by sharing this knowledge and helping as many people as you can.
Very helpful Raghav, thank you for posting. The microwave example was a clear, common example and your coding walk-through was thorough, and nicely paced. Your final analysis of HOW this abstraction is helpful in changing only code in one (or a few spots) and not having the user care about those changes was particularly helpful.
Hi Ryan, so happy to know this
Best explanation I ever need in this topic. Thank you very much.💚
You're very welcome Mashoor
I very much appreciate this. Thank you very much for having this. It's very helpful.
Glad it was helpful Muriel
That was extremely helpful, thank you. Also, I have that very microwave that you used in your example. :D
Glad it was helpful Erick
You are a great Teacher
My team has used your tutorial, it was truly helpful
So happy to know this
This is very helpful, easy to understand, very easy to follow, thank you Raghav
Most welcome Anthony
Thank you sir, very helpful ❤
Most welcome Shantanu
Perfect explanation...appreciate it...thanks
You're welcome Mohan
nice lesson, thank you very much
You are welcome!
Its not a abstraction. It is a encapsulation example. This information will cause confusion in people, please update it.
will check
Thank you for keeping it nice and simple :)
My pleasure Sama
The way you explain thats too easy man 👍😁
Thanks Saurabh
@@RaghavPal actually i want to thanks you your so Good 👍❤️😘
Playlist done - great refresher ... Looking forward to Es6 topics if you can pls..
Glad to know Shailesh
best explanation sir..
Thanks and welcome
Hello Raghav, declared JS constructor as function . What is the advantage of declaring employee as function instead of constructor. Can't we achieve with constructor the same. Thank you.
Hi Hima
In JavaScript, a constructor is essentially a function that is used to create objects. When we declare a constructor function, we can use the "new" keyword to create new instances of that object.
When you declare an employee as a function, it means that the function can be called directly and does not require the "new" keyword to create an object. This approach is sometimes called a factory function, as it is used to create objects without relying on the constructor pattern.
One advantage of using a factory function is that it can provide more flexibility in creating objects. For example, you can add additional logic to the function to create more complex objects or to enforce certain business rules. This approach can be especially useful when creating objects that require more complex initialization or when creating objects with dynamic properties.
On the other hand, using a constructor can also be useful in certain situations. Constructors provide a standard way to create objects that follow a specific pattern. They also provide a way to encapsulate object initialization logic within the object itself, which can help with code organization and reusability.
Overall, both approaches have their own advantages and disadvantages, and the choice between them depends on the specific needs of your application.
@@RaghavPal thanks so much Raghav for the detailed reply as always
what about closures, callbacks, modules and all? I was really hoping you would have made those videos too
I will plan on that Sowjanya
You give provide the link of the playlist in the description or you can also share the link of your your previous related video
Sure
This is not abstraction. This is encapsulation. Abstraction is implementation details hiding
I will recheck on this
Abstraction is when we hide the complexity of the code, and also not letting the user access some of our functions. We do that by using var,let or const keywords.
If you use the "this" keyword that function will be shown to the user and that wouldn't be abstraction because we are not hiding any complexity for the user + letting the user interact with our code.
Encapsulation is when we combine relative functions and variables in a single unit(object).
So what he is showing in the video is Abstraction, and not encapsulation.
@@dremiq6670
Thanks for your informative reply!
Can you explain this from the user perspective? Who is the user here? And in what way would they be trying to access the internal data? Would they be making changes from the UI or will they be opening up the code and making changes? Im not understanding that. Who are we hiding this data from?
I will do a session
great tutorial man
Thanks Hamza
what font-family are you using in VSCODE ?
don't remember Pawan
Thank you so much brother
You're welcome Minhaj
Thanks for the video. Can anybody explain please why abstraction is explained with constructor function, instead of class like in previous videos about encapsulation, inheritance & polymorphism? Can we 'hide' properties via class in JavaScript? I tried to use #private properties in class, but they are still visible in dev tools inside instantiated objects. Hope my question makes sense.
Hi Anton, this can help - stackoverflow.com/questions/12593917/abstraction-vs-abstract-class
This was extremely helpful sir
But where can get practice questions in your website . I didn't found the practice questions.
Plz reply sir.
I am requesting you
Hi Madhavi, happy to know this helped.
This is my website automationstepbystep.com/
As of now I did not add practice ques on JS here.
HI Raghav, thank you for the videos.. will these cover all the JS concepts.. please advise..
Hi Ravi, Yes it will all foundation concepts
Awesome
Thanks a lot
Very nice….
Thank you
This is not Abstraction. This is Encapsulation.
Hi Ensar, I believe you are thinking of abstract class here, there is difference between abstraction and abstract class concept. Pls check this stackoverflow.com/questions/12593917/abstraction-vs-abstract-class
If abstraction and encapsulation are both hiding data and implementation - what is the difference?
why you didnt use const ?
It depends on the need. You can if you have to
nice!
Thanks for watching
@@RaghavPal Hi Raghav, i have watched all videos from your ''JavaScript tutorials' Playlist. Are these enough to start automating SPA applications? Also, which tool should i pick- WebDriver IO or something else?
how perform dmas rules
Not sure on this Wasim
@@RaghavPal how to perform dmas rules by use classes
Not much info as of now Wasim, can check online
cool :)
thanks for watching
Too fast hard to understand
I will try to do it at a slow pace, For this one you can change speed from player settings