<?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 Ericpraveen on Medium]]></title>
        <description><![CDATA[Stories by Ericpraveen on Medium]]></description>
        <link>https://medium.com/@ericpraveen123?source=rss-46f8b59344bc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cyAT_QE7dIx0584jpaYdPw.jpeg</url>
            <title>Stories by Ericpraveen on Medium</title>
            <link>https://medium.com/@ericpraveen123?source=rss-46f8b59344bc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 13:24:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ericpraveen123/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[SOLID Principles in Object-Oriented Programming]]></title>
            <link>https://medium.com/@ericpraveen123/solid-principles-in-object-oriented-programming-6c984ad62e67?source=rss-46f8b59344bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c984ad62e67</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[solid-principles]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[oop]]></category>
            <dc:creator><![CDATA[Ericpraveen]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 15:29:11 GMT</pubDate>
            <atom:updated>2026-10-31T15:29:11.564Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Understanding the five fundamental design principles that help developers build clean, maintainable, flexible, and scalable software.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5NxwxPUt-zeqdHksjL-mEw.jpeg" /></figure><h3>Introduction</h3><p>As software applications grow, maintaining and extending their codebases becomes increasingly challenging. Poorly structured code can lead to tightly coupled components, duplicated logic, difficult debugging, and unexpected changes across an application.</p><p>This is where <strong>SOLID principles</strong> come into play.</p><p>SOLID is an acronym representing five fundamental object-oriented design principles that guide developers in writing maintainable, flexible, and understandable code.</p><p>These principles were popularized by Robert C. Martin and are widely used in modern software engineering.</p><p>SOLID stands for:</p><ol><li><strong>S</strong> — Single Responsibility Principle (SRP)</li><li><strong>O</strong> — Open/Closed Principle (OCP)</li><li><strong>L</strong> — Liskov Substitution Principle (LSP)</li><li><strong>I</strong> — Interface Segregation Principle (ISP)</li><li><strong>D</strong> — Dependency Inversion Principle (DIP)</li></ol><p>Let’s explore each principle with practical Java examples.</p><h3>1. Single Responsibility Principle (SRP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GbW0z9yHmca-yvgRzXseUg.jpeg" /></figure><h3><strong>“A class should have only one reason to change.”</strong></h3><p>The Single Responsibility Principle states that a class should have one primary responsibility.</p><p>In simpler terms, a class should focus on one specific job rather than handling multiple unrelated responsibilities.</p><p>When a single class manages several responsibilities, changes to one functionality may unintentionally affect another. This makes the code harder to maintain, test, and extend.</p><h3>Problem: Multiple Responsibilities in One Class</h3><p>Consider the following example:</p><pre>class Customer {<br><br>private String name;<br>private String email;<br><br>public Customer(String name, String email) {<br>        this.name = name;<br>        this.email = email;<br>    }<br><br>  public void saveToDatabase() {<br>        // Save customer data<br>    }<br><br>  public void sendEmailNotification() {<br>        // Send email notification<br>    }<br>}</pre><p>Here, the Customer class handles two responsibilities:</p><ul><li>Managing customer information.</li><li>Saving customer data and sending email notifications.</li></ul><p>If the database implementation or email notification process changes, the Customer class must also be modified.</p><p>This violates SRP.</p><h3>Solution: Separate Responsibilities</h3><p>We can separate these responsibilities into different classes.</p><pre>class Customer {<br>  private String name;<br>  private String email;<br><br>  public Customer(String name, String email) {<br>        this.name = name;<br>        this.email = email;<br>    }<br>}<br><br>class CustomerDataStorage {<br>    public void saveToDatabase(Customer customer) {<br>        // Save customer data<br>    }<br>}<br><br>class EmailSender {<br>    public void sendEmailNotification(Customer customer) {<br>        // Send email notification<br>    }<br>}</pre><p>Now, each class has a clearly defined responsibility.</p><ul><li>Customer manages customer information.</li><li>CustomerDataStorage handles database operations.</li><li>EmailSender handles email notifications.</li></ul><p><strong>Key Takeaway:</strong> Keep classes focused on a single responsibility to improve cohesion, maintainability, and testability.</p><h3>2. Open/Closed Principle (OCP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPCs0f2FLoI3ZOCDPcIDtg.jpeg" /></figure><p><strong>“Software entities should be open for extension but closed for modification.”</strong></p><p>The Open/Closed Principle states that existing code should allow new functionality to be added without requiring modifications to its existing implementation.</p><p>In other words, instead of continuously changing existing classes whenever a new feature is introduced, we should design our code so that new functionality can be added through extension.</p><h3>Problem: Modifying Existing Code</h3><p>Consider an application that draws different geometric shapes.</p><pre>class Rectangle {<br>    void drawRectangle() {<br>        // Draw rectangle<br>    }<br>}<br><br>class Circle {<br>    void drawCircle() {<br>        // Draw circle<br>    }<br>}</pre><p>As the application grows, we may need to support additional shapes such as triangles or squares.</p><p>Without a common abstraction, the drawing logic may become increasingly difficult to manage as more shape-specific conditions are introduced.</p><h3>Solution: Use Abstraction and Polymorphism</h3><p>We can introduce a common Shape interface.</p><pre>interface Shape {<br>    void draw();<br>}<br><br>class Rectangle implements Shape {<br>    @Override<br>    public void draw() {<br>        // Draw rectangle<br>    }<br>}<br><br>class Circle implements Shape {<br>    @Override<br>    public void draw() {<br>        // Draw circle<br>    }<br>}<br><br>class Triangle implements Shape {<br>    @Override<br>    public void draw() {<br>        // Draw triangle<br>    }<br>}   </pre><p>Now, whenever we need to introduce a new shape, we can create another class that implements the Shape interface without modifying the existing shape classes.</p><p><strong>Key Takeaway:</strong> Design your code to support new functionality through extension rather than repeatedly modifying existing implementations.</p><h3>3. Liskov Substitution Principle (LSP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ANuVYmh1wRiw33iL2u5oHA.jpeg" /></figure><p><strong>“Objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program.”</strong></p><p>The Liskov Substitution Principle states that subclasses should behave consistently with the expectations established by their parent classes.</p><p>In simpler terms, if a class inherits from another class, its objects should be usable wherever objects of the parent class are expected without introducing unexpected behavior.</p><h3>Problem: Incorrect Inheritance</h3><p>Consider the following example:</p><pre>class Bird {<br>    public void fly() {<br>        System.out.println(&quot;Bird is flying&quot;);<br>    }<br>}<br><br>class Penguin extends Bird {<br>    @Override<br>    public void fly() {<br>        throw new UnsupportedOperationException(<br>            &quot;Penguins cannot fly&quot;<br>        );<br>    }<br>}</pre><p>The problem is that not every bird can fly.</p><p>If an application expects every Bird object to support the fly() method, using a Penguin object will result in unexpected behavior.</p><p>This violates LSP because the subclass cannot correctly fulfill the expectations of its parent class.</p><h3>Solution: Design Appropriate Abstractions</h3><p>We can separate general bird behavior from flying behavior.</p><pre>class Bird {<br>    public void eat() {<br>        System.out.println(&quot;Bird is eating&quot;);<br>    }<br>}<br><br>interface Flyable {<br>    void fly();<br>}<br><br>class Sparrow extends Bird implements Flyable {<br>    @Override<br>    public void fly() {<br>        System.out.println(&quot;Sparrow is flying&quot;);<br>    }<br>}<br><br>class Penguin extends Bird {<br><br>    public void swim() {<br>        System.out.println(&quot;Penguin is swimming&quot;);<br>    }<br>}</pre><p>Now:</p><ul><li>Both Sparrow and Penguin inherit the common behavior of Bird.</li><li>Only birds that can fly implement the Flyable interface.</li><li>A Penguin is no longer forced to provide an unsupported flying behavior.</li></ul><p><strong>Key Takeaway:</strong> Subclasses should preserve the expected behavior of their parent classes. Avoid inheritance structures that force subclasses to implement behavior they cannot support.</p><h3>4. Interface Segregation Principle (ISP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XreikUbpcz0JD42XArE-8g.jpeg" /></figure><p><strong>“Clients should not be forced to depend on interfaces they do not use.”</strong></p><p>The Interface Segregation Principle encourages developers to create smaller, specific interfaces instead of large, general-purpose interfaces.</p><p>A class should only implement the methods relevant to its functionality.</p><h3>Problem: Large Interfaces</h3><p>Consider an interface designed for document-processing devices.</p><pre>interface Document <br>{<br>    void print();<br>    void scan();<br>    void fax();<br>}   </pre><p>Now, imagine two devices:</p><ul><li>A photocopier that can print, scan, and fax.</li><li>A simple printer that can only print.</li></ul><p>If both devices implement the Document interface, the simple printer must also implement scanning and faxing methods, even though it does not support those operations.</p><p>This creates unnecessary dependencies and forces classes to implement methods they do not need.</p><h3>Solution: Split Interfaces into Smaller Interfaces</h3><p>Instead of one large interface, we can create smaller, focused interfaces.</p><pre>interface Printer {<br>    void print();<br>}<br><br>interface Scanner {<br>    void scan();<br>}<br><br>interface FaxMachine {<br>    void fax();<br>}</pre><p>Now, each device can implement only the interfaces relevant to its functionality.</p><pre>class Photocopier implements Printer, Scanner, FaxMachine {<br><br>    public void print() {<br>        // Print document<br>    }<br><br>    public void scan() {<br>        // Scan document<br>    }<br><br>    public void fax() {<br>        // Fax document<br>    }<br>}<br><br>class SimplePrinter implements Printer {<br>    public void print() {<br>        // Print document<br>    }<br>} </pre><p>The SimplePrinter class only implements the Printer interface, while the Photocopier supports all three operations.</p><p><strong>Key Takeaway:</strong> Prefer smaller, focused interfaces to reduce unnecessary dependencies and improve flexibility.</p><h3>5. Dependency Inversion Principle (DIP)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cD4jsSSIVCdDtel7_4upPQ.jpeg" /></figure><p><strong>“High-level modules should not depend on low-level modules. Both should depend on abstractions.”</strong></p><p>The Dependency Inversion Principle focuses on reducing tight coupling between software components.</p><p>High-level modules contain the application’s business logic, while low-level modules handle implementation details such as sending emails, accessing databases, or communicating with external services.</p><p>Instead of directly depending on specific implementations, both should interact through abstractions, such as interfaces.</p><h3>Problem: Direct Dependency</h3><p>Consider the following example:</p><pre>class NotificationService {<br>    EmailSender emailSender = new EmailSender();<br>    void sendNotification(String message) {<br>        emailSender.sendEmail(message);<br>    }<br>}<br><br>class EmailSender {<br>    void sendEmail(String message) {<br>        // Send email<br>    }<br>}</pre><p>Here, NotificationService directly creates and depends on EmailSender.</p><p>If we want to introduce SMS notifications or another notification mechanism, we need to modify the existing implementation.</p><p>This creates tight coupling between the classes.</p><h3>Solution: Depend on Abstractions</h3><p>We can introduce a common interface called Notifier.</p><pre>interface Notifier {<br>    void send(String message);<br>}<br><br>class NotificationService {<br>    private Notifier notifier;<br>    public NotificationService(Notifier notifier) {<br>        this.notifier = notifier;<br>    }<br>    void sendNotification(String message) {<br>        notifier.send(message);<br>    }<br>}<br><br>class EmailSender implements Notifier {<br>    @Override<br>    public void send(String message) {<br>        // Send email<br>    }<br>}<br><br>class SmsSender implements Notifier {<br>    @Override<br>    public void send(String message) {<br>        // Send SMS<br>    }<br>}</pre><p>Now, NotificationService depends on the Notifier abstraction rather than a specific notification implementation.</p><p>We can inject different implementations through its constructor.</p><p>This approach is known as <strong>Dependency Injection</strong>, which is a common technique for implementing the Dependency Inversion Principle.</p><p><strong>Key Takeaway:</strong> Depend on abstractions rather than concrete implementations to reduce coupling and make your application more flexible and testable.</p><h3>Why Are SOLID Principles Important?</h3><p>Applying SOLID principles helps developers build software that is easier to understand, maintain, test, and extend.</p><p>Some major benefits include:</p><ul><li><strong>Maintainability:</strong> Changes can be made with fewer unintended effects on other components.</li><li><strong>Flexibility:</strong> New features and implementations can be introduced more easily.</li><li><strong>Reusability:</strong> Well-designed components can be reused across different parts of an application.</li><li><strong>Testability:</strong> Smaller, loosely coupled components are easier to test independently.</li><li><strong>Scalability:</strong> A well-structured codebase is easier to evolve as application requirements grow.</li></ul><p>However, SOLID principles should not be applied blindly. Overengineering and unnecessary abstractions can make simple applications unnecessarily complex. The goal is to use these principles where they provide meaningful design benefits.</p><h3>Conclusion</h3><p>SOLID principles are fundamental concepts in object-oriented software design. They provide a foundation for building software that is maintainable, flexible, and easier to extend.</p><p>To summarize:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8mEPhDcwZVzDgttEiQSmw.png" /></figure><p>PrincipleMain IdeaSRPOne class, one responsibility.OCPOpen for extension, closed for modification.LSPSubclasses should be replaceable for their parent classes.ISPPrefer smaller, focused interfaces.DIPDepend on abstractions, not concrete implementations.</p><p>Understanding these principles is an important step toward becoming a better software developer. More importantly, applying them in real-world projects helps transform code from something that simply works into something that is easier to maintain and evolve.</p><p><strong>Write clean code. Design for change. Build better software.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c984ad62e67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java 25 Made main() Simpler. Here's What Actually Changed.]]></title>
            <link>https://medium.com/@ericpraveen123/java-25-made-main-simpler-heres-what-actually-changed-69ed8ea4a283?source=rss-46f8b59344bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/69ed8ea4a283</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learn-to-code]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ericpraveen]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 14:15:36 GMT</pubDate>
            <atom:updated>2026-10-20T14:15:36.229Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Java 25: A Simpler Way to Start Coding" src="https://cdn-images-1.medium.com/max/1024/1*Jvsl2PGn86a7eQkJcLmbaw.jpeg" /><figcaption>Java 25: A Simpler Way to Start Coding</figcaption></figure><h3>From public static void main(String[] args) to void main() — understanding Java&#39;s new entry point and why it matters for beginners.</h3><p>If you’ve ever written your first Java program, you probably remember this line:</p><pre>public static void main(String[] args)</pre><p>Your first program might have been just one line of output, but before you could print anything, you had to write a class, declare a method, add a few keywords, and include a parameter that you probably didn’t understand yet.</p><p>For experienced developers, this is second nature. For beginners, it can feel like learning five different concepts just to display <em>Hello, World!</em></p><p>With Java 25, things became simpler.</p><p>You can now write a basic Java program like this:</p><pre>void main() {<br>    IO.println(&quot;Hello, World!&quot;);<br>}</pre><p>That’s it. No explicit class declaration. No public static. No String[] args.</p><p>But Java hasn’t abandoned its traditional programming model. Instead, it has introduced a simpler way to get started.</p><p>Let’s explore what changed, how it works, and why it took several Java releases to become a permanent feature.</p><h3>1. Why Did Java Need to Change?</h3><p>Java is designed to support large applications with classes, interfaces, packages, access control, and many other features.</p><p>These concepts are essential when building enterprise applications. However, they’re not always necessary when someone is learning their first programming concepts.</p><p>Consider the traditional Hello World program:</p><pre>public class HelloWorld {</pre><pre>    public static void main(String[] args) {<br>        System.out.println(&quot;Hello, World!&quot;);<br>    }</pre><pre>}</pre><p>Before a beginner can focus on variables, loops, or conditions, they encounter several concepts:</p><ul><li>class — defines a class.</li><li>public — an access modifier.</li><li>static — allows a method to be called without an instance.</li><li>void — indicates that the method doesn&#39;t return a value.</li><li>String[] args — receives command-line arguments.</li></ul><p>Every keyword has a purpose. The problem isn’t that these concepts are unnecessary; it’s that beginners don’t need to understand all of them before writing a simple program.</p><p>Java’s goal with this change is straightforward: let people start programming first and learn the additional structure when they need it.</p><h3>2. Meet JEP 512: Compact Source Files and Instance Main Methods</h3><p>Java 25 finalized a feature called <strong>Compact Source Files and Instance Main Methods</strong>, specified by <a href="https://openjdk.org/jeps/512">JEP 512</a>.</p><p>It introduces two closely related improvements:</p><ol><li><strong>Compact source files:</strong> You can write methods and fields without explicitly declaring the surrounding class.</li><li><strong>Instance </strong><strong>main methods:</strong> The entry-point method doesn&#39;t have to be static, and it doesn&#39;t always need a String[] parameter.</li></ol><p>Together, these changes make small Java programs easier to write and read.</p><p>Here’s the important distinction: the class still exists. Java simply allows the compiler to infer it rather than requiring you to declare it explicitly.</p><figure><img alt="comparison graphic showing the traditional entry point next to the compact Java 25 version." src="https://cdn-images-1.medium.com/max/1024/1*Oh_bObhhyTYxIQ6sDTTg0g.png" /><figcaption>comparison graphic showing the traditional entry point next to the compact Java 25 version.</figcaption></figure><h3>3. Where Did the Class Go?</h3><p>Let’s compare the old and new approaches.</p><p><strong>Traditional Java</strong></p><pre>public class HelloWorld {<br>      System.out.println(&quot;Hello, World!&quot;);<br>          }<br>      }</pre><p><strong>Java 25 compact source file</strong></p><pre>void main() {<br>    IO.println(&quot;Hello, World!&quot;);<br>}</pre><p>You might wonder how Java can run a method when there’s no class declaration around it.</p><p>The answer is that the compiler implicitly declares a class containing the methods and fields in the compact source file.</p><p>Conceptually, your code still belongs to a class. You simply don’t have to write that class yourself.</p><p>This is not a separate programming language or a replacement for object-oriented Java. It’s a shorter way to write small programs.</p><p>You can still learn classes, constructors, inheritance, and interfaces when you’re ready to explore them.</p><h3>4. Why Doesn’t main() Need to Be Static Anymore?</h3><p>This is probably the most interesting change.</p><p>In traditional Java, the launcher expects a suitable public static void main(String[] args) method. Because the method is static, Java can invoke it without creating an instance of the class.</p><p>But the new approach also supports an instance method:</p><pre>void main() {<br>    IO.println(&quot;Hello from an instance main method!&quot;);<br>}</pre><p>So who creates the object?</p><p>When Java selects an instance main method, the launcher creates an instance of the class using its default, no-argument constructor and then invokes the method on that instance.</p><p>In a compact source file, the class is implicitly declared, and Java provides the default constructor required for this process.</p><p>The sequence is essentially:</p><ol><li>Java identifies the compact source file.</li><li>The compiler provides the implicit class.</li><li>The launcher creates an instance.</li><li>The launcher calls main().</li><li>Your program executes.</li></ol><p>The object-oriented model hasn’t disappeared. Java is simply handling some of the setup for you.</p><figure><img alt="comparison graphic showing the traditional entry point next to the compact Java 25 version." src="https://cdn-images-1.medium.com/max/1024/1*7jk9ixr2UmoSno2fVyL6wQ.png" /><figcaption>flow diagram showing the implicit class, instance creation, and method invocation.</figcaption></figure><h3>5. Printing Is Simpler, Too</h3><p>Another useful addition is IO, a class in the java.lang package that provides basic console input and output methods.</p><p>Instead of writing:</p><pre>System.out.println(&quot;Hello, World!&quot;);</pre><p>You can write:</p><pre>IO.println(&quot;Hello, World!&quot;);</pre><p>The difference may look small, but it makes introductory examples easier to read.</p><p>Compact source files also automatically import public top-level types from packages exported by the java.base module. Since java.lang is part of that module, you don&#39;t need to explicitly import IO for this example.</p><p>One detail worth remembering: IO.println() is not a replacement for every feature of System.out. It is a simpler option for basic console I/O.</p><h3>6. Can You Run It Without Compiling It Manually?</h3><p>Yes. Java’s launcher supports running a compact source file directly.</p><p>Save the following code in a file named HelloWorld.java:</p><pre>void main() {<br>    IO.println(&quot;Hello, World!&quot;);<br>}</pre><p>Then run:</p><pre>java HelloWorld.java</pre><p>You don’t need to run javac separately first.</p><p>You can also compile and run it in two steps:</p><pre>javac HelloWorld.java<br>java HelloWorld</pre><p>For these examples, use a JDK that supports the finalized Java 25 feature.</p><p>This is especially convenient when experimenting with Java, testing a small idea, or learning the basics without setting up a larger project.</p><h3>7. Why Did It Take Several Releases?</h3><p>Java is used in millions of applications, from small tools to large enterprise systems. Changes to the language and its launcher must be designed carefully so that existing programs continue to work.</p><p>This feature was developed through multiple preview releases:</p><p>Java release Development stageJava 21First previewJava 22Second previewJava 23Third previewJava 24Fourth previewJava 25Finalized feature</p><p>The repeated previews gave developers and the Java team opportunities to evaluate the design and refine it before making it permanent.</p><p>The result is not simply a shorter main method. It is a carefully designed way to introduce Java while preserving the language&#39;s established programming model.</p><h3>8. Does This Mean the Traditional main Method Is Obsolete?</h3><p>Not at all.</p><p>Your existing Java programs can continue to use:</p><pre>public static void main(String[] args) {<br>    System.out.println(&quot;Hello, World!&quot;);<br>}</pre><p>The traditional entry point remains supported.</p><p>For larger applications, explicit classes and conventional entry points may still be the clearest choice. They make program structure visible and fit naturally into established project conventions.</p><p>Compact source files are particularly useful for beginners, demonstrations, small experiments, and simple standalone programs.</p><p>The right approach depends on the program you’re building.</p><h3>9. What This Means for Someone Learning Java</h3><p>I think the most important change is not the number of lines saved. It’s the order in which beginners can learn the language.</p><p>You can start with:</p><ul><li>Variables and data types.</li><li>Conditional statements.</li><li>Loops.</li><li>Methods.</li><li>Basic input and output.</li></ul><p>Then, when you begin building larger programs, you can explore classes, objects, constructors, encapsulation, and other object-oriented concepts.</p><p>You don’t have to understand the entire structure of a Java application before writing your first useful program.</p><p>And experienced developers can still use the full language whenever the situation calls for it.</p><h3>Final Thoughts</h3><p>Java 25 didn’t kill public static void main(String[] args). It made that traditional entry point optional for a new category of simple programs.</p><p>With <strong>JEP 512</strong>, Java introduced compact source files and instance main methods, allowing beginners to focus on programming fundamentals before dealing with the structure required by larger applications.</p><p>Sometimes, improving a programming language doesn’t mean adding another powerful feature. Sometimes, it means removing an unnecessary barrier between a beginner and their first working program.</p><p>Java’s new entry point is a good example of that idea.</p><p><strong>The language hasn’t become less powerful. Getting started has simply become easier.</strong></p><h3>References</h3><ul><li><a href="https://openjdk.org/jeps/512">JEP 512 — Compact Source Files and Instance Main Methods</a></li><li><a href="https://docs.oracle.com/en/java/javase/25/language/compact-source-files-instance-main-methods.html">Oracle Java 25 Documentation — Compact Source Files and Instance Main Methods</a></li><li><a href="https://docs.oracle.com/en/java/javase/26/language/java-language-changes-release.html">Oracle — Java Language Changes by Release</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69ed8ea4a283" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing the “br” Issue in WSO2 Micro Integrator]]></title>
            <link>https://medium.com/@ericpraveen123/fixing-the-br-issue-in-wso2-micro-integrator-d38fb995e670?source=rss-46f8b59344bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d38fb995e670</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[wso2-micro-integrator]]></category>
            <category><![CDATA[ws02]]></category>
            <category><![CDATA[api-integration]]></category>
            <dc:creator><![CDATA[Ericpraveen]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 06:04:07 GMT</pubDate>
            <atom:updated>2026-09-23T06:04:07.109Z</atom:updated>
            <content:encoded><![CDATA[<h3>A practical look at how a small Brotli dependency caused incorrect Accept-Encoding headers in WSO2 Micro Integrator</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j3OK4BJshdL-1-jUF6AjvQ.png" /></figure><p>When I started contributing to <strong>WSO2 Micro Integrator</strong> as my first open-source contribution, I picked an issue that looked surprisingly small.</p><p>The issue was about one extra value in an HTTP request header:</p><p>Accept-Encoding: gzip, compress, deflate, br</p><p>At first glance, it didn’t seem like a big deal. But after digging into the codebase, I realized this tiny br value could cause real response parsing failures in Micro Integrator.</p><p>This article is a walkthrough of what I learned while fixing <strong>WSO2 Issue #4488</strong>.</p><h3>The Bug: An Unexpected br in Accept-Encoding</h3><p>WSO2 Micro Integrator sends HTTP requests to backend services using <strong>Apache HttpComponents</strong>.</p><p>The problem was that outgoing requests automatically advertised support for <strong>Brotli (</strong><strong>br) compression</strong>.</p><p><strong>Before the fix</strong></p><pre>Accept-Encoding: gzip, compress, deflate, br</pre><p>The issue is that <strong>Micro Integrator’s response pipeline does not support Brotli decompression</strong>. If a backend server chooses br and returns a Brotli-compressed response, MI cannot process it correctly, leading to response parsing failures.</p><p>So the request claimed support for something the runtime could not actually handle.</p><h3>Why Was br Added Automatically?</h3><p>This was the most interesting part for me.</p><p>The runtime included the dependency:</p><p>org.brotli:dec</p><p>Apache HttpComponents detects available content decoders on the classpath during startup. Since the Brotli decoder JAR was bundled with the distribution, it automatically registered Brotli support and appended br to every outgoing Accept-Encoding header.</p><p>In other words:</p><pre>Brotli JAR present<br>        ↓<br>HttpComponents detects Brotli support<br>        ↓<br>Automatically adds &quot;br&quot;<br>        ↓<br>Backend may return Brotli response<br>        ↓<br>MI cannot decompress it</pre><p>The bug wasn’t inside the HTTP header logic itself — it was caused by a dependency that changed runtime behaviour.</p><h3>The Fix</h3><p>Instead of modifying HTTP request generation, I removed the unnecessary Brotli decoder from the Micro Integrator distribution.</p><p>I updated two files:</p><ul><li>distribution/pom.xml</li><li>distribution/src/assembly/bin.xml</li></ul><p>By removing the org.brotli:dec dependency from the runtime distribution, HttpComponents no longer detects Brotli support.</p><p><strong>After the fix</strong></p><pre>Accept-Encoding: gzip, compress, deflate</pre><p>Now Micro Integrator only advertises compression formats that it can actually process.</p><h3>Why This Fix Matters</h3><p>Although it was only a few lines of change, it improves runtime behaviour in an important way.</p><ul><li>Prevents backend services from returning unsupported Brotli responses.</li><li>Keeps the Accept-Encoding header aligned with MI&#39;s actual capabilities.</li><li>Avoids unnecessary response parsing failures caused by unsupported compression.</li></ul><p>This is a good example of how a <strong>small dependency can affect the behaviour of an entire runtime</strong>.</p><h3>What I Learned from This Contribution</h3><p>This was my first contribution to the WSO2 Micro Integrator codebase, and it taught me something valuable:</p><p>Sometimes the root cause of a bug isn’t in the feature that appears broken. It can come from how libraries interact with the runtime behind the scenes.</p><p>Reading the issue, tracing the dependency, understanding how Apache HttpComponents builds the Accept-Encoding header, and finally submitting the fix gave me a much better understanding of how Micro Integrator handles HTTP communication internally.</p><h3>Final Thoughts</h3><p>Open-source contributions are not always about writing hundreds of lines of code. Sometimes a small, focused change can fix an important runtime behaviour and improve reliability for everyone using the platform.</p><p>This contribution fixed <strong>WSO2 Micro Integrator Issue #4488</strong> by ensuring the runtime no longer advertises unsupported Brotli compression through the Accept-Encoding header.</p><p>It was a great first step into contributing to the WSO2 open-source ecosystem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d38fb995e670" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>