Dependency Inversion Principle Tutorial with Java Code Example for Students
Dependency Inversion Principle Tutorial with Java Code Example for Students
Dependency Inversion Principle is the fifth and final Solid principle. Robert C. Martin’s definition of the Dependency Inversion Principle consists of two parts.
a. High-level modules should not depend on low-level modules. Both should depend on abstractions.
b. Abstractions should not depend on details. Details should depend on abstractions.
An important detail to note here is that high-level and low-level modules depend on the abstraction. It splits the dependency between the high-level and low-level modules by introducing an abstraction between them. Dependency inversion principle is related to other SOLID principles. That is, if you consequently apply the Open/Closed Principle and Liskov Substitution Principle in your code, it will automatically compliance with Dependency Inversion Principle.
Dependency Inversion principle introduces an interface abstraction between higher-level and lower-level software components to remove the dependencies between them. This aims to reduce the coupling between the classes by introducing abstraction between the layer.
** Use of Dependency Inversion Principle **
1. Use Dependency Inversion principle if you want high level class should not depends on low level classes.
2. Use Dependency Inversion if you want high level and low-level classes depends on abstractions.
3. Use Dependency Inversion if you Abstraction (interface or abstract class) should not depend on detail but detail (implementation class) should depend on abstraction
4. Use Dependency Inversion when you don’t want to achieve loose coupling between classes.
** Benefits of Dependency Inversion Principle **
1. Dependency Inversion principle ensures loose coupling between classes.
2. Dependency Inversion Principle make sure high-level class not dependent on low level classes.
3. Dependency Inversion principle makes sure abstraction should not depend on detail but details should depend on abstraction.
** Chapter Timestamps **
0:00 Welcome to Dependency Inversion Principle
1:25 Agenda of Dependency Inversion Principle Tutorial
2:24 Introduction to Dependency Inversion Principle
5:26 Real World Examples of Dependency Inversion Principle
7:22 Java Code Example of Dependency Inversion Principle
12:52 Usage of Dependency Inversion Principle
13:39 Advantages of Dependency Inversion Principle
14:01 Summary of Dependency Inversion Principle
#solidprinciples #dependencyinversion #dependencyinversionprinciple
** GIT Repository **
CodeOneDigest Solid Principles Example https://github.com/codeonedigest/soli...
** CHECK OUT OUR OTHER VIDEOS **
Spring boot project setup:
• Spring boot Proje...
Spring Boot Microservice with postgres database Project:
• Spring Boot Micro...
Prepare Docker file, Container and Build Image:
• Docker Tutorial f...
Deploy Docker Image AWS Elastic Container Service:
• Deploy Springboot...
Solid Principle Tutorial
• Solid Principles ...
** CHECK OUR PLAYLISTS **
Java Design Pattern Complete Tutorial
• Java Design Patte...
Spring Boot Complete Tutorial
• Spring Boot Tutor...
Docker Containers Complete Tutorial
• Cloud & Container...
Solid Principles and Object-Oriented Programming Concept and Design
• Solid Principles ...
** Acronyms **
OOP – Object Oriented Programming Languages
SRP – Single Responsibility Principle
OCP – Open Closed Principle
LSP – Liskov Substitution Principle
ISP – Dependency Inversion Principle
DIP – Dependency Inversion Principle
COD – Code One Digest
** ABOUT OUR CHANNEL **
CodeOneDigest is a youtube channel that produces videos on programming languages, cloud and container technologies, Software design principles, Java frameworks in English and Hindi languages.
Dosto, CodeOneDigest youtube channel pe aapko programming languages, container technology, cloud computing, software engineering se related videos milenge.
Check out our channel here:
/ @codeonedigest
Don’t forget to subscribe!
** OUR WEBSITE **
https://codeonedigest.wordpress.com/
** GET IN TOUCH **
Email us on codeonedigest@gmail.com
FOLLOW US ON SOCIAL - LIKE, SHARE & SUBSCRIBE
Get updates or reach out to Get updates on our Social Media Profiles!
Subscribe: https://bit.ly/3NeWQ8U
Youtube:
/ @codeonedigest
Twitter: https://twitter.com/codeonedigest
Facebook: https://www.facebook.com/codeonedigest
Instagram: https://www.instagram.com/codeonedigest/
Linkedin: https://www.linkedin.com/in/codeone-d...
Reddit: https://www.reddit.com/user/codeonedi...
Github: https://github.com/codeonedigest
Website: https://codeonedigest.wordpress.com/
Tumblr: https://www.tumblr.com/codeonedigest
Pinterest: https://in.pinterest.com/codeonedigest/
Comments
Post a Comment