<?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: Mujuzi Moses </title>
    <description>The latest articles on DEV Community by Mujuzi Moses  (@iammujuzimoses).</description>
    <link>https://dev.to/iammujuzimoses</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4047712%2F587b42d5-249c-4822-8f51-79620adb4972.PNG</url>
      <title>DEV Community: Mujuzi Moses </title>
      <link>https://dev.to/iammujuzimoses</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iammujuzimoses"/>
    <language>en</language>
    <item>
      <title>🚀 Building Spring by Example V2: Completing Module 03 - Reactive Spring</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Tue, 13 Oct 2026 10:37:55 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-v2-completing-module-03-reactive-spring-3f2e</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-v2-completing-module-03-reactive-spring-3f2e</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example-v2&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 03 - Reactive Spring!&lt;/strong&gt; 🎉&lt;/p&gt;

&lt;p&gt;This module was an opportunity to explore a different way of building applications with Spring. Rather than focusing only on traditional blocking operations, I explored reactive programming, asynchronous data processing, and how Spring WebFlux works with Project Reactor.&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project Reactor&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Mono&lt;/code&gt; and &lt;code&gt;Flux&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reactive Pipelines&lt;/li&gt;
&lt;li&gt;Backpressure&lt;/li&gt;
&lt;li&gt;Spring WebFlux&lt;/li&gt;
&lt;li&gt;Reactive Controllers&lt;/li&gt;
&lt;li&gt;Reactive Clients&lt;/li&gt;
&lt;li&gt;Reactive Data Access&lt;/li&gt;
&lt;li&gt;Reactive Error Handling&lt;/li&gt;
&lt;li&gt;Reactive Testing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Understanding Mono and Flux
&lt;/h2&gt;

&lt;p&gt;One of the first things I explored was the difference between &lt;code&gt;Mono&lt;/code&gt; and &lt;code&gt;Flux&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In Project Reactor, these are two fundamental types for representing asynchronous sequences of data.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;Mono&lt;/code&gt; represents a sequence that produces at most one item, while a &lt;code&gt;Flux&lt;/code&gt; represents a sequence that can produce zero to many items.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Mono&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;greeting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Mono&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;just&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, Spring!"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="nc"&gt;Flux&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;greetings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Flux&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;just&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"from"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Reactive Spring"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These types don't simply represent values or collections. They represent publishers that can participate in a reactive pipeline.&lt;/p&gt;

&lt;p&gt;That distinction helped me understand why reactive code often looks different from traditional Java code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building Reactive Pipelines
&lt;/h2&gt;

&lt;p&gt;After learning the basics, I explored how reactive pipelines are composed.&lt;/p&gt;

&lt;p&gt;Instead of processing data through a sequence of blocking method calls, Reactor allows operations to be chained together using operators such as &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, and &lt;code&gt;flatMap&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Flux&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Flux&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;just&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Moses"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"John"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Mary"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="nc"&gt;Flux&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;filteredNames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;filter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;map&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;String:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;toUpperCase&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the pipeline filters the names and transforms the remaining values.&lt;/p&gt;

&lt;p&gt;Exploring these operators helped me understand how data flows through a reactive sequence and how individual operations can be composed into larger processing pipelines.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Backpressure
&lt;/h2&gt;

&lt;p&gt;Backpressure was another important concept in this module.&lt;/p&gt;

&lt;p&gt;A publisher may produce data faster than a subscriber can process it. Backpressure provides a mechanism through which demand can be communicated so that data processing can be better coordinated.&lt;/p&gt;

&lt;p&gt;This introduced me to the relationship between publishers, subscribers, and demand in reactive streams.&lt;/p&gt;

&lt;p&gt;It also helped me understand that reactive programming isn't simply about using asynchronous APIs. It involves thinking carefully about how data is produced, consumed, and managed throughout a pipeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bringing Reactive Programming into Spring WebFlux
&lt;/h2&gt;

&lt;p&gt;Once I had explored the Reactor fundamentals, I moved into Spring WebFlux.&lt;/p&gt;

&lt;p&gt;I worked through reactive controllers, reactive clients, and reactive data access to understand how reactive programming fits into a Spring application.&lt;/p&gt;

&lt;p&gt;One of the important distinctions I explored was that returning a &lt;code&gt;Mono&lt;/code&gt; or &lt;code&gt;Flux&lt;/code&gt; from a controller doesn't automatically make every operation in the application non-blocking.&lt;/p&gt;

&lt;p&gt;The underlying operations matter too.&lt;/p&gt;

&lt;p&gt;For example, a reactive controller that calls a blocking database driver can still introduce blocking work into the request-processing flow.&lt;/p&gt;

&lt;p&gt;Understanding this distinction helped me appreciate why WebFlux works best when the application uses compatible non-blocking components throughout the relevant execution path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reactive Error Handling
&lt;/h2&gt;

&lt;p&gt;Errors are an inevitable part of application development, and reactive pipelines introduce their own ways of handling them.&lt;/p&gt;

&lt;p&gt;I explored how errors propagate through a pipeline and how Reactor operators can be used to recover from certain failures.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Mono&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Mono&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;IllegalStateException&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Something went wrong"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;onErrorReturn&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Fallback value"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of allowing the error to terminate the sequence without recovery, &lt;code&gt;onErrorReturn&lt;/code&gt; provides a fallback value.&lt;/p&gt;

&lt;p&gt;This helped me understand error handling as part of the reactive pipeline rather than treating it as something separate from the data-processing flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing Reactive Applications
&lt;/h2&gt;

&lt;p&gt;One of my favourite parts of this module was reactive testing.&lt;/p&gt;

&lt;p&gt;Testing reactive code requires more than checking the final value returned by a method. Depending on the behavior being tested, we may also need to verify emitted items, completion signals, errors, timing, and demand.&lt;/p&gt;

&lt;p&gt;I explored &lt;code&gt;StepVerifier&lt;/code&gt; from Project Reactor's testing utilities.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;StepVerifier&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Flux&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;just&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Spring"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"WebFlux"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Reactor"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;expectNext&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Spring"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;expectNext&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"WebFlux"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;expectNext&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Reactor"&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;verifyComplete&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This test verifies the sequence of emitted values and confirms that the publisher completes successfully.&lt;/p&gt;

&lt;p&gt;I also explored:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;WebTestClient&lt;/code&gt;&lt;/strong&gt; for testing reactive web endpoints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Virtual-time testing&lt;/strong&gt; for time-dependent reactive sequences without waiting for real delays.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error testing&lt;/strong&gt; for verifying how publishers behave when failures occur.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backpressure testing&lt;/strong&gt; for checking how publishers respond to subscriber demand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These examples helped me see that reactive behavior can be tested explicitly rather than relying only on assumptions about how the pipeline should work.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Took Away from This Module
&lt;/h2&gt;

&lt;p&gt;The biggest lesson from this module is that &lt;strong&gt;reactive programming is not just about replacing return types with &lt;code&gt;Mono&lt;/code&gt; and &lt;code&gt;Flux&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's about understanding asynchronous sequences, composing operations, handling errors, managing demand, and choosing the right components for the execution model.&lt;/p&gt;

