<?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: Nishchya Verma</title>
    <description>The latest articles on DEV Community by Nishchya Verma (@nishchay7pixels).</description>
    <link>https://dev.to/nishchay7pixels</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F718677%2F3bf5f76f-55aa-4567-8073-b719294137d1.PNG</url>
      <title>DEV Community: Nishchya Verma</title>
      <link>https://dev.to/nishchay7pixels</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nishchay7pixels"/>
    <language>en</language>
    <item>
      <title>Designing a UI That AI Can Actually Understand (DOMGlyph Deep Dive)</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Fri, 03 Apr 2026 15:35:42 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/designing-a-ui-that-ai-can-actually-understand-cortexui-deep-dive-1775</link>
      <guid>https://dev.to/nishchay7pixels/designing-a-ui-that-ai-can-actually-understand-cortexui-deep-dive-1775</guid>
      <description>&lt;p&gt;DOMGlyph (formerly llcortex/CortexUI) is an AI-native interface system that turns UI into a contract for intelligent agents. You can explore the source on &lt;a href="https://github.com/llcortex/DOMGlyph" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and browse the docs and demos at &lt;a href="https://domglyph.llcortex.ai" rel="noopener noreferrer"&gt;domglyph.llcortex.ai&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5i0p5qst181e2iovdrk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5i0p5qst181e2iovdrk.jpg" alt=" " width="800" height="603"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want AI to operate a UI reliably, you have to stop making it guess.&lt;/p&gt;

&lt;p&gt;That is the shortest possible explanation of DOMGlyph.&lt;/p&gt;

&lt;p&gt;The longer explanation is more interesting.&lt;/p&gt;

&lt;p&gt;Most web automation today works by inference. The system looks at the DOM, searches for a likely button, reads labels, tracks layout, maybe uses screenshots, and tries to decide what to do next. It works until the interface changes. Then the guessing starts to fall apart.&lt;/p&gt;

&lt;p&gt;DOMGlyph fixes that by giving the UI its own explicit machine-readable layer.&lt;/p&gt;

&lt;p&gt;Here is the simplest example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-id=&lt;/span&gt;&lt;span class="s"&gt;"save-profile"&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-role=&lt;/span&gt;&lt;span class="s"&gt;"action"&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-action=&lt;/span&gt;&lt;span class="s"&gt;"save-profile"&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-state=&lt;/span&gt;&lt;span class="s"&gt;"idle"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  Save Profile
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This looks almost trivial.&lt;/p&gt;

&lt;p&gt;It is not.&lt;/p&gt;

&lt;p&gt;Those four attributes turn a generic button into a deterministic action contract.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;data-ai-id="save-profile"&lt;/code&gt; gives the element a stable identity.&lt;br&gt;&lt;br&gt;
This is how agents, tests, and runtime tools refer to the exact element across renders and redesigns.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;data-ai-role="action"&lt;/code&gt; tells the system what kind of thing this is.&lt;br&gt;&lt;br&gt;
Not just “an element.” An action trigger.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;data-ai-action="save-profile"&lt;/code&gt; declares intent.&lt;br&gt;&lt;br&gt;
This is the operation being performed, independent of the visible button label.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;data-ai-state="idle"&lt;/code&gt; exposes the current machine state.&lt;br&gt;&lt;br&gt;
If it becomes &lt;code&gt;loading&lt;/code&gt;, an agent knows to wait. If it becomes &lt;code&gt;error&lt;/code&gt;, an agent knows the operation failed. If it becomes &lt;code&gt;success&lt;/code&gt;, it knows the action completed.&lt;/p&gt;

&lt;p&gt;That is the contract layer in miniature.&lt;/p&gt;

&lt;p&gt;Once a page is annotated like this, DOMGlyph’s runtime can read those attributes and expose a structured API in the browser.&lt;/p&gt;

&lt;p&gt;The basic idea looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__DOMGLYPH__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAvailableActions&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the result is not a raw element tree. It is a usable representation of what the UI can do right now.&lt;/p&gt;

&lt;p&gt;Something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;save-profile&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;save-profile&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;idle&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;section&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;profile-form&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That changes the interaction model completely.&lt;/p&gt;

&lt;p&gt;Instead of asking:&lt;br&gt;
“Can I find a button that probably means save?”&lt;/p&gt;

&lt;p&gt;An agent can ask:&lt;br&gt;
“What actions are currently available?”&lt;br&gt;
“Is &lt;code&gt;save-profile&lt;/code&gt; one of them?”&lt;br&gt;
“What state is it in?”&lt;br&gt;
“What screen am I on?”&lt;br&gt;
“What form fields are required before I trigger it?”&lt;/p&gt;

&lt;p&gt;That is the difference between heuristic automation and deterministic automation.&lt;/p&gt;
&lt;h2&gt;
  
  
  A More Realistic Example
&lt;/h2&gt;

&lt;p&gt;DOMGlyph gets more useful as soon as you move beyond a single button.&lt;/p&gt;

&lt;p&gt;Imagine a profile editing flow.&lt;/p&gt;

&lt;p&gt;You have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a form with fields&lt;/li&gt;
&lt;li&gt;a save action&lt;/li&gt;
&lt;li&gt;a status banner&lt;/li&gt;
&lt;li&gt;a table of related records&lt;/li&gt;
&lt;li&gt;a confirmation dialog for destructive actions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A DOMGlyph-style screen can declare all of that.&lt;/p&gt;

&lt;p&gt;A form might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;data-ai-role=&lt;/span&gt;&lt;span class="s"&gt;"form"&lt;/span&gt; &lt;span class="na"&gt;data-ai-id=&lt;/span&gt;&lt;span class="s"&gt;"edit-profile-form"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-role=&lt;/span&gt;&lt;span class="s"&gt;"field"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-id=&lt;/span&gt;&lt;span class="s"&gt;"profile-name"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-field-type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-required=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
  &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-role=&lt;/span&gt;&lt;span class="s"&gt;"field"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-id=&lt;/span&gt;&lt;span class="s"&gt;"profile-email"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-field-type=&lt;/span&gt;&lt;span class="s"&gt;"email"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-required=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt;
  &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-role=&lt;/span&gt;&lt;span class="s"&gt;"action"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-id=&lt;/span&gt;&lt;span class="s"&gt;"save-profile"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-action=&lt;/span&gt;&lt;span class="s"&gt;"save-profile"&lt;/span&gt;
    &lt;span class="na"&gt;data-ai-state=&lt;/span&gt;&lt;span class="s"&gt;"idle"&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    Save Profile
  &lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the runtime can return the form schema directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__DOMGLYPH__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFormSchema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;edit-profile-form&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which means an agent can learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;which fields exist&lt;/li&gt;
&lt;li&gt;what type each field expects&lt;/li&gt;
&lt;li&gt;which fields are required&lt;/li&gt;
&lt;li&gt;what action submits the form&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No label scraping. No input guessing. No hardcoded selectors.&lt;/p&gt;

&lt;p&gt;That is especially important because forms are where AI often fails in production. A human can see that one field is for billing zip code and another is for email. An agent looking at generic markup often cannot do that reliably. DOMGlyph removes that ambiguity by encoding the schema directly into the interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Runtime: The Missing Bridge
&lt;/h2&gt;

&lt;p&gt;The runtime is one of the most practical parts of the system.&lt;/p&gt;

&lt;p&gt;DOMGlyph installs a browser API that acts like an inspection layer over the UI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__DOMGLYPH__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getScreenContext&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__DOMGLYPH__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAvailableActions&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__DOMGLYPH__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFormSchema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;edit-profile-form&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__DOMGLYPH__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getVisibleEntities&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;__DOMGLYPH__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getRecentEvents&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives an agent a real operating loop.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Orient itself with &lt;code&gt;getScreenContext()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Discover available operations with &lt;code&gt;getAvailableActions()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Read form structure with &lt;code&gt;getFormSchema()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Inspect visible business objects with &lt;code&gt;getVisibleEntities()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Verify outcomes with &lt;code&gt;getRecentEvents()&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This matters because AI agents do not just need to act. They need to know whether acting worked.&lt;/p&gt;

&lt;p&gt;A typical sequence might look like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;agent sees it is on &lt;code&gt;settings&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;finds &lt;code&gt;save-profile&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;notices the button is &lt;code&gt;idle&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;fills required fields from &lt;code&gt;getFormSchema()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;triggers the action&lt;/li&gt;
&lt;li&gt;observes state move to &lt;code&gt;loading&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;waits for an &lt;code&gt;action_completed&lt;/code&gt; event&lt;/li&gt;
&lt;li&gt;confirms success instead of assuming it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is how you remove guesswork.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo Scenario: Form, Table, Dialog
&lt;/h2&gt;

&lt;p&gt;A useful way to picture DOMGlyph is to imagine a realistic admin screen.&lt;/p&gt;

&lt;p&gt;At the top is a user form.&lt;br&gt;&lt;br&gt;
In the middle is a table of related entities.&lt;br&gt;&lt;br&gt;
At the bottom is a destructive action that opens a confirm dialog.&lt;/p&gt;

&lt;p&gt;In traditional UI automation, each of those pieces would require different heuristics. The form would be inferred from labels. The table rows would be identified by structure. The dialog would be detected visually. Success and failure would be inferred from DOM changes.&lt;/p&gt;

&lt;p&gt;In DOMGlyph, all three pieces can expose the same kind of contract.&lt;/p&gt;

