<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yassin Alm</title>
    <description>The latest articles on DEV Community by Yassin Alm (@yelmach).</description>
    <link>https://dev.to/yelmach</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3656979%2F15e8664e-139f-4c9a-8d4f-47a22747d858.jpg</url>
      <title>DEV Community: Yassin Alm</title>
      <link>https://dev.to/yelmach</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yelmach"/>
    <language>en</language>
    <item>
      <title>Spring Boot IoC &amp; DI: What Actually Happens Under the Hood?</title>
      <dc:creator>Yassin Alm</dc:creator>
      <pubDate>Thu, 11 Dec 2025 10:58:51 +0000</pubDate>
      <link>https://dev.to/yelmach/spring-boot-ioc-di-what-actually-happens-under-the-hood-1ja9</link>
      <guid>https://dev.to/yelmach/spring-boot-ioc-di-what-actually-happens-under-the-hood-1ja9</guid>
      <description>&lt;p&gt;When I started with Spring, annotations like @Autowired felt like magic spells. But relying on "magic" doesn't work in production. To truly master the framework, we have to look under the hood.&lt;/p&gt;

&lt;p&gt;Here is a breakdown of how the Inversion of Control (IoC) container actually works:&lt;/p&gt;

&lt;p&gt;🔹 The Container: Many confuse BeanFactory with ApplicationContext.&lt;/p&gt;

&lt;p&gt;BeanFactory is lazy (instantiates beans only when asked).&lt;/p&gt;

&lt;p&gt;ApplicationContext (the Spring Boot default) is eager. It creates all Singletons at startup to catch configuration errors early.&lt;/p&gt;

&lt;p&gt;🔹 Recipe vs. Meal: Spring doesn't just create objects; it creates BeanDefinitions first. Think of the Definition as the recipe and the actual Bean as the meal.&lt;/p&gt;

&lt;p&gt;🔹 Dependency Injection: Stop using Field Injection (@Autowired on variables).&lt;/p&gt;

&lt;p&gt;Constructor Injection is the industry standard. It ensures immutability, prevents NullPointerExceptions, and makes Unit Testing possible without loading the whole context.&lt;/p&gt;

&lt;p&gt;🔹 The Circular Dependency Trick: How does Spring handle Bean A needing Bean B, which needs Bean A? It uses a clever Three-Level Cache system to expose "raw" bean factories before they are fully initialized.&lt;/p&gt;

&lt;p&gt;Understanding these internals specifically the lifecycle from BeanDefinition to Singleton Cache is often what distinguishes a Junior developer from a Senior Engineer.&lt;/p&gt;

</description>
      <category>designpatterns</category>
      <category>java</category>
      <category>backend</category>
      <category>architecture</category>
    </item>
    <item>
      <title>How do you cache User Profiles with dynamic "Follow" buttons?</title>
      <dc:creator>Yassin Alm</dc:creator>
      <pubDate>Thu, 11 Dec 2025 10:54:53 +0000</pubDate>
      <link>https://dev.to/yelmach/how-do-you-cache-user-profiles-with-dynamic-follow-buttons-19ih</link>
      <guid>https://dev.to/yelmach/how-do-you-cache-user-profiles-with-dynamic-follow-buttons-19ih</guid>
      <description>&lt;p&gt;The Scenario I’m building Postly, a blogging platform using Spring Boot 3. To make profile loading fast, I want to cache the UserProfile object in Redis.&lt;/p&gt;

&lt;p&gt;The Issue The profile page has a "Follow/Unfollow" button.&lt;/p&gt;

&lt;p&gt;If User A views the profile, it says "Follow".&lt;/p&gt;

&lt;p&gt;If User B (who already follows them) views the same profile, it says "Following".&lt;/p&gt;

&lt;p&gt;If I cache the whole Profile DTO in Redis, I risk showing the wrong button state to the wrong user.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>java</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
