<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Behavioral Patterns on Java &amp; Software Architecture Knowledge Hub</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/</link><description>Recent content in Behavioral Patterns 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/design-patterns/behavioral/index.xml" rel="self" type="application/rss+xml"/><item><title>Chain of Responsibility Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/chain-of-responsibility/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/chain-of-responsibility/</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;The &lt;strong&gt;Chain of Responsibility&lt;/strong&gt; pattern passes a request along a &lt;strong&gt;chain of handler objects&lt;/strong&gt;. Each handler either handles the request or passes it to the next one. The sender does not know which handler will deal with it.&lt;/p&gt;</description></item><item><title>Command Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/command/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/command/</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;The &lt;strong&gt;Command&lt;/strong&gt; pattern wraps a request — &amp;ldquo;insert this text at position 5&amp;rdquo; — in an &lt;strong&gt;object&lt;/strong&gt;. Because the request is now a value, it can be stored in a history, undone, redone, queued for later, sent to another thread or logged and replayed.&lt;/p&gt;</description></item><item><title>Interpreter Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/interpreter/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/interpreter/</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;The &lt;strong&gt;Interpreter&lt;/strong&gt; pattern defines a class for each rule of a small language&amp;rsquo;s &lt;strong&gt;grammar&lt;/strong&gt;. A sentence in the language is parsed into a tree of these objects (an &lt;strong&gt;abstract syntax tree&lt;/strong&gt;, AST), and calling &lt;code&gt;interpret(context)&lt;/code&gt; on the root evaluates it recursively.&lt;/p&gt;</description></item><item><title>Iterator Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/iterator/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/iterator/</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;The &lt;strong&gt;Iterator&lt;/strong&gt; pattern gives a way to visit the elements of a collection &lt;strong&gt;one at a time, without exposing how the collection is stored&lt;/strong&gt;: an array, a linked list, a tree, a database cursor or pages from a remote API.&lt;/p&gt;</description></item><item><title>Mediator Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/mediator/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/mediator/</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;The &lt;strong&gt;Mediator&lt;/strong&gt; pattern puts the rules for how a group of objects interact into &lt;strong&gt;one object&lt;/strong&gt;, the mediator. The objects (colleagues) report events to the mediator instead of calling each other; the mediator decides what happens next.&lt;/p&gt;</description></item><item><title>Memento Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/memento/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/memento/</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;The &lt;strong&gt;Memento&lt;/strong&gt; pattern lets an object save a &lt;strong&gt;snapshot&lt;/strong&gt; of its internal state and later restore it, while keeping that state &lt;strong&gt;private&lt;/strong&gt;: other objects can store snapshots but cannot read or change what is inside them.&lt;/p&gt;</description></item><item><title>Observer Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/observer/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/observer/</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;The &lt;strong&gt;Observer&lt;/strong&gt; pattern lets an object (the &lt;strong&gt;subject&lt;/strong&gt;) keep a list of interested objects (&lt;strong&gt;observers&lt;/strong&gt;) and notify all of them automatically when something happens. The subject knows only that observers implement a small interface; it does not know what they do.&lt;/p&gt;</description></item><item><title>State Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/state/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/state/</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;The &lt;strong&gt;State&lt;/strong&gt; pattern moves state-specific behaviour into separate &lt;strong&gt;state objects&lt;/strong&gt;. The main object (the &lt;strong&gt;context&lt;/strong&gt;) delegates each request to its current state object, and the state object decides what to do and which state comes next. To the outside, the object appears to change its class.&lt;/p&gt;</description></item><item><title>Strategy Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/strategy/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/strategy/</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;The &lt;strong&gt;Strategy&lt;/strong&gt; pattern defines a family of algorithms, puts each one in its own class behind a common interface, and lets the client choose which one to use. The code that &lt;em&gt;uses&lt;/em&gt; the algorithm does not change when you add a new one.&lt;/p&gt;</description></item><item><title>Template Method Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/template-method/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/template-method/</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;The &lt;strong&gt;Template Method&lt;/strong&gt; pattern puts the &lt;strong&gt;fixed outline of an algorithm&lt;/strong&gt; in a base-class method (the template method) and leaves certain &lt;strong&gt;steps&lt;/strong&gt; for subclasses to implement. Subclasses change the steps, never the order.&lt;/p&gt;&#10;&lt;p&gt;GoF intent: &lt;em&gt;&amp;ldquo;Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm&amp;rsquo;s structure.&amp;rdquo;&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Visitor Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/visitor/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/behavioral/visitor/</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;The &lt;strong&gt;Visitor&lt;/strong&gt; pattern moves an operation out of the classes it works on and into a separate &lt;strong&gt;visitor&lt;/strong&gt; object. Each class in the hierarchy has one generic &lt;code&gt;accept(visitor)&lt;/code&gt; method; adding a new operation means writing a new visitor, not editing every class.&lt;/p&gt;</description></item></channel></rss>