&lt;p&gt;The table can declare entity type and row identity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;table&lt;/span&gt; &lt;span class="na"&gt;data-ai-role=&lt;/span&gt;&lt;span class="s"&gt;"table"&lt;/span&gt; &lt;span class="na"&gt;data-ai-id=&lt;/span&gt;&lt;span class="s"&gt;"users-table"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;tr&lt;/span&gt; &lt;span class="na"&gt;data-ai-entity=&lt;/span&gt;&lt;span class="s"&gt;"user"&lt;/span&gt; &lt;span class="na"&gt;data-ai-entity-id=&lt;/span&gt;&lt;span class="s"&gt;"user-42"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    ...
  &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means an agent can reason about the row as a real &lt;code&gt;user&lt;/code&gt;, not just “the second row in a table.”&lt;/p&gt;

&lt;p&gt;A confirm dialog can declare that it is a modal and that it is expanded:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-role=&lt;/span&gt;&lt;span class="s"&gt;"modal"&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-id=&lt;/span&gt;&lt;span class="s"&gt;"delete-user-dialog"&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-state=&lt;/span&gt;&lt;span class="s"&gt;"expanded"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  ...
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means the system knows it is in a confirmation state. It does not have to infer that from a darkened backdrop and a centered box.&lt;/p&gt;

&lt;p&gt;Once you start seeing UI this way, the benefit compounds quickly. The same interface becomes understandable to developers, test suites, runtime tooling, and AI agents using the same contract vocabulary.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Developer Experience Looks Like
&lt;/h2&gt;

&lt;p&gt;The practical developer story is straightforward.&lt;/p&gt;

&lt;p&gt;You can install the packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm add @domglyph/components @domglyph/runtime @domglyph/ai-contract
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use DOMGlyph components such as &lt;code&gt;ActionButton&lt;/code&gt;, &lt;code&gt;FormField&lt;/code&gt;, &lt;code&gt;DataTable&lt;/code&gt;, &lt;code&gt;StatusBanner&lt;/code&gt;, and &lt;code&gt;ConfirmDialog&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Or, if you need lower-level control, use the primitives and add the contract manually.&lt;/p&gt;

&lt;p&gt;The important shift is that state is no longer just visual. If a save operation is loading, your component should expose that in &lt;code&gt;aiState&lt;/code&gt;. If a dialog is open, it should say so. If a field is required, the contract should say so. The UI becomes self-describing by design.&lt;/p&gt;

&lt;p&gt;That ends up helping more than just AI.&lt;/p&gt;

&lt;p&gt;Tests get more stable because they can target semantic identifiers instead of class names.&lt;/p&gt;

&lt;p&gt;Debugging gets easier because the runtime can tell you what the page believes is currently true.&lt;/p&gt;

&lt;p&gt;Automation gets less fragile because the meaning of the interface survives restyles and refactors.&lt;/p&gt;

&lt;p&gt;And AI systems stop operating your app like a tourist reading street signs in a language they barely know.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Is Powerful
&lt;/h2&gt;

&lt;p&gt;The deepest value of DOMGlyph is not that it adds new components.&lt;/p&gt;

&lt;p&gt;It changes the role of the interface.&lt;/p&gt;

&lt;p&gt;Instead of being a surface that must be interpreted, the UI becomes a system that can declare itself.&lt;/p&gt;

&lt;p&gt;That matters for AI today because the current alternative is a pile of heuristics.&lt;/p&gt;

&lt;p&gt;But it matters even more in the long run because software is clearly moving toward a world where interfaces are used by multiple kinds of operators: humans, copilots, agents, tests, automations, and devtools.&lt;/p&gt;

&lt;p&gt;Those operators need more than visuals.&lt;/p&gt;

&lt;p&gt;They need a contract.&lt;/p&gt;

&lt;p&gt;DOMGlyph treats that contract as a first-class part of interface design.&lt;/p&gt;

&lt;p&gt;And once you see the browser that way, it becomes hard to go back.&lt;/p&gt;

&lt;p&gt;To explore the system in detail, visit the DOMGlyph project on &lt;a href="https://github.com/llcortex/DOMGlyph" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and the website at &lt;a href="https://domglyph.llcortex.ai" rel="noopener noreferrer"&gt;domglyph.llcortex.ai&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For a quick DEMO of DOMGlyph in ACTION &lt;a href="https://domglyph-demo.llcortex.ai" rel="noopener noreferrer"&gt;click-here&lt;/a&gt; .&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>UI Is Not a View Layer. It’s an Interface Contract.</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Tue, 31 Mar 2026 17:04:11 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/ui-is-not-a-view-layer-its-an-interface-contract-2o62</link>
      <guid>https://dev.to/nishchay7pixels/ui-is-not-a-view-layer-its-an-interface-contract-2o62</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq254bswbmoafyccvbyce.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq254bswbmoafyccvbyce.jpg" alt=" " width="800" height="603"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DOMGlyph&lt;/strong&gt; (formerly llcortex/CortexUI)  is an AI-native interface system built on this exact idea: UI should be operable by humans visually and by intelligent agents programmatically. The project lives on &lt;a href="https://github.com/llcortex/DOMGlyph" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, and the full docs are available at &lt;a href="https://cortexui.llcortex.ai" rel="noopener noreferrer"&gt;domglyph.llcortex.ai&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Frontend developers have spent years talking about UI as a view layer.&lt;/p&gt;

&lt;p&gt;That framing is too small.&lt;/p&gt;

&lt;p&gt;A serious interface is not just something that looks good and responds to clicks. It is the operational boundary between a system and whoever is trying to use it. For years, that “whoever” was assumed to be a human. Now it is increasingly a human and a machine.&lt;/p&gt;

&lt;p&gt;Once you accept that, the way we talk about UI starts to feel outdated.&lt;/p&gt;

&lt;p&gt;Backend engineers have been trained to think in contracts for decades. A good API is explicit. It names its endpoints. It declares its inputs. It specifies success and failure modes. It gives clients something stable to build against.&lt;/p&gt;

&lt;p&gt;We treat API contracts as real architecture.&lt;/p&gt;

&lt;p&gt;But on the frontend, we routinely ship interfaces where the semantics are implied rather than declared. A button has a label, not an identity. A form has fields, but no machine-readable schema. A loading state exists visually, but there is no explicit contract that says, “this action is in progress, do not trigger it again.”&lt;/p&gt;

&lt;p&gt;Humans cope with this because humans are excellent at inference.&lt;/p&gt;

&lt;p&gt;Machines are not.&lt;/p&gt;

&lt;p&gt;That is the philosophical core of CortexUI: UI should be designed with the same contractual rigor we expect from APIs.&lt;/p&gt;

&lt;p&gt;Not because we want to make frontend feel like backend.&lt;/p&gt;

&lt;p&gt;Because modern software now has non-human operators.&lt;/p&gt;

&lt;p&gt;The DOMGlyph worldview is built on a few strong ideas.&lt;/p&gt;

&lt;p&gt;First: UI is an interface, not decoration.&lt;/p&gt;

&lt;p&gt;The visual layer matters. A lot. Good typography, spacing, accessibility, hierarchy, and motion are part of how humans understand software. DOMGlyph does not reject any of that.&lt;/p&gt;

&lt;p&gt;But visual design is only one half of the job.&lt;/p&gt;

&lt;p&gt;The second half is semantic clarity. What is this element? What action does it trigger? What state is it in? What entity does it belong to? What section of the workflow am I looking at?&lt;/p&gt;

&lt;p&gt;If those answers only exist in a human’s head, the UI is incomplete.&lt;/p&gt;

&lt;p&gt;Second: interfaces should be deterministic.&lt;/p&gt;

&lt;p&gt;An agent should not need to infer whether a button is a destructive action, a primary action, or a navigation affordance based on color and placement. It should not need to guess whether a spinner means “loading” or whether a quiet layout change means the action succeeded.&lt;/p&gt;

&lt;p&gt;Determinism means the interface declares what is true right now.&lt;/p&gt;

&lt;p&gt;A DOMGlyph element carries explicit identity and state:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;data-ai-id&lt;/code&gt; for stable identity&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-ai-role&lt;/code&gt; for semantic type&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-ai-action&lt;/code&gt; for executable intent&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-ai-state&lt;/code&gt; for current condition&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-ai-screen&lt;/code&gt; and &lt;code&gt;data-ai-section&lt;/code&gt; for context&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-ai-entity&lt;/code&gt; and &lt;code&gt;data-ai-entity-id&lt;/code&gt; for domain anchoring&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not metadata as decoration. It is metadata as architecture.&lt;/p&gt;

&lt;p&gt;Third: actions should be first-class.&lt;/p&gt;

&lt;p&gt;Traditional UI often treats actions as the byproduct of components. There is a button. The button has some text. Somewhere in code there is an &lt;code&gt;onClick&lt;/code&gt;. The action is hidden inside implementation.&lt;/p&gt;

&lt;p&gt;DOMGlyph flips that. The action becomes the thing you design around.&lt;/p&gt;

&lt;p&gt;What is the action called? When is it available? What does success look like? What does failure look like? What state transitions can it go through? What entity does it operate on?&lt;/p&gt;

&lt;p&gt;That is a better design discipline even before AI enters the picture.&lt;/p&gt;

&lt;p&gt;Once you are forced to name an action explicitly, ambiguity gets harder to hide.&lt;/p&gt;

&lt;p&gt;Fourth: interfaces should have a dual layer.&lt;/p&gt;

&lt;p&gt;This is one of the most useful ways to think about CortexUI.&lt;/p&gt;

