<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rajesh vijayakumar on Medium]]></title>
        <description><![CDATA[Stories by Rajesh vijayakumar on Medium]]></description>
        <link>https://medium.com/@rajeshvijayakumar5?source=rss-2e8467908e6b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rUGPvPcNNZ3lCHjQfxn7HQ.jpeg</url>
            <title>Stories by Rajesh vijayakumar on Medium</title>
            <link>https://medium.com/@rajeshvijayakumar5?source=rss-2e8467908e6b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:17:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajeshvijayakumar5/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Managing Dependencies in Java and Spring: Traditional Flow vs. IoC]]></title>
            <link>https://medium.com/@rajeshvijayakumar5/managing-dependencies-in-java-and-spring-traditional-flow-vs-ioc-ed69ea5bfccc?source=rss-2e8467908e6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed69ea5bfccc</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[inversion-of-control]]></category>
            <category><![CDATA[spring]]></category>
            <dc:creator><![CDATA[Rajesh vijayakumar]]></dc:creator>
            <pubDate>Tue, 10 Dec 2024 20:49:48 GMT</pubDate>
            <atom:updated>2024-12-10T20:49:48.317Z</atom:updated>
            <content:encoded><![CDATA[<p>Managing dependencies efficiently is essential for creating scalable and maintainable software applications. There are two key approaches for managing dependencies: <strong>Traditional Control Flow</strong> and <strong>Inversion of Control (IoC)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*egzMy9WClyktZZDptSysRg.png" /></figure><p>In the <strong>traditional approach</strong>, dependencies are manually created and managed within the application, often using the new keyword in Java. This leads to <strong>tight coupling</strong> between the application and its dependencies, making it difficult to scale or adapt the application as requirements evolve.</p><p>On the other hand, with <strong>Inversion of Control (IoC)</strong>, the application simply declares the dependencies it needs, and an <strong>IoC container</strong> takes responsibility for managing and injecting these dependencies. This shift of responsibility from the application to the IoC container reduces tight coupling and promotes more flexible and modular code.</p><p>A significant benefit of IoC is that it allows developers to focus on the core <strong>business logic</strong>, without having to spend time writing boilerplate code for dependency management. In larger projects, where the codebase might contain thousands of classes with numerous dependencies, manually managing these dependencies becomes cumbersome and error-prone. By delegating this task to the IoC container, developers can concentrate on solving actual business problems instead of worrying about how objects are instantiated and wired together.</p><p>IoC can be implemented through several design patterns, such as <strong>Dependency Injection (DI)</strong>, <strong>Service Locator</strong>, <strong>Factory Pattern</strong>, and others. In the <strong>Spring Framework</strong>, <strong>DI</strong> is commonly used to achieve IoC. DI injects dependencies using methods like <strong>Constructor Injection</strong>, <strong>Setter Injection</strong>, or <strong>Field Injection</strong>, which are configured through metadata.</p><p>While <strong>IoC</strong> is the high level Abstraction of delegating control over dependency management, <strong>DI</strong> is a specific mechanism used to implement it. Together, they reduce tight coupling and improve maintainability.</p><blockquote><strong>Stay tuned for the next post, where we’ll explore how DI, combined with composition and polymorphism, helps achieve loose coupling!</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed69ea5bfccc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>