<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Senthilathiban on Medium]]></title>
        <description><![CDATA[Stories by Senthilathiban on Medium]]></description>
        <link>https://medium.com/@senthilathiban0?source=rss-6a337545ce40------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_Z96RCy63PzXhlzLuhFlcQ.jpeg</url>
            <title>Stories by Senthilathiban on Medium</title>
            <link>https://medium.com/@senthilathiban0?source=rss-6a337545ce40------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 06:50:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@senthilathiban0/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Plugin System That Actually Respects Domain Boundaries in MFE]]></title>
            <link>https://medium.com/@senthilathiban0/the-plugin-system-that-actually-respects-domain-boundaries-in-mfe-49693f2e3236?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/49693f2e3236</guid>
            <category><![CDATA[extension]]></category>
            <category><![CDATA[micro-front-end]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[slot]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 18:29:32 GMT</pubDate>
            <atom:updated>2025-11-16T18:29:32.625Z</atom:updated>
            <content:encoded><![CDATA[<p>You know that feeling when you’re working on a massive React app, and every time someone from another team needs to add a feature to “your” page, you end up in a meeting? Or worse, they open a PR that touches 47 files and conflicts with everything you’ve been working on?</p><p>Yeah, we’ve all been there.</p><p>Let me tell you about a pattern that’s been quietly saving developers from this hell: <strong>Extension Slots</strong>. Think of it as a plugin system for your React components, but actually good.</p><h3>The Problem (Or: Why We Can’t Have Nice Things)</h3><p><strong>Picture this:</strong> You’re building a hospital management system. You own the Billing dashboard. Life is good.</p><p>Then the Pharmacy team shows up: <em>“Hey, we need to show pending prescriptions on the billing page.”</em></p><p>No problem, you add their component.</p><p>Next week, the Lab team: <em>“We need a test results widget there too.”</em></p><p>Sure, why not?</p><p>Then Inventory wants alerts. Radiology wants schedules. Appointments want… You get the idea.</p><p>Fast forward two months, and your billing dashboard looks like this:</p><pre>import PharmacyWidget from &#39;@hospital/pharmacy/widgets/pending&#39;;<br>import LabResults from &#39;@hospital/lab/results/summary&#39;;<br>import InventoryAlerts from &#39;@hospital/inventory/alerts&#39;;<br>import RadiologySchedule from &#39;@hospital/radiology/schedule&#39;;<br>import AppointmentReminders from &#39;@hospital/appointments/reminders&#39;;<br>// ... 15 more imports<br><br>function BillingDashboard() {<br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Billing&lt;/h1&gt;<br>      {/* Your actual billing stuff */}<br>      <br>      &lt;PharmacyWidget /&gt;<br>      &lt;LabResults /&gt;<br>      &lt;InventoryAlerts /&gt;<br>      {/* This is fine. Everything is fine. */}<br>    &lt;/div&gt;<br>  );<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y0Cc52li3KrBpde482aF_g.png" /></figure><p>What’s wrong with this?</p><ol><li><strong>You’re the bottleneck:</strong> Every team needs you to merge their changes.</li><li><strong>Deployment hell:</strong> A bug in the pharmacy widget? Gotta redeploy billing.</li><li><strong>Bundle bloat:</strong> That small clinic without a Lab? They’re still loading Lab code.</li><li><strong>Merge conflict city:</strong> Six teams editing the same file? Good luck.</li><li><strong>It’s YOUR problem now:</strong> Their component crashes? Guess who gets paged at 3 AM.</li></ol><p>There has to be a better way, right?</p><h3>The “Aha!” Momemt</h3><p>What if your Billing dashboard could be like… a power strip?</p><p>You know how a <a href="https://en.wikipedia.org/wiki/Power_strip">power strip</a> (multi-socket) doesn’t care what you plug into it? It just provides the outlets (with electricity flowing through them), and whatever device gets plugged in can use that power. The power strip doesn’t need to know if it’s charging a phone, a laptop, or a lamp.</p><p>That’s exactly what Extension-Slots do for your UI.</p><pre>// billing/Dashboard.jsx<br>function BillingDashboard() {<br>  const [currentPatient, setCurrentPatient] = useState(null);<br>  <br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;Billing&lt;/h1&gt;<br>      {/* Your actual billing stuff */}<br>      <br>      {/* &quot;Outlets&quot; that other teams can plug into */}<br>      &lt;ExtensionSlot <br>        name=&quot;billing-sidebar&quot; <br>        moduleName=&quot;billing&quot;<br>        state={{ patient: currentPatient }}<br>      /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>Now, over in the Pharmacy codebase (completely separate repo, separate team):</p><pre>// pharmacy/extensions.ts<br>registerExtension({<br>  name: &#39;pending-prescriptions&#39;,<br>  slot: &#39;billing-sidebar&#39;,<br>  component: ({ patient }) =&gt; {<br>    // Gets the patient data automatically!<br>    return &lt;PrescriptionWidget patientId={patient.id} /&gt;;<br>  }<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P2VJE6PoV5zmCiVQfSURAQ.png" /></figure><p><strong>What just happened?</strong></p><ol><li><strong>Billing Team:</strong> “Here’s a slot. I’ll give you patient data. Do whatever.”</li><li><strong>Pharmacy team:</strong> “Cool, we’ll show prescriptions. We’ll deploy ourselves.”</li><li><strong>Lab Team:</strong> “We’ll add lab test results. Also deploying ourselves.”</li></ol><p>No imports. No dependencies. No merge conflicts. No meetings.</p><h3>How It Actually Works (The Fun Part)</h3><p>Alright, let’s pop the hood and see what makes this tick.</p><h4>The Big Picture</h4><p>Imagine a bulletin board in an office. The Extension slot system is basically:</p><ol><li>A bulletin board (store) where everyone posts what they want.</li><li>Registration desk where components sign up and say “I want to be on board X”</li><li>The boards themeseleves (ExtensionSlot components) that display everything posted to them.</li></ol><p><strong>Here’s the flow:</strong></p><pre>Pharmacy Team: &quot;We have a widget!&quot; <br>    ↓<br>    Registers widget in global registry<br>    ↓<br>    Says &quot;Put me on the billing-sidebar board&quot;<br>    ↓<br>Billing Dashboard: &quot;Show me what&#39;s on billing-sidebar&quot;<br>    ↓<br>    Looks at registry, finds Pharmacy widget<br>    ↓<br>    Renders it with patient data</pre><p>Simple right?</p><h4>The Secret Sauce: Two Stores</h4><p>Here’s where it gets clever. The system uses two stores — think of them as a messy workshop and a clean showroom.</p><p><strong>Store #1: The Workshop (Internal Store)</strong></p><p>This is where the raw data lives. It’s optimized for writing:</p><pre>{<br>  extensions: {<br>    &#39;prescription-widget&#39;: {<br>      name: &#39;prescription-widget&#39;,<br>      component: PrescriptionWidget,<br>      order: 1<br>    },<br>    &#39;lab-results&#39;: {<br>      name: &#39;lab-results&#39;, <br>      component: LabResults,<br>      order: 2<br>    }<br>  },<br>  slots: {<br>    &#39;billing-sidebar&#39;: {<br>      attachedIds: [&#39;prescription-widget&#39;, &#39;lab-results&#39;],<br>      state: { patient: { id: 123, name: &#39;John&#39; } }<br>    }<br>  }<br>}</pre><p>See those attachedIds ? Just simple strings. Easy to add, remove, reorder.</p><p><strong>Store #2: The Showroom (Public Store)</strong></p><p>This is what your components actually read. It’s optimized for rendering:</p><pre>{<br>  slots: {<br>    &#39;billing-sidebar&#39;: {<br>      assignedExtensions: [<br>        {<br>          id: &#39;prescription-widget&#39;,<br>          component: PrescriptionWidget,  // Actual component, not string!<br>          order: 1<br>        },<br>        {<br>          id: &#39;lab-results&#39;,<br>          component: LabResults,  // Already sorted by order!<br>          order: 2<br>        }<br>      ],<br>      state: { patient: { id: 123, name: &#39;John&#39; } }<br>    }<br>  }<br>}</pre><p>Why two stores?</p><p>It’s like having your ingredients (store 1) separate from your cooked meal (store 2). You don’t want to slice tomatoes while serving dinner.</p><ul><li><strong>Workshop</strong>: Easy to add ingredients (attachedIds.push(&#39;new-widget&#39;))</li><li><strong>Showroom</strong>: Ready to serve (components resolved, sorted, everything done)</li></ul><p>When the workshop changes, a magical synchronization function cooks everything up and updates the showroom:</p><pre>// runs automatically whenever the internal store changes<br>function updateExtensionOutputStore(internalState) {<br>    const slots = {};<br>    <br>    // For each slot, cook up the final data<br>    for (const [slotName, slot] of Object.entries(internalState.slots)) {<br>        // Look up all the extension IDs and get their actual components<br>        const assignedExtensions = getAssignedExtensionsFromSlotData(<br>            slotName, <br>            internalState<br>        );<br>        <br>        slots[slotName] = {<br>            assignedExtensions,  // Fully cooked, ready to render<br>            state: slot.state<br>        }<br>    }<br><br>    // Only update if something actually changed (performance!)<br>    if (!isEqual(oldSlots, slots)) {<br>        extensionStore.setState({ slots });<br>    }<br>}</pre><p>That isEqual check? That’s saving you from re-rendering your entire app everytime someone sneezes.</p><h3>Let’s Build Something Real</h3><p>Theory is boring. Let’s build an actual dashboard with this thing.</p><p><strong>Step 1: Setting Up The Slots (The “Host”)</strong></p><p>You’re building a dashboard. You want other teams to be able to add widgets. Here’s your code:</p><pre>// dashboard/App.jsx<br>import { useState } from &#39;react&#39;;<br>import { ExtensionSlot } from &#39;extension-slot-core&#39;;<br><br>function Dashboard() {<br>  const [stats, setStats] = useState({ visits: 42, revenue: 12500 });<br><br>  return (<br>    &lt;div className=&quot;dashboard&quot;&gt;<br>      &lt;header&gt;<br>        &lt;h1&gt;Hospital Dashboard&lt;/h1&gt;<br>        {/* Anyone can add header widgets */}<br>        &lt;ExtensionSlot <br>          name=&quot;header-actions&quot; <br>          moduleName=&quot;dashboard&quot; <br>        /&gt;<br>      &lt;/header&gt;<br><br>      &lt;main&gt;<br>        {/* Main content area - pass live data to extensions */}<br>        &lt;ExtensionSlot <br>          name=&quot;main-widgets&quot; <br>          moduleName=&quot;dashboard&quot;<br>          state={{ stats }}  // Extensions get this data!<br>        /&gt;<br>        <br>        &lt;button onClick={() =&gt; setStats(prev =&gt; ({<br>          ...prev, <br>          visits: prev.visits + 1 <br>        }))}&gt;<br>          Simulate Visit<br>        &lt;/button&gt;<br>      &lt;/main&gt;<br><br>      &lt;aside&gt;<br>        {/* Sidebar */}<br>        &lt;ExtensionSlot <br>          name=&quot;sidebar&quot; <br>          moduleName=&quot;dashboard&quot; <br>        /&gt;<br>      &lt;/aside&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>That’s it. You’re done. You just created three outlets that anyone can plug into.</p><p><strong>Step 2: Plugging In Extensions (The “Guests”)</strong></p><p>Now, completely separately, the Pharmacy team writes their extension:</p><pre>// pharmacy-module/extensions/register.js<br>import { registerExtension, attach } from &#39;extension-slot-core&#39;;<br>import PrescriptionAlerts from &#39;./components/PrescriptionAlerts&#39;;<br>import QuickRefill from &#39;./components/QuickRefill&#39;;<br><br>// Define what we want to plug in<br>const extensions = [<br>  {<br>    name: &#39;prescription-alerts&#39;,<br>    component: PrescriptionAlerts,<br>    slot: &#39;sidebar&#39;,<br>    order: 1,  // Render first<br>    meta: {<br>      title: &#39;Pending Prescriptions&#39;,<br>      refreshInterval: 30000<br>    }<br>  },<br>  {<br>    name: &#39;quick-refill&#39;,<br>    component: QuickRefill,<br>    slot: &#39;header-actions&#39;,<br>    order: 10,  // Render after others<br>    meta: {<br>      icon: &#39;pill&#39;<br>    }<br>  }<br>];<br><br>// Register them<br>extensions.forEach(ext =&gt; {<br>  // Add to global registry<br>  registerExtension({<br>    name: ext.name,<br>    component: ext.component,<br>    meta: ext.meta,<br>    moduleName: &#39;pharmacy&#39;,<br>    order: ext.order<br>  });<br><br>  // Attach to slot(s)<br>  attach(ext.slot, ext.name, &#39;pharmacy&#39;);<br>});</pre><p>And here’s their actual component:</p><pre>// pharmacy-module/components/PrescriptionAlerts.jsx<br>function PrescriptionAlerts({ stats, meta }) {<br>  const [alerts, setAlerts] = useState([]);<br>  <br>  useEffect(() =&gt; {<br>    // Use the meta.refreshInterval we defined<br>    const interval = setInterval(() =&gt; {<br>      fetchPrescriptionAlerts().then(setAlerts);<br>    }, meta.refreshInterval);<br>    <br>    return () =&gt; clearInterval(interval);<br>  }, []);<br><br>  return (<br>    &lt;div className=&quot;widget&quot;&gt;<br>      &lt;h3&gt;{meta.title}&lt;/h3&gt;<br>      &lt;p&gt;Today&#39;s visits: {stats.visits}&lt;/p&gt; {/* Gets this from state! */}<br>      &lt;ul&gt;<br>        {alerts.map(alert =&gt; (<br>          &lt;li key={alert.id}&gt;{alert.message}&lt;/li&gt;<br>        ))}<br>      &lt;/ul&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>Notice what’s happening:</p><ol><li>The pharmacy team never imported anything from dashboard code.</li><li>The dashboard team never imported anything from pharmacy code.</li><li>They both work in completely separate repos.</li><li>Yet the component gets stats automatically because the dashboard passed it via state .</li><li>The component also gets meta with the configuration we defined.</li></ol><p><strong>Step 3: The Magic Glue (The Hook)</strong></p><p>So how does &lt;ExtensionSlot&gt; know what to render? There’s a custom hook doing the heavy lifting:</p><pre>function ExtensionSlot({ name, moduleName, state }) {<br>  // This hook does three things<br>  const { extensions } = useExtensionSlot(moduleName, name, state);<br><br>  return (<br>    &lt;div data-slot-name={name}&gt;<br>      {extensions.map(extension =&gt; {<br>        const Component = extension.component;<br>        return (<br>          &lt;div key={extension.id}&gt;<br>            {/* Pass state as props + meta from registration */}<br>            &lt;Component {...state} meta={extension.meta} /&gt;<br>          &lt;/div&gt;<br>        );<br>      })}<br>    &lt;/div&gt;<br>  );<br>}</pre><p>The useExtensionSlot hook is where the real work happens:</p><pre>function useExtensionSlot(moduleName, slotName, state) {<br>  const isFirstRender = useRef(true);<br><br>  // On first render: Register this slot<br>  useEffect(() =&gt; {<br>    registerExtensionSlot(slotName, moduleName, state);<br>    isFirstRender.current = false;<br>  }, []); // Run once<br><br>  // On subsequent renders: Update the state<br>  useEffect(() =&gt; {<br>    if (!isFirstRender.current) {<br>      updateExtensionSlot(slotName, state ?? {});<br>    }<br>  }, [state]); // Run when state changes<br><br>  // Read what&#39;s attached to this slot<br>  const extensions = useAssignedExtensions(slotName);<br>  <br>  return { extensions };<br>}</pre><p><strong>Breaking this down:</strong></p><ol><li><strong>First render: </strong>“Hey store, I’m a new slot called <strong>sidebar</strong> from module <strong>dashboard</strong>”.</li><li><strong>Store: </strong>“Got it! I see Pharmacy and Lab have already attached widgets to you. Here they are.”</li><li><strong>Component:</strong> “Cool, I’ll render them”.</li><li><strong>Later, when state changes:</strong> “Hey store, update my state to this new value”.</li><li><strong>Store:</strong> “Done, Extensions will get the new state on their next render.”</li></ol><p>The two useEffect hooks are split because:</p><ul><li>Registering a slot is expensive (creates data structures)</li><li>Updating state is cheap (just swaps an object)</li><li>We don’t want to re-register every time state changes</li></ul><p><strong>Step 4: The Store Operations</strong></p><p>When you call registerExtension or attach , what actually happens?</p><p><strong>Registering an extension:</strong></p><pre>export function registerExtension(extensionData) {<br>  updateExtensionInternalStore((state) =&gt; {<br>    return {<br>      ...state,  // Keep everything else<br>      extensions: {<br>        ...state.extensions,  // Keep other extensions<br>        [extensionData.name]: {  // Add/update this one<br>          ...extensionData,<br>          instances: [] <br>        }<br>      }<br>    };<br>  });<br>}</pre><p>This is just saying: “Add this extension to the registery”. That’s it. It’s not attached to any slot yet.</p><h4>Attaching to a slot:</h4><pre>export function attach(slotName, extensionId, moduleName) {<br>  updateExtensionInternalStore((state) =&gt; {<br>    const existingSlot = state.slots?.[slotName];<br><br>    // Slot doesn&#39;t exist yet? Create it!<br>    if (!existingSlot) {<br>      return {<br>        ...state,<br>        slots: {<br>          ...state.slots,<br>          [slotName]: {<br>            name: slotName,<br>            moduleName,<br>            attachedIds: [extensionId],  // First extension!<br>            state: {}<br>          }<br>        }<br>      };<br>    }<br><br>    // Slot exists, add extension to it<br>    if (existingSlot.attachedIds.includes(extensionId)) {<br>      console.warn(`Already attached!`);<br>      return state;  // No changes<br>    }<br><br>    return {<br>      ...state,<br>      slots: {<br>        ...state.slots,<br>        [slotName]: {<br>          ...existingSlot,<br>          attachedIds: [...existingSlot.attachedIds, extensionId]<br>        }<br>      }<br>    };<br>  });<br>}</pre><p><strong>The beautiful part:</strong> Extensions can attach to slots that don’t exist yet!</p><p>Why? Because in micro-frontends, load order is unpredictable:</p><ul><li>Maybe Pharmacy loads first → attaches to ‘billing-sidebar’</li><li>Later, Billing loads → creates ‘billing-sidebar’ → finds existing attachments</li></ul><p>Or vice versa! Doesn’t matter. It just works.</p><h4>The Real-World Stuff</h4><p>Remember that order property? Here’s how it’s used:</p><pre>function getAssignedExtensionsFromSlotData(slotName, internalState) {<br>  const slot = internalState.slots?.[slotName];<br>  if (!slot) return [];<br><br>  const extensions = [];<br>  <br>  // Look up each extension ID<br>  for (const extensionId of slot.attachedIds) {<br>    const name = getExtensionNameFromId(extensionId);<br>    const extension = internalState.extensions[name];<br>    if (extension) {<br>      extensions.push({<br>        component: extension.component,<br>        id: extensionId,<br>        meta: extension.meta,<br>        order: extension.order<br>      });<br>    }<br>  }<br><br>  // Sort by order (lower numbers first)<br>  return extensions.sort((a, b) =&gt; {<br>    const orderA = a.order ?? 999;  // No order? Render last<br>    const orderB = b.order ?? 999;<br>    return orderA - orderB;<br>  });<br>}</pre><p>So if you have:</p><ul><li>Lab widget with order: 1</li><li>Pharmacy widget with order: 2</li><li>Inventory widget with order: 5</li></ul><p>They’ll always render in that order, regardless of when they registered.</p><p><strong>Passing Live Data</strong></p><p>This is where it gets cool. The state you pass flows through automatically:</p><pre>function Dashboard() {<br>  const [patient, setPatient] = useState(null);<br>  const [vitals, setVitals] = useState({});<br><br>  // Live data updates every second<br>  useEffect(() =&gt; {<br>    const interval = setInterval(() =&gt; {<br>      setVitals(fetchLatestVitals());<br>    }, 1000);<br>    return () =&gt; clearInterval(interval);<br>  }, []);<br><br>  return (<br>    &lt;ExtensionSlot <br>      name=&quot;monitoring&quot;<br>      moduleName=&quot;dashboard&quot;<br>      state={{ patient, vitals }}  // Both change over time<br>    /&gt;<br>  );<br>}</pre><p>Every extension attached to “monitoring” will re-render with fresh data every second. They don’t need to fetch anything — it’s just handed to them.</p><h4>Dynamic Loading</h4><p>Want to load extensions conditionally?</p><pre>// Only load expensive analytics in production<br>if (process.env.NODE_ENV === &#39;production&#39;) {<br>  registerExtension({<br>    name: &#39;analytics-dashboard&#39;,<br>    component: lazy(() =&gt; import(&#39;./AnalyticsDashboard&#39;)),<br>    slot: &#39;admin-panel&#39;<br>  });<br>}<br><br>// Or based on user permissions<br>if (user.hasPermission(&#39;VIEW_LAB_RESULTS&#39;)) {<br>  attach(&#39;patient-sidebar&#39;, &#39;lab-results&#39;, &#39;laboratory&#39;);<br>}</pre><h4>Detaching Extensions</h4><p>Need to remove something?</p><pre>// User disabled a feature<br>detach(&#39;billing-sidebar&#39;, &#39;prescription-widget&#39;);</pre><h3>The Performance Story</h3><p>“But won’t this be slow with lots of extensions?”</p><p>Great question! Here’s how it stays fast:</p><ol><li><strong>The Deep Equality Check</strong></li></ol><pre>function updateExtensionOutputStore(internalState) {<br>  const newSlots = computeSlots(internalState);<br>  const oldSlots = extensionStore.getState();<br><br>  // Only update if something actually changed<br>  if (!isEqual(oldSlots, newSlots)) {<br>    extensionStore.setState({ slots: newSlots });<br>  }<br>}</pre><p>Without this, every tiny change would re-render every compoent. With this, React only re-renders when data actually changes.</p><p><strong>2. Memoize Your Extensions</strong></p><pre>// Expensive component that shouldn&#39;t re-render unless data changes<br>const PatientChart = React.memo(({ patientId, vitals }) =&gt; {<br>  // Heavy computation here<br>  const chartData = processVitals(vitals);<br>  return &lt;LineChart data={chartData} /&gt;;<br>});<br><br>registerExtension({<br>  name: &#39;patient-chart&#39;,<br>  component: PatientChart,  // Wrapped in memo<br>  // ...<br>});</pre><p><strong>3. Lazy Load Heavy Stuff</strong></p><pre>const HeavyAnalyticsDashboard = lazy(() =&gt; <br>  import(/* webpackChunkName: &quot;analytics&quot; */ &#39;./AnalyticsDashboard&#39;)<br>);<br><br>registerExtension({<br>  name: &#39;analytics&#39;,<br>  component: () =&gt; (<br>    &lt;Suspense fallback={&lt;Spinner /&gt;}&gt;<br>      &lt;HeavyAnalyticsDashboard /&gt;<br>    &lt;/Suspense&gt;<br>  ),<br>  slot: &#39;admin-panel&#39;<br>});</pre><h3>Real-World Example: Building a Hospital Dashboard</h3><p>Let’s put it all together with a realistic scenario.</p><p><strong>Your mission:</strong> Build a patient dashboard that different hospital departments can extend.</p><p><strong>The Dashboard (Core Team):</strong></p><pre>// dashboard/App.jsx<br>import { ExtensionSlot } from &#39;extension-slot-core&#39;;<br>import &#39;./extensions&#39;;  // Load our own extensions<br><br>function PatientDashboard() {<br>  const { patientId } = useParams();<br>  const patient = usePatient(patientId);<br>  const vitals = useRealTimeVitals(patientId);<br><br>  if (!patient) return &lt;Loading /&gt;;<br><br>  return (<br>    &lt;div className=&quot;patient-dashboard&quot;&gt;<br>      &lt;header&gt;<br>        &lt;h1&gt;{patient.name}&lt;/h1&gt;<br>        &lt;ExtensionSlot <br>          name=&quot;patient-header-actions&quot;<br>          moduleName=&quot;dashboard&quot;<br>          state={{ patient }}<br>        /&gt;<br>      &lt;/header&gt;<br><br>      &lt;div className=&quot;layout&quot;&gt;<br>        &lt;aside className=&quot;sidebar&quot;&gt;<br>          &lt;ExtensionSlot <br>            name=&quot;patient-sidebar&quot;<br>            moduleName=&quot;dashboard&quot;<br>            state={{ patient, vitals }}<br>          /&gt;<br>        &lt;/aside&gt;<br><br>        &lt;main&gt;<br>          &lt;PatientInfo patient={patient} /&gt;<br>          <br>          &lt;ExtensionSlot <br>            name=&quot;patient-main-content&quot;<br>            moduleName=&quot;dashboard&quot;<br>            state={{ patient, vitals }}<br>          /&gt;<br>        &lt;/main&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p><strong>Pharmacy Team:</strong></p><pre>// pharmacy-module/extensions.js<br>import { registerExtension, attach } from &#39;extension-slot-core&#39;;<br><br>// Active prescriptions widget<br>registerExtension({<br>  name: &#39;active-prescriptions&#39;,<br>  component: ({ patient }) =&gt; {<br>    const prescriptions = usePrescriptions(patient.id);<br>    return (<br>      &lt;WidgetCard title=&quot;Active Prescriptions&quot;&gt;<br>        {prescriptions.map(rx =&gt; (<br>          &lt;PrescriptionItem key={rx.id} prescription={rx} /&gt;<br>        ))}<br>      &lt;/WidgetCard&gt;<br>    );<br>  },<br>  meta: { icon: &#39;pill&#39;, color: &#39;blue&#39; },<br>  moduleName: &#39;pharmacy&#39;,<br>  order: 1<br>});<br><br>attach(&#39;patient-sidebar&#39;, &#39;active-prescriptions&#39;, &#39;pharmacy&#39;);<br></pre><p><strong>Lab Team:</strong></p><pre>// lab-module/extensions.js<br><br>// Recent lab results<br>registerExtension({<br>  name: &#39;recent-labs&#39;,<br>  component: ({ patient, vitals }) =&gt; {<br>    const labs = useLabResults(patient.id);<br>    return (<br>      &lt;WidgetCard title=&quot;Recent Lab Results&quot;&gt;<br>        {labs.map(lab =&gt; (<br>          &lt;LabResultRow <br>            key={lab.id} <br>            result={lab}<br>            isAbnormal={checkIfAbnormal(lab, vitals)}<br>          /&gt;<br>        ))}<br>      &lt;/WidgetCard&gt;<br>    );<br>  },<br>  meta: { icon: &#39;flask&#39;, color: &#39;green&#39; },<br>  moduleName: &#39;laboratory&#39;,<br>  order: 2<br>});<br><br>attach(&#39;patient-sidebar&#39;, &#39;recent-labs&#39;, &#39;laboratory&#39;);</pre><p><strong>Radiology Team:</strong></p><pre>// radiology-module/extensions.js<br><br>registerExtension({<br>  name: &#39;imaging-history&#39;,<br>  component: ({ patient }) =&gt; {<br>    const scans = useImagingHistory(patient.id);<br>    return (<br>      &lt;WidgetCard title=&quot;Recent Imaging&quot;&gt;<br>        {scans.map(scan =&gt; (<br>          &lt;ImagingCard <br>            key={scan.id} <br>            scan={scan}<br>            onView={() =&gt; openImageViewer(scan)}<br>          /&gt;<br>        ))}<br>      &lt;/WidgetCard&gt;<br>    );<br>  },<br>  meta: { icon: &#39;x-ray&#39;, color: &#39;purple&#39; },<br>  moduleName: &#39;radiology&#39;,<br>  order: 3<br>});<br><br>attach(&#39;patient-sidebar&#39;, &#39;imaging-history&#39;, &#39;radiology&#39;);</pre><p><strong>What did we just do?</strong></p><ul><li><strong>Three separate teams</strong> deployed code to the same UI</li><li><strong>Zero imports</strong> between modules</li><li><strong>Zero coordination</strong> needed</li><li><strong>Each team</strong> can deploy independently</li><li><strong>Each hospital</strong> can enable/disable modules as needed</li></ul><p>And if Radiology’s code crashes? Only their widget breaks. The rest of the dashboard keeps working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aYmq4cheUrro2p35Y_myFA.png" /><figcaption>Overall Architecture</figcaption></figure><h3>When NOT to Use This</h3><p>Real talk: this pattern isn’t always the answer.</p><p><strong>Don’t use it when:</strong></p><ol><li><strong>You have a small, stable team</strong> — The coordination overhead isn’t worth it</li><li><strong>Your app is simple</strong> — Props and component composition work fine</li><li><strong>You need tight integration</strong> — Extensions are intentionally loosely coupled</li><li><strong>Performance is critical</strong> — The indirection adds tiny overhead</li><li><strong>You’re just starting</strong> — Add this when you feel the pain, not before</li></ol><p><strong>DO use it when:</strong></p><ol><li><strong>Multiple teams</strong> own different domains</li><li><strong>You need an independent deployment</strong></li><li><strong>Your app is plugin-like</strong> by nature (dashboards, admin panels, etc.)</li><li><strong>You want to avoid merge conflicts</strong> between teams</li><li><strong>Different customers need different features</strong></li></ol><h3>Wrapping Up</h3><p>Extension Slots are basically saying: “I don’t know what you need here, so I’ll make space for you to add it yourself.”</p><p>It’s the difference between building a house with rooms already divided (traditional components) versus building a house with movable walls (extension slots). Sure, movable walls are more complex, but when you need to reconfigure, you’ll be glad you have them.</p><p>The pattern shines in micro-frontend architectures where:</p><ul><li>Teams need autonomy</li><li>Features come and go</li><li>Not every customer needs every feature</li><li>Deployment independence matters</li></ul><p>Is it overkill for a simple React app? Absolutely.</p><p>Is it a lifesaver for a large-scale, multi-team application? You bet.</p><p>Now go forth and build something awesome. And when your teammate asks “Can I add a widget to your page?”, just point them to an extension slot and sip your coffee in peace. ☕️</p><p><strong>NPM Package:</strong> <a href="https://www.npmjs.com/package/react-extension-slot">https://www.npmjs.com/package/react-extension-slot</a></p><p><strong>Source code:</strong> <a href="https://github.com/senthil-athiban/extension-slot">https://github.com/senthil-athiban/extension-slot</a></p><p><strong>Example:</strong> <a href="https://github.com/senthil-athiban/extension-slot-demo">https://github.com/senthil-athiban/extension-slot-demo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49693f2e3236" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unicast vs Multicast vs Broadcast vs Anycast]]></title>
            <link>https://medium.com/@senthilathiban0/unicast-vs-multicast-vs-broadcast-vs-anycast-99abcf81ddcf?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/99abcf81ddcf</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[engineer]]></category>
            <category><![CDATA[computer-networking]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Tue, 25 Feb 2025 04:19:35 GMT</pubDate>
            <atom:updated>2025-02-25T04:19:35.748Z</atom:updated>
            <content:encoded><![CDATA[<p>If you haven’t checked my previous blog, where I explained about the <a href="https://medium.com/@senthilathiban0/made-dns-resolution-simple-d14fbda20ded">DNS resolution</a>, I recommend giving it a read first.</p><h3>Cast in Networking</h3><blockquote>In simple terms, <strong>cast</strong> refers to how data is transmitted from one device to others over a network. It determines whether a message is delivered to a single device, a group of devices, or every device in the network.</blockquote><h4>📌 Types of Cast in Networking</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLEhd3X8jeaAdjnWjrcmNA.png" /></figure><h3><strong>1.Unicast</strong> 📩 (One-to-One)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-HgLeD2_iRAPkBQJxklPKg.png" /></figure><p>This is the most straightforward type — <strong>one sender, one receiver</strong>. When data is sent via unicast, it goes directly to a specific recipient without involving others.</p><h4>Real-world Example: Netflix Streaming</h4><p>Imagine you’re watching <em>Stranger Things</em>, while your friend is watching <em>Avengers</em>. Each of you receives a separate video stream. The server sends a <strong>unique data stream</strong> to each user, ensuring an individualized experience.</p><p><strong>Other examples:</strong> HTTP, SMTP (email), FTP (file transfers).</p><h3><strong>2. Broadcast</strong> 📡 (One-to-All)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IRB7RLOviqsylqKh1MB1uA.png" /></figure><p>Here, a <strong>single sender transmits data to all devices</strong> in the network, regardless of whether they need it.</p><h4>Real-world Example: Radio Broadcast</h4><ul><li>A radio station transmits a signal.</li><li>Anyone with a radio can tune in.</li><li>There’s no way to select who receives the signal — it’s available to everyone.</li></ul><p><strong>Technical Example:</strong> The <strong>Address Resolution Protocol (ARP)</strong> sends packets to all devices in a network to discover IP-to-MAC address mappings. Every device must process these packets, even if they don’t need them.</p><h3><strong>3.Multicast</strong> 🎯 (One-to-Many)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ht94NxqS25SLYBsUW_WFKA.png" /></figure><p>Multicast is like a refined version of broadcast. Instead of sending data to <strong>everyone</strong>, it goes <strong>only to a group of subscribed recipients</strong>.</p><p>At the network level, multicast data is efficiently replicated by routers. Instead of sending multiple copies from the sender, a single stream is transmitted, and routers duplicate the data only where necessary. This minimizes bandwidth usage</p><h4>Real-world Example: Live Football Streaming</h4><ul><li>A single camera films the match.</li><li>Thousands of fans worldwide watch the game.</li><li>The stream is <strong>sent only to those who have subscribed</strong> (e.g., via a streaming service).</li></ul><p><strong>How it works:</strong></p><ul><li>A server sends <strong>one stream</strong> to a <strong>multicast group</strong>.</li><li>Routers <strong>replicate and forward</strong> the stream only to interested receivers.</li><li>Users must <strong>subscribe</strong> to receive the data, reducing unnecessary bandwidth usage.</li></ul><p><strong>Key difference from Broadcast:</strong></p><ul><li><strong>Broadcast</strong> sends data to <strong>everyone</strong>, even if they don’t want it.</li><li><strong>Multicast</strong> sends data <strong>only to those who requested it</strong>.</li></ul><p>Multicast uses protocols like IGMP (Internet Group Management Protocol) to allow users to join multicast groups. The server sends one stream to a multicast group, and routers copy the stream only where needed.</p><h4>PIM Dense Mode and Prune Mechanism</h4><p>Multicast routing protocols like PIM (Protocol Independent Multicast) manage how data flows in the network.</p><ul><li><strong>PIM Dense Mode (PIM-DM)</strong> assumes that most devices in the network need the data. It floods the multicast traffic everywhere and later prunes unnecessary branches.</li><li><strong>Prune Mechanism</strong> is used to cut off network branches that don’t need multicast data. If a router detects that none of its connected hosts need the multicast traffic, it sends a prune message upstream to stop receiving it.</li></ul><h3><strong>4.Anycast</strong> 🚀 (One-to-Closest One)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NqXvZ90de3awx0T8IdOlrA.png" /></figure><p>Anycast is different from the rest — it <strong>routes data to the closest available receiver</strong> instead of a predefined one.</p><h4>Real-world Example: Google DNS (8.8.8.8)</h4><p>When you use Google’s public DNS (8.8.8.8), your request doesn’t go to a single fixed server. Instead:</p><ul><li><strong>Multiple Google DNS servers</strong> worldwide share the <strong>same IP address</strong>.</li><li>The <strong>nearest</strong> server (based on network conditions) responds to your request.</li><li>If the closest server goes down, traffic is <strong>rerouted</strong> to another healthy one.</li></ul><h3>Unicast vs multicast</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wG2zVGH7h_DIq2FsUwTvqA.png" /><figcaption>data stream flow in unicast</figcaption></figure><p>In <strong>unicast</strong>, if a sender needs to send data to 3 different users, it will <strong>transmit 3 separate data streams</strong>. If each stream consumes <strong>5 Mbps</strong>, then total bandwidth usage is <strong>15 Mbps</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4G8nl1IikS74cp6E2tG9Vw.png" /><figcaption>data stream flow in multicast</figcaption></figure><p>In <strong>multicast</strong>, the sender transmits <strong>only one copy</strong>, and routers duplicate it <strong>only when needed</strong>, making it bandwidth-efficient.</p><h3>Anycast vs multicast</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNq5CVotf6hMeIY_Si6Itw.png" /></figure><p>In <strong>anycast</strong>, when a client makes a request, it gets routed to the <strong>nearest</strong> available server. If that server fails, traffic is <strong>automatically rerouted</strong> to another healthy one.</p><p>In <strong>multicast</strong>, data is sent to <strong>all interested receivers</strong>, not just the closest one.</p><h3>🚀 Conclusion</h3><p>Choosing the right <strong>cast</strong> method depends on your needs:</p><ul><li><strong>Unicast</strong>: Best for <strong>one-on-one</strong> communication (e.g., video streaming, web browsing).</li><li><strong>Broadcast</strong>: Ideal for <strong>network-wide messages</strong> (e.g., ARP requests, local network announcements).</li><li><strong>Multicast</strong>: Perfect for <strong>group-based communication</strong> (e.g., live sports streaming, stock market feeds).</li><li><strong>Anycast</strong>: Great for <strong>reducing latency &amp; handling failovers</strong> (e.g., DNS resolution, CDN load balancing).</li></ul><p>Google leverages <strong>anycast</strong> for its DNS servers to <strong>ensure high availability and fast response times</strong>, making internet browsing more efficient.</p><p>I hope this post made the concepts clearer! If you found it helpful, let me know your thoughts in the comments. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99abcf81ddcf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DNS Resolution: Beyond the Basics]]></title>
            <link>https://medium.com/@senthilathiban0/made-dns-resolution-simple-d14fbda20ded?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/d14fbda20ded</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[computer-networking]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Sun, 16 Feb 2025 09:06:29 GMT</pubDate>
            <atom:updated>2025-02-16T11:15:55.876Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>From Domain Names to IP Addresses</strong></h4><p><strong>Understanding DNS Resolution: What Happens When You Enter a URL?</strong></p><p>Before diving in, let’s understand. What actually happens when we type <a href="http://www.google.com/">www.google.com</a> into the browser? Why do we use domain names like <a href="http://www.google.com/">www.google.com</a> instead of something else?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*lniSl-8BMWIipjv9dVS_Pg.jpeg" /></figure><h4>The Need for domain Name</h4><p>In the world of internet, every machine connected to the networks has a unique <strong>IP address.</strong></p><blockquote><strong>IP Address</strong>: IP address stands for <strong>Internet Protocol address</strong>, is a unique numerical identifier assigned to each device connected to the internet, allowing communication between them. ( Eg.<strong>,</strong> IP address: <strong>142.250.77.132 )</strong></blockquote><p>If we need to access a website, we actually connect to a specific machine identified by it’s IP address. However, humans aren’t great at remembering the long sequences of numbers (IP address). Wouldn’t it be easier if we could use something more readable?</p><p>That’s where <strong>domain names </strong>come in.</p><blockquote><strong>Domain Name: </strong>It refers to human-friendly label used to identify a location on the internet, which makes the user’s life easier to access the websites and online service.</blockquote><p>Instead of remembering the <strong>IP address</strong> <strong>(142.250.77.132)</strong>, it is easier for us to remember a <strong>domain name</strong> like <a href="http://www.google.com/"><strong>www.google.com</strong></a></p><p>But wait — how does the browser know which IP address corresponds to <a href="http://www.google.com/?">www.google.com </a>🤔 ? This is where DNS Resolution comes into play.</p><h4>DNS Resolution: <strong>Translating Domain Names into IP Addresses</strong></h4><blockquote>The process of DNS resolution involves converting a domain name (<a href="http://www.example.com)/">www.google.com)</a> into a computer-friendly IP address (<strong>142.250.77.132</strong>)</blockquote><p>At first glance, it may seem like a simple translation, but under the hood, a fascinating multi-step process takes place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jyWJifzhPJfYZQuhcoxyyg.png" /><figcaption>DNS in one picture</figcaption></figure><p>🤯 Too many layers, and too many jargon. Let’s break it down step by step.</p><p>Assume a user is typing <a href="http://www.google.com/">www.google.com</a> in the browser. The client then makes a DNS query to retrieve the IP address of <a href="http://www.google.com,/">www.google.com</a> to access the website.</p><p>The DNS query will first pass through the cache layer to check whether the IP address is available. If it is available, the cache return the IP address to the client.</p><h3>1. Checking the Cache</h3><blockquote>Caching is the process of temporarily storing data in a specific location to improve performance and reliability for data requests.</blockquote><p>If the IP address of <a href="http://www.google.com/"><strong>www.google.com</strong></a> is found in the cache, the browser uses it directly, saving time and resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gc5AFSVz9n0PB_NRieuquA.png" /></figure><p><strong>Client:</strong> Hey guys, does anyone know the IP address of <a href="http://www.google.com/">www.google.com</a>?</p><p><strong>Browser:</strong> Oh, wait! let me check my cache system.</p><p>(Meanwhile… 🥱)</p><p><strong>Browser:</strong> 😅 Sorry, I couldn’t find any IP address that belongs to <a href="http://www.google.com/">www.google.com</a></p><p><strong>OS:</strong> Got it! Let me check my cache…</p><p>(Meanwhile… 😴)</p><p><strong>OS:</strong> Sorry dude! Bad luck 😐. I don’t have it either. I’ll ask the <strong>DNS resolver</strong>.</p><h3>2. Querying the DNS Resolver</h3><blockquote><strong>DNS resolver: </strong>The DNS resolver is responsible for handling the lookup process and finding the correct IP address.</blockquote><p><strong>Client:</strong> Hey DNS Resolver, you are my last hope 🤧, I need the IP address for <a href="http://www.google.com./"><strong>www.google.com</strong>.</a> Can you help?</p><p><strong>DNS resolver:</strong> Let me check my cache… Nope, not here either. Let me start the DNS lookup process.</p><h3>3. DNS Lookup Process</h3><blockquote>DNS lookup follows a step-by-step resolution from the <strong>Recursive Resolver</strong> to the <strong>Authoritative Name Server</strong> to retrieve the correct IP.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QI9yCMv3-sbOIpH6NplpDw.png" /></figure><p><strong>Step 3.1: Contacting the Root Name Server</strong></p><p>The <strong>Root Name Server (RNS) </strong>is the top-level server that directs the resolver to relevant <strong>Top Level Domain (TLD) Name</strong> <strong>Server.</strong> In our case, we are looking the IP address of <a href="http://www.google.com,/">www.google.com,</a> here the TLD is <strong>.com, </strong>so the Root name server will route the DNS query to <strong>.com </strong>TLD server.</p><p><strong>DNS resolver:</strong> Hey <strong>RNS</strong>, I’m looking for IP address of <a href="http://www.google.com/?">www.google.com</a>. Can you help?</p><p><strong>RNS: </strong>Looks like domain ends in <strong>.com</strong>, Okay. I’ll guide you to <strong>.com TLD server. </strong>He will help you!</p><p><strong>DNS resolver: </strong>Hurray, Ready to go 🚀.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ul3j4je8OUTMw-GkBuNAw.png" /></figure><p><strong>Step 3.2: Querying the TLD Name Server</strong></p><blockquote>The <strong>Top-Level Domain (TLD) Name Server</strong> helps route DNS queries to the correct <strong>Authoritative Name Server</strong> for a given domain by directing requests for domains like .com, .org, or .net to their respective authoritative DNS servers.</blockquote><p><strong>DNS resolver:</strong> Hey TLD Server, I need IP address for <a href="http://www.google.com/?">www.google.com</a>.</p><p><strong>TLD:</strong> Ah! I can’t give you the IP, but I know who can!</p><p><strong>DNS resolver: </strong>Who is that 🧐?</p><p><strong>TLD: Authoritative Name Server</strong>, I’ll call him☎️.</p><p><strong>Step 3.3: Contacting the Authoritative Name Server</strong></p><blockquote>The <strong>Authoritative name server</strong> stores and manages the DNS zone, which includes records ( A, CNAME, etc., ), that maps the domain names to the corresponding IP address.</blockquote><p><strong>DNS resolver</strong>: Hey man, i was looking for…</p><p><strong>ANS: </strong>Wait ✋, give me the domain name.</p><p><strong>DNS resolver</strong>: <a href="http://www.google.com/">www.google.com</a></p><p><strong>ANS</strong>: here is your IP address: <strong>142.250.77.132</strong></p><p><strong>DNS resolver</strong>: Thanks buddy 🤝.</p><h3>4. Returning the Response</h3><p>Now that we have the IP address, the DNS resolver:</p><ol><li><strong>Caches</strong> the IP address for future queries.</li><li><strong>Returns</strong> the IP address to the client.</li><li>The browser then <strong>connects</strong> to 142.250.77.132 to load the website.</li></ol><p><strong>DNS resolver:</strong> Who asked me for the IP address of <a href="http://www.google.com/?">www.google.com?</a></p><p><strong>Client:</strong> Yeah, I’m here 🤚.</p><p><strong>DNS resolver:</strong> Oh, thanks for your patience 😀. Here is your IP address: <strong>142.250.77.132.</strong></p><p><strong>Client:</strong> Thank you so much 😌🙏.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*TW7t_VHZt8GFT6sU3EBD-Q.png" /></figure><p>Finally, the user could able to access the <a href="http://www.google.com/">www.google.com</a> website.</p><h3>Summary</h3><p>The DNS resolution process ensures that when you type a human-friendly domain name into your browser, it seamlessly translates into a machine-friendly IP address, allowing you to access websites effortlessly.</p><h4>Key Takeaways:</h4><ul><li>The internet relies on <strong>IP addresses</strong> for communication, but <strong>domain names</strong> make it easier for humans.</li><li>The <strong>DNS resolution</strong> process translates domain names into IP addresses.</li><li>The process involves <strong>caching</strong>, a <strong>DNS resolver</strong>, and multiple layers of <strong>DNS servers</strong>.</li><li><strong>There are only 13 Root Name Servers globally, each with multiple distributed servers.</strong></li><li>The <strong>Authoritative Name Server</strong> is the final stop, managing DNS records like <strong>CNAME and A records</strong>.</li><li>The final result is an IP address that allows the browser to load the requested website.</li></ul><p>Next time you visit a website, you’ll know exactly what’s happening behind the scenes! 🚀</p><p><strong>References:</strong></p><p>i) <a href="https://www.cloudflare.com/en-gb/learning/dns/what-is-dns/">https://www.cloudflare.com/en-gb/learning/dns/what-is-dns/</a></p><p>ii) <a href="https://howdns.works/ep5/">https://howdns.works/ep5/</a></p><p>iii) <a href="https://roadmap.sh/guides/dns-in-one-picture">https://roadmap.sh/guides/dns-in-one-picture</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d14fbda20ded" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[S.O.L.I.D Principle: Beyond the Basics]]></title>
            <link>https://medium.com/@senthilathiban0/make-s-o-l-i-d-principles-simple-e6d32a04ce2f?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6d32a04ce2f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[software-principles]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 16:37:23 GMT</pubDate>
            <atom:updated>2025-02-16T11:12:36.301Z</atom:updated>
            <content:encoded><![CDATA[<p>As developers, we often strive to write code that not only works, but also is clean, maintainable and easier to understand. But achieving this isn’t straightforward, this is where <strong>SOLID</strong> principles come in — a set of five tried-and-true guidelines designed to help us build software that is flexible, scalable and easier-to-maintain over time.</p><p>In this blog, I’ll walk you through these principles with relatable and beginner-friendly examples, so that you can see how they apply in real-world scenarios. Whether you’re new to these concepts or looking to solidify your understanding, this is a great starting point.</p><p>Let’s explore how SOLID principles can transform the way you approach Software Development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RLkCIdYXIh1dE0cUWAic-A.jpeg" /></figure><h4>1. Single Responsibility Principle (SRP): Keeping classes focused</h4><blockquote>A class should have one and only one reason to change, meaning that a class should only have one job.</blockquote><p><strong>What does this mean?</strong></p><p>Imagine a payment service in a software application. It’s primary responsibility is to process payments — nothing more, nothing less. Let’s break down this with a practical example:</p><pre>type PaymentMethod = &#39;credit_card&#39;|&#39;stripe&#39;|&#39;paypal&#39;;<br><br>interface PaymentDetails {<br>  amount: number;<br>  accountId: string;<br>}<br><br>class PaymentService {<br>  constructor() {}<br>  async processPayments(paymentMethod: PaymentMethod, paymentDetails:PaymentDetails) {<br>        console.log(`Processing ${paymentMethod} payment for ${paymentDetails.currency} ${paymentDetails.amount}`);<br>        await new Promise(resolve =&gt; setTimeout(resolve, 1000));<br>        console.log(`${paymentMethod} payment processed successfully`);<br>  }<br>}</pre><p><strong>Why is this important?</strong></p><p><strong>i) Simplicity:</strong> When a class does one thing, it’s easier to understand to maintain</p><p><strong>ii) Flexibility:</strong> Changes in one part of the system won’t cascade though multiple responsibilities</p><h4>Common Anti-pattern</h4><p>A violation of SRP looks like these</p><pre>class PaymentService {<br>  processPayment(paymentDetails: PaymentDetails){<br>    // payment processing<br>  }<br>  sendPaymentConfirmationEmail(){<br>    // Sending emails<br>  }<br>}</pre><p>This approach violates SRP because the class now has multiple responsibilities such as payment processing and email sending.</p><h4>Ideal approach</h4><p>Instead, separate the concerns</p><pre>class PaymentService {<br>  processPayment(paymentDetails: PaymentDetails){<br>    // payment processing<br>  }<br>}<br><br>class EmailService {<br>  sendConfirmation(to: string, body: string){<br>    // Email sending logic<br>  }<br>}</pre><h4>2. Open/Close principles (OCP): Extending without modification</h4><blockquote>Objects or entities should be open for extension, but closed for modification.</blockquote><p>In simpler terms, we should be able to add new functionality without modifying the existing code.</p><p><strong>The Problem with Rigid code</strong></p><pre>type PaymentMethod = &#39;credit_card&#39;|&#39;stripe&#39;|&#39;paypal&#39;;<br><br>interface PaymentDetails {<br>  amount: number;<br>  accountId: string;<br>}<br><br>class PaymentService {<br>  constructor() {}<br>  async processPayments(paymentMethod: PaymentMethod, paymentDetails:PaymentDetails) {<br>        if(paymentMethod === &#39;credit_card&#39;){<br>            // processing credit_card payment logic<br>        } else if(paymentMethod === &#39;paypal&#39;){<br>            // processing paypal payment logic<br>        } else if(paymentMethod === &#39;stripe&#39;){<br>          // processing stripe payment logic<br>        }<br>  }<br>}</pre><p>This approach has a critical flaw, adding new payment method requires to modify the existing class.</p><p><strong>Ideal Approach</strong></p><p>Each payment method should have their own class and payment processing logic.</p><pre>interface IPaymentProcessor {<br>  processPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt;;<br>}<br><br>class CreditCardPayment implements IPaymentProcessor {<br>  async processPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt; {<br>    // Credit card payment logic<br>    return true;<br>  }<br>}<br><br>class PayPalPayment implements IPaymentProcessor {<br>  async processPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt; {<br>    // PayPal payment logic<br>    return true;<br>  }<br>}<br><br>class StripePayment implements IPaymentProcessor {<br>  async processPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt; {<br>    // Stripe payment logic<br>    return true;<br>  }<br>}<br><br>class PaymentService {<br>  constructor(private paymentProcessor: IPaymentProcessor) {}<br>  async processPayment(paymentDetails: PaymentDetails): Promise&lt;void&gt; {<br>    await this.paymentProcessor.processPayment(paymentDetails);<br>  }<br>}<br><br>// Usage<br>// Create payment processor instances<br>const creditCardProcessor = new CreditCardPayment();<br>const paypalProcessor = new PayPalPayment();<br>const stripeProcessor = new StripePayment();<br>// Create PaymentService instances with specific processors<br>const creditCardPaymentService = new PaymentService(creditCardProcessor);<br>const paypalPaymentService = new PaymentService(paypalProcessor);<br>const stripePaymentService = new PaymentService(stripeProcessor);<br>async function makePayment() {<br>  const paymentDetails = {<br>    amount: 100,<br>    accountId: &quot;user123&quot;,<br>  };<br>  await creditCardPaymentService.processPayment(paymentDetails);<br>  await paypalPaymentService.processPayment(paymentDetails);<br>  await stripePaymentService.processPayment(paymentDetails);<br>}<br><br>makePayment();</pre><p><strong>Why is this important ?</strong></p><p>i) Reduces the risk of breaking existing functionality.</p><p>ii) Simplifies the adding new features.</p><p>iii) Promotes cleaner, more maintainable code.</p><h4>3. Liskov Substitution Principle (LSP):</h4><blockquote>Let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T.</blockquote><p>In simpler words, it states that objects of a superclass should be replaceable with objects of its subclasses without breaking the application’s behaviour.</p><p>Let’s continue with payment service class example here.</p><ul><li>Create BasePaymentProcessor class as the parent class, implementing the PaymentProcessor interface. This class provides a common template for payment processing, including default validation, fee calculation logic, and abstract hooks for subclass customization.</li><li>Here we are re-definingCreditCardPayment and PayPalPayment as <strong>subclasses</strong> that extend the BasePaymentProcessor class. These subclasses implement the specific payment logic by overriding the abstract methods performPayment() and getBaseTransactionFeeRate(). They can also add custom validation logic, as seen with credit card and PayPal-specific rules.</li></ul><pre>interface IPaymentProcessor {<br>  processPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt;;<br>  calculateTransactionFee(amount: number): number;<br>}<br><br>abstract class BasePaymentProcessor implements IPaymentProcessor {<br>  async processPayment(paymentDetails: PaymentDetails):Promise&lt;boolean&gt; {<br>      if(!this.validatePayment(paymentDetails)){<br>          return false;<br>      }<br>      return this.performPayment(paymentDetails);<br>  }<br><br>  protected validatePayment(paymentDetails: PaymentDetails){<br>      return paymentDetails.amount &gt; 0;<br>  }<br><br>  // Abstract method to be implemented by subclasses<br>  protected abstract performPayment(<br>    paymentDetails: PaymentDetails<br>  ): Promise&lt;boolean&gt;;<br><br>  calculateTransactionFee(amount: number):number {<br>      return this.getTransactionFeeRate() * amount;<br>  }<br><br>  // method for subclasses to provide their specific fee rate<br>  protected abstract getTransactionFeeRate(): number;<br>}</pre><pre>class CreditCardPayment extends BasePaymentProcessor {<br>  protected async performPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt; {<br>    // Credit card payment logic<br>    return true;<br>  }<br><br>  protected getTransactionFeeRate(): number {<br>        return 0.025;  // 2.5%<br>  }<br>}<br><br>class PayPalPayment extends BasePaymentProcessor {<br><br>  protected async performPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt; {<br>    // PayPal payment logic<br>    return true;<br>  }<br><br>  protected getTransactionFeeRate(): number {<br>      return 0.015; // 1.5%<br>  }<br><br>  // Optional: Additional validation specific to credit card<br>  protected validatePayment(paymentDetails: PaymentDetails): boolean {<br>    // Credit limit<br>      return (<br>        super.validatePayment(paymentDetails) &amp;&amp; paymentDetails.amount &lt;= 5000<br>      );<br>    }<br>}<br><br>class StripePayment extends BasePaymentProcessor {<br><br>  protected async performPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt; {<br>    // Stripe payment logic<br>    return true;<br>  }<br><br>  protected getTransactionFeeRate(): number {<br>      return 0.05; // 0.5%<br>  }<br>}</pre><pre>class PaymentService {<br>  constructor(private paymentProcessor: IPaymentProcessor) {}<br><br>  async processPayment(paymentDetails: PaymentDetails): Promise&lt;void&gt; {<br>      const result = await this.paymentProcessor.processPayment(paymentDetails);<br>      if(!result) {<br>          throw new Error(&#39;Payment processing failed&#39;);<br>      }<br>  }<br><br>  calculateTransactionFee(amount: number) {<br>    return this.paymentProcessor.calculateTransactionFee(amount);<br>  }<br><br>}</pre><pre>async function main(){<br>  const creditCardInstance = new CreditPayment();<br>  const stripeInstance = new StripePayment();<br><br>  const creditCardService = new PaymentService(creditCardInstance);<br>  const stripeService = new PaymentService(stripeInstance);<br>  const paymentDetails: PaymentDetails = {<br>          amount: 100,<br>          accountId: &quot;user123&quot;<br>   };<br>    try {<br>        await creditCardService.processPayment(paymentDetails);<br>        await stripeService.processPayment(paymentDetails);<br>        const creditCardFee = creditCardService.calculateTransactionFee(paymentDetails.amount);<br>        const stripeFee = stripeService.calculateTransactionFee(paymentDetails.amount);<br>        console.log(`Credit Card Fee: ${creditCardFee}`);<br>        console.log(`Stripe Fee: ${stripeFee}`);<br>    } catch(error){<br>      console.log(&#39;[ERROR IN PAYMENT PROCESSING]&#39; , error);<br>    }<br>  }</pre><p>From the above example:</p><ul><li>The CreditCardPayment class caps the maximum payment amount at $5000 and applies a 2.5% transaction fee.</li><li>The PayPalPayment class requires a minimum payment of $10 and applies a 1.5% transaction fee.</li></ul><h4>4. Interface Segregation Principle (ISP)</h4><blockquote>A client should never be forced to implement an interface that it doesn’t use or clients shouldn’t be forced to depend on methods they do not use.</blockquote><p>In simpler words, it states that a class should not be compelled to implement a method or interface that is irrelevant to its functionality or use case.</p><p>Continuing with our payment service, Credit card payments are widely used in e-commerce websites such as Amazon, Flipkart. These payment methods are often come with discount offers on specific product to attract customers. On the other hand, Stripe payment do not typically have such discount-based use case in their e-commerce platform.</p><p>In this scenario, it doesn’t make sense to force the Stripe payment class to implement <strong>discountFee()</strong> method, as it has no practical use case here.</p><p>To adhere to the <strong>Interface Segregation Principle (ISP)</strong>, we should create a separate interface specifically for discounts. This ensures that only payment methods supporting discounts, such as credit card payments, implement the relevant methods, while others, such as Stripe, remain unaffected.</p><pre>// Base payment processing interface<br>interface IBasePaymentProcessor {<br>  processPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt;;<br>  calculateTransactionFee(amount: number): number;<br>}<br><br>// Separate interface for discount-capable payments<br>interface IDiscountCapable {<br>  calculateDiscount(amount: number): number;<br>  isDiscountEligible(productId: string): boolean;<br>}<br><br>// Credit Card implements both base payment and discount capabilities<br>class CreditCardPayment implements IBasePaymentProcessor, IDiscountCapable {<br>  async processPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt; {<br>    console.log(&quot;Processing credit card payment&quot;);<br>    return true;<br>  }<br>  calculateTransactionFee(amount: number): number {<br>    return amount * 0.025; // 2.5% fee<br>  }<br>  calculateDiscount(amount: number): number {<br>    return amount * 0.1; // 10% discount<br>  }<br>  isDiscountEligible(productId: string): boolean {<br>    // Check if product is eligible for discount<br>    return true;<br>  }<br>}<br><br>// Stripe only implements base payment processing<br>class StripePayment implements IBasePaymentProcessor {<br>  async processPayment(paymentDetails: PaymentDetails): Promise&lt;boolean&gt; {<br>    console.log(&quot;Processing stripe payment&quot;);<br>    return true;<br>  }<br>  calculateTransactionFee(amount: number): number {<br>    return amount * 0.029; // 2.9% fee<br>  }<br>}</pre><p>The above implementation demonstrates how <strong>Interface Segregation Principle (ISP)</strong> helps create more focused and maintainable code by avoiding the burden of unnecessary interface methods on classes that don’t need them.</p><h4>5. Dependency Inversion Principle:</h4><blockquote>Entities must depend on abstractions not on concretions. It states that the high level module must not depend on the low level module, but they should depend on abstractions.</blockquote><p>Let’s revisit the payment service example,</p><p>i) Here, High-level module is <strong>PaymentService</strong> which only depends on abstraction ( <strong>IPaymentProcessor )</strong>.</p><p>ii) Both <strong>CreditCardPayment</strong> and <strong>StripePayment</strong> are low-level modules that implement the <strong>IPaymentProcessor</strong> interface. They are providing specific logic for handling payments but it do not affect PaymentService( high-level module ).</p><pre>// 1. Define abstraction<br>interface IPaymentProcessor {<br>    processPayment(details: PaymentDetails): Promise&lt;boolean&gt;;<br>}<br><br>// 2. High-level module depends on abstraction<br>class PaymentService {<br><br>    constructor(<br>        // Depends on interface, not concrete class<br>        private paymentProcessor: IPaymentProcessor<br>    ) {}<br><br>    processPayment(details: PaymentDetails) {<br>        return this.paymentProcessor.processPayment(details);<br>    }<br>}<br><br>// 3. Low-level modules implement abstraction<br>class CreditCardPayment implements IPaymentProcessor {<br>    processPayment(details: PaymentDetails) {<br>        // Credit card specific logic<br>    }<br>}<br>class StripePayment implements IPaymentProcessor {<br>    processPayment(details: PaymentDetails) {<br>        // Stripe specific logic<br>    }<br>}<br><br>// 4. Usage<br>const creditCard = new CreditCardPayment();<br>const stripe = new StripePayment();<br><br>// Can use any payment processor<br>const paymentService1 = new PaymentService(creditCard);<br>const paymentService2 = new PaymentService(stripe);</pre><p>Can we enhance it bit more :)</p><h4><strong>#Bonus topic: Factory pattern</strong></h4><p>The <strong>Factory Pattern</strong> in Node.js is a creational design pattern used to abstract the instantiation logic of objects, allowing clients to create objects without specifying the exact class of the object. It involves defining a factory class or function that centralizes the logic for creating different types of objects based on input parameters.</p><p><strong>Without Factory pattern</strong></p><pre>// Direct instantiation - violates DIP<br>const creditCard = new CreditCardPayment();<br>const paymentService = new PaymentService(creditCard);</pre><p><strong>With Factory pattern</strong></p><pre>// Payment Type Enum<br>enum PaymentType {<br>  CREDIT_CARD = &#39;credit_card&#39;,<br>  STRIPE = &#39;stripe&#39;<br>}<br><br>interface IPaymentFactory {<br>    createPayment(type: PaymentType): IPaymentProcessor;<br>}<br>class PaymentFactory implements IPaymentFactory {<br>    createPayment(type: PaymentType): IPaymentProcessor {<br>        switch(type) {<br>            case PaymentType.CREDIT_CARD:<br>                return new CreditCardPayment();<br>            case PaymentType.STRIPE:<br>                return new StripePayment();<br>            default:<br>                throw new Error(&#39;Invalid payment type&#39;);<br>        }<br>    }<br>}<br>// Usage - follows DIP<br>const factory: IPaymentFactory = new PaymentFactory();<br>const processor = factory.createPayment(PaymentType.CREDIT_CARD);<br>const paymentService = new PaymentService(processor);</pre><p><strong>Conclusion:</strong></p><p>Programming is not confined to a single implementation; there are always ways to enhance and improve it. The examples I have provided may be sufficient, but there could be other approaches that effectively achieve the same principles. I’ve aimed to present the concepts in a way that is easy for beginners to understand and implement. Ultimately, the goal is to make the code as simple and maintainable as possible. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6d32a04ce2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC 2024: Validation Rule Builder for the Form Builder]]></title>
            <link>https://medium.com/@senthilathiban0/gsoc-2024-validation-rule-builder-for-the-form-builder-0dcd4cb05bb6?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/0dcd4cb05bb6</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[openmrs]]></category>
            <category><![CDATA[gsoc2021]]></category>
            <category><![CDATA[gsoc]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Fri, 23 Aug 2024 05:14:32 GMT</pubDate>
            <atom:updated>2024-08-23T05:28:13.546Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Hello Devs,</em></p><p>Here is my final blog post in the GSoC journey series. If you haven’t read my previous posts, you can <a href="https://medium.com/@senthilathiban0">check them out</a></p><p><strong>Project Title:</strong> Validation Rule Builder for Form Builder</p><p><strong>Mentors:</strong> <a href="https://www.linkedin.com/in/denniskigen/">Dennis Kigen</a> (primary mentor), and <a href="https://www.linkedin.com/in/hadijah-kyampeire-418900141/">Hadijah</a> (backup mentor)</p><p><strong>Contributor:</strong> <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban M</a></p><p><strong>Project Link:</strong> <a href="https://openmrs.atlassian.net/wiki/spaces/RES/pages/26278995/Gsoc+2024+Validation+rule+builder+for+the+form+builder">Wiki Page</a></p><h3>Overview</h3><p><strong>OpenMRS Form Builder</strong> is used to create forms with an interactive builder, but creating conditional logic has traditionally been challenging, requiring users to write complex JavaScript expressions directly into the schema. Without a user-friendly interface, building these advanced logics can be difficult and error-prone. To address this, the project involved developing a Validation Rule Builder for the Form Builder, enabling users to create complex rules effortlessly, without needing to worry about JavaScript expressions. The tool provides a real-time preview and minimizes errors, significantly enhancing the user experience and making the process more accessible.</p><h3>Objectives</h3><p>i) <strong>Rule Definition:</strong> Create custom rules for form fields, including conditional logic, validation logic with custom error messages, and calculation logic that automatically fills form fields with computed values.</p><p>ii) <strong>Reduce Manual Effort:</strong> Eliminate the need for users to write complex JavaScript expressions, thereby reducing manual effort. Instead, provide an intuitive, user-friendly interface that empowers users to build sophisticated logic in seconds, enhancing productivity and user experience.</p><p>iii) <strong>Real-Time Validation:</strong> Ensure that the logic being created is valid and functional as users build it, preventing errors and saving time.</p><h3>Figma Design</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*UkBeZle_G_L-JfnFE3A0Aw.png" /></figure><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHvf8C5u2YgloudqfPFaBw.png" /></figure><h3>Contributed Repository</h3><p><a href="https://github.com/openmrs/openmrs-esm-form-builder">GitHub - openmrs/openmrs-esm-form-builder: OpenMRS Form Builder microfrontend</a></p><h3>Pull Request</h3><p><a href="https://github.com/openmrs/openmrs-esm-form-builder/pull/279">(feat) O3-3230: add rule builder to form builder by senthil-athiban · Pull Request #279 · openmrs/openmrs-esm-form-builder</a></p><h3>Documentation</h3><p><a href="https://openmrs.atlassian.net/wiki/spaces/projects/pages/114426045/Validation+Rule+Builder">Validation Rule Builder - Projects - OpenMRS Wiki</a></p><h3>Demo Videos</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fqk3_jLCDFJU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dqk3_jLCDFJU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fqk3_jLCDFJU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e29ce436358bbb85cb27164762d1692/href">https://medium.com/media/4e29ce436358bbb85cb27164762d1692/href</a></iframe><h3>Summary</h3><p>During my GSoC project, I accomplished the following:</p><ol><li><strong>Developed a User-Friendly Validation Rule Builder:</strong> Created an intuitive interface that allows users to easily build validation rules within the form builder.</li><li><strong>Enabled Advanced Logic Creation:</strong> Added functionality for users to create complex conditional logic, validation logic, and calculation logic directly within forms, enhancing the form’s capabilities.</li><li><strong>Implemented Rule Management:</strong> Provided features to edit and delete existing rules, giving users full control over their form logic.</li><li><strong>Enhanced Rule Complexity:</strong> Enabled the creation of multiple conditions and actions for each rule within a form field, allowing for more granular and customized logic.</li><li><strong>Supported Multiple Rules per Field:</strong> Allowed users to define multiple rules for a single form field, offering greater flexibility and precision in form behavior.</li></ol><h3>Future Works</h3><ol><li><strong>Store Rules in a Table:</strong> Implement functionality to save the logic created for form fields in a structured table format. This table will be accessible via a separate tab next to the interactive builder, displaying all rules in a single view with options to edit and delete, streamlining rule management.</li><li><strong>Duplicate Rule Functionality:</strong> Introduce the ability for users to duplicate existing rule definitions, allowing for easy replication and application of similar logic across different form fields, saving time and reducing redundancy.</li><li><strong>Expand Action Types:</strong> Add new action types to the rule builder, such as the ability to automatically navigate to a specific page when certain conditions are met, enhancing the interactivity and dynamic behavior of forms.</li><li><strong>End-to-End Test Cases:</strong> Develop comprehensive end-to-end test cases for various calculation logic scenarios, including “Next Visit Date” and “Treatment Date” calculations, ensuring robustness and accuracy in real-world applications.</li></ol><h3>Talk Threads</h3><p><a href="https://talk.openmrs.org/t/gsoc-2024-validation-rule-builder-for-the-form-builder-progress-update/42683/17">GSoC 2024 : Validation Rule Builder for the form builder Progress Update</a></p><h3>Weekly blog posts</h3><p><strong>Community Bonding</strong></p><ul><li><a href="https://medium.com/@senthilathiban0/my-gsoc-journey-begins-community-bonding-17188e7f1c66">My GSoC Journey Begins: Community Bonding</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-2nd-week-of-community-bonding-42159ba831db">GSoC Journey: 2nd Week of Community Bonding</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-3rd-week-of-community-bonding-233bfafaaf0f">GSoC Journey: 3rd week of Community Bonding</a></li></ul><p><strong>Coding Period</strong></p><ul><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-01-of-coding-period-48727197abf3">GSoC Journey: Week 01 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-02-of-coding-period-1e36ad6dae36">GSoC Journey: Week 02 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-03-of-coding-period-9a563e3df13b">GSoC Journey: Week 03 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-04-of-coding-period-599e1d7a188b">GSoC Journey: Week 04 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-05-of-coding-period-cd8b51406ede">GSoC Journey: Week 05 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-06-of-coding-period-c5d47f879e0d">GSoC Journey: Week 06 of coding period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-07-of-coding-period-396c18832288">GSoC Journey: Week 07 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-08-of-coding-period-13e4ab391f66">GSoC Journey: Week 08 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-09-of-coding-period-978cc2641953">GSoC Journey: Week 09 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-10-of-coding-period-16f871ea0bb8">GSoC Journey: Week 10 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-week-11-of-coding-period-70be830a063d">GSoC Journey: Week 11 of Coding Period</a></li><li><a href="https://medium.com/@senthilathiban0/gsoc-journey-final-week-of-coding-period-ced0a76bd72c">GSoC Journey: Final Week of Coding Period</a></li></ul><p><strong>Thoughts on GSoC</strong></p><p>Google Summer of Code has been a life-changing experience for me, teaching me more about understanding product requirements and client engagement than just writing code. I had an incredible time collaborating with my mentors, fellow contributors, and the O3 squad. This internship gave me a deeper understanding of what software engineering truly entails — how software benefits users, saves time, and reduces costs.</p><p>On the technical side, I gained significant knowledge in areas such as React best practices, testing, and documentation. A special thanks to my mentor, Dennis Kigen, for encouraging me to dive deeper into React best practices, which have greatly improved my coding skills. I’m also very grateful to my backup mentor for their invaluable support, especially during the initial stages of the project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0dcd4cb05bb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Journey: Final Week of Coding Period]]></title>
            <link>https://medium.com/@senthilathiban0/gsoc-journey-final-week-of-coding-period-ced0a76bd72c?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/ced0a76bd72c</guid>
            <category><![CDATA[gsoc2024]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Sun, 18 Aug 2024 07:15:04 GMT</pubDate>
            <atom:updated>2024-08-18T07:15:04.836Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Hello Devs,</em></p><p>Myself <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban</a>, a final year undergraduate student at Madras Institute of Technology. This blog represents a continuous series documenting my journey through GSoC. If you haven’t already read my previous blogs, I encourage you to check out my <a href="https://medium.com/@senthilathiban0/gsoc-journey-week-11-of-coding-period-70be830a063d">previous blogs here</a>. I have been selected as a GSoC student at <strong>OpenMRS</strong> for the <strong>Validation Rule Builder for the Form Builder project</strong>. My primary mentor is <a href="https://www.linkedin.com/in/denniskigen/">Dennis Kigen</a>, and my backup mentor is <a href="https://www.linkedin.com/in/hadijah-kyampeire-418900141/">Hadijah Kyampeire</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwbCJUXfcdLdz4bZgx6nJQ.png" /></figure><h3>GSoC Admin Meeting</h3><p>This week, on August 12, 2024, we contributors had our final GSoC Social Hour with our GSoC Admin. It was a valuable session where we had the opportunity to ask questions about OpenMRS and open-source contributions, as well as engage in casual conversation. Additionally, We received some insightful career advice, which I plan to integrate into my professional journey.</p><h3>📅 Week 12: August 12 — August 17</h3><h3>Tasks to be Completed:</h3><ul><li><strong>Review Changes &amp; Bug Fixes:</strong> Identified various bugs through manual testing and worked on fixing them.</li></ul><h3>Tasks Completed:</h3><ul><li>Fixes on Editing specificfailsWhenExpression in Validators:<strong> </strong><a href="https://www.loom.com/share/f3054b23aca04a35aa7e4fae49983cf3?sid=dffab4cd-a7f9-4e9f-a532-0b59767ca602"><strong>Video Walkthrough</strong></a></li><li>Fixes on Deleting Specific Conditional Logic:<strong> </strong><a href="https://www.loom.com/share/52c5dd390bf343cf986d4eee10c6e6c1?sid=3de48a02-69f0-4a5f-b350-973766ed79c1"><strong>Video Walkthrough</strong></a></li><li>Fixes on Deleting All Conditional Logic Associated with a Specific Condition:<strong> </strong><a href="https://www.loom.com/share/99a0d334e7fe4dc5898a2f265fcb38f2?sid=5eab1ab2-d960-4a95-b2cf-7a30534638bb"><strong>Video Walkthrough</strong></a></li><li>Fixes on Deleting a Mistakenly Chosen Condition/Action and Reverting the Schema:<strong> </strong><a href="https://www.loom.com/share/b578543e95c84eefb45cf3bad8226120?sid=d6ab05c0-b4cc-4c8c-bb0e-f0060ff94b78"><strong>Video Walkthrough</strong></a></li></ul><h3>Lesson Learned:</h3><p>Throughout my GSoC journey, I’ve adopted several strategies that have significantly contributed to the quality and functionality of my project:</p><ol><li><strong>Client-Centric Perspective:</strong> One common mistake developers often make is thinking purely from a developer’s perspective rather than a client’s. My primary principle is to always consider the client’s viewpoint. Engaging with clients helps build a more intuitive and user-friendly product that truly meets their needs.</li><li><strong>Early Product Familiarization:</strong> Utilizing the product extensively during its early stages is crucial. This deepens your understanding of its features and workflow, laying a solid foundation for future development.</li><li><strong>Thoughtful Technology Selection:</strong> After gaining an understanding of the product, it’s important to think like a developer, choosing the right technologies, tools, frameworks, and more.</li><li><strong>Readable and Contextual Code:</strong> Writing readable code that provides clear context not only improves maintainability but also enhances collaboration. For instance:</li></ol><pre>const a = 2;<br>if(a % 2 === 0 ){<br>  // .. do math logics here<br>}</pre><pre>const a = 2;<br>const isEvenNumber = a % 2;<br>if(isEvenNumber){<br> // do math logic here<br>}</pre><p>Both snippets determine whether a number is even, but the second snippet provides additional context, making the code more intuitive and easier for other developers to read and understand.</p><p>In conclusion, this final week of the GSoC coding period has been a time of refining, learning, and solidifying my development practices. By focusing on client-centric perspectives, early product familiarization, thoughtful technology choices, and writing clear, context-rich code, I’ve been able to enhance the quality of my contributions. This journey has not only improved my technical skills but also deepened my understanding of effective software development. As I move forward, these lessons will continue to guide me in building user-friendly, robust, and maintainable products.</p><h3>About Me</h3><p>I’m Senthil Athiban, a final-year undergraduate student from India. By day, I play with VS Code by building new projects, and by night, I contribute to projects on GitHub. My journey is driven by a passion for software development and a curiosity to explore new technologies.</p><p>🔗 <strong>Connect with Me</strong></p><ul><li><strong>GitHub:</strong> <a href="https://github.com/senthil-athiban">senthil-athiban</a></li><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban M</a></li><li><strong>Twitter:</strong> <a href="https://twitter.com/senthil_k8s">@senthil_k8s</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ced0a76bd72c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Journey: Week 11 of Coding Period]]></title>
            <link>https://medium.com/@senthilathiban0/gsoc-journey-week-11-of-coding-period-70be830a063d?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/70be830a063d</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[openmrs]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[gsoc2024]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Sun, 11 Aug 2024 12:23:51 GMT</pubDate>
            <atom:updated>2024-08-11T12:47:32.669Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Hello folks,</em></strong></p><p>Myself <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban</a>, a final year undergraduate student at Madras Institute of Technology. This blog represents a continuous series documenting my journey through GSoC. If you haven’t already read my previous blogs, I encourage you to check out my <a href="https://medium.com/@senthilathiban0/gsoc-journey-week-09-of-coding-period-978cc2641953">previous blogs here</a>. I have been selected as a GSoC student at <strong>OpenMRS</strong> for the <strong>Validation Rule Builder for the Form Builder project</strong>. My primary mentor is <a href="https://www.linkedin.com/in/denniskigen/">Dennis Kigen</a>, and my backup mentor is <a href="https://www.linkedin.com/in/hadijah-kyampeire-418900141/">Hadijah Kyampeire</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uGrn63HVseTY3hM2v-3Rsw.png" /></figure><h3>📅 Week 11: August 05 — August 10</h3><h3>Tasks to be Completed:</h3><ul><li><strong>Review Changes &amp; Bug Fixes</strong>: Identify and fix bugs through manual testing, and implement changes based on mentor feedback.</li><li><strong>Code Refactoring</strong>: Refactor the validation rule builder by adding descriptive comments to handler and utility functions.</li></ul><h3>Tasks Completed:</h3><ul><li>✅ <strong>Review Changes</strong>: Implemented adjustments based on mentor feedback.</li><li>✅ <a href="https://github.com/openmrs/openmrs-esm-form-builder/pull/279/commits/22adbb64b45d3439fc6ef0e4947dc11cd6437c8b"><strong>Code Refactoring</strong></a>: Added descriptive comments to utility and handler functions, making it easier for new contributorsto understand the workflow of the validation rule builder and refactored the handler functions, test cases and avoided some <a href="https://github.com/openmrs/openmrs-esm-form-builder/pull/279/commits/0896c4ba737d52b4678a44a7dc0247ccbb449a84">common mistakes in React</a>.</li></ul><h3>Lessons Learned:</h3><p>I discovered that revisiting code after a month can be surprisingly time-consuming. This experience reinforced the value of writing clear, descriptive functions that not only serve their purpose but also make the code more accessible for future reference and for new contributors. Taking the time to document my thought process within the code has proven invaluable, as it not only aids in debugging but also helps in ensuring the continuity of the project, even when team members change or when I need to revisit the work after a period of time. This process also highlighted the importance of maintaining a clean and organized codebase, where every function and utility is clearly defined, making it easier for others to pick up and build upon my work without unnecessary delays or confusion.</p><p>To further clarify the workflow, I created a dedicated block diagram that visually represents the entire process of the validation rule builder UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHvf8C5u2YgloudqfPFaBw.png" /></figure><h3>About Me</h3><p>I’m Senthil Athiban, a final-year undergraduate student from India. By day, I play with VS Code by building new projects, and by night, I contribute to projects on GitHub. My journey is driven by a passion for software development and a curiosity to explore new technologies.</p><p>🔗 <strong>Connect with Me</strong></p><ul><li><strong>GitHub:</strong> <a href="https://github.com/senthil-athiban">senthil-athiban</a></li><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban M</a></li><li><strong>Twitter:</strong> <a href="https://twitter.com/senthil_k8s">@senthil_k8s</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70be830a063d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Journey: Week 10 of Coding Period]]></title>
            <link>https://medium.com/@senthilathiban0/gsoc-journey-week-10-of-coding-period-16f871ea0bb8?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/16f871ea0bb8</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[openmrs]]></category>
            <category><![CDATA[gsoc2024]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Sat, 03 Aug 2024 08:56:17 GMT</pubDate>
            <atom:updated>2024-08-03T08:56:17.241Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Hello folks,</em></strong></p><p>Myself <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban</a>, a final year undergraduate student at Madras Institute of Technology. This blog represents a continuous series documenting my journey through GSoC. If you haven’t already read my previous blogs, I encourage you to check out my <a href="https://medium.com/@senthilathiban0/gsoc-journey-week-09-of-coding-period-978cc2641953">previous blogs here</a>. I have been selected as a GSoC student at <strong>OpenMRS</strong> for the <strong>Validation Rule Builder for the Form Builder project</strong>. My primary mentor is <a href="https://www.linkedin.com/in/denniskigen/">Dennis Kigen</a>, and my backup mentor is <a href="https://www.linkedin.com/in/hadijah-kyampeire-418900141/">Hadijah Kyampeire</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*vW6ZsSn-TBBZHKFQH2c-zQ.png" /></figure><h3>GSoC Admin Meeting</h3><p>On the first day of week 10, I had a meeting with our GSoC admin at OpenMRS. We discussed our blockers, challenges, and had some fun chat. Our GSoC admin, <a href="https://www.linkedin.com/in/jaye-cc/">Jayasanka Weerasinghe</a>, was very friendly and offered suggestions, such as extending our coding period if needed, and provided other helpful advice. He also emphasized the importance of writing test cases and documentation for our project. Thankfully, I had already started writing documentation and test cases parallelly while building the validation rule builder, and I received appreciation from the GSoC admin for my progress.</p><h3>📅 Week 10: July 29 — August 03</h3><h3>Tasks to be Completed:</h3><ul><li><strong>Review Changes &amp; Bug Fixes</strong>: Fix bugs through manual testing and implement changes based on mentor feedback.</li><li><strong>E2E Test</strong>: Cover E2E test cases for the validation rule builder.</li></ul><h3>Tasks Completed:</h3><p>✅ <strong>Review Changes</strong>: Made adjustments based on mentor feedback.<br>✅ <a href="https://github.com/openmrs/openmrs-esm-form-builder/pull/279/commits/b620610882d15e96dcd555857089608dc5cc2bc8"><strong>Testing</strong></a>: Covered E2E test cases for various validations, such as hideWhenExpression, failsWhenExpression,allowing or disallowing future dates and decimal values and calculation logic.</p><h3>Lessons Learned:</h3><p>The purpose of E2E test cases is to ensure the workflow of a feature is functioning correctly. These tests are added to the GitHub workflow to validate incoming PRs. While not particularly difficult, E2E testing is crucial. So, I began practicing E2E tests before covering my feature. Sometimes the tests pass, and other times they fail. For example, tests may pass on the local machine but fail in CI. I later realized that debugging skills are essential when writing E2E test cases. Thankfully, the Playwright documentation helped me resolve issues while writing E2E tests.</p><h3>Plans for Next Week:</h3><ul><li><strong>Manual Testing:</strong> Conduct thorough testing of the validation rule builder with complex form logics to ensure functionality and reliability.</li></ul><h3>About Me</h3><p>I’m Senthil Athiban, a final-year undergraduate student from India. By day, I play with VS Code by building new projects, and by night, I contribute to projects on GitHub. My journey is driven by a passion for software development and a curiosity to explore new technologies.</p><p>🔗 <strong>Connect with Me</strong></p><ul><li><strong>GitHub:</strong> <a href="https://github.com/senthil-athiban">senthil-athiban</a></li><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban M</a></li><li><strong>Twitter:</strong> <a href="https://twitter.com/senthil_k8s">@senthil_k8s</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16f871ea0bb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Journey: Week 09 of Coding Period]]></title>
            <link>https://medium.com/@senthilathiban0/gsoc-journey-week-09-of-coding-period-978cc2641953?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/978cc2641953</guid>
            <category><![CDATA[openmrs]]></category>
            <category><![CDATA[gsoc2024]]></category>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Sat, 27 Jul 2024 12:19:20 GMT</pubDate>
            <atom:updated>2024-07-27T12:19:20.916Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Hello folks,</em></strong></p><p>Myself <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban</a>, a final year undergraduate student at Madras Institute of Technology. This blog represents a continuous series documenting my journey through GSoC. If you haven’t already read my previous blogs, I encourage you to check out my <a href="https://medium.com/p/13e4ab391f66">previous blogs here</a>. I have been selected as a GSoC student at <strong>OpenMRS</strong> for the <strong>Validation Rule Builder for the Form Builder project</strong>. My primary mentor is <a href="https://www.linkedin.com/in/denniskigen/">Dennis Kigen</a>, and my backup mentor is <a href="https://www.linkedin.com/in/hadijah-kyampeire-418900141/">Hadijah Kyampeire</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*i1V8jOVb77oeS9aMMc6KwA.png" /></figure><h3>📅 <strong>Week 9: July 22 — July 27</strong></h3><h3>Tasks to be Completed:</h3><ul><li><strong>Historical Expression Integration:</strong> Integrate Historical Expression logic to retrieve past encounter data.</li><li><strong>Review Changes &amp; Bug Fixes:</strong> Fix bugs through manual testing and implement changes based on mentor feedback.</li></ul><h3>Tasks Completed:</h3><p><strong>✅ </strong><a href="https://github.com/openmrs/openmrs-esm-form-builder/pull/279/commits/371cd7e726544a99f29ef68fdbbf6c8652fde407"><strong>Retrieval of Past Encounter Data</strong></a><strong>:</strong> Implemented a new feature to retrieve a patient’s past encounter data, allowing this data to be used in other forms.</p><p><strong>✅ </strong><a href="https://github.com/openmrs/openmrs-esm-form-builder/pull/279/commits/a7158e45dbf03c3bcd4beddafdd5c932955ee488"><strong>Review Changes</strong></a><strong>:</strong> Made adjustments based on mentor feedback.</p><p><strong>📚 </strong><a href="https://openmrs.atlassian.net/wiki/spaces/projects/pages/114426045/Validation+Rule+Builder"><strong>Documentation</strong></a><strong>:</strong> Created new examples and tutorial guides to help users understand the functionality of the newly added calculation logic.</p><h3>Lessons Learned:</h3><p>Through mentor feedback on my recent work, I realized I had been making some minor mistakes and typos. My mentor <a href="https://www.linkedin.com/in/denniskigen/">Dennis Kigen</a>, recommended reading documentation to learn good practices. This guidance pushed me to delve into documentation, blogs and adopt best practices.</p><h3>Plans for Next Week:</h3><ul><li><strong>Manual Testing:</strong> Conduct thorough testing of the validation rule builder with complex form logics to ensure functionality and reliability.</li></ul><h3>About Me</h3><p>I’m Senthil Athiban, a final-year undergraduate student from India. By day, I play with VS Code by building new projects, and by night, I contribute to projects on GitHub. My journey is driven by a passion for software development and a curiosity to explore new technologies.</p><p>🔗 <strong>Connect with Me</strong></p><ul><li><strong>GitHub:</strong> <a href="https://github.com/senthil-athiban">senthil-k8s</a></li><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban M</a></li><li><strong>Twitter:</strong> <a href="https://twitter.com/senthil_k8s">@senthil_k8s</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=978cc2641953" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GSoC Journey: Week 08 of Coding Period]]></title>
            <link>https://medium.com/@senthilathiban0/gsoc-journey-week-08-of-coding-period-13e4ab391f66?source=rss-6a337545ce40------2</link>
            <guid isPermaLink="false">https://medium.com/p/13e4ab391f66</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[gsoc2024]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Senthilathiban]]></dc:creator>
            <pubDate>Fri, 19 Jul 2024 13:13:28 GMT</pubDate>
            <atom:updated>2024-07-19T13:13:28.403Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Hello folks,</em></strong></p><p>Myself <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban</a>, a final year undergraduate student at Madras Institute of Technology. This blog represents a continuous series documenting my journey through GSoC. If you haven’t already read my previous blogs, I encourage you to check out my <a href="https://medium.com/@senthilathiban0/gsoc-journey-week-07-of-coding-period-396c18832288">previous blogs here</a>. I have been selected as a GSoC student at <strong>OpenMRS</strong> for the <strong>Validation Rule Builder for the Form Builder project</strong>. My primary mentor is <a href="https://www.linkedin.com/in/denniskigen/">Dennis Kigen</a>, and my backup mentor is <a href="https://www.linkedin.com/in/hadijah-kyampeire-418900141/">Hadijah Kyampeire</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*Ifdp3oNs2SviILE4zHsPiA.png" /></figure><h3>📅 Week 8: July 15— July 19</h3><p><strong>Tasks to be Completed:</strong></p><ul><li><strong>Calculation Function Integration:</strong> Implement a streamlined approach for adding calculation functions with just 4–5 lines of code to simplify the process.</li><li><strong>Date Calculation Feature:</strong> Integrate a new date calculation feature to enable autofilling of form fields based on calculated values.</li></ul><h3>Tasks Completed</h3><p>✅ <a href="https://github.com/openmrs/openmrs-esm-form-builder/pull/279/commits/6616d72e9ab8c064b03d26f0d700c606f11598b1"><strong>Streamlined Workflow</strong></a><strong>:</strong> Implemented a new approach to simplify the addition of calculation functions in the validation rule builder, improving overall efficiency and code maintainability.</p><p>✅ <a href="https://github.com/openmrs/openmrs-esm-form-builder/pull/279/commits/79f572727a9d1bf96c14137da5b9487eb1fda68a"><strong>Adding Date Calculations</strong></a><strong>:</strong> Introduced new calculation functions for date fields, including calcNextVisitDate and calcTreatmentEndDate, along with a helper function, calcGravida.</p><p><strong>📚 </strong><a href="https://openmrs.atlassian.net/wiki/spaces/projects/pages/114426045/Validation+Rule+Builder"><strong>Documentation:</strong></a> Created new examples and tutorial guides to help users understand the functionality of the newly added calculation logic.</p><h3>Challenges Faced</h3><h4>Adding Calculation Functionality</h4><p>In software development, implementing new functionalities often requires adjusting the existing codebase, which can sometimes result in convoluted code. When I first attempted to integrate calculation functions into the validation rule builder, I encountered several challenges. These changes not only altered the code structure but also led to less maintainable code, despite having comprehensive test cases in place.</p><p><strong>Problem:</strong> The initial approach proved to be non-scalable and prone to errors, which underscored the need for a more efficient solution.</p><p><strong>Solution:</strong> To address this, I developed a streamlined approach that simplifies the process of adding new calculation functions. This approach focuses on enhancing workflow efficiency by introducing a more structured and reusable logic that minimizes potential errors and improves code maintainability.</p><p>With this new approach, you can add new calculation logic in four simple steps:</p><ol><li><strong>Add the Calculation Name:</strong> Include the new calculation name in the calculateFunctions array according to its category.</li><li><strong>Define Arguments:</strong> Specify the arguments required for the new calculation function.</li><li><strong>Configure Condition Schema:</strong> Set up the conditionSchema for the new calculation function.</li><li><strong>Test the Logic:</strong> Finally, test the new logic within the validation rule builder to ensure it works as expected.</li></ol><h3>Lesson Learned</h3><p>Implementing a structured approach for adding new features can prevent code complexity and enhance maintainability. Clear steps for integrating functionalities improve efficiency and reduce errors. Reusability and thorough testing are crucial for ensuring that new logic is reliable and consistent. This experience underscores the value of organized and scalable solutions in software development.</p><h3>Plans for Next Week</h3><ul><li><strong>Manual Testing:</strong> Conduct thorough testing of the validation rule builder with complex form logics to ensure functionality and reliability.</li><li><strong>Bug Fixing:</strong> Address and resolve any bugs identified during testing, aiming to minimize errors and improve overall performance.</li></ul><h3><strong><em>About Me</em></strong></h3><p>I’m Senthil Athiban, a final-year undergraduate student from India. By day, I play with VS Code by building new projects, and by night, I contribute to projects on GitHub. My journey is driven by a passion for software development and a curiosity to explore new technologies.</p><p>🔗 <strong>Connect with Me</strong></p><ul><li><strong>GitHub:</strong> <a href="https://github.com/senthil-k8s">senthil-k8s</a></li><li><strong>LinkedIn:</strong> <a href="https://www.linkedin.com/in/senthil-athiban-m/">Senthil Athiban M</a></li><li><strong>Twitter:</strong> <a href="https://twitter.com/senthil_k8s">@senthil_k8s</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13e4ab391f66" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>