&lt;p&gt;I also learned to pay more attention to the difference between writing reactive code and building an application that is genuinely non-blocking across its relevant processing path.&lt;/p&gt;

&lt;p&gt;As with the previous modules, the goal wasn't to build one large application that uses every feature.&lt;/p&gt;

&lt;p&gt;It was to create small, focused examples that make each concept easier to understand, test, and revisit later.&lt;/p&gt;

&lt;p&gt;With Spring Data and Reactive Spring now complete, &lt;strong&gt;spring-by-example-v2&lt;/strong&gt; continues to grow as a practical learning resource covering different parts of the Spring ecosystem.&lt;/p&gt;

&lt;p&gt;The project is open source, and I'm continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example-v2" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitLab: &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example-v2" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Completing &lt;strong&gt;Module 03 - Reactive Spring&lt;/strong&gt; feels like another important milestone in this journey. 🚀&lt;/p&gt;

&lt;p&gt;There are still more Spring concepts to explore, more examples to build, and more things to learn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One focused example at a time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you've worked with reactive programming in Spring, &lt;strong&gt;what was the biggest learning curve for you - understanding Reactor, handling backpressure, testing reactive pipelines, or knowing when to choose WebFlux over Spring MVC?&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Java #SpringFramework #SpringBoot #ProjectReactor #SpringWebFlux #ReactiveProgramming #OpenSource #LearningInPublic #BackendDevelopment #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example V2: Completing Module 02 -Spring Data</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Wed, 07 Oct 2026 13:58:37 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-v2-completing-module-02-spring-data-12kf</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-v2-completing-module-02-spring-data-12kf</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 02 - Spring Data&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;This module took me from the fundamentals of Spring Data repositories to more advanced ways of querying, mapping, and testing data.&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spring Data Repositories&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CrudRepository&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Query Methods&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@Query&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Entity Mapping&lt;/li&gt;
&lt;li&gt;Entity Relationships&lt;/li&gt;
&lt;li&gt;Transactions&lt;/li&gt;
&lt;li&gt;Pagination&lt;/li&gt;
&lt;li&gt;Specifications&lt;/li&gt;
&lt;li&gt;Projections&lt;/li&gt;
&lt;li&gt;Auditing&lt;/li&gt;
&lt;li&gt;Custom Repositories&lt;/li&gt;
&lt;li&gt;Database Testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing I really enjoyed about this module was seeing how much Spring Data can handle while still allowing you to take control when you need to.&lt;/p&gt;

&lt;p&gt;I started with repository abstractions and &lt;code&gt;CrudRepository&lt;/code&gt;, then explored how Spring Data can derive queries directly from method names.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;findByAgeGreaterThan&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's no SQL or JPQL in the method itself, but Spring Data can interpret the method name and create the appropriate query.&lt;/p&gt;

&lt;p&gt;From there, I explored &lt;code&gt;@Query&lt;/code&gt; for cases where defining the query explicitly makes more sense.&lt;/p&gt;

&lt;p&gt;Then came entity mapping and relationships.&lt;/p&gt;

&lt;p&gt;Working with &lt;code&gt;@OneToOne&lt;/code&gt;, &lt;code&gt;@OneToMany&lt;/code&gt;, &lt;code&gt;@ManyToOne&lt;/code&gt;, and &lt;code&gt;@ManyToMany&lt;/code&gt; helped me understand how object relationships are represented in the persistence layer rather than simply treating entities as isolated classes.&lt;/p&gt;

&lt;p&gt;Transactions were another important part of the module.&lt;/p&gt;

&lt;p&gt;I explored how multiple database changes can be grouped into a single transactional operation and, more importantly, how a failure partway through an operation can cause those changes to be rolled back.&lt;/p&gt;

&lt;p&gt;Pagination and Specifications then showed two different ways of building more flexible queries.&lt;/p&gt;

&lt;p&gt;With Specifications, I could compose criteria dynamically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Specification&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;specification&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
        &lt;span class="nc"&gt;PersonSpecifications&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nameContains&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Jan"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;and&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PersonSpecifications&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ageGreaterThan&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Projections introduced another useful idea: sometimes you don't need the entire entity.&lt;/p&gt;

&lt;p&gt;Instead, you can retrieve only the data required by a particular use case.&lt;/p&gt;

&lt;p&gt;I also explored auditing with annotations such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@CreatedDate&lt;/span&gt;
&lt;span class="nd"&gt;@LastModifiedDate&lt;/span&gt;
&lt;span class="nd"&gt;@CreatedBy&lt;/span&gt;
&lt;span class="nd"&gt;@LastModifiedBy&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helped me understand how Spring Data can automatically track information about when an entity was created or modified and who performed the operation.&lt;/p&gt;

&lt;p&gt;Custom repositories were another interesting step.&lt;/p&gt;

&lt;p&gt;Instead of relying entirely on derived queries and &lt;code&gt;@Query&lt;/code&gt;, I explored repository fragments and how a custom implementation can be composed with a Spring Data repository.&lt;/p&gt;

&lt;p&gt;Finally, I finished the module with database testing.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;@DataJpaTest&lt;/code&gt;, H2, and &lt;code&gt;@Sql&lt;/code&gt;, I explored how repository behavior can be tested against an actual database rather than relying only on mocks.&lt;/p&gt;

&lt;p&gt;That distinction was particularly useful because a mocked repository cannot tell you whether a JPQL query, entity mapping, or derived query actually works against the database.&lt;/p&gt;

&lt;p&gt;The goal isn’t just to learn how to write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;PersonRepository&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bigger goal is to understand what Spring Data is doing for me, where its conventions help, and when I should take more control.&lt;/p&gt;

&lt;p&gt;The project is open source, and I’m continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example-v2" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitLab: &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example-v2" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing &lt;strong&gt;Module 02 - Spring Data&lt;/strong&gt; feels like another important milestone. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up: Module 03 - Reactive Spring&lt;/strong&gt; - moving from traditional blocking application development into reactive programming with Spring.&lt;/p&gt;

&lt;p&gt;One focused example at a time. 🚀&lt;/p&gt;

&lt;p&gt;If you’ve worked with Spring Data before, &lt;strong&gt;which feature do you find most useful in your day-to-day development - derived queries, Specifications, projections, transactions, or something else?&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #springdata #springboot #opensource #github #learninginpublic #backend #softwareengineering
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🚀 Starting Spring by Example V2: Completing Module 01 -Spring Security</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Wed, 30 Sep 2026 10:38:53 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/starting-spring-by-example-v2-completing-module-01-spring-security-21pc</link>
      <guid>https://dev.to/iammujuzimoses/starting-spring-by-example-v2-completing-module-01-spring-security-21pc</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed that many tutorials showed &lt;strong&gt;how to use Spring features&lt;/strong&gt;, but didn't always explain how the different pieces fit together.&lt;/p&gt;

&lt;p&gt;I learn best by building and documenting what I discover, so I started &lt;strong&gt;Spring by Example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: build small, focused examples that explore specific Spring concepts through code, tests, and documentation.&lt;/p&gt;