&lt;p&gt;There is a human layer:&lt;br&gt;
the visible UI, layout, style, interaction polish, accessibility affordances, responsive behavior.&lt;/p&gt;

&lt;p&gt;And there is a machine layer:&lt;br&gt;
the contract that exposes identity, meaning, state, and available operations to agents, tests, and runtime tooling.&lt;/p&gt;

&lt;p&gt;These layers are not in conflict. They coexist.&lt;/p&gt;

&lt;p&gt;A human still sees a clean form and a clear primary button. An agent sees a form schema, field types, required flags, and a stable action identifier.&lt;/p&gt;

&lt;p&gt;Same interface. Two consumers. One contract.&lt;/p&gt;

&lt;p&gt;That dual-layer model matters because the current alternative is terrible. Without an explicit machine layer, AI systems end up reading interfaces the same way a human with blurred vision might: making guesses from incomplete evidence. That produces brittle automation, unreliable copilots, fragile end-to-end tests, and endless maintenance every time a UI changes.&lt;/p&gt;

&lt;p&gt;A contract layer changes that.&lt;/p&gt;

&lt;p&gt;Stable identity means an action remains targetable even if the copy changes from “Save” to “Update profile.”&lt;/p&gt;

&lt;p&gt;Observability means an agent can inspect current state instead of deducing it from pixels.&lt;/p&gt;

&lt;p&gt;Explicit state means a system can know that an action is &lt;code&gt;loading&lt;/code&gt;, a field is in &lt;code&gt;error&lt;/code&gt;, or a modal is &lt;code&gt;expanded&lt;/code&gt; without guessing.&lt;/p&gt;

&lt;p&gt;This is why DOMGlyph is not just another component library.&lt;/p&gt;

&lt;p&gt;A component library helps you render UI.&lt;/p&gt;

&lt;p&gt;A contract system helps you make UI operable.&lt;/p&gt;

&lt;p&gt;That distinction will matter more every year.&lt;/p&gt;

&lt;p&gt;The future of software is not just people clicking around inside browsers. It is people, agents, automations, test runners, copilots, and monitoring systems all interacting with the same interfaces. The teams that win in that world will not be the ones with the prettiest buttons alone. They will be the ones whose interfaces are explicit, stable, observable, and trustworthy.&lt;/p&gt;

&lt;p&gt;The frontend world spent years optimizing for how software looks.&lt;/p&gt;

&lt;p&gt;The next frontier is optimizing for how software declares itself.&lt;/p&gt;

&lt;p&gt;That is the deeper idea behind DOMGlyph.&lt;/p&gt;

&lt;p&gt;Not prettier components.&lt;/p&gt;

&lt;p&gt;Interfaces that can be understood.&lt;/p&gt;

&lt;p&gt;If that model resonates, explore DOMGlyph on &lt;a href="https://github.com/llcortex/DOMGlyph" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and read more at &lt;a href="https://domglyph.llcortex.ai" rel="noopener noreferrer"&gt;domglyph.llcortex.ai&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>The Web Was Built for Humans. AI Is Struggling Because of It.</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Tue, 31 Mar 2026 17:01:43 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/the-web-was-built-for-humans-ai-is-struggling-because-of-it-53n3</link>
      <guid>https://dev.to/nishchay7pixels/the-web-was-built-for-humans-ai-is-struggling-because-of-it-53n3</guid>
      <description>&lt;p&gt;AI is getting better at reasoning.&lt;/p&gt;

&lt;p&gt;It is still surprisingly bad at using software.&lt;/p&gt;

&lt;p&gt;That gap is not because the models are weak. It is because the web was never designed to be legible to machines in the first place.&lt;/p&gt;

&lt;p&gt;Most modern interfaces are optimized for human perception. We use typography, spacing, button placement, color, and copy to communicate meaning. A person can glance at a checkout screen and understand where they are, what fields matter, what the primary action is, and what will probably happen next.&lt;/p&gt;

&lt;p&gt;An AI agent does not get that for free.&lt;/p&gt;

&lt;p&gt;When an agent lands on a page, it usually has to reverse-engineer the interface from unstable clues. It scrapes the DOM. It follows brittle selectors. It guesses that the button labeled “Save” is probably the one it wants. It hopes the gray button is disabled and not just styled that way. It infers structure from wrappers, classes, and visible text that product teams change every week.&lt;/p&gt;

&lt;p&gt;That is not intelligence. That is survival.&lt;/p&gt;

&lt;p&gt;And it breaks constantly.&lt;/p&gt;

&lt;p&gt;A small redesign can move one button, rename one label, or insert one extra wrapper div and suddenly the entire automation flow starts failing. A CSS selector that worked yesterday stops working today. A form field the agent identified by label text is now ambiguous. A modal opens with no explicit contract that says, “you are in a confirmation step now.”&lt;/p&gt;

&lt;p&gt;This is why so much AI-powered UI automation feels flaky in production. The model is being asked to operate an interface that only humans were ever meant to understand.&lt;/p&gt;

&lt;p&gt;That is the real problem.&lt;/p&gt;

&lt;p&gt;We act like the browser is a universal interface. It is not. It is a universal visual interface.&lt;/p&gt;

&lt;p&gt;For humans.&lt;/p&gt;

&lt;p&gt;If AI is going to become a real operator of software, there is a missing layer we need to add between the rendered UI and the agent trying to use it. Not another prompt. Not better XPath. Not smarter screenshot parsing.&lt;/p&gt;

&lt;p&gt;A contract.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnmmjt23kjevtrsdz291.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnmmjt23kjevtrsdz291.jpg" alt=" " width="800" height="628"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is the idea behind DOMGlyph (formerly llcortex/CortexUI).&lt;/p&gt;

&lt;p&gt;DOMGlyph starts from a simple but important premise: a modern interface has two audiences now. The first is the human using it visually. The second is the machine trying to interact with it programmatically.&lt;/p&gt;

&lt;p&gt;Most design systems only serve the first audience.&lt;/p&gt;

&lt;p&gt;DOMGlyph is built for both.&lt;/p&gt;

&lt;p&gt;A DOMGlyph component does not just render a button, a field, or a table. It also emits a machine-readable contract alongside the visual layer. Identity, role, action, state, screen context, section context, entity context. The UI stops being a pile of elements and starts being self-describing.&lt;/p&gt;

&lt;p&gt;A button stops being “something blue near the bottom of the form.”&lt;/p&gt;

&lt;p&gt;It becomes this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-id=&lt;/span&gt;&lt;span class="s"&gt;"save-profile"&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-role=&lt;/span&gt;&lt;span class="s"&gt;"action"&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-action=&lt;/span&gt;&lt;span class="s"&gt;"save-profile"&lt;/span&gt;
  &lt;span class="na"&gt;data-ai-state=&lt;/span&gt;&lt;span class="s"&gt;"idle"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  Save Profile
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That difference is bigger than it looks.&lt;/p&gt;

&lt;p&gt;Now an agent does not need to guess. It can ask: what actions are available right now? Which one is &lt;code&gt;save-profile&lt;/code&gt;? Is it idle, loading, disabled, or finished? Which screen am I on? What entity is this form editing?&lt;/p&gt;

&lt;p&gt;In DOMGlyph, the interface can answer those questions directly.&lt;/p&gt;

&lt;p&gt;That changes the architecture of AI interaction completely. Instead of DOM scraping and heuristics, you get deterministic access to the meaning of the page. The UI becomes less like a screenshot the model has to interpret and more like an API the model can query.&lt;/p&gt;

&lt;p&gt;That is the shift.&lt;/p&gt;

&lt;p&gt;Not “AI in the UI.”&lt;/p&gt;

&lt;p&gt;UI built so AI can actually use it.&lt;/p&gt;

&lt;p&gt;The web was built for humans. That was the right decision for the last era.&lt;/p&gt;

&lt;p&gt;But the next era includes operators without eyes.&lt;/p&gt;

&lt;p&gt;If we keep building interfaces that only humans can truly understand, AI will remain trapped in a layer of brittle guesswork.&lt;/p&gt;

&lt;p&gt;If we build interfaces that declare what they mean, what they do, and what state they are in, something more interesting happens.&lt;/p&gt;

&lt;p&gt;The UI stops being a visual artifact.&lt;/p&gt;

&lt;p&gt;It becomes a contract.&lt;/p&gt;

&lt;p&gt;And that is where DOMGlyph begins.&lt;/p&gt;

