<?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 Dinuka Kasun Medis on Medium]]></title>
        <description><![CDATA[Stories by Dinuka Kasun Medis on Medium]]></description>
        <link>https://medium.com/@dinukakasunmedis?source=rss-64890151f803------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CJuj2y2vX3BwumIgrwPHnw.png</url>
            <title>Stories by Dinuka Kasun Medis on Medium</title>
            <link>https://medium.com/@dinukakasunmedis?source=rss-64890151f803------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 05:55:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dinukakasunmedis/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[Sync vs. Async Communication]]></title>
            <link>https://dinukakasunmedis.medium.com/sync-vs-async-communication-2feaae23e38c?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/2feaae23e38c</guid>
            <category><![CDATA[message-queue]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[synchronous]]></category>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[message-broker]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 16:42:28 GMT</pubDate>
            <atom:updated>2026-10-28T16:42:28.565Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>How to choose the right way to communicate, between people and between services, on purpose.</em></h4><p>Let’s start with a story. <strong>A tale of two coffee shops:</strong> There were two coffee shops on the same street.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85P9JeJumfR80xRqKBZ8_Q.png" /></figure><p>At the first, you order at the counter and the cashier makes your drink while you stand there. Nobody else can order until yours is done. The line grows, the cashier is stuck, and one slow “oat-milk flat white” holds up everyone.</p><p>At the second, the cashier takes your order, hands you a receipt with a number, and moves on to the next person. The barista works through the queue in the background. You sit down, check your phone, and your name gets called when the drink is ready.</p><p>Both shops serve coffee. The difference is <strong>how the work is coordinated</strong>. The first is <strong>synchronous,</strong> everyone waits for the answer. The second is <strong>asynchronous,</strong> you hand off the request and carry on, and the result arrives later.</p><p>This same choice shows up in every team and every system we build, first between people, then between software services. Most of us never decide it. We drift into it, and the drift is expensive.</p><h3><strong>What we mean by sync and async</strong></h3><p><strong>Synchronous communication</strong> happens in real time. Both sides are present at once, and a reply comes immediately because the other party is right there: a meeting, a phone call, a tap on the shoulder.</p><p><strong>Asynchronous communication</strong> doesn’t require simultaneous presence. You send a message, document, or recording, and the other side responds when it can: email, shared docs, ticket comments, a thoughtful Slack message that doesn’t expect an instant answer.</p><p>The line is blurrier than it looks. A Slack thread can be fully async or behave like a meeting that never ends. What matters isn’t the tool, it’s the <strong>expected response time</strong>.</p><h4><strong>The real cost of sync</strong></h4><p>Real-time communication feels efficient because answers are fast, but the costs are hidden:</p><ul><li><strong>Scheduling friction. </strong>Finding a slot for five people across time zones can take longer than the conversation.</li><li><strong>Interrupted focus.</strong> One “quick question” can cost far more than the minute it takes to answer, because deep concentration takes a while to rebuild.</li><li><strong>Unequal participation. </strong>Live discussion favours fast talkers over people who think best on paper.</li><li><strong>No record. </strong>Verbal decisions evaporate unless someone writes them down.</li><li><strong>Everyone waits on the slowest party.</strong> Like the first coffee shop, throughput is capped by whoever takes longest.</li></ul><h4><strong>The real cost of async</strong></h4><p>Async isn’t a free upgrade either:</p><ul><li><strong>Slow loops.</strong> A five-minute live question can take two days by email.</li><li><strong>Lost nuance.</strong> Tone and hesitation don’t survive text well.</li><li><strong>Ambiguity spirals.</strong> A vague message produces a vague reply, then another question.</li><li><strong>Isolation.</strong> Teams that only write can lose the rapport that makes hard conversations easier.</li><li><strong>Harder to reason about.</strong> You can’t be sure when, or whether, something was handled.</li></ul><h3><strong>A simple way to choose (for people)</strong></h3><p>Instead of asking “should this be a meeting?”, ask about the work itself:</p><ul><li><strong>Is it urgent?</strong> A production outage needs a call. A weekly status update doesn’t.</li><li><strong>Is it emotionally charged?</strong> Feedback, conflict, and sensitive news deserve a voice or a face.</li><li><strong>Is it complex and exploratory?</strong> Early brainstorming and tangled trade-offs often move faster live.</li><li><strong>Is it informational?</strong> Updates and announcements rarely need a meeting. Write it down.</li><li><strong>Does it need a record?</strong> Decisions and plans should be written regardless of how they were discussed.</li></ul><blockquote><strong>Use sync for ambiguity, emotion, and urgency. Use async for information, deliberation, and decisions that benefit from thought.</strong></blockquote><p>Teams that do async well write complete messages (context, ask, deadline), set response-time norms, default to shared documents, and end every thread with a summary of decisions and owners. Teams that do sync well send agendas, invite only the people who need to be there, and leave with written outcomes.</p><h3><strong>Now the same question, for Microservices</strong></h3><p>Swap people for services and the coffee shops come back.</p><p>Imagine an e-commerce platform. A customer clicks <strong>Place Order</strong>. Behind that click, several services need to act:</p><ul><li><strong>Order Service</strong> creates the order</li><li><strong>Payment Service</strong> charges the card</li><li><strong>Inventory Service</strong> reserves the items</li><li><strong>Notification Service</strong> sends the confirmation email</li><li><strong>Shipping Service</strong> schedules the delivery</li><li><strong>Analytics Service</strong> records the event</li></ul><p>The question is the same one the coffee shops answered, “<strong>Who has to wait for whom?”</strong></p><h4><strong>Synchronous communication between services</strong></h4><p>In the synchronous model, one service calls another (typically over REST or gRPC) and <strong>waits for the response</strong> before continuing.</p><p>If Order Service calls Payment, then Inventory, then Notification, then Shipping, all in a chain, the customer’s click sits there until every link finishes.</p><h4><strong>When it shines:</strong></h4><ul><li>The caller <strong>needs the answer to proceed.</strong> You can’t confirm an order before knowing the payment succeeded.</li><li>You need <strong>immediate, consistent feedback</strong>, such as validating a coupon or checking a user’s permissions.</li><li>The interaction is a simple <strong>request and response</strong>, like fetching a product’s details.</li><li>It’s easy to reason about and debug, because one request follows one path.</li></ul><h4><strong>What it costs:</strong></h4><ul><li><strong>Temporal coupling,</strong> Both services must be up at the same moment.</li><li><strong>Cascading failures,</strong> If Shipping is slow, Order is slow. If Notification is down, the order might fail over an email.</li><li><strong>Latency adds up,</strong> Five services at 200 ms each is a full second of waiting.</li><li><strong>Scaling is tied together,</strong> A spike in one service pushes load straight into the next.</li></ul><p>This is the first coffee shop: simple and predictable, but fragile under load.</p><h3><strong>Asynchronous communication between services</strong></h3><p>In the asynchronous model, a service publishes a <strong>message or event </strong>to a broker (Kafka, RabbitMQ, SQS, etc.) and <strong>moves on</strong>. Interested services consume it on their own time.</p><p>When the order is placed, Order Service publishes an “OrderPlaced” event. Notification, Shipping, and Analytics each pick it up independently. Order Service doesn’t know or care who’s listening.</p><h4><strong>When it shines:</strong></h4><ul><li>The work <strong>doesn’t need to finish before you reply</strong> to the user: emails, analytics, report generation, search indexing.</li><li>You want <strong>loose coupling</strong>. Services can be added, removed, or deployed without touching the publisher.</li><li>You need to <strong>absorb traffic spikes</strong>. The queue buffers load, and consumers work at their own pace.</li><li>You need <strong>resilience</strong>. If Notification is down for ten minutes, messages wait and nothing is lost.</li><li><strong>Multiple services</strong> care about the same event (fan-out).</li></ul><h4><strong>What it costs:</strong></h4><ul><li><strong>Eventual consistency,</strong> The system is briefly in between states. The order exists, but the email hasn’t gone out.</li><li><strong>Harder debugging,</strong> A single user action now spans many services and logs. You’ll need distributed tracing and correlation IDs.</li><li><strong>New failure modes,</strong> Duplicate messages, out-of-order delivery, and poison messages that crash consumers.</li><li><strong>Operational overhead,</strong> You now run and monitor a broker.</li></ul><p>This is the second coffee shop: it scales and absorbs rushes, but you need a good system for the receipt numbers.</p><h4><strong>Choosing between them</strong></h4><p>The workplace questions translate almost directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sYATJqdpReApZZ9xsHuHAg.png" /></figure><blockquote><strong>Use sync when you need an answer now. Use async when you need something to happen eventually.</strong></blockquote><h4><strong>The hybrid sweet spot</strong></h4><p>Just like the best teams, the best architectures use both. A typical checkout flow:</p><p>1. <strong>Sync:</strong> Order Service calls Payment and waits. The customer needs to know if the card was declined.</p><p>2. <strong>Sync:</strong> Order Service checks Inventory, because overselling is unacceptable.</p><p>3. <strong>Async:</strong> Once the order is confirmed, Order Service publishes “OrderConfirmed”.</p><p>4. <strong>Async:</strong> Notification, Shipping, Loyalty Points, and Analytics each react on their own time.</p><p>The customer waits only for what truly blocks the outcome. Everything else happens behind the counter.</p><h3><strong>Making each style work</strong></h3><h4><strong>For synchronous calls:</strong></h4><ul><li>Set <strong>timeouts</strong> on every call. Never wait forever.</li><li>Use <strong>retries with backoff</strong> and <strong>circuit breakers</strong> so one failing service doesn’t drag down others.</li><li>Keep call chains <strong>short</strong>. If you see A → B → C → D → E, rethink the boundaries.</li></ul><h4><strong>For asynchronous messaging:</strong></h4><ul><li>Make consumers <strong>idempotent</strong>. Processing the same message twice must be safe.</li><li>Use <strong>dead-letter queues</strong> for messages that repeatedly fail.</li><li>Version your <strong>event schemas</strong> so producers and consumers can evolve separately.</li><li>Add <strong>correlation IDs</strong> and distributed tracing from day one.</li><li>Be explicit about <strong>ordering and delivery guarantees</strong> (at-least-once vs. exactly-once, and what you actually get).</li></ul><h4>Conclusion</h4><p>Whether you’re coordinating people or services, communication isn’t a question of loyalty to one style. It’s a design decision. Every call and every message spends something scarce. A colleague’s attention in one case, a service’s availability and your system’s latency in the other.</p><p>So before you schedule the meeting, or write the next REST call, ask “<em>Does the caller truly need to wait for this answer?” If not, hand over the receipt and let the barista work.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2feaae23e38c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java One Set, Two Answers: The BigDecimal Puzzle That Breaks Set]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://dinukakasunmedis.medium.com/java-one-set-two-answers-the-bigdecimal-puzzle-that-breaks-set-b54af00f335f?source=rss-64890151f803------2"><img src="https://cdn-images-1.medium.com/max/1376/1*Apq9zcUHunYRUEwqHd72WQ.jpeg" width="1376"></a></p><p class="medium-feed-snippet">How 0, 0.0, and 0.00 can be the same number and three different elements.</p><p class="medium-feed-link"><a href="https://dinukakasunmedis.medium.com/java-one-set-two-answers-the-bigdecimal-puzzle-that-breaks-set-b54af00f335f?source=rss-64890151f803------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://dinukakasunmedis.medium.com/java-one-set-two-answers-the-bigdecimal-puzzle-that-breaks-set-b54af00f335f?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/b54af00f335f</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[datastrucutre]]></category>
            <category><![CDATA[bigdecimal]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Sat, 17 Oct 2026 17:36:52 GMT</pubDate>
            <atom:updated>2026-10-17T17:36:52.581Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Java Generics Wildcards Explained: PECS (Producer Extends, Consumer Super)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://dinukakasunmedis.medium.com/generics-wildcards-and-pecs-in-java-42d6a0a0b181?source=rss-64890151f803------2"><img src="https://cdn-images-1.medium.com/max/1672/1*bBaRhltao8VT6JNjLxOaFw.png" width="1672"></a></p><p class="medium-feed-snippet">One rule that tells you whether to write ? extends or ? super</p><p class="medium-feed-link"><a href="https://dinukakasunmedis.medium.com/generics-wildcards-and-pecs-in-java-42d6a0a0b181?source=rss-64890151f803------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://dinukakasunmedis.medium.com/generics-wildcards-and-pecs-in-java-42d6a0a0b181?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/42d6a0a0b181</guid>
            <category><![CDATA[wildcard]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[pec]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[generics]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 17:18:59 GMT</pubDate>
            <atom:updated>2026-10-16T18:21:14.495Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Java Queue vs Deque vs PriorityQueue: Differences and Examples]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://dinukakasunmedis.medium.com/queue-deque-and-priorityqueue-in-java-9e509748b08f?source=rss-64890151f803------2"><img src="https://cdn-images-1.medium.com/max/1672/1*iOJfMzuvRWv_-wGcea1tOQ.png" width="1672"></a></p><p class="medium-feed-snippet">Think about ticket line, two-door bus, emergency room. Three pictures, three behaviors. All three types hold items and hand them back one&#x2026;</p><p class="medium-feed-link"><a href="https://dinukakasunmedis.medium.com/queue-deque-and-priorityqueue-in-java-9e509748b08f?source=rss-64890151f803------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://dinukakasunmedis.medium.com/queue-deque-and-priorityqueue-in-java-9e509748b08f?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e509748b08f</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[priority-queue]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[dequeue]]></category>
            <category><![CDATA[queue]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 18:10:06 GMT</pubDate>
            <atom:updated>2026-10-16T18:16:08.934Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[AI Agent Harness: The Part Around the Model]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://dinukakasunmedis.medium.com/ai-agent-harness-the-part-around-the-model-ca3e08411b01?source=rss-64890151f803------2"><img src="https://cdn-images-1.medium.com/max/1689/1*BwMmGXXQneFFWHeKczqiQw.png" width="1689"></a></p><p class="medium-feed-snippet">The model is the horse. The harness is everything that lets it pull the cart safely.</p><p class="medium-feed-link"><a href="https://dinukakasunmedis.medium.com/ai-agent-harness-the-part-around-the-model-ca3e08411b01?source=rss-64890151f803------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://dinukakasunmedis.medium.com/ai-agent-harness-the-part-around-the-model-ca3e08411b01?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca3e08411b01</guid>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-harness]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Tue, 13 Oct 2026 16:04:50 GMT</pubDate>
            <atom:updated>2026-10-14T16:26:04.824Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Java Collections: List vs Set vs Queue vs Map (When to Use Which)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://dinukakasunmedis.medium.com/how-to-choose-the-right-java-collection-3b6211afd9fe?source=rss-64890151f803------2"><img src="https://cdn-images-1.medium.com/max/2600/1*uRLJn-G6_RIi5mI2lgE1RA.png" width="2720"></a></p><p class="medium-feed-snippet">Keep this handy next time you&#x2019;re stuck between List, Set, Queue, and Map.</p><p class="medium-feed-link"><a href="https://dinukakasunmedis.medium.com/how-to-choose-the-right-java-collection-3b6211afd9fe?source=rss-64890151f803------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://dinukakasunmedis.medium.com/how-to-choose-the-right-java-collection-3b6211afd9fe?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b6211afd9fe</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[collection]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 17:47:44 GMT</pubDate>
            <atom:updated>2026-10-16T18:17:29.977Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Angular in One Picture]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://dinukakasunmedis.medium.com/angular-in-one-picture-772ab31e282d?source=rss-64890151f803------2"><img src="https://cdn-images-1.medium.com/max/1672/1*Ty5ybvBmvknvt0k6wNVWtQ.png" width="1672"></a></p><p class="medium-feed-snippet">A simple story that explains how an Angular application really works</p><p class="medium-feed-link"><a href="https://dinukakasunmedis.medium.com/angular-in-one-picture-772ab31e282d?source=rss-64890151f803------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://dinukakasunmedis.medium.com/angular-in-one-picture-772ab31e282d?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/772ab31e282d</guid>
            <category><![CDATA[application]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ngrx]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 16:32:15 GMT</pubDate>
            <atom:updated>2026-09-07T16:32:15.440Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[SynthID: The Invisible Watermark Inside LLM-Generated Text]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://dinukakasunmedis.medium.com/synthid-the-invisible-watermark-inside-llm-generated-text-da1bcc0b279e?source=rss-64890151f803------2"><img src="https://cdn-images-1.medium.com/max/1672/1*umyqR0AcLth3AFLzhqUA_g.png" width="1672"></a></p><p class="medium-feed-snippet">How AI-generated writing can carry a hidden signal without changing the way it looks or reads</p><p class="medium-feed-link"><a href="https://dinukakasunmedis.medium.com/synthid-the-invisible-watermark-inside-llm-generated-text-da1bcc0b279e?source=rss-64890151f803------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://dinukakasunmedis.medium.com/synthid-the-invisible-watermark-inside-llm-generated-text-da1bcc0b279e?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/da1bcc0b279e</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[secret-key]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-watermarking]]></category>
            <category><![CDATA[synthid]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Sun, 30 Aug 2026 18:11:47 GMT</pubDate>
            <atom:updated>2026-08-30T18:11:47.823Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[JWT, OAuth2, and OIDC Explained with One Simple Story]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://dinukakasunmedis.medium.com/jwt-oauth2-and-oidc-explained-with-one-simple-story-67d2271e8278?source=rss-64890151f803------2"><img src="https://cdn-images-1.medium.com/max/1536/1*JV55pidwtb8AONulF1TRtw.png" width="1536"></a></p><p class="medium-feed-snippet">Three security terms. One memorable analogy.</p><p class="medium-feed-link"><a href="https://dinukakasunmedis.medium.com/jwt-oauth2-and-oidc-explained-with-one-simple-story-67d2271e8278?source=rss-64890151f803------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://dinukakasunmedis.medium.com/jwt-oauth2-and-oidc-explained-with-one-simple-story-67d2271e8278?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/67d2271e8278</guid>
            <category><![CDATA[jwt-token]]></category>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[oidc]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Fri, 28 Aug 2026 18:33:36 GMT</pubDate>
            <atom:updated>2026-08-28T18:33:36.286Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Java Basics: Key Concepts Every Developer Should Know]]></title>
            <link>https://dinukakasunmedis.medium.com/java-essentials-1c7186013d26?source=rss-64890151f803------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c7186013d26</guid>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[essentials]]></category>
            <category><![CDATA[java-memory-map]]></category>
            <category><![CDATA[technical]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Dinuka Kasun Medis]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 18:41:12 GMT</pubDate>
            <atom:updated>2026-10-16T18:25:04.168Z</atom:updated>
            <content:encoded><![CDATA[<h4>java</h4><p>Java is a versatile and widely-used programming language, known for its platform independence and robustness. Whether you’re just starting your programming journey or brushing up on your skills, understanding the core concepts of Java can significantly enhance your development capabilities. Below are essential Java concepts every developer should know.</p><h3>JVM, JRE, and JDK: The Building Blocks</h3><p><strong>Java Virtual Machine (JVM)</strong> is an abstract machine that executes Java byte-code, providing platform independence.</p><p><strong>Java Runtime Environment (JRE)</strong> includes the JVM and standard libraries, enabling users to run Java applications.</p><p><strong>Java Development Kit (JDK)</strong> is a complete package containing the JVM, JRE, compilers, and additional development tools necessary for Java application development.</p><h3>Classes and Objects</h3><ul><li><strong>Class</strong>: Defines properties (fields) and behaviors (methods).</li><li><strong>Object</strong>: An instance of a class created using the new keyword.</li></ul><h3>Object-Oriented Programming (OOP) Concepts</h3><h4>1) Inheritance</h4><p>Inheritance allows a class (subclass) to acquire properties and methods of another class (superclass).</p><pre>class Animal {<br>  void eat() { System.out.println(&quot;Eating...&quot;); }<br>}<br><br>class Dog extends Animal {<br>  void bark() { System.out.println(&quot;Barking...&quot;); }<br>}</pre><h4>2) Polymorphism</h4><p>Polymorphism is the ability of objects to take multiple forms:</p><ul><li><strong>Method Overloading (Compile-time)</strong>: Methods with the same name but different parameters.</li><li><strong>Method Overriding (Runtime)</strong>: Subclass method specifically implementing a method declared in the superclass.</li></ul><h4>3) Abstraction</h4><p>Abstraction hides complex implementation details, exposing only essential functionality:</p><ul><li><strong>Abstract Classes and Interfaces</strong>:</li></ul><pre>interface Animal {<br>  void sound();<br>}<br><br>class Dog implements Animal {<br>  public void sound() { System.out.println(&quot;Bark&quot;); }<br>}</pre><h4>4) Encapsulation</h4><p>Encapsulation protects data by bundling variables and methods into a class, controlling data access via getters and setters.</p><pre>public class Person {<br>  private String name;<br><br>  public String getName() { <br>    return name; <br>  }<br>  public void setName(String name) { <br>    this.name = name; <br>  }<br>}</pre><h3>Constructors</h3><p>Constructors initialize objects at creation:</p><ul><li><strong>Default Constructor</strong>: No arguments.</li><li><strong>Parameterized Constructor</strong>: Accepts arguments to initialize object state.</li></ul><h3>Keywords: this, static, and super</h3><ul><li><strong>this</strong>: Refers to the current object.</li><li><strong>static</strong>: Used for class-level members accessible without object instantiation.</li><li><strong>super</strong>: References immediate parent class.</li></ul><h3>Handling Common Issues</h3><h4>Cyclic Dependencies</h4><p>Occurs when classes directly or indirectly depend on each other, creating circular references. Resolve using:</p><ul><li>Dependency Inversion Principle (DIP)</li><li>Interfaces or abstract classes</li><li>Dependency Injection</li></ul><h4>Diamond Problem</h4><p>Occurs in multiple inheritances when a class inherits from two classes with a common superclass. Java resolves this by disallowing multiple class inheritance but allows multiple interface implementations with explicit conflict resolution.</p><pre>interface B extends A {<br>  default void show() { System.out.println(&quot;B Implementation&quot;); }<br>}<br><br>interface C extends A {<br>  default void show() { System.out.println(&quot;C Implementation&quot;); }<br>}<br>class D implements B, C {<br>  public void show() { B.super.show(); }<br>}</pre><h3>Understanding Java Strings</h3><p>Strings are immutable in Java. They are stored in the String Pool for memory optimization.</p><pre>String s1 = &quot;Java&quot;; // String pool<br>String s2 = new String(&quot;Java&quot;); // Heap</pre><p>Use StringBuilder for efficient string concatenation and StringBuffer for thread-safe operations.</p><h3>Java Collections Framework</h3><p>Efficient data handling is vital. Commonly used collections include:</p><ul><li><strong>Lists</strong>: ArrayList (fast addition), LinkedList (fast deletion)</li><li><strong>Sets</strong>: HashSet (fast lookup), LinkedHashSet (maintains order), TreeSet (sorted order)</li><li><strong>Queues</strong> and <strong>Stacks</strong>: For FIFO and LIFO operations</li></ul><h3>Hashtable and Hashing</h3><p>HashTables provide synchronized key-value mappings:</p><ul><li>Efficient lookup: Typically O(1)</li><li>Collision Handling: Managed via chaining or open addressing</li></ul><pre>Hashtable&lt;String, Integer&gt; table = new Hashtable&lt;&gt;();<br>table.put(&quot;Apple&quot;, 10);</pre><h3>Final Thoughts</h3><p>Mastering these foundational Java concepts enhances your coding proficiency, enabling you to write robust, efficient, and maintainable applications. Embrace these essentials, and you’ll find Java programming significantly more manageable and rewarding.</p><p>Additionally, here I will share a memory map of Java which will may time to time update with you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AERIH-GHJBsJVZJQvn4Rig.png" /><figcaption>Image: Last update 28, Aug 2026 — Created with Freeform, Apple</figcaption></figure><blockquote>If this article helped you understand the topic, please give it a clap 👏 and share it with someone who might find it useful.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c7186013d26" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>