&lt;p&gt;After completing the first version of the project, I decided to start a new chapter: &lt;strong&gt;Spring by Example V2&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why V2?
&lt;/h2&gt;

&lt;p&gt;V2 keeps the same philosophy but expands the scope.&lt;/p&gt;

&lt;p&gt;The goal is to explore the &lt;strong&gt;modern Spring ecosystem&lt;/strong&gt; through small but extensive examples, covering areas such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Spring Security&lt;/li&gt;
&lt;li&gt;Spring Data&lt;/li&gt;
&lt;li&gt;Reactive Spring&lt;/li&gt;
&lt;li&gt;Spring Modulith&lt;/li&gt;
&lt;li&gt;Spring Testing&lt;/li&gt;
&lt;li&gt;Capstone Application&lt;/li&gt;
&lt;li&gt;Spring Batch&lt;/li&gt;
&lt;li&gt;Spring Integration&lt;/li&gt;
&lt;li&gt;Spring Cloud&lt;/li&gt;
&lt;li&gt;Spring AI&lt;/li&gt;
&lt;li&gt;GraalVM Native&lt;/li&gt;
&lt;li&gt;Kotlin&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Small examples. Extensive coverage.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And I'm happy to say that &lt;strong&gt;Module 01 - Spring Security is now complete!&lt;/strong&gt; 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Module 01 - Spring Security
&lt;/h2&gt;

&lt;p&gt;The module contains focused examples covering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic Spring Security&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SecurityFilterChain&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Authentication&lt;/li&gt;
&lt;li&gt;&lt;code&gt;UserDetailsService&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Password Encoding&lt;/li&gt;
&lt;li&gt;Authorization&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SecurityContext&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Method Security&lt;/li&gt;
&lt;li&gt;CSRF Protection&lt;/li&gt;
&lt;li&gt;Session Management&lt;/li&gt;
&lt;li&gt;OAuth2 Login&lt;/li&gt;
&lt;li&gt;JWT Authentication&lt;/li&gt;
&lt;li&gt;Spring Security Testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the biggest things I wanted to understand was how these pieces fit together.&lt;/p&gt;

&lt;p&gt;A simplified view looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP Request
     ↓
Security Filter Chain
     ↓
Authentication
     ↓
Authorization
     ↓
SecurityContext
     ↓
Application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal wasn’t simply to memorize Spring Security annotations.&lt;/p&gt;

&lt;p&gt;It was to understand what each component does, where it fits, and how the pieces work together.&lt;/p&gt;

&lt;p&gt;That’s the approach I want to continue throughout V2.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next?
&lt;/h2&gt;

&lt;p&gt;With Spring Security complete, Module 02 - Spring Data is next.&lt;/p&gt;

&lt;p&gt;I’ll be exploring repositories, entity mapping, queries, pagination, specifications, auditing, projections, transactions, and custom repository implementations.&lt;/p&gt;

&lt;p&gt;The project is open source:&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example-v2" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitLab: &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example-v2" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One focused example at a time. 🚀&lt;/p&gt;

&lt;p&gt;If you’ve worked with Spring Security before, what part helped you understand it better?&lt;/p&gt;

&lt;h1&gt;
  
  
  java #spring #springframework #springboot #springsecurity #opensource #github #learninginpublic #backend #softwareengineering #programming
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the OpenMRS Examples Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Wed, 23 Sep 2026 11:58:45 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-openmrs-examples-module-2f68</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-openmrs-examples-module-2f68</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always what was happening behind the scenes or how the different pieces of the framework worked together.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 14 - OpenMRS Examples&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;But this milestone is a little more significant than completing another module.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Module 14 is the final module and final example of Spring by Example V1.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That means &lt;strong&gt;V1 of spring-by-example is now complete.&lt;/strong&gt; 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  From Learning Spring to Studying Real-World Code
&lt;/h2&gt;

&lt;p&gt;This module was different from the previous ones because it moved away from studying Spring only through isolated examples and focused on how Spring concepts are applied in a &lt;strong&gt;real-world, open-source application&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For this module, I used &lt;strong&gt;OpenMRS&lt;/strong&gt; as the real-world reference.&lt;/p&gt;

&lt;p&gt;OpenMRS is an open-source electronic medical record platform, and its codebase provided a much more realistic environment for exploring how Spring is used in a large application.&lt;/p&gt;

&lt;p&gt;Instead of simply asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How does this Spring feature work?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I wanted to ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How is this Spring feature actually used in a real application?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Why was it implemented this way?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The goal of this module was not to reproduce the entire OpenMRS codebase.&lt;/p&gt;

&lt;p&gt;Instead, I created focused examples based on patterns and concepts found in OpenMRS, while keeping each example small enough to understand independently.&lt;/p&gt;

&lt;p&gt;The module explored areas such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Service Registration&lt;/li&gt;
&lt;li&gt;Module Loading&lt;/li&gt;
&lt;li&gt;XML to Java Configuration&lt;/li&gt;
&lt;li&gt;&lt;code&gt;OpenmrsBeanRegistrar&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ServiceContext&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;AOP in OpenMRS&lt;/li&gt;
&lt;li&gt;Transaction Management&lt;/li&gt;
&lt;li&gt;Custom Spring Profiles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the things I found particularly valuable was seeing how the concepts from the previous modules connect when they're no longer isolated examples.&lt;/p&gt;

&lt;p&gt;For example, after learning about dependency injection, bean definitions, &lt;code&gt;BeanPostProcessor&lt;/code&gt;, transactions, and AOP proxies, it's one thing to understand each concept individually.&lt;/p&gt;

&lt;p&gt;It's another thing to encounter them together in a real application and understand &lt;strong&gt;why they are there and how they interact&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That was one of the main goals of this module.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Journey Through V1
&lt;/h2&gt;

&lt;p&gt;The progression of &lt;strong&gt;Spring by Example V1&lt;/strong&gt; now looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Spring Core
     │
     ▼
Dependency Injection
     │
     ▼
Bean Lifecycle
     │
     ▼
Events
     │
     ▼
AOP
     │
     ▼
Transactions
     │
     ▼
Spring Boot
     │
     ▼
Spring MVC
     │
     ▼
Testing
     │
     ▼
Advanced Spring
     │
     ▼
Spring Internals
     │
     ▼
OpenMRS Examples
     │
     ▼
   V1 DONE 🎉
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looking back at the progression, each module added another layer of understanding.&lt;/p&gt;

&lt;p&gt;I started with the fundamentals of Spring and gradually moved into dependency injection, bean lifecycle, events, AOP, transactions, Spring Boot, Spring MVC, testing, and more advanced Spring concepts.&lt;/p&gt;

&lt;p&gt;Then I went deeper into &lt;strong&gt;Spring Internals&lt;/strong&gt; to understand what was happening behind many of those features.&lt;/p&gt;

&lt;p&gt;Finally, &lt;strong&gt;OpenMRS Examples&lt;/strong&gt; brought those ideas into the context of a real-world application.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Took Away
&lt;/h2&gt;

&lt;p&gt;One of the biggest lessons from this journey is that understanding a framework isn't only about knowing its annotations and APIs.&lt;/p&gt;