&lt;p&gt;If you want to dig deeper, explore DOMGlyph on &lt;a href="https://github.com/llcortex/DOMGlyph" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; or read the docs at &lt;a href="https://domglyph.llcortex.ai" rel="noopener noreferrer"&gt;domglyph.llcortex.ai&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Top 20 Spring-boot questions for interview</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Fri, 04 Jul 2025 10:24:14 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/top-20-spring-boot-questions-for-interview-3073</link>
      <guid>https://dev.to/nishchay7pixels/top-20-spring-boot-questions-for-interview-3073</guid>
      <description>&lt;p&gt;Here is a list of top 20 Spring Boot questions. These cover core Spring Boot, best practices, integrations, performance, and real-world architecture.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I've divided them under sub-headings and not covered the answers as it will be better for you to find answers to these questions yourself as it promote learning. Use ChatGpt or some other ai or just google search like old times to deepen your understanding. Feel free to add more questions in the comments below.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Core Spring Boot &amp;amp; Configuration
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q1. What is the difference between @Component, @Service, @Repository, and @Controller? When should each be used?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q2. How does Spring Boot auto-configuration work? Can you override auto-configured beans?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q3. How would you organize a large Spring Boot project with multiple modules?&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  REST API Design &amp;amp; Best Practices
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q4. How do you design a versioned REST API in Spring Boot?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q5. How do you handle global exceptions in Spring Boot REST APIs?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q6. What is the purpose of @RestControllerAdvice and how does it differ from @ControllerAdvice?&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Spring Boot + Data Layer
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q7. How do you optimize performance when using Spring Data JPA with large datasets? (pagination, projections, batch processing)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q8. What are common causes of N+1 query problems in JPA and how do you fix them?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q9. How do you handle transactions across multiple services or databases in Spring Boot?&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Security and Authentication
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q10. What is the difference between session-based and token-based authentication (JWT)? How would you implement JWT in Spring Boot?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q11. How would you implement role-based access control (RBAC) using Spring Security?&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Spring Boot Advanced Concepts
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q12. What are some common memory issues or performance bottlenecks you've faced in Spring Boot apps and how did you solve them?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q13. What is the role of @Transactional? What happens if it's used on private methods or internal calls within the same bean?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q14. How do you use async processing in Spring Boot? What are potential pitfalls (e.g. context loss, exception handling)?&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Spring Boot + Messaging/Kafka
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q15. How do you integrate Kafka with Spring Boot? What are best practices for idempotent consumers and error handling?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q16. What is the difference between @KafkaListener and KafkaTemplate and when do you use each?&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing &amp;amp; Observability
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q17. How do you write integration tests for Spring Boot applications with an in-memory database and mock services (e.g., Testcontainers, @MockBean)?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q18. How do you implement centralized logging and tracing (using Sleuth, Zipkin, ELK, or OpenTelemetry) in a microservice architecture?&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  DevOps and Deployment Readiness
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Q19. How do you externalize configuration in Spring Boot? What are your strategies for different environments (Dev, QA, Prod)?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q20. How do you ensure your Spring Boot service is production-ready (health checks, metrics, graceful shutdown, retry policies)?&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>backenddevelopment</category>
      <category>programming</category>
      <category>webdev</category>
      <category>java</category>
    </item>
    <item>
      <title>System Design - Twitter X</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Wed, 25 Jun 2025 15:03:13 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/system-design-twitter-x-247o</link>
      <guid>https://dev.to/nishchay7pixels/system-design-twitter-x-247o</guid>
      <description>&lt;p&gt;Ever wondered how social platforms like Twitter manage millions of tweets, likes, and comments in real time? I did too—so I decided to design one from scratch. In this post, I’ll take you through the architecture, APIs, and decisions involved in creating a scalable microservices-based Twitter clone.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Functional Requirements:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create an account and login,&lt;/li&gt;
&lt;li&gt;Create edit delete tweets&lt;/li&gt;
&lt;li&gt;Follow other users&lt;/li&gt;
&lt;li&gt;View a timeline of tweets for following&lt;/li&gt;
&lt;li&gt;Like or reply to tweets&lt;/li&gt;
&lt;li&gt;Search for tweets&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Non functional Requirements:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;availability - system should be available&lt;/li&gt;
&lt;li&gt;scalability - should be able to handle users as users, tweets created, etc increases&lt;/li&gt;
&lt;li&gt;durability - Tweets created should not be lost&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Core Entities:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;User :&lt;/strong&gt; {user_id. user_name, user_metadata, password}&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tweet:&lt;/strong&gt; {tweet_id, user_id. content, created_at, edited_at, edited, orignal_content}&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comment:&lt;/strong&gt; {tweet_id, comment_content, user_id, timestamp}&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Followers:&lt;/strong&gt; {user_id, following_user_id}&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Likes:&lt;/strong&gt; {tweet_id, user_id}&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;APIs:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;SignIn/SignUP&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- [GET] /auth/username-availability?username=&amp;lt;value&amp;gt;    -check if user already exist
- [POST] /auth/user/signup {user_name, user_metatData, user_credetials, email}
- [POST] /auth/login {user_name, email, credentails} 
- [POST] /auth/verify-otp {user_name, otp}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tweets&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- [GET] /tweets?sort=latest ----Return top recent tweets
- [GET] /tweets/following?sort=latest&amp;amp;page=1&amp;amp;limit=10 ----Return top recent tweets by following
- [GET] /users/{user_id}/tweets?page=1&amp;amp;limit=10 ---- Return all recent tweets by user [support pagination] if some users userid
 passed it return for that user otherwise for the user himself. 
- [POST] /tweets/search {keywords []}
- [GET] /tweets/{tweet_id} – fetch tweet by ID
- [DELETE] /tweets/{tweet_id} – for user delete 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Comments/Likes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-[POST] /tweets/{tweet_id}/comments {user_id, content, tweet_id}
-[GET] /tweets/{tweet_id}/comments
-[GET] /tweets/{tweet_id}/likes
-[POST] /tweets/{tweet_id}/likes
-[DELETE] /tweets/{tweet_id}/likes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Search&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- [POST] /search/tweets { keywords: [], tags: [] }
- [GET] /tags/trending – trending topics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Follow&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[POST] /users/{user_id}/follow
[DELETE] /users/{user_id}/follow
[GET] /users/{user_id}/followers
[GET] /users/{user_id}/following
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;DIAGRAM:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5apb40ev0ag48j1izm3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5apb40ev0ag48j1izm3.png" alt="High Level Design Twitter" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Suggestions for Further Enhancement&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Timeline Service: Push vs Pull Strategy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Push Model (Fan-out-on-write):&lt;/strong&gt; Pre-generate user timelines when someone posts a tweet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pull Model:&lt;/strong&gt; Fetch tweets in real-time from users a person follows.
You can start with Pull (easier), and switch to Push for high-scale active users (e.g., celebrities).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Likes &amp;amp; Comments as Microservices&lt;/strong&gt;&lt;br&gt;
Not required now, but eventually split LikesService, CommentService to handle independent scaling.&lt;br&gt;
Add rate limiting on likes/comments to avoid spam or abuse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Notifications Service (Future)&lt;/strong&gt;&lt;br&gt;
For follows, likes, replies.&lt;br&gt;
Async (Kafka-based) + push (WebSocket or polling)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Moderation / Flagging&lt;/strong&gt;&lt;br&gt;
Add a moderation flag or queue to enable content reporting.&lt;br&gt;
Optional ML service for spam/inappropriate content.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>programming</category>
      <category>development</category>
      <category>architecture</category>
    </item>
    <item>
      <title>5 Must-Know Design Patterns Every Developer Should Master</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Tue, 24 Jun 2025 15:50:59 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/5-must-know-design-patterns-every-developer-should-master-4fbk</link>
      <guid>https://dev.to/nishchay7pixels/5-must-know-design-patterns-every-developer-should-master-4fbk</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fot0cw6z702aq16hykm3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fot0cw6z702aq16hykm3w.png" alt="Top 5 Design Patterns" width="800" height="800"&gt;&lt;/a&gt;&lt;br&gt;
At some point in our careers we’ve all been tangled in if-else nests and duct-taped functions just trying to make things work. But what if I told you there’s a better way? A way used by seasoned developers to write cleaner, smarter, and more maintainable code?&lt;/p&gt;

&lt;p&gt;We’ve all heard the term &lt;strong&gt;“design patterns”&lt;/strong&gt; thrown around — usually by that one senior dev who speaks fluent Lorem ipsum.&lt;br&gt;
Maybe you’ve even noticed how certain built-in functions or framework methods just make sense — like they were crafted with some secret blueprint. Well, spoiler alert: they were. That blueprint is what we call a design pattern — a time-tested solution to a common software design problem. In this article, I'll break down the &lt;strong&gt;Top 5 Design Patterns&lt;/strong&gt; you’ve probably seen in the wild (even if you didn’t know their names), and show you how to use them like a pro.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Strategy Pattern
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Intent:&lt;/strong&gt; Define a family of algorithms, encapsulate each one, and make them interchangeable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use When:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You have multiple ways of doing something (e.g., sorting, payment, compression).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You want to switch algorithms at runtime.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Structure:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Strategy Interface&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Concrete Strategies&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Context (uses Strategy)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Strategy
interface PaymentStrategy {
    void pay(int amount);
}

// Concrete Strategy
class CreditCardPayment implements PaymentStrategy {
    public void pay(int amount) {
        System.out.println("Paid " + amount + " using credit card");
    }
}

class PayPalPayment implements PaymentStrategy {
    public void pay(int amount) {
        System.out.println("Paid " + amount + " using PayPal");
    }
}

// Context
class ShoppingCart {
    private PaymentStrategy strategy;

    public void setPaymentStrategy(PaymentStrategy strategy) {
        this.strategy = strategy;
    }

