Dependency Injection in OOP

Authors

  • Chandresh Bakliwal 1. Assistant Professor, Information Technology, Arya Institute of Engineering and Technology Author

DOI:

https://doi.org/10.61841/az6tar15

Keywords:

Dependency Injection, Design Pattern, Object Dependencies,, Flexibility, , Modular Design

Abstract

This summary delves into the concept of Dependency Injection (DI) within the context of Object-Oriented Programming (OOP), exploring its importance, mechanisms, and implications in modern software program development. Dependency Injection, a layout pattern in OOP, addresses the project of coping with object dependencies, promoting flexibility, and facilitating the construction of modular, maintainable, and scalable software structures.

At its middle, Dependency Injection involves the external provision of dependencies to an object in preference to having the item create its dependencies internally. This summary scrutinizes the mechanisms thru which DI is implemented, that specialize in strategies inclusive of constructor injection, setter injection, and method injection. These strategies make contributions to a decoupled and loosely coupled structure, taking into consideration the seamless substitution of dependencies, improving code maintainability, and selling the adherence to the Single Responsibility Principle (SRP) in OOP.

The summary underscores the importance of Dependency Injection in attaining the ideas of inversion of manipulate and dependency inversion in OOP. By inverting the manipulate of object introduction and permitting dependencies to be injected from external resources, DI empowers developers to manipulate dependencies greater correctly, fostering modular and extensible software architectures. This technique aligns with the open-closed precept, enabling the extension of functionality without editing current code.

Furthermore, the summary explores the consequences of Dependency Injection in the broader panorama of software program development. The decoupling of components via DI no longer only simplifies unit trying out but additionally promotes the reusability of code modules, enhancing the general agility and flexibility of software program structures. The adoption of DI patterns allows the advent of packages which can be more maintainable, scalable, and resilient to trade, contributing to the lengthy-time period viability and success of OOP-primarily based software program initiatives.

In end, this abstract encapsulates the essence of Dependency Injection in OOP, emphasizing its position in attaining modularity, maintainability, and scalability. By inspecting its mechanisms and implications, this exploration ambitions to provide a complete knowledge of the pivotal role Dependency Injection performs in modern-day software program development in the framework of Object-Oriented Programming.

Downloads

Download data is not yet available.

References

1. Murgia, A.; Tonelli, R.; Counsell, S.; Concas, G.; Marchesi, M. An empirical study of refactoring in the context of FanIn and FanOut coupling. In Proceedings of the 18th Working Conference on Reverse Engineering, Limerick, Ireland, 17–20 October 2011; pp. 372–376.

2. Johnson, R.; Hoeller, J. Expert One-on-One J2EE Development without EJB; Wiley Publishing: Hoboken, NJ, USA, 2004.

3. Razina, E.; Janzen, D.S. Effects of dependency injection on maintainability. In Proceedings of the 11th IASTED International Conference on Software Engineering and Applications, Cambridge, MA, USA, 19–21 November 2007;

pp. 7–12.

4. Yang, H.Y.; Tempero, E.; Melton, H. An empirical study into use of dependency injection in java. In Proceedings of the 19th Australian Conference on Software Engineering, Perth, WA, Australia, 26–28 March 2008.

5. Lee, Y.; Chang, K.H. Reusability and maintainability metrics for object-oriented software. In Proceedings of the 38th Annual on Southeast Regional Conference, Clemson, SC, USA, 7–8 April 2000; pp. 88–94.

6. Crasso, M.; Mateos, C.; Zunino, A.; Campo, M. Empirically assessing the impact of dependency injection on the development of Web Service applications. J. Web Eng. 2010, 9, 66–94.

7. Roubtsov, S.; Serebrenik, A.; van den Brand, M. Detecting modularity “smells” in dependencies injected with Java annotations. In Proceedings of the 14th European Conference on Software Maintenance and Engineering, Madrid, Spain, 15–18 March 2010; pp. 244–247.

8. Okike, E. An Evaluation of Chidamber and Kemerer’s Lack of Cohesion in Method (LCOM) Metric Using Different

Normalization Approaches. Afr. J. Comput. ICT 2008, 1, 35–54.

9. R. K. Kaushik Anjali and D. Sharma, "Analyzing the Effect of Partial Shading on Performance of Grid Connected Solar PV System", 2018 3rd International Conference and Workshops on Recent Advances and Innovations in Engineering (ICRAIE), pp. 1-4, 2018.

Downloads

Published

30.06.2020

How to Cite

Bakliwal, C. (2020). Dependency Injection in OOP. International Journal of Psychosocial Rehabilitation, 24(4), 31295-31298. https://doi.org/10.61841/az6tar15