&lt;p&gt;It's also about understanding how those pieces are used together to solve problems in a larger system.&lt;/p&gt;

&lt;p&gt;A simple annotation such as &lt;code&gt;@Autowired&lt;/code&gt; or &lt;code&gt;@Transactional&lt;/code&gt; can look straightforward when used in a small example.&lt;/p&gt;

&lt;p&gt;In a real application, however, it can be connected to configuration, proxies, bean lifecycle processing, transactions, service layers, persistence, testing, and many other parts of the system.&lt;/p&gt;

&lt;p&gt;Looking at these interactions made the concepts from the earlier modules feel much more concrete.&lt;/p&gt;

&lt;p&gt;The goal of the project was never to simply collect Spring annotations and interfaces.&lt;/p&gt;

&lt;p&gt;I wanted to understand &lt;strong&gt;how Spring works, why these features exist, and how the different pieces fit together&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Building small examples made the concepts easier to explore.&lt;/p&gt;

&lt;p&gt;Studying Spring's internals helped me understand what was happening underneath.&lt;/p&gt;

&lt;p&gt;And studying OpenMRS helped me see how those concepts can come together in a much larger application.&lt;/p&gt;

&lt;h2&gt;
  
  
  V1 Is Complete
&lt;/h2&gt;

&lt;p&gt;After all the modules, examples, tests, documentation, and experiments, &lt;strong&gt;Spring by Example V1 is officially complete.&lt;/strong&gt; 🎉&lt;/p&gt;

&lt;p&gt;This isn't the end of the project.&lt;/p&gt;

&lt;p&gt;It's the end of &lt;strong&gt;V1&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The project started as a way for me to learn Spring by building small examples instead of simply reading about the framework.&lt;/p&gt;

&lt;p&gt;Over time, it grew into a structured journey through different areas of the Spring ecosystem.&lt;/p&gt;

&lt;p&gt;And now I have a complete V1 that I can look back on as a record of what I learned.&lt;/p&gt;

&lt;p&gt;The next stage will be about deciding what &lt;strong&gt;Spring by Example V2&lt;/strong&gt; should look like and where to take the project from here.&lt;/p&gt;

&lt;p&gt;For now, though, I'm taking a moment to appreciate reaching this milestone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14 modules.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One focused example at a time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spring by Example V1 — complete.&lt;/strong&gt; 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Open Source
&lt;/h2&gt;

&lt;p&gt;The project is open source, and the complete V1 is available here:&lt;/p&gt;

&lt;p&gt;🔗 GitLab &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitHub &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Completing &lt;strong&gt;Module 14 - OpenMRS Examples&lt;/strong&gt; helped me connect those concepts to a real-world application.&lt;/p&gt;

&lt;p&gt;And completing Module 14 means something even bigger:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The final example of Spring by Example V1 is complete.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but reaching this milestone feels like an important point in the journey. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spring by Example V1 — DONE.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, let's see what V2 brings.&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #opensource #github #learninginpublic #backend #softwareengineering #spring #springboot #openmrs #programming
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the Spring Internals Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Fri, 18 Sep 2026 12:31:13 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-internals-module-1fcg</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-internals-module-1fcg</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always what was happening behind the scenes or how the different pieces of the framework worked together.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 13 - Spring Internals&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;This module was particularly interesting because it went beyond using Spring features and focused on understanding &lt;strong&gt;what happens behind the scenes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of simply writing &lt;code&gt;@Autowired&lt;/code&gt;, &lt;code&gt;@Transactional&lt;/code&gt;, or &lt;code&gt;@Component&lt;/code&gt; and letting Spring handle everything, I wanted to understand what Spring is actually doing with those annotations and how the different pieces of the container work together.&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How Beans Are Registered&lt;/li&gt;
&lt;li&gt;How Dependency Injection Works&lt;/li&gt;
&lt;li&gt;How Component Scanning Works&lt;/li&gt;
&lt;li&gt;How &lt;code&gt;@Autowired&lt;/code&gt; Works&lt;/li&gt;
&lt;li&gt;How &lt;code&gt;@Transactional&lt;/code&gt; Works&lt;/li&gt;
&lt;li&gt;How AOP Proxies Are Created&lt;/li&gt;
&lt;li&gt;How Bean Post Processors Work&lt;/li&gt;
&lt;li&gt;Understanding &lt;code&gt;DefaultListableBeanFactory&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Understanding &lt;code&gt;ConfigurationClassPostProcessor&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the first things I explored was &lt;strong&gt;how beans are registered&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I already knew that Spring manages beans, but looking at &lt;code&gt;BeanDefinition&lt;/code&gt; and &lt;code&gt;DefaultListableBeanFactory&lt;/code&gt; helped me understand an important distinction: &lt;strong&gt;registering a bean definition is not the same thing as creating the bean itself&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Spring can first work with metadata describing a bean and later use that metadata to create and manage the actual object.&lt;/p&gt;

&lt;p&gt;That led naturally into &lt;strong&gt;dependency injection&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of looking at dependency injection only from the perspective of annotations, I explored concepts such as &lt;code&gt;DependencyDescriptor&lt;/code&gt;, &lt;code&gt;MethodParameter&lt;/code&gt;, and &lt;code&gt;resolveDependency()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This helped me see dependency injection as a process of identifying an injection point, resolving the required dependency, and obtaining the appropriate bean from the container.&lt;/p&gt;

&lt;p&gt;Then I explored &lt;strong&gt;component scanning&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;@Component&lt;/code&gt; is something I've done many times, but looking at &lt;code&gt;ClassPathBeanDefinitionScanner&lt;/code&gt; made the process much clearer.&lt;/p&gt;

&lt;p&gt;A class annotated with &lt;code&gt;@Component&lt;/code&gt; doesn't magically become a Spring bean. Spring has to discover it during scanning, create a corresponding &lt;code&gt;BeanDefinition&lt;/code&gt;, and register that definition with the container.&lt;/p&gt;

&lt;p&gt;Then came &lt;strong&gt;&lt;code&gt;@Autowired&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;One of the most useful lessons here was understanding that &lt;code&gt;@Autowired&lt;/code&gt; itself doesn't perform the injection.&lt;/p&gt;

&lt;p&gt;It provides metadata that &lt;code&gt;AutowiredAnnotationBeanPostProcessor&lt;/code&gt; detects and processes.&lt;/p&gt;

&lt;p&gt;I also explored &lt;strong&gt;&lt;code&gt;@Transactional&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Rather than hiding transaction management behind Spring's higher-level configuration, I worked directly with &lt;code&gt;TransactionInterceptor&lt;/code&gt;, &lt;code&gt;TransactionAttributeSource&lt;/code&gt;, &lt;code&gt;AnnotationTransactionAttributeSource&lt;/code&gt;, and &lt;code&gt;PlatformTransactionManager&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Another particularly interesting part was &lt;strong&gt;AOP proxy creation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I used &lt;code&gt;ProxyFactory&lt;/code&gt; and &lt;code&gt;MethodInterceptor&lt;/code&gt; to see how a proxy can sit between the caller and the target object.&lt;/p&gt;

