<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ddd on Java &amp; Software Architecture Knowledge Hub</title><link>https://samirsahoo.github.io/design-patterns-hub/tags/ddd/</link><description>Recent content in Ddd on Java &amp; Software Architecture Knowledge Hub</description><generator>Hugo</generator><language>en-US</language><copyright>© 2026 Samir Kumar Sahoo (https://github.com/samirsahoo). All rights reserved.</copyright><atom:link href="https://samirsahoo.github.io/design-patterns-hub/tags/ddd/index.xml" rel="self" type="application/rss+xml"/><item><title>What Is a Bounded Context?</title><link>https://samirsahoo.github.io/design-patterns-hub/domain-driven-design/strategic/bounded-context/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/domain-driven-design/strategic/bounded-context/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;A &lt;strong&gt;bounded context&lt;/strong&gt; is an explicit boundary within which a particular domain model applies, and within which every term in the ubiquitous language has exactly one meaning.&lt;/p&gt;&#10;&lt;p&gt;Outside the boundary, the same word may mean something else, and that is acceptable. The boundary makes the difference explicit instead of leaving it hidden in one overloaded class.&lt;/p&gt;</description></item><item><title>Domain-Driven Design Fundamentals</title><link>https://samirsahoo.github.io/design-patterns-hub/domain-driven-design/fundamentals/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/domain-driven-design/fundamentals/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Domain-Driven Design (DDD)&lt;/strong&gt; is an approach to building software for complex business domains. Its central idea is that the structure and language of the code should match the business it serves, and that developers and domain experts should build that model together.&lt;/p&gt;</description></item><item><title>Microservices versus Modular Monolith</title><link>https://samirsahoo.github.io/design-patterns-hub/microservices/fundamentals/microservices-vs-modular-monolith/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/microservices/fundamentals/microservices-vs-modular-monolith/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="table-wrap" tabindex="0" role="region" aria-label="Table"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th&gt;Style&lt;/th&gt;&#10; &lt;th&gt;Deployment units&lt;/th&gt;&#10; &lt;th&gt;Internal boundaries&lt;/th&gt;&#10; &lt;th&gt;Data&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;strong&gt;Monolith&lt;/strong&gt; (unstructured)&lt;/td&gt;&#10; &lt;td&gt;One&lt;/td&gt;&#10; &lt;td&gt;Weak or none&lt;/td&gt;&#10; &lt;td&gt;One shared schema, accessed from anywhere&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;strong&gt;Modular monolith&lt;/strong&gt;&lt;/td&gt;&#10; &lt;td&gt;One&lt;/td&gt;&#10; &lt;td&gt;Strong, enforced module boundaries aligned with business capabilities&lt;/td&gt;&#10; &lt;td&gt;One database, but each module owns its tables&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;&lt;strong&gt;Microservices&lt;/strong&gt;&lt;/td&gt;&#10; &lt;td&gt;Many, independently deployable&lt;/td&gt;&#10; &lt;td&gt;Enforced by the network&lt;/td&gt;&#10; &lt;td&gt;Each service owns its database&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;A &lt;strong&gt;modular monolith&lt;/strong&gt; is a single deployable application divided internally into modules with explicit interfaces and private internals. &lt;strong&gt;Microservices&lt;/strong&gt; take the same idea further: each module becomes a separately deployed process, owned by one team, with its own data store.&lt;/p&gt;</description></item><item><title>Designing an Order Management System</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/order-management-system/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/case-studies/order-management-system/</guid><description>&lt;h2 id="overview"&gt;Overview&lt;a class="heading-anchor" href="#overview" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;This case study designs the system that takes a customer&amp;rsquo;s order in an online shop, reserves stock, takes payment and hands the order to fulfilment. It follows the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/system-design/introduction/"&gt;18-step framework&lt;/a&gt; and reuses the retail domain from the &lt;a href="https://samirsahoo.github.io/design-patterns-hub/domain-driven-design/fundamentals/"&gt;DDD articles&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Hexagonal Architecture with Spring Boot</title><link>https://samirsahoo.github.io/design-patterns-hub/hexagonal-architecture/spring-boot-implementation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/hexagonal-architecture/spring-boot-implementation/</guid><description>&lt;h2 id="what-you-will-build"&gt;What you will build&lt;a class="heading-anchor" href="#what-you-will-build" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;A small order service with two use cases — &lt;strong&gt;place an order&lt;/strong&gt; (and charge for it) and &lt;strong&gt;get an order&lt;/strong&gt; — structured as Ports and Adapters:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The &lt;strong&gt;domain model&lt;/strong&gt; enforces business rules in plain Java.&lt;/li&gt;&#10;&lt;li&gt;The &lt;strong&gt;application service&lt;/strong&gt; orchestrates use cases and talks to the outside world only through &lt;strong&gt;ports&lt;/strong&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Adapters&lt;/strong&gt; connect the core to HTTP (Spring MVC), a database (Spring Data JPA with H2) and a payment provider (simulated, so the example needs no credentials).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Tests&lt;/strong&gt; cover each part at the right level. The use-case tests run without Spring and without a database.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The full source is in &lt;code&gt;examples/spring-hexagonal-orders/&lt;/code&gt;. It targets &lt;strong&gt;Java 21&lt;/strong&gt; and &lt;strong&gt;Spring Boot 4.1.1&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>CQRS and Event Sourcing</title><link>https://samirsahoo.github.io/design-patterns-hub/microservices/data-consistency/cqrs-and-event-sourcing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/microservices/data-consistency/cqrs-and-event-sourcing/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;CQRS (Command Query Responsibility Segregation)&lt;/strong&gt; uses &lt;strong&gt;different models for writing and reading&lt;/strong&gt;. Commands change state through a write model that enforces business rules; queries read from one or more read models shaped for the screens and APIs that use them.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Event sourcing&lt;/strong&gt; stores an entity&amp;rsquo;s state as the &lt;strong&gt;sequence of events&lt;/strong&gt; that happened to it (&lt;code&gt;OrderPlaced&lt;/code&gt;, &lt;code&gt;ItemAdded&lt;/code&gt;, &lt;code&gt;OrderShipped&lt;/code&gt;) instead of its current values. Current state is derived by replaying the events.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;They are independent patterns that combine naturally: event sourcing produces a stream of events, and CQRS projections consume it to build read models.&lt;/p&gt;</description></item></channel></rss>