Duration 1:00

Dependency Inversion Principle Tutorial with Java Code Example for Beginners

90 watched
0
2
Published 11 Mar 2023

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. ** Topics Covered ** 1. Introduction of Dependency Inversion Principle 2. Real world example of Dependency Inversion Principle 3. Java code implementation of Dependency Inversion Principle 4. Usage of Dependency Inversion Principle 5. Advantage of Dependency Inversion Principle 6. Summary of Dependency Inversion Principle #solidprinciples #dependencyinversion #dependencyinversionprinciple ** GIT Repository ** CodeOneDigest Solid Principles Example https://github.com/codeonedigest/solidprinciples ** CHECK OUT OUR OTHER VIDEOS ** Spring boot project setup: /watch/sxKJe02AgsbAJ Spring Boot Microservice with postgres database Project: /watch/05bEg9Ow4wiwE Prepare Docker file, Container and Build Image: /watch/osunjzTdp_gdn Deploy Docker Image AWS Elastic Container Service: /watch/wzZwuno5RlZ5w Solid Principle Tutorial /watch/EewXfBrZ4d7ZX ** CHECK OUR PLAYLISTS ** Java Design Pattern Complete Tutorial /playlist/PL2NZAYdLkYvglL0xl-4tgBAribrcjeuNH Spring Boot Complete Tutorial /playlist/PL2NZAYdLkYvg_VlNmszrb-Um0wRx5yGDF Docker Containers Complete Tutorial /playlist/PL2NZAYdLkYvhZQo2VTVCSug_zVjekNodi Solid Principles and Object-Oriented Programming Concept and Design /playlist/PL2NZAYdLkYvgB_35bYUnqP1p6v6P2Yb4- ** 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: /channel/UC9V0QYsWKz_OD2uooCtEtRg 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: /channel/UC9V0QYsWKz_OD2uooCtEtRg Twitter: https://twitter.com/codeonedigest Facebook: https://www.facebook.com/codeonedigest Instagram: https://www.instagram.com/codeonedigest/ Linkedin: https://www.linkedin.com/in/codeone-digest-10b418255/ Reddit: https://www.reddit.com/user/codeonedigest Github: https://github.com/codeonedigest Website: https://codeonedigest.wordpress.com/ Tumblr: https://www.tumblr.com/codeonedigest Pinterest: https://in.pinterest.com/codeonedigest/

Category

Show more

Comments - 1