&lt;p&gt;Then I looked at &lt;strong&gt;BeanPostProcessor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This was another important piece of the puzzle because it showed how Spring can intercept and modify bean instances during their lifecycle.&lt;/p&gt;

&lt;p&gt;I also explored how a post processor can return the original bean or even replace it with another object.&lt;/p&gt;

&lt;p&gt;After working with all these individual mechanisms, I reached &lt;strong&gt;&lt;code&gt;DefaultListableBeanFactory&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This was probably one of the most important pieces for putting everything together.&lt;/p&gt;

&lt;p&gt;It helped me see why the bean factory is so central to Spring's internals.&lt;/p&gt;

&lt;p&gt;It brings together responsibilities around bean definitions, bean lookup, dependency resolution, singleton management, and bean creation.&lt;/p&gt;

&lt;p&gt;Finally, I explored &lt;strong&gt;&lt;code&gt;ConfigurationClassPostProcessor&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This connected many of the concepts from earlier examples.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@Configuration&lt;/code&gt;, &lt;code&gt;@Bean&lt;/code&gt;, &lt;code&gt;@ComponentScan&lt;/code&gt;, and &lt;code&gt;@Import&lt;/code&gt; are all configuration metadata that Spring needs to process.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ConfigurationClassPostProcessor&lt;/code&gt; participates in turning that configuration metadata into bean definitions that can ultimately be managed by the bean factory.&lt;/p&gt;

&lt;p&gt;The bigger picture started to look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Configuration Metadata
        │
        ▼
ConfigurationClassPostProcessor
        │
        ▼
BeanDefinitions
        │
        ▼
DefaultListableBeanFactory
        │
        ▼
Dependency Resolution
        │
        ▼
Bean Creation
        │
        ▼
BeanPostProcessors
        │
        ├── @Autowired
        └── AOP-related processing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course, this is a simplified model of Spring's internals, but having this mental model makes the framework feel much less like magic.&lt;/p&gt;

&lt;p&gt;And I think that's what made this module particularly valuable.&lt;/p&gt;

&lt;p&gt;The goal wasn't just to learn more Spring classes or memorize internal APIs.&lt;/p&gt;

&lt;p&gt;It was to understand the machinery underneath the features I've already been using.&lt;/p&gt;

&lt;p&gt;Instead of thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Spring does this."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I can now start asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Which part of Spring does this, and at what stage of the container lifecycle?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That shift in perspective is probably the biggest thing I'm taking away from this module.&lt;/p&gt;

&lt;p&gt;After completing modules covering Spring Core, dependency injection, bean lifecycle, events, AOP, transactions, Spring Boot, Spring MVC, testing, Advanced Spring, and now Spring Internals, the project continues to grow into something much bigger than I originally imagined.&lt;/p&gt;

&lt;p&gt;The goal still isn't to simply collect Spring annotations and interfaces.&lt;/p&gt;

&lt;p&gt;I'm trying to understand how Spring works, why these features exist, and how the different pieces of the framework fit together - one focused example at a time.&lt;/p&gt;

&lt;p&gt;The project is open source, and I'm continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 GitLab: &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing &lt;strong&gt;Module 13 - Spring Internals&lt;/strong&gt; feels like another important milestone in this learning journey. 🚀&lt;/p&gt;

&lt;p&gt;And now comes the next stage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up: Module 14 - OpenMRS Examples.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This time, instead of focusing only on isolated Spring concepts, I'll be looking at how these concepts are actually applied in a real-world project.&lt;/p&gt;

&lt;p&gt;I'm especially looking forward to this module because it brings everything closer to the kind of code found in a real production system.&lt;/p&gt;

&lt;p&gt;One focused example at a time. 🚀&lt;/p&gt;

&lt;p&gt;If you've worked with Spring internals before, what's one part of the Spring container that helped you understand the framework better?&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #opensource #github #learninginpublic #backend #softwareengineering #spring #springboot #openmrs #programming
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the Advanced Spring Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Tue, 15 Sep 2026 08:16:00 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-advanced-spring-module-2868</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-advanced-spring-module-2868</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 12 - Advanced Spring&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;This module was a particularly interesting one because it moved beyond the higher-level features I had been using and gave me a closer look at some of the abstractions and extension points that make Spring work.&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;BeanFactory&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ApplicationContext&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FactoryBean&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BeanDefinition&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BeanDefinitionRegistry&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ImportSelector&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DeferredImportSelector&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ImportBeanDefinitionRegistrar&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Environment&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Property Sources&lt;/li&gt;
&lt;li&gt;Resource Loading&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MessageSource&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ConversionService&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;li&gt;Spring Expression Language (SpEL)&lt;/li&gt;
&lt;li&gt;Method Injection&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@Lookup&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the things I really enjoyed about this module was seeing how much of Spring's behavior is built around the &lt;strong&gt;application context, bean definitions, and the container itself&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, &lt;code&gt;BeanDefinition&lt;/code&gt; helped me understand that Spring doesn't immediately need an object instance to know how a bean should be created. Instead, it can work with metadata describing the bean.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;BeanDefinitionRegistry&lt;/code&gt; then showed how those definitions can be registered and managed programmatically.&lt;/p&gt;

&lt;p&gt;The configuration-related examples went even deeper. With &lt;code&gt;ImportSelector&lt;/code&gt;, &lt;code&gt;DeferredImportSelector&lt;/code&gt;, and &lt;code&gt;ImportBeanDefinitionRegistrar&lt;/code&gt;, I explored different ways Spring can dynamically select configuration or register bean definitions during application context processing.&lt;/p&gt;

&lt;p&gt;I also explored the &lt;code&gt;Environment&lt;/code&gt; and property sources, which helped connect Spring's environment abstraction with how configuration values can be provided and resolved from different sources.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;Resource&lt;/code&gt; abstraction and &lt;code&gt;MessageSource&lt;/code&gt; introduced another side of Spring: providing consistent APIs for accessing resources and resolving localized messages.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;ConversionService&lt;/code&gt; and Spring validation, I explored how Spring provides reusable infrastructure for type conversion and object validation rather than requiring every application to implement these concerns independently.&lt;/p&gt;

&lt;p&gt;Then came &lt;strong&gt;SpEL - Spring Expression Language&lt;/strong&gt; - which was a great example of how Spring provides its own expression engine for evaluating values, properties, variables, and expressions.&lt;/p&gt;

&lt;p&gt;Finally, I explored &lt;strong&gt;Method Injection&lt;/strong&gt; and &lt;code&gt;@Lookup&lt;/code&gt;, including the interesting singleton/prototype problem where a singleton bean needs to obtain a new prototype instance whenever a method is called.&lt;/p&gt;

&lt;p&gt;What made this module especially meaningful is that it wasn't just about learning more Spring APIs. It gave me a better understanding of the machinery underneath the features I've already been using.&lt;/p&gt;

&lt;p&gt;And there's another milestone worth mentioning: &lt;strong&gt;SpEL was my 100th example in the project.&lt;/strong&gt; 🎉&lt;/p&gt;