    public void checkout(int amount) {
        strategy.pay(amount);
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Observer Pattern
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Intent:&lt;/strong&gt; Define a one-to-many dependency so when one object (subject) changes state, all its dependents (observers) are notified.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use When:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;An object changes state and others need to know.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For event-driven systems (e.g., UI, stock price updates).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Structure:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Subject&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Observer Interface&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Concrete Observers&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Observer {
    void update(String message);
}

class EmailSubscriber implements Observer {
    public void update(String message) {
        System.out.println("Email received: " + message);
    }
}

class Publisher {
    private List&amp;lt;Observer&amp;gt; observers = new ArrayList&amp;lt;&amp;gt;();

    public void subscribe(Observer obs) {
        observers.add(obs);
    }

    public void notifyObservers(String message) {
        for (Observer obs : observers) {
            obs.update(message);
        }
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Decorator Pattern
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Intent:&lt;/strong&gt; Attach additional responsibilities to an object dynamically. It’s like wrapping an object with extra behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use When:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You want to add features without changing the base class.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Avoid subclass explosion.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Structure:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Component Interface&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Concrete Component&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Decorator (implements component and wraps another)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Coffee {
    String getDescription();
    int cost();
}

class BasicCoffee implements Coffee {
    public String getDescription() { return "Basic Coffee"; }
    public int cost() { return 50; }
}

class MilkDecorator implements Coffee {
    private Coffee coffee;
    public MilkDecorator(Coffee coffee) { this.coffee = coffee; }

    public String getDescription() {
        return coffee.getDescription() + ", Milk";
    }
    public int cost() {
        return coffee.cost() + 10;
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Factory Pattern
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Intent:&lt;/strong&gt; Create objects without exposing the instantiation logic to the client. Use a method to create the object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use When:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You want to delegate object creation to a separate method/class.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Need to avoid tight coupling.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Structure:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Interface or Superclass&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Factory method to create instances&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Animal {
    void speak();
}

class Dog implements Animal {
    public void speak() {
        System.out.println("Woof!");
    }
}

class AnimalFactory {
    public static Animal getAnimal(String type) {
        if (type.equals("dog")) return new Dog();
        throw new IllegalArgumentException("Unknown type");
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Singleton Pattern
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Intent:&lt;/strong&gt; Ensure a class has only one instance and provide a global access point to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use When:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You need only one instance (e.g., DB connection, config).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To coordinate actions across the system.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Structure:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Private constructor&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Static instance variable&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Public static getter method&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ConfigManager {
    private static ConfigManager instance;

    private ConfigManager() {}

    public static ConfigManager getInstance() {
        if (instance == null) {
            instance = new ConfigManager();
        }
        return instance;
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thread Safe Version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ThreadSafeSingleton {
    private static final ThreadSafeSingleton instance = new ThreadSafeSingleton();

    private ThreadSafeSingleton() {}

    public static ThreadSafeSingleton getInstance() {
        return instance;
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s a quick table to help you map the purpose of each pattern to its core concept.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;th&gt;Key Concept&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Strategy&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Swap behavior like changing themes&lt;/td&gt;
&lt;td&gt;Algorithms packed neatly in separate boxes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Observer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Alert everyone when something changes&lt;/td&gt;
&lt;td&gt;One-to-many notification chain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Decorator&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Add features without changing the original object&lt;/td&gt;
&lt;td&gt;Wrap it, stack it, reuse it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Factory&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Don’t &lt;code&gt;new&lt;/code&gt; up stuff everywhere&lt;/td&gt;
&lt;td&gt;One method to create them all&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Singleton&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Only one allowed in the club&lt;/td&gt;
&lt;td&gt;One instance, globally accessed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So whether you’re building a game, an API, or the next unicorn startup from your garage, these patterns will save you time, headaches, and therapy bills.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>java</category>
      <category>designpatterns</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Backtracking : Master it like a pro</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Tue, 10 Jun 2025 06:02:42 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/backtracking-master-it-like-a-pro-259k</link>
      <guid>https://dev.to/nishchay7pixels/backtracking-master-it-like-a-pro-259k</guid>
      <description>&lt;h2&gt;
  
  
  Core Idea:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"I do, I fail, I go back and try something else." - Nishchya Verma&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's break it down:&lt;br&gt;
&lt;strong&gt;"I do"&lt;/strong&gt;&lt;br&gt;
→ You make a choice or decision (e.g. placing a queen on a chessboard, choosing a number in Sudoku, picking a path in a maze).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"I fail"&lt;/strong&gt;&lt;br&gt;
→ You reach an invalid state — maybe a constraint is violated or no further progress is possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"I go back"&lt;/strong&gt;&lt;br&gt;
→ You undo the last decision — this is the "backtrack" part.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Try something else"&lt;/strong&gt;&lt;br&gt;
→ Explore a different path by making another valid choice and continuing.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Backtracking = Try &amp;gt; Fail &amp;gt; Undo &amp;gt; Try Something Else&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Think of it like a &lt;strong&gt;smart brute force&lt;/strong&gt; approach where you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Choose - Pick an option from a set.&lt;/li&gt;
&lt;li&gt;Explore - Go deeper with that option.&lt;/li&gt;
&lt;li&gt;Unchoose (Backtrack) - If it doesn’t lead to a solution, undo and try the next.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It’s used when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need all possible combinations/permutations/subsets.&lt;/li&gt;
&lt;li&gt;You make decisions step by step, and some decisions may lead to dead ends.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  How To Recognize a Backtracking Problem:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;"Find all..."&lt;/li&gt;
&lt;li&gt;"Count the number of ways..."&lt;/li&gt;
&lt;li&gt;"Return possible arrangements..."&lt;/li&gt;
&lt;li&gt;You’re asked to explore all combinations, permutations, paths, or valid configurations.&lt;/li&gt;
&lt;li&gt;Constraints must be obeyed (e.g. Sudoku, N-Queens).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Template
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function backtrack(path, options) {
    if (isGoal(path)) {
        result.push([...path]); // or return true if only one solution is needed
        return;
    }

    for (let option of options) {
        if (isValid(option, path)) {
            path.push(option);             // Choose
            backtrack(path, updatedOptions); // Explore
            path.pop();                   // Unchoose (Backtrack)
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Let’s Learn by Examples
&lt;/h2&gt;

&lt;p&gt;Let’s dive into two famous problems where backtracking is not just helpful — it’s essential for solving them.&lt;/p&gt;

&lt;p&gt;We’ll start with an easier problem to build confidence, then move on to a slightly more challenging one.&lt;/p&gt;
&lt;h4&gt;
  
  
  1. Permutations [&lt;a href="https://leetcode.com/problems/permutations/description/" rel="noopener noreferrer"&gt;Leetcode #43&lt;/a&gt;]
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Given an array nums of distinct integers, return all the possible . You can return the answer in any order.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Input: nums = [1,2,3]&lt;br&gt;
Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Input: nums = [0,1]&lt;br&gt;
Output: [[0,1],[1,0]]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 3:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Input: nums = [1]&lt;br&gt;
Output: [[1]]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    1 &amp;lt;= nums.length &amp;lt;= 6&lt;/li&gt;
&lt;li&gt;    -10 &amp;lt;= nums[i] &amp;lt;= 10&lt;/li&gt;
&lt;li&gt;    All the integers of nums are unique.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lets try to address it,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are we doing here?&lt;/strong&gt;&lt;br&gt;
You're trying every possible arrangement of the numbers.&lt;br&gt;
This is a backtracking problem:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "Try, fail, go back, try something else."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Lets understand it visually for example &lt;br&gt;
&lt;strong&gt;Input:&lt;/strong&gt; nums = [1,2,3]&lt;br&gt;
&lt;strong&gt;Output:&lt;/strong&gt; [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4zograkavykjzoey44va.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4zograkavykjzoey44va.png" alt=" " width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each level:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;    Chooses a number not already used&lt;/li&gt;
&lt;li&gt;    Adds it to the current path&lt;/li&gt;
&lt;li&gt;    Backtracks when needed (removes the last added number)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lets write the backtrack code for above actions&lt;br&gt;
&lt;strong&gt;Python&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def permute(nums):
    result = []

    def backtrack(path):
        if len(path) == len(nums):       # base case: full permutation
            result.append(path[:])       # make a copy of path
            return

        for num in nums:
            if num in path:              # skip already used numbers
                continue
            path.append(num)             # make a choice
            backtrack(path)              # explore
            path.pop()                   # undo choice (backtrack)

    backtrack([])
    return result
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Java&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    List&amp;lt;List&amp;lt;Integer&amp;gt;&amp;gt; permutations = new ArrayList&amp;lt;&amp;gt;();
    int[] used;
    private void backtrack(int[] nums, ArrayList&amp;lt;Integer&amp;gt; temp) {
        if(temp.size() == nums.length) {
            permutations.add(new ArrayList&amp;lt;&amp;gt;(temp));
            return;
        }
        for(int i=0;i&amp;lt;nums.length;i++) {
            if(used[i] != 1) {
                temp.add(nums[i]);
                used[i] = 1;
                backtrack(nums, temp);
                used[i] = 0;
                temp.remove(temp.size()-1);
            }  
        }
    }
    public List&amp;lt;List&amp;lt;Integer&amp;gt;&amp;gt; permute(int[] nums) {
        used = new int[nums.length];
        backtrack(nums, new ArrayList&amp;lt;Integer&amp;gt;());
        return permutations;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets understand what is happening&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Start: []&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Choose 1 → [1]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose 2 → [1, 2]

&lt;ul&gt;
&lt;li&gt;Choose 3 → [1, 2, 3] ✅&lt;/li&gt;
&lt;li&gt;Backtrack → [1, 2]&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Backtrack → [1]&lt;/li&gt;

&lt;li&gt;Choose 3 → [1, 3] 

&lt;ul&gt;
&lt;li&gt;Choose 2 → [1, 3, 2] ✅&lt;/li&gt;
&lt;li&gt;Backtrack → [1, 3]&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt; Backtrack → [1]&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Backtrack → []&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Choose 2 → [2]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose 1 → [2, 1]

&lt;ul&gt;
&lt;li&gt;Choose 3 → [2, 1, 3] ✅&lt;/li&gt;
&lt;li&gt;Backtrack → [2, 1]&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Backtrack → [2]&lt;/li&gt;

&lt;li&gt;Choose 3 → [2, 3] 

&lt;ul&gt;
&lt;li&gt;Choose 1 → [2, 3, 1] ✅&lt;/li&gt;
&lt;li&gt;Backtrack → [2, 3]&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt; Backtrack → [2]&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Backtrack → []&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Choose 3 → [3]&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose 1 → [3, 1]

&lt;ul&gt;
&lt;li&gt;Choose 2 → [3, 1, 2] ✅&lt;/li&gt;
&lt;li&gt;Backtrack → [3, 1]&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Backtrack → [3]&lt;/li&gt;

&lt;li&gt;Choose 2 → [3, 2]

&lt;ul&gt;
&lt;li&gt;Choose 1 → [3, 2, 1] ✅&lt;/li&gt;
&lt;li&gt;Backtrack → [3, 2]&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt; Backtrack → [3]&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lets take another example, a little complex this time.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Combinations [&lt;a href="https://leetcode.com/problems/combinations/description/" rel="noopener noreferrer"&gt;Leetcode #77&lt;/a&gt;]
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;Given two integers n and k, return all possible combinations of k numbers chosen from the range [1, n].&lt;/p&gt;

&lt;p&gt;You may return the answer in any order.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Input: n = 4, k = 2&lt;br&gt;
Output: [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Input: n = 1, k = 1&lt;br&gt;
Output: [[1]]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    1 &amp;lt;= n &amp;lt;= 20&lt;/li&gt;
&lt;li&gt;    1 &amp;lt;= k &amp;lt;= n&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note - This is combinatorics, not permutations → Order doesn’t matter.&lt;br&gt;
So [1, 2] and [2, 1] are same combination (we only want one of them).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Lets understand it visually for example &lt;br&gt;
&lt;strong&gt;Input:&lt;/strong&gt; n = 4, k = 2&lt;br&gt;
&lt;strong&gt;Output:&lt;/strong&gt; [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fehau3ne23rdwd6z7o8bl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fehau3ne23rdwd6z7o8bl.png" alt=" " width="800" height="584"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We start with an empty list, and at each level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Pick the next number from start to n&lt;/li&gt;
&lt;li&gt;    Recurse deeper with one more number in the path&lt;/li&gt;
&lt;li&gt;    Stop when path size reaches k&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lets write the backtrack code for above actions&lt;br&gt;
&lt;strong&gt;Python&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def combine(n, k):
    result = []

    def backtrack(start, path):
        if len(path) == k:           # base case
            result.append(path[:])
            return

        for i in range(start, n + 1):
            path.append(i)           # make a choice
            backtrack(i + 1, path)   # explore next numbers
            path.pop()               # undo choice (backtrack)

    backtrack(1, [])
    return result

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Java&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    List&amp;lt;List&amp;lt;Integer&amp;gt;&amp;gt; solution;
    int size;
    private void backtrack(int n, int k, List&amp;lt;Integer&amp;gt; subset) {
        if(subset.size() == k) {
            solution.add(new ArrayList&amp;lt;&amp;gt;(subset));
            return;
        }
        for(int i = n;i&amp;lt;=size;i++) {
            subset.add(i);
            backtrack(i+1, k, subset);
            subset.remove(subset.size()-1);
        }

    }
    public List&amp;lt;List&amp;lt;Integer&amp;gt;&amp;gt; combine(int n, int k) {
        solution = new ArrayList&amp;lt;&amp;gt;();
        size = n;
        backtrack(1,k, new ArrayList&amp;lt;Integer&amp;gt;());
        return solution;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets understand what is happening&lt;br&gt;
Here, n=4 and k=2&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    [] → [1] → [1,2] ✅&lt;/li&gt;
&lt;li&gt;    Backtrack → [1] → [1,3] ✅&lt;/li&gt;
&lt;li&gt;    Backtrack → [1,4] ✅&lt;/li&gt;
&lt;li&gt;    Backtrack to [] → Try [2] → [2,3] ✅, [2,4] ✅&lt;/li&gt;
&lt;li&gt;    Try [3] → [3,4] ✅&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total: 6 combinations&lt;/p&gt;

&lt;p&gt;I’ll be sharing two carefully chosen problems to help you master this concept.&lt;br&gt;
Once you've solved them, share your experience and solutions in the comments — let’s learn together!&lt;/p&gt;

&lt;h3&gt;
  
  
  Practice Questions
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Generate Parentheses [&lt;a href="https://leetcode.com/problems/generate-parentheses/description/" rel="noopener noreferrer"&gt;Leetcode #22&lt;/a&gt;]
&lt;/h4&gt;

&lt;h4&gt;
  
  
  2. N-Queens [&lt;a href="https://leetcode.com/problems/n-queens/description/" rel="noopener noreferrer"&gt;Leetcode #51&lt;/a&gt;]
&lt;/h4&gt;

</description>
      <category>programming</category>
      <category>development</category>
      <category>datastructures</category>
      <category>leetcode</category>
    </item>
    <item>
      <title>Blockchain - Simply Explained</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Wed, 04 Jan 2023 11:48:48 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/blockchain-simply-explained-n4h</link>
      <guid>https://dev.to/nishchay7pixels/blockchain-simply-explained-n4h</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;A blockchain is a digital record of transactions. Each transaction is recorded on a block, and multiple blocks are linked together to form a chain. This chain is distributed, meaning that copies of it are stored on multiple computers (also known as "nodes") around the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;One of the main features of a blockchain is that it is decentralized, meaning that it is not controlled by a single entity such as a bank or government. Instead, the network of computers that make up the blockchain is responsible for verifying and recording transactions. This makes it difficult for any one person or group to manipulate the record of transactions.&lt;/p&gt;

&lt;p&gt;Another important feature of a blockchain is that it is transparent and secure. All transactions are recorded on the chain and can be viewed by anyone, but they are also encrypted, making it difficult for anyone to alter or tamper with the record of transactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Blockchain behind the scenes
&lt;/h2&gt;

&lt;p&gt;A blockchain is a decentralized, distributed database that stores a growing list of records, called blocks, which are linked and secured using cryptography. Each block typically contains a cryptographic hash of the previous block, a timestamp, and transaction data. By design, a blockchain is resistant to modification of the data.&lt;/p&gt;

&lt;p&gt;Here's an example of how a blockchain works:&lt;/p&gt;

&lt;p&gt;Imagine that Alice wants to send Bob some money over the internet. Alice initiates the transaction by sending a message to the network indicating that she wants to transfer a certain amount of money to Bob. This message, called a transaction, is broadcast to all the nodes in the network.&lt;/p&gt;

&lt;p&gt;The nodes, or computers, in the network verify the transaction by checking that Alice has the necessary funds and that she has not already sent the money to someone else. Once the transaction is verified, it is added to a block, along with other transactions that have been verified around the same time.&lt;/p&gt;

&lt;p&gt;The block is then cryptographically hashed, and the hash is added to the previous block in the chain, forming a chain of blocks, hence the name "blockchain." This chain of blocks is then distributed to all the nodes in the network.&lt;/p&gt;

&lt;p&gt;The transaction is now complete and the money has been transferred from Alice to Bob. Because the transaction is recorded on multiple blocks in the chain and the chain is distributed across the network, it is very difficult to alter the transaction retroactively without the consensus of the network. This makes a blockchain an secure and transparent way to record transactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Overall, a blockchain is a way of securely and transparently recording transactions digitally, without the need for a central authority.&lt;/p&gt;

</description>
      <category>community</category>
      <category>learning</category>
    </item>
    <item>
      <title>Kubernetes/: Introduction</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Fri, 28 Oct 2022 18:31:55 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/kubernetes-introduction-1ig2</link>
      <guid>https://dev.to/nishchay7pixels/kubernetes-introduction-1ig2</guid>
      <description>&lt;h3&gt;
  
  
  👀 &lt;strong&gt;What is Kubernetes?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Kubernetes or K8s is container orchestration system on "steroids". It takes care of automatic deployment of containerized applications across different servers. &lt;br&gt;
It scale the system up and down automatically and also takes care of the distribution of load across multiple servers automatically. It will also take care of monitor and perform health checks of containers, replacing the failed ones.&lt;br&gt;
It also provide many more features that you'll be learning throughout the course.&lt;/p&gt;

&lt;h3&gt;
  
  
  📝 &lt;strong&gt;Important Terminology&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Lets cover some of the important terms and concepts that you'll be listening throughout the course.&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;Cluster:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;A Kubernetes cluster (or cluster) is a grouping of nodes that run containerized applications in an efficient, automated, efficient and scalable manner.&lt;br&gt;
It consists of master nodes(or control plane) and worker nodes. Every cluster has at least one worker node. Worker nodes are the nodes where your containerized application is running. The control plane manages the worker nodes and the Pods in the cluster. The control plane's components make global decisions about the cluster (for example, scheduling), as well as detecting and responding to cluster events (for example, starting up a new pod when a deployment's replicas field is unsatisfied).&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;Pod:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Pods are the smallest, most basic deployable objects in Kubernetes. A Pod represents a single instance of a running process in your cluster. Pods contain one or more containers, such as Docker containers. When a Pod runs multiple containers, the containers are managed as a single entity and share the Pod's resources.&lt;br&gt;
Pods also contain shared networking and storage resources for their containers.&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;Control Plane:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Control plane is responsible for making the decisions about the cluster as well as detecting and responding to the events that occur within a cluster. Control plane components can run on any machine in the cluster however for simplicity they are usually on same machine. These components are kube-apiserver, etcd, kube-schedular, kube-controller-manager, cloud-controller-manager.&lt;/p&gt;

&lt;h4&gt;
  
  
  - &lt;strong&gt;Node:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;A Node is a worker machine in kubernetes and maybe a virtual machine or physical machine, depending on the cluster. Each node is managed by the control plane. A node can hold multiple pods and control plane automatically handles the scheduling pods across the Nodes in the cluster.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙ &lt;strong&gt;Kubernetes Cluster Components&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When you deploy Kubernetes, you get a cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0px7wn1hzaqupxgn0bsh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0px7wn1hzaqupxgn0bsh.png" alt=" " width="721" height="702"&gt;&lt;/a&gt;&lt;br&gt;
Lets discuss each component in details,&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Control Plane components:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;kube-apiserver&lt;/strong&gt;
The apiserver is the front-end to the K8s control plane that exposes the Kubernetes API.
The Kubernetes API server validates and configures data for the api objects which include pods, services, replicationcontrollers, and others. The API Server services REST operations and provides the frontend to the cluster's shared state through which all other components interact.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;etcd&lt;/strong&gt;&lt;br&gt;
It is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines.&lt;br&gt;
More info on etcd &lt;a href="https://etcd.io/docs/" rel="noopener noreferrer"&gt;etcd.io docs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;kube-scheduler&lt;/strong&gt;&lt;br&gt;
kube-scheduler is the default scheduler for Kubernetes and runs as part of the control plane. kube-scheduler is designed so that, if you want and need to, you can write your own scheduling component and use that instead. &lt;br&gt;
The Kubernetes scheduler is a control plane process which assigns Pods to Nodes. The scheduler determines which Nodes are valid placements for each Pod in the scheduling queue according to constraints and available resources. The scheduler then ranks each valid Node and binds the Pod to a suitable Node. A scheduler watches for newly created Pods that have no Node assigned. For every Pod that the scheduler discovers, the scheduler becomes responsible for finding the best Node for that Pod to run on. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;kube-controller-manager&lt;/strong&gt;&lt;br&gt;
The Kubernetes controller manager is a program that runs continuously as a background process and wakes up to handle periodic service requests, which often come from remote processes. It embeds the core control loops shipped with Kubernetes. In applications of robotics and automation, a control loop is a non-terminating loop that regulates the state of the system. In Kubernetes, a controller is a control loop that watches the shared state of the cluster through the apiserver and makes changes attempting to move the current state towards the desired state.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;cloud-controller-manager&lt;/strong&gt;&lt;br&gt;
Cloud infrastructure technologies let you run Kubernetes on public, private, and hybrid clouds. Kubernetes believes in automated, API-driven infrastructure without tight coupling between components.&lt;br&gt;
The cloud-controller-manager is a Kubernetes control plane component that embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Node components:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Every node in the cluster have dedicated node components running on them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;kubelet&lt;/strong&gt;
An agent that runs on each node in the cluster. It makes sure that containers are running in a Pod. It can register the node with the apiserver using one of: the hostname; a flag to override the hostname; or specific logic for a cloud provider. 
The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object that describes a pod. The kubelet takes a set of PodSpecs that are provided through various mechanisms (primarily through the apiserver) and ensures that the containers described in those PodSpecs are running and healthy. The kubelet doesn't manage containers which were not created by Kubernetes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;kube-proxy&lt;/strong&gt;
kube-proxy maintains network rules on nodes. These network rules allow network communication to your Pods from network sessions inside or outside of your cluster. This reflects services as defined in the Kubernetes API on each node and can do simple TCP, UDP, and SCTP stream forwarding or round robin TCP, UDP, and SCTP forwarding across a set of backends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;container runtime&lt;/strong&gt;
The container runtime, also known as container engine, is the software that is responsible for running containers. You need to install a container runtime into each node in the cluster so that Pods can run there. Container runtime is responsible for loading container images from a repository, monitoring local system resources, isolating system resources for use of a container, and managing container lifecycle. &lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Upcoming Articles&lt;/strong&gt; ✍🏻
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Kubernetes/: Onboarding &lt;br&gt;
Kubernetes/: Scaling &lt;br&gt;
Kubernetes/: Dockerizing &lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h5&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Lets connect&lt;br&gt;
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://github.com/nishchay7pixels" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbws0adjeg22fnzyco1i.png" alt=" " width="32" height="32"&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="https://in.linkedin.com/in/nishchay-verma" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5mq8wbg15afvlv4qkph.png" alt=" " width="32" height="32"&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="https://mobile.twitter.com/nishchyaverma" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7xhvymv4wd9u3507cibr.png" alt=" " width="32" height="32"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://www.flaticon.com/free-icons/github" rel="noopener noreferrer"&gt;Icons created by riajulislam&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>docker</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
    <item>
      <title>Creational Patterns : Factory Method</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Wed, 06 Oct 2021 08:14:31 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/creational-pattern-factory-method-ej0</link>
      <guid>https://dev.to/nishchay7pixels/creational-pattern-factory-method-ej0</guid>
      <description>&lt;h2&gt;
  
  
  Creational Patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Factory Method
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Factory pattern encapsulates object creation letting the subclasses decide what object to create. It is the most used design pattern.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A framework needs to standardize the architectural model for a range of applications but allow for individual applications to define their own domain objects and provide for their instantiation. In simple words, In &lt;strong&gt;Factory Method&lt;/strong&gt; a superclass specifies all standard and generic behavior, and then delegates the creation details to subclasses that are supplied by the client. This superclass is called a &lt;strong&gt;Factory&lt;/strong&gt;. &lt;em&gt;Factories handle the details of object creation. This way it makes the design more customizable.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0dma4oo0hcyv5tqaahyw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0dma4oo0hcyv5tqaahyw.png" alt="image" width="474" height="335"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Why do we need Factory Method?
&lt;/h3&gt;

&lt;p&gt;The Factory Method defines an interface for creating objects, but let’s subclasses decide which classes to instantiate.&lt;/p&gt;

&lt;p&gt;When we use new operator, we are instantiating a concrete class. There is a difference between requesting an object and creating one. The new operator always creates an object and fails to encapsulate object creation. A Factory Method enforces that encapsulation and allows an object to be requested without inextricable coupling to the act of creation.&lt;/p&gt;

&lt;p&gt;Lets consider an example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pizza pizzaOrder;

if(margerita){
  pizzaOrder = new Margerita();
}
else if(country){
  pizzaOrder = new CountryFeast();
}
else if(corn){
 pizzaOrder = new CornCheese();
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In above example &lt;em&gt;Pizza&lt;/em&gt; is an interface that helps us keep code flexible. However, we must create an instance of a concrete class. And since we have a bunch of different Pizza classes, and we do not know until runtime which one we need to instantiate.&lt;/p&gt;

&lt;p&gt;Now this is possible that above code snippet may exist in your code base at several locations in multiple classes, and when you are required to add or remove a type of Pizza Class it will make code update more difficult, time consuming and prone to errors.&lt;/p&gt;

&lt;p&gt;To solve this issue, we use Factory Method pattern.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lets explore Factory Method Pattern.
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Note- The examples discussed will be in Java.&lt;/em&gt;&lt;br&gt;
Suppose the client code needs a new product(object). Now client have two options, first is that it can use new operator to create the Product. However when implementing Factory Pattern our client code will instead ask the factory object for a new Product by providing it the information regarding the type of product it need.&lt;/p&gt;

&lt;p&gt;Once the factory object will receive the necessary information regarding the Product type needed, factory will instantiate the new concrete Product and then return to the client the newly created Product(casted to abstract Product class). The client will use the products as abstract products without being aware about their concrete implementation.&lt;/p&gt;

&lt;p&gt;Let's consider the following example for better understanding,&lt;br&gt;
A coffee-outlet pos application works with different types of Coffee. Here the &lt;strong&gt;Menu Class&lt;/strong&gt; is the client and different types of coffee in the menu are the Products. All coffee products like &lt;strong&gt;(Espresso, Latte, Mocha)&lt;/strong&gt; are derived from an &lt;strong&gt;abstract Coffee class(or interface)&lt;/strong&gt;. The Coffee class(or interface) defined the &lt;em&gt;withSugar&lt;/em&gt; and &lt;em&gt;withMilk&lt;/em&gt; methods which must be implemented by all the 3 Product classes. Now suppose a Latte Coffee is selected from the Menu. the code recieves the type of coffee, ie. Latte as a String paramenter and it asks our Factory Object to create a new concrete Object ie. Latte. The factory creates a new Latte and returns it to the calling object casted to an abstract Coffee class. Then the code uses the object as casted to the abstract class without being aware of the concrete object type.&lt;/p&gt;

&lt;p&gt;The core advantage of implementing Factory Pattern is that new coffee products can be added without changing a single line of code in the framework(the client code that uses the coffee from the factory). &lt;/p&gt;
&lt;h3&gt;
  
  
  Implementation
&lt;/h3&gt;

&lt;p&gt;Lets discuss certain factory implementations that allow adding new products without even modifying the factory class.&lt;/p&gt;

&lt;p&gt;Suppose you own a Logistic Business. You provide logistics solutions via trucks. In your application the bulk of your code lives inside the Truck class. Now you also want to manage logistics via Ships.&lt;/p&gt;

&lt;p&gt;Since most of your code is coupled to the Truck class. Adding Ships into the app would require making changes to the entire codebase. Same apply if in future you want to add Airplane.&lt;/p&gt;

&lt;p&gt;Your app’s will be filled with conditional statements that will switch the behavior of the application depending on the class of transportation objects (Ships, Trucks, etc).&lt;/p&gt;

&lt;p&gt;Lets solve above issue by implementing Factory Method Pattern. Factory method suggest that you replace direct object construction calls (using the new operator) with calls to a special factory method. Now the objects are still created via the new operator, but it’s being called from within the factory method inside the factory object. Objects returned by a factory method are often referred to as products.&lt;/p&gt;

&lt;p&gt;First we declare a Transport interface. This is the Product interface that we discussed earlier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public interface Transport {
    public String deliverBy();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we will declare two concrete products ie, Ship and Truck which implements Transport interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Ship implements Transport {
    public String deliverBy(){
        return "Ship deliver logistics by Sea";
    }
}

public class Truck implements Transport{
    public String deliverBy(){
        return "Truck deliver logistics by Road.";
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now once we have our concrete product classes and product interface now its time to setup our Factory in this example referred as Logistics.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public abstract class Logistics{
    public Transport createTransport(String type){

    }
    abstract Transport create(String type);
}

public class LandLogistics extends Logistics{
    public Transport create(String type){
        return new Truck();
    }
    public void deliveryBy(){
        System.out.println("Delivery by Road!");
    }
}

public class SeaLogistics extends Logistics{
    public Transport create(String type){
        return new Ship();
    }
    public void deliveryBy(){
        System.out.println("Delivery by Sea!");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once we have our abstract factory class (Logistics) along with the two concrete factory classes (SeaLogistics and LandLogistics) we can use the above in our calling code as,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
    Logistics log=null;
    if(input=="Sea"){
        log = new SeaLogistics();
    }
    else if(input=="Land"){
        log = new LandLogistics();
    }
    Transport transport = log.create();
    transport.deliveryBy();
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will be discussing about other Creational patterns in the upcoming posts. Next will be Abstract Factory Pattern.&lt;/p&gt;

&lt;p&gt;Stay tuned! &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note - Be part of the discussion and also leave a heart if you found it helpful.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>java</category>
      <category>opensource</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>Creational Patterns : Singleton</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Mon, 04 Oct 2021 13:46:29 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/creational-patterns-singleton-4nkm</link>
      <guid>https://dev.to/nishchay7pixels/creational-patterns-singleton-4nkm</guid>
      <description>&lt;h2&gt;
  
  
  Creational Patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Singleton Pattern
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;"One of a kind!!"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Singleton pattern is used when we want to create one-of-a-kind objects for which there is only one instance.&lt;/p&gt;

&lt;p&gt;Often there are many objects which we just want at most one instance, for eg. Services, Objects that act as drivers or device drivers etc. And if more than one instance of these objects exist we might end up with more problems or weird program behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why do we need Singleton?
&lt;/h3&gt;

&lt;p&gt;Now I know most of you will be thinking about Global objects, Right?&lt;/p&gt;

&lt;p&gt;Well lets discuss why not use global. Suppose you use a global object instead. This global object will be instantiated at the start of your program. Now what if your application never ends up using it? What if we want our object (one of a kind) to be created only when its needed.&lt;/p&gt;

&lt;p&gt;Interesting right?&lt;br&gt;
So to conclude why not use global object, &lt;strong&gt;we want one-of-a-kind object to be instantiated only when its needed&lt;/strong&gt;. &lt;/p&gt;
&lt;h3&gt;
  
  
  Lets get back to Singleton.
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Note- The examples discussed will be in Java.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Generally, we create an object using &lt;strong&gt;new&lt;/strong&gt; keyword in Java like &lt;code&gt;new NotSingleton();&lt;/code&gt;. However another classes can also create new instances on NotSingleton class. &lt;/p&gt;

&lt;p&gt;So how do we implement Singleton pattern?&lt;br&gt;
Lets consider below example which demonstrate Singleton Pattern in action.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Singleton() {
  private static Singleton singletonInstance;
  //other variables here

  private Singleton() {}

  public static Singleton getInstance(){
    if(singletonInstance==null) {
      singletonInstance =  new Singleton();
    }
    return singletonInstance;
  }
  //other useful methods here
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now lets talk about the above example in details.&lt;br&gt;
Firstly, we have declared a variable &lt;em&gt;singletonInstance&lt;/em&gt; of class Singleton type. This static variable will hold one single instance of our &lt;em&gt;Singleton.class&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Secondly, as you may have already noticed the constructor is declared private. Now you might ask well then how are we suppose to create an instance of Singleton class. Well if we think about it we only want Singleton class to be able to create an instance of itself. Since the constructor is private it cannot be accessed from outside the class however we still can access it from the inside.&lt;/p&gt;

&lt;p&gt;Now the last part in above example is the answer to the question &lt;em&gt;If Constructor is private how can we create an instance of Singleton class?&lt;/em&gt;. Method &lt;em&gt;getInstance()&lt;/em&gt; return the only Singleton object ever created inside the Singleton class. If its not already created, it first create an instance, assign it to singletonInstance variable and then return our singletonInstance . And since method &lt;em&gt;Singleton.getInstance()&lt;/em&gt; is static, it can be accessed from other parts of our code to get this unique instance of Singleton Class. Also since no public constructor exist we cannot create another instance of Singleton class anywhere else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mission:&lt;/strong&gt; &lt;em&gt;create one-of-a-kind objects&lt;/em&gt;: &lt;strong&gt;Done!&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Lets summarize what we have learn so far about Singleton. *&lt;em&gt;Singleton pattern ensures that a class has only one instance, and provide a global point of access to it. In other words Singleton pattern is used when we want our object to be unique such that it only have one instance when needed and that unique instance is used throughout our code when required. To achieve this we declare the constructor of such class as private to prevent anyone from making new instance of our Class (ie. new object of same class). So we cannot instantiate a Singleton object we can just ask for its instance. We do that using the *getInstance()&lt;/em&gt; method, our global access point.&lt;br&gt;
So if I put it in more simple words, we are taking a class and letting it manage a single instance of itself. We are also preventing any other class from creating a new instance on its own. And to get an instance, you have got to go through the class itself.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note - I've demonstrated a classic example of singleton class, however if you'll further explore this topic (that I hope you will) you will find that above mentioned example will resemble the actual use case most of the times however when dealing with multithreading we might need to make some changes however the concept will remain the same.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That's all Folks!&lt;br&gt;
Remember,&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fesyzp4i4n2ufwwdnslir.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fesyzp4i4n2ufwwdnslir.png" alt="image" width="500" height="494"&gt;&lt;/a&gt;&lt;br&gt;
We will be discussing about other Creational patterns in the upcoming posts. Next will be Factory Pattern.&lt;/p&gt;

&lt;p&gt;Stay tuned! &lt;/p&gt;

&lt;p&gt;Note - Be part of the discussion and also leave a heart if you found it helpful.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>algorithms</category>
      <category>design</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>Design Patterns : Creational Patterns</title>
      <dc:creator>Nishchya Verma</dc:creator>
      <pubDate>Mon, 04 Oct 2021 11:15:07 +0000</pubDate>
      <link>https://dev.to/nishchay7pixels/design-patterns-creational-patterns-14c1</link>
      <guid>https://dev.to/nishchay7pixels/design-patterns-creational-patterns-14c1</guid>
      <description>&lt;h2&gt;
  
  
  Creational Patterns
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"Provide object creation mechanism"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creational Design Patterns are concerned with the way in which objects are created.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why do we need Creational Patterns?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Creational Design Patterns&lt;/strong&gt; address this issue by &lt;em&gt;decoupling&lt;/em&gt; the client entirely from the actual initialization process. &lt;br&gt;
&lt;em&gt;Difficult to understand right?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In simpler terms, sometimes its important to be &lt;em&gt;flexible&lt;/em&gt; with the nature of your object. When its required that the nature of the object must be changed according to the nature of the program. In such cases, creational design patterns come in handy to provide more general and flexible approach to object creation.&lt;br&gt;
In other words, the general way of object creation could result in design problems or added complexity to the design and to prevent this we use Creational Design Patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use Creational design Patterns?
&lt;/h2&gt;

&lt;p&gt;Well if your aim resonates with any of the below scenario,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want at most only one instance of an object available throughout the application. eg. Service classes should be stateless, and hence they don't need more than one instance.&lt;/li&gt;
&lt;li&gt;If you want to create objects of several related different classes and you do not want to specify which object is created and also you do not want to coupled your code to use one class so that if later you introduce another class, this would require to make change in the entire codebase.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More such scenarios exist however the intake should be that if you want your code less coupled in terms on initialization and reduce complexities and instability by creating objects in a controlled manner, maybe creational pattern can come to the rescue.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the different Creational design Patterns?
&lt;/h2&gt;

&lt;p&gt;We will be discussing about 5 of the commonly used Creational design Patterns namely,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Singleton Pattern&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Factory Pattern&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Abstract Factory Pattern&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Builder Pattern&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prototype Pattern&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We will be discussing about above mentioned patterns in the upcoming posts starting with Singleton Pattern. &lt;/p&gt;

&lt;p&gt;Stay tuned! &lt;/p&gt;

&lt;p&gt;Note - Be part of the discussion and also leave a heart if you found it helpful.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