&lt;p&gt;After building examples across Spring Core, dependency injection, bean lifecycle, events, AOP, transactions, Spring Boot, Spring MVC, testing, and now Advanced Spring, reaching 100 examples feels like a significant milestone in this learning journey.&lt;/p&gt;

&lt;p&gt;The goal still isn't to simply collect Spring annotations and interfaces.&lt;/p&gt;

&lt;p&gt;I'm trying to understand how Spring works, why these features exist, and how the different pieces of the framework fit together - one focused example at a time.&lt;/p&gt;

&lt;p&gt;The project is open source, and I’m continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 GitLab: &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing &lt;strong&gt;Module 12 - Advanced Spring&lt;/strong&gt; and reaching 100 examples feels like a milestone worth celebrating. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up:&lt;/strong&gt; continuing with the next stage of the project and exploring more Spring concepts, one example at a time.&lt;/p&gt;

&lt;p&gt;If you’ve worked with Spring before, what’s one advanced Spring concept you think developers should understand better?&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #opensource #github #learninginpublic #backend #softwareengineering #spring #springboot #programming
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the Spring Testing Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Mon, 07 Sep 2026 09:03:28 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-testing-module-h6l</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-testing-module-h6l</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 11 - Spring Testing&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unit Testing with JUnit&lt;/li&gt;
&lt;li&gt;Spring TestContext&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@SpringBootTest&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@MockitoBean&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@TestConfiguration&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Integration Testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the things I enjoyed about this module was understanding the different levels at which a Spring application can be tested.&lt;/p&gt;

&lt;p&gt;I started with &lt;strong&gt;unit testing&lt;/strong&gt;, where the goal is to test a class in isolation without starting the Spring application context. This helped reinforce the idea that not every test needs Spring.&lt;/p&gt;

&lt;p&gt;I then moved into the &lt;strong&gt;Spring TestContext&lt;/strong&gt;, where Spring can create and manage the application context for tests. This makes it possible to test components using the same dependency injection and configuration mechanisms used by the application.&lt;/p&gt;

&lt;p&gt;From there, I explored &lt;code&gt;@SpringBootTest&lt;/code&gt; and how it can be used to load the full Spring Boot application context. This helped connect the concepts of application startup, component scanning, dependency injection, and testing.&lt;/p&gt;

&lt;p&gt;I also explored mocking Spring-managed dependencies. With Spring Boot 4, the approach uses &lt;code&gt;@MockitoBean&lt;/code&gt; to replace a bean in the test context with a Mockito mock. This makes it possible to isolate the component being tested while still using Spring's dependency injection.&lt;/p&gt;

&lt;p&gt;Another interesting part was &lt;code&gt;@TestConfiguration&lt;/code&gt;, which allows test-specific beans to be defined without changing the production configuration. This was a useful way to understand how Spring's configuration system can be customized specifically for tests.&lt;/p&gt;

&lt;p&gt;Finally, I explored &lt;strong&gt;integration testing&lt;/strong&gt;, where multiple parts of the application work together instead of being tested in isolation.&lt;/p&gt;

&lt;p&gt;The integration testing example uses a controller, service, and repository together, starts the application on a random port, and makes a real HTTP request using &lt;code&gt;TestRestTemplate&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That helped put the previous testing concepts together and made the distinction between unit tests and integration tests much clearer.&lt;/p&gt;

&lt;p&gt;The goal isn’t just to collect Spring annotations and APIs. I’m trying to understand how Spring works under the hood, how its features fit together, and why these features exist, one concept at a time.&lt;/p&gt;

&lt;p&gt;The project is open source, and I’m continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitLab: &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing another module feels like a good milestone. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up: Module 12&lt;/strong&gt; - continuing deeper into the Spring ecosystem and building on the concepts covered so far.&lt;/p&gt;

&lt;p&gt;If you’ve worked with Spring testing before, what’s one testing concept you think developers commonly misunderstand?&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #opensource #github #gitlab #learninginpublic #backend #softwareengineering #spring #testing #junit
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the Spring Web (Spring MVC) Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Wed, 02 Sep 2026 10:00:21 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-web-spring-mvc-module-506g</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-web-spring-mvc-module-506g</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 10 — Spring Web (Spring MVC)&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DispatcherServlet&lt;/li&gt;
&lt;li&gt;Controllers&lt;/li&gt;
&lt;li&gt;Request Mapping&lt;/li&gt;
&lt;li&gt;Path Variables&lt;/li&gt;
&lt;li&gt;Request Parameters&lt;/li&gt;
&lt;li&gt;Request Body&lt;/li&gt;
&lt;li&gt;Response Body&lt;/li&gt;
&lt;li&gt;Model and View&lt;/li&gt;
&lt;li&gt;View Resolvers&lt;/li&gt;
&lt;li&gt;Exception Handling&lt;/li&gt;
&lt;li&gt;Request Scope&lt;/li&gt;
&lt;li&gt;Session Scope&lt;/li&gt;
&lt;li&gt;Application Scope&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the things I enjoyed about this module was understanding what actually happens when an HTTP request enters a Spring MVC application.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;DispatcherServlet&lt;/code&gt; acts as the front controller, receiving incoming requests and coordinating the request-handling process. Controllers then define how those requests should be handled using mappings such as &lt;code&gt;@GetMapping&lt;/code&gt; and &lt;code&gt;@PostMapping&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I also explored different ways of working with request data, including path variables, request parameters, and request bodies, as well as how Spring converts incoming data into Java objects.&lt;/p&gt;

&lt;p&gt;The view-related examples helped connect the pieces between a controller, a model, and a view. &lt;code&gt;ModelAndView&lt;/code&gt; can be used to return both model data and a logical view name, while &lt;code&gt;ViewResolver&lt;/code&gt; determines which actual view should be rendered.&lt;/p&gt;

&lt;p&gt;Exception handling was another important part of the module. Using mechanisms such as &lt;code&gt;@ExceptionHandler&lt;/code&gt; and &lt;code&gt;@ControllerAdvice&lt;/code&gt;, it becomes possible to keep error-handling logic organized instead of putting it directly into every controller.&lt;/p&gt;

&lt;p&gt;Finally, I explored Spring's web scopes - request, session, and application scope — and how the lifetime of a bean can be tied to the lifecycle of an HTTP request, user session, or web application.&lt;/p&gt;

&lt;p&gt;The goal isn’t just to collect Spring annotations and APIs. I’m trying to understand how Spring works under the hood, how its features fit together, and why these features exist, one concept at a time.&lt;/p&gt;

&lt;p&gt;The project is open source, and I’m continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitLab: &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing another module feels like a good milestone. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up: Module 11 - Testing&lt;/strong&gt; - exploring how to test Spring applications, starting with unit testing and the Spring TestContext, followed by &lt;code&gt;@SpringBootTest&lt;/code&gt;, &lt;code&gt;@MockBean&lt;/code&gt;, &lt;code&gt;@TestConfiguration&lt;/code&gt;, and integration testing.&lt;/p&gt;

&lt;p&gt;If you’ve worked with Spring MVC before, what’s one part of the request-handling process you think developers commonly misunderstand?&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #opensource #github #gitlab #learninginpublic #backend #softwareengineering #spring #springmvc
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the Spring Boot Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Thu, 27 Aug 2026 08:50:15 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-boot-module-3g45</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-boot-module-3g45</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 9 — Spring Boot&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;This module focused on the foundations of Spring Boot and covered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SpringApplication&lt;/li&gt;
&lt;li&gt;Auto Configuration&lt;/li&gt;
&lt;li&gt;Starter Dependencies&lt;/li&gt;
&lt;li&gt;Configuration Properties&lt;/li&gt;
&lt;li&gt;Profiles&lt;/li&gt;
&lt;li&gt;CommandLineRunner&lt;/li&gt;
&lt;li&gt;Actuator&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the things I enjoyed most about this module was seeing how much Spring Boot does behind the scenes while still allowing us to understand and control what is happening.&lt;/p&gt;

&lt;p&gt;I started with &lt;strong&gt;SpringApplication&lt;/strong&gt;, exploring how &lt;code&gt;SpringApplication.run()&lt;/code&gt; bootstraps a Spring Boot application and creates the application context.&lt;/p&gt;

&lt;p&gt;Then I explored &lt;strong&gt;Auto Configuration&lt;/strong&gt;, which showed how Spring Boot can automatically configure application infrastructure based on the dependencies available on the classpath.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Starter Dependencies&lt;/strong&gt; were another important piece. Instead of manually adding and managing every dependency needed for a particular feature, Spring Boot starters provide convenient dependency groupings that bring the required libraries together.&lt;/p&gt;

&lt;p&gt;I also explored &lt;strong&gt;Configuration Properties&lt;/strong&gt;, which demonstrated how application configuration can be externalized rather than hard-coded into the application.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Profiles&lt;/strong&gt;, I looked at how Spring applications can use different configurations depending on the active environment, such as development, testing, or production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CommandLineRunner&lt;/strong&gt; introduced a simple way to execute code when the application starts, which is useful for initialization tasks and understanding the application startup lifecycle.&lt;/p&gt;

&lt;p&gt;Finally, &lt;strong&gt;Actuator&lt;/strong&gt; showed how Spring Boot applications can expose operational information such as health endpoints. Seeing &lt;code&gt;/actuator/health&lt;/code&gt; return an &lt;code&gt;UP&lt;/code&gt; status was a nice way to finish the module.&lt;/p&gt;

&lt;p&gt;What I’m enjoying about Spring Boot is that it isn't just about reducing configuration.&lt;/p&gt;

&lt;p&gt;It provides conventions and sensible defaults while still allowing developers to understand and customize the underlying Spring infrastructure.&lt;/p&gt;

&lt;p&gt;The goal of this project isn't just to collect Spring Boot annotations and APIs. I'm trying to understand what Spring is doing underneath the surface, how its features fit together, and why these features exist, one concept at a time.&lt;/p&gt;

&lt;p&gt;The project is open source, and I’m continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gith.ub/dsAQrAU5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;GitLab:&lt;/strong&gt; &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;https://gitl.ab/gfDEyGH3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing another module feels like a good milestone. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up: Spring Web (Spring MVC)&lt;/strong&gt; — exploring &lt;code&gt;DispatcherServlet&lt;/code&gt;, controllers, request mapping, request parameters, request bodies, views, exception handling, and request/session/application scopes.&lt;/p&gt;

&lt;p&gt;If you've worked with Spring Boot before, &lt;strong&gt;what Spring Boot feature made the biggest difference in your day-to-day development?&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #springboot #opensource #github #gitlab #learninginpublic #backend #softwareengineering #spring
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>spring</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the Spring Transactions Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Mon, 24 Aug 2026 08:54:17 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-transactions-module-3f8c</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-transactions-module-3f8c</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 8 — Transactions&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;@Transactional&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Transaction Propagation&lt;/li&gt;
&lt;li&gt;Isolation Levels&lt;/li&gt;
&lt;li&gt;Rollback Rules&lt;/li&gt;
&lt;li&gt;Programmatic Transactions&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TransactionProxyFactoryBean&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the most interesting parts of this module was understanding what actually happens when Spring manages a transaction.&lt;/p&gt;

&lt;p&gt;For example, &lt;code&gt;@Transactional&lt;/code&gt; makes it possible to declaratively define transaction boundaries without having to manually begin, commit, or roll back transactions in application code.&lt;/p&gt;

&lt;p&gt;Transaction propagation introduced another important concept: what should happen when a transactional method calls another transactional method?&lt;/p&gt;

&lt;p&gt;I explored propagation behaviors such as &lt;code&gt;REQUIRED&lt;/code&gt; and &lt;code&gt;REQUIRES_NEW&lt;/code&gt;, and how they affect whether operations participate in the same transaction or run in an independent transaction.&lt;/p&gt;

&lt;p&gt;Isolation levels then showed another side of transaction management: how concurrent transactions interact with data and what kinds of visibility and consistency guarantees they provide.&lt;/p&gt;

&lt;p&gt;Rollback rules were another useful area to explore. A transaction does not necessarily roll back for every exception automatically, so understanding how Spring determines whether a transaction should be rolled back is important when designing transactional services.&lt;/p&gt;

&lt;p&gt;I also explored programmatic transactions, which provide more explicit control over transaction boundaries when declarative transaction management isn't the right fit.&lt;/p&gt;

&lt;p&gt;Finally, I looked at &lt;code&gt;TransactionProxyFactoryBean&lt;/code&gt;, an older Spring approach to applying transaction management through proxies. It was especially useful for understanding how Spring's transaction infrastructure evolved and how it connects to the proxy concepts explored in the previous AOP module.&lt;/p&gt;

&lt;p&gt;The goal isn’t just to collect Spring annotations and APIs. I’m trying to understand how the Spring container works, how its features fit together, and why these features exist, one concept at a time.&lt;/p&gt;

&lt;p&gt;The project is open source, and I’m continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;githu.b/sbe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 GitLab: &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;gitla.b/sbe&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing another module feels like a good milestone. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up: Spring JDBC&lt;/strong&gt; — continuing to explore how Spring works with databases and how its abstractions simplify database access.&lt;/p&gt;

&lt;p&gt;If you’ve worked with Spring before, what part of Spring's transaction management do you think developers commonly misunderstand?&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #opensource #github #gitlab #learninginpublic #backend #softwareengineering #spring #transactions
&lt;/h1&gt;

</description>
      <category>opensource</category>
      <category>java</category>
      <category>spring</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the Spring AOP Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Thu, 20 Aug 2026 10:02:15 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-aop-module-15oa</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-aop-module-15oa</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 7 — Spring AOP&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is AOP?&lt;/li&gt;
&lt;li&gt;JDK Dynamic Proxies&lt;/li&gt;
&lt;li&gt;CGLIB Proxies&lt;/li&gt;
&lt;li&gt;Creating an Aspect&lt;/li&gt;
&lt;li&gt;Before Advice&lt;/li&gt;
&lt;li&gt;After Advice&lt;/li&gt;
&lt;li&gt;After Returning Advice&lt;/li&gt;
&lt;li&gt;Around Advice&lt;/li&gt;
&lt;li&gt;Pointcuts&lt;/li&gt;
&lt;li&gt;Advice Ordering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the most interesting parts of this module was understanding that Spring AOP is built around &lt;strong&gt;proxies&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before getting into Spring's AOP abstractions, I explored JDK Dynamic Proxies and CGLIB proxies separately. That made it easier to understand what Spring is doing behind the scenes when it creates an AOP proxy around a Spring-managed bean.&lt;/p&gt;

&lt;p&gt;For example, instead of manually creating a proxy, Spring can use an aspect such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Aspect&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LoggingAspect&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Before&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"execution(* com.springbyexample.GreetingService.greet(..))"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;beforeGreeting&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Before greeting"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Spring then uses the pointcut to determine which method calls should receive that behavior.&lt;/p&gt;

&lt;p&gt;That led into another important concept: &lt;strong&gt;advice&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I explored several different types of advice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@Before&lt;/code&gt; — runs before the target method.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@After&lt;/code&gt; — runs after the method invocation completes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@AfterReturning&lt;/code&gt; — runs when the method returns successfully.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@Around&lt;/code&gt; — surrounds the target invocation and gives the advice control over when the target executes through &lt;code&gt;ProceedingJoinPoint&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Around advice was particularly interesting because &lt;code&gt;proceed()&lt;/code&gt; determines whether the target method actually gets invoked.&lt;/p&gt;

&lt;p&gt;I also explored &lt;strong&gt;pointcuts&lt;/strong&gt;, which helped clarify an important distinction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pointcut
    ↓
Where should the advice apply?

Advice
    ↓
What should happen?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Before&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"execution(* com.springbyexample.GreetingService.greet(..))"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;uses the pointcut to tell Spring which method should be intercepted.&lt;/p&gt;

&lt;p&gt;Finally, I looked at &lt;strong&gt;advice ordering&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When multiple aspects apply to the same method, &lt;code&gt;@Order&lt;/code&gt; can be used to control their precedence. Lower order values have higher precedence, and the ordering becomes especially interesting when looking at how &lt;code&gt;@Before&lt;/code&gt; and &lt;code&gt;@After&lt;/code&gt; advice execute around the target method.&lt;/p&gt;

&lt;p&gt;One of the things I wanted to understand through these examples was not just &lt;em&gt;how to write an aspect&lt;/em&gt;, but what is actually happening when a method call goes through Spring AOP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Caller
   ↓
Spring AOP Proxy
   ↓
Pointcut matching
   ↓
Ordered Advice
   ↓
Target Method
   ↓
Ordered Advice
   ↓
Return value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That connects nicely with the earlier proxy examples and makes Spring AOP feel much less like "magic."&lt;/p&gt;

&lt;p&gt;The goal of &lt;strong&gt;spring-by-example&lt;/strong&gt; isn't just to collect Spring annotations and APIs.&lt;/p&gt;

&lt;p&gt;I'm trying to understand how the Spring container works, how its features fit together, and why these features exist, one concept at a time.&lt;/p&gt;

&lt;p&gt;The project is open source, and I’m continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://gitlab.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;GitLab&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing another module feels like a good milestone. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up: Spring Transactions&lt;/strong&gt; — continuing the journey by exploring another important part of the Spring ecosystem.&lt;/p&gt;

&lt;p&gt;If you’ve worked with Spring AOP before, what concept do you think is the most difficult for developers to understand: &lt;strong&gt;proxies, pointcuts, advice, or advice ordering?&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #opensource #github #gitlab #learninginpublic #backend #softwareengineering #spring #aop
&lt;/h1&gt;

</description>
      <category>spring</category>
      <category>java</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🚀 Building Spring by Example: Completing the Spring Events Module</title>
      <dc:creator>Mujuzi Moses </dc:creator>
      <pubDate>Sun, 16 Aug 2026 15:57:40 +0000</pubDate>
      <link>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-events-module-184l</link>
      <guid>https://dev.to/iammujuzimoses/building-spring-by-example-completing-the-spring-events-module-184l</guid>
      <description>&lt;p&gt;When I started learning Spring, I noticed something about many of the tutorials I found.&lt;/p&gt;

&lt;p&gt;They often showed how to use a feature, but not always why it worked or when you should choose one approach over another.&lt;/p&gt;

&lt;p&gt;I learn best by building things and documenting what I discover, so I started a project called &lt;strong&gt;spring-by-example&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The idea is simple: instead of building one large application, I’m creating a collection of small, focused examples where each example explores a specific Spring concept with clear explanations, tests, and documentation.&lt;/p&gt;

&lt;p&gt;I’m happy to say that I’ve now completed &lt;strong&gt;Module 6 — Events&lt;/strong&gt;. 🎉&lt;/p&gt;

&lt;p&gt;The module covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Publishing Events&lt;/li&gt;
&lt;li&gt;Listening for Events&lt;/li&gt;
&lt;li&gt;Custom Events&lt;/li&gt;
&lt;li&gt;Transactional Events&lt;/li&gt;
&lt;li&gt;Async Events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing I’ve really enjoyed about this module is seeing how Spring’s event system can help decouple different parts of an application.&lt;/p&gt;

&lt;p&gt;For example, &lt;code&gt;ApplicationEventPublisher&lt;/code&gt; allows one component to publish an event without needing to know which components will respond to it. &lt;code&gt;@EventListener&lt;/code&gt; then provides a simple way for other components to react to those events.&lt;/p&gt;

&lt;p&gt;I also explored custom events, which made it possible to model application-specific events such as an order being created.&lt;/p&gt;

&lt;p&gt;Transactional events introduced another interesting concept: controlling when an event listener should run in relation to a transaction. With &lt;code&gt;@TransactionalEventListener&lt;/code&gt;, event handling can be tied to transaction phases such as after a successful commit.&lt;/p&gt;

&lt;p&gt;Finally, &lt;code&gt;@Async&lt;/code&gt; showed how event listeners can be processed asynchronously, allowing the publisher to continue without waiting for the listener to finish.&lt;/p&gt;

&lt;p&gt;The goal isn’t just to collect Spring annotations and APIs. I’m trying to understand how the Spring container works, how its features fit together, and why these features exist, one concept at a time.&lt;/p&gt;

&lt;p&gt;The project is open source, and I’m continuing to build it as I learn:&lt;/p&gt;

&lt;p&gt;🔗 GitHub: &lt;a href="https://github.com/IamMujuziMoses/spring-by-example" rel="noopener noreferrer"&gt;githu.b/mujuzimoses&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s still a long way to go, but completing another module feels like a good milestone. 🚀&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next up: Spring AOP&lt;/strong&gt; — exploring Aspect-Oriented Programming, proxies, aspects, advice, pointcuts, and how Spring applies cross-cutting concerns.&lt;/p&gt;

&lt;p&gt;If you’ve worked with Spring before, what’s one part of Spring’s event system you think developers commonly misunderstand?&lt;/p&gt;

&lt;h1&gt;
  
  
  java #springframework #opensource #github #learninginpublic #backend #softwareengineering #spring #events
&lt;/h1&gt;

</description>
      <category>spring</category>
      <category>java</category>
      <category>opensource</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
