<?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 Praveenabaskar on Medium]]></title>
        <description><![CDATA[Stories by Praveenabaskar on Medium]]></description>
        <link>https://medium.com/@praveenabaskar123?source=rss-df1532e5c9c8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*DuZDnszEiYZCCw2Q</url>
            <title>Stories by Praveenabaskar on Medium</title>
            <link>https://medium.com/@praveenabaskar123?source=rss-df1532e5c9c8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 21:12:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@praveenabaskar123/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[From Try-Catch to Global Exception Handling in Springboot]]></title>
            <link>https://medium.com/@praveenabaskar123/from-try-catch-to-global-exception-handling-in-springboot-d50a58a42ea5?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d50a58a42ea5</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Tue, 25 Aug 2026 15:20:01 GMT</pubDate>
            <atom:updated>2026-08-25T15:30:49.895Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction:</strong></h3><p>Imagine you are building e-commerce application. When user enters a product Id 100, but that product doesn’t exist. Here, without proper exception handling, the application may show a technical error message. Instead of showing system error, we can catch the exception and return a clear message like “Product Not Found”.</p><p>So, In this blog, I will explain basic Java exception handling using try-catch and then how Global Exception handling helps us to handle errors in one central place in Springboot application.</p><h3><strong>What is Exception?</strong></h3><p>An exception is an unwanted event occurs during program execution disrupts normal flow of program.</p><p><strong><em>Example: int result = 10/0;</em></strong><br>This cause an ArithmeticException, because a number divided by zero.</p><p><strong>Handling Exception Using Try-Catch:</strong></p><pre>try {<br>    int result = 10 / 0;<br>} catch (ArithmeticException e) {<br>    System.out.println(&quot;Cannot divide by zero&quot;);<br>}</pre><blockquote>Here, <br>try -&gt; Contains code that may cause exception<br>catch -&gt; Handles the exception</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjS80pWNuvJQO4xbxKMn8g.png" /></figure><p>Now we can handle exceptions using try-catch. We may think this is enough. But is it?</p><h3><strong>Problem with Using Try-Catch Everywhere:</strong></h3><p>Imagine we are building Springboot applications hat has different APIs for managing users and products.</p><p><strong><em>For Example: We have many APIs to get a user, to create a user, delete a user, to get a product and delete a product.<br></em></strong><em> </em><br>Here, <br>when we try to get a user, the requested user may not exist. Similarly, when we try to get a product, the product may not be available.</p><p>One way to handle these exceptions is by using a try-catch block inside each controller method like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I4E5Me49sm4ibBKNralwPw.png" /></figure><p>Writing try-catch block in each controller method can lead to duplicate code and make the application harder to maintain.</p><p>Now, Global Exception Handling plays an main role…….</p><h3>What is Global Exception Handling?</h3><p>Global Exception Handling is a centralized way of handling exceptions for the entire application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*KX92hSpnlrYdlOYPty3Feg.png" /></figure><p>Understanding Global Exception Handling Annotations<br>In Springboot, we use annotations such as <strong>@ControllerAdvice</strong>, <strong>@RestControllerAdvice</strong> and <strong>@ExceptionHandler</strong> to handle exceptions globally.</p><blockquote><strong><em>@ControllerAdvice</em></strong><br>@ControllerAdvice allows us to handle exceptions globally across multiple controllers.</blockquote><blockquote><strong><em>@RestController</em></strong><br>@RestController is commonly used in REST APIs. It allows us to handle exceptions globally and return the response directly to the client.</blockquote><p>For REST APIs, we can use:</p><pre>@RestControllerAdvice</pre><p>Inside this class, we use @ExceptionHandler to specify which exception should be handled.</p><p>For example:</p><pre>@RestControllerAdvice<br>public class GlobalExceptionHandler {<br>      @ExceptionHandler(Exception.class)<br>    public ResponseEntity&lt;String&gt; handleException(Exception exception) {<br>        return ResponseEntity<br>                .status(HttpStatus.INTERNAL_SERVER_ERROR)<br>                .body(&quot;Something went wrong&quot;);<br>    }<br>}</pre><p>Here:</p><pre>@ExceptionHandler(Exception.class)</pre><p>means that whenever an Exception occurs, Spring Boot will use this method to handle it and return an response to the client.</p><h3><strong>Create a Custom Exception:</strong></h3><p>Custom Exception means user-defined exception, instead of throwing general exception, we can clearly describe the actual problem.</p><p><strong>For example: UserNotFoundException</strong> is more meaningful than <strong>Exception</strong></p><pre>public class UserNotFoundException extends RuntimeException {<br>  public UserNotFoundException(String message) {<br>        super(message);<br>    }<br>}</pre><p>We can also create custom exceptions, such as UserNotFoundException, to clearly represent specific problems in our application.</p><h3>Throw the Exception from the Service Layer</h3><pre>public User getUserById(Long id) {<br>  return userRepository.findById(id)<br>            .orElseThrow(() -&gt;<br>                    new UserNotFoundException(<br>                            &quot;User not found with id: &quot; + id<br>                    ));<br>}</pre><p><strong>Flow of Service Layer:<br></strong><em>findById(id)</em>→ Check if the user exists → Yes: Return User | No: Throw <em>UserNotFoundExcception</em></p><h3>Handle the Custom Exception Globally</h3><pre>@RestControllerAdvice<br>public class GlobalExceptionHandler {<br>      @ExceptionHandler(UserNotFoundException.class)<br>    public ResponseEntity&lt;String&gt; handleUserNotFound(<br>            UserNotFoundException exception) {<br>        return ResponseEntity<br>                .status(HttpStatus.NOT_FOUND)<br>                .body(exception.getMessage());<br>    }<br>}</pre><p>Explanation:</p><ol><li>Exception occurs.</li><li>UserNotFoundException is thrown.</li><li>Spring finds the matching @ ExceptionHandler .</li><li>The handler catches the exception.</li><li>A proper response is returned.</li></ol><h3>Conclusion:</h3><p>So, Exception handling is an important part of any application. Instead of handling exceptions everywhere using try-catch, Global Exception Handling allows us to handle them centrally and return clean and meaningful responses to the client.</p><p>Thankyou for Reading☺️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d50a58a42ea5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices Using Springboot]]></title>
            <link>https://medium.com/@praveenabaskar123/microservices-using-springboot-08e07ff31d40?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/08e07ff31d40</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Tue, 21 Apr 2026 08:27:43 GMT</pubDate>
            <atom:updated>2026-04-21T08:27:43.831Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Microservices?</h3><p>Microservices is a way of building an application by dividing it into <strong>small, independent services</strong>. Instead of creating one large application, we break it into multiple smaller parts. Each part is called a microservice, and each microservice handles one specific job.</p><h3>Building Application Using Microservices</h3><p>After understanding the microservices concept, I built a small e-commerce application to get practical experience. In this blog, I will explain what I implemented and the challenges I faced while building it.</p><h3>Project Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*ZcBKHFcRu-9wki3a8dQVyQ.png" /><figcaption>flow of Microservices.</figcaption></figure><h4>Services Used in this Project:</h4><ul><li><strong>User Service — </strong>Handles user details <em>(e.g., creating user, fetching user details)</em></li><li><strong>Product Service — </strong>Handles product-related details</li><li><strong>Order Service — </strong>Connects User Service and Product Service and processes orders</li></ul><h4>Eureka Server</h4><p>All services are registered in the Eureka Server. It helps services discover and communicate with each other using service names instead of fixed URLs.</p><p>Instead of remembering:</p><ul><li>User Service → localhost:8081</li><li>Product Service → localhost:8082</li><li>Order Service → localhost:8083</li></ul><p>We can simply use:</p><ul><li>USER-SERVICE</li><li>PRODUCT-SERVICE</li><li>ORDER-SERVICE</li></ul><p>Eureka handles the actual service location internally.</p><h4>Feign Client:</h4><p>I used Feign Client for communication between one service to other service. In simple words, Inter-communication service.</p><h4>API Gateway:</h4><p>Instead of calling each service directly, I used an API Gateway. All requests go through the gateway, and it routes them to the appropriate service.</p><h3>Step-by-Step Procedure of the Project</h3><h4>1. Set up Eureka Server</h4><p>In a microservices architecture, multiple services run on different ports.</p><p><strong>Problem:</strong></p><ul><li>How does one service find another service?</li></ul><p><strong>Solution:</strong></p><ul><li>Eureka Server acts as a <strong>service registry</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*3j2RdKXSFd72JEUph29n1w.png" /><figcaption>Eureka server setup steps</figcaption></figure><h4>2. Create User Service and Product Service</h4><p>User Service is a separate Spring Boot application. I connected it to the database and Eureka. I used a simple structure and created APIs to add and get user details. Then I registered it in Eureka and tested it using Postman. Similarly done it Product Service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*C3pBJx7LO-HgKA_JjBtpXA.png" /><figcaption>Setup User and Product Service steps</figcaption></figure><h4><strong>3. Order Service:</strong></h4><p>Order Service handles the full order process. When a user places an order, it gets user details and product details from other services, calculates the total, and saves the order. So, it connects everything and completes the process.</p><h4>4. Feign Client(Inside Order Service):</h4><p>Feign Client is used to talk to other services. While using Feign Client, the API path must exactly match the controller path of the target service.</p><p>It helps Order Service get data from:</p><ul><li>Product Service</li><li>User Service</li></ul><p>Instead of writing HTTP code, we just call it like a normal Java method. It works like,</p><ul><li>finds the service using Eureka</li><li>calls the API</li><li>returns the result</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*ttnwcwbKwrVhHlyzxREx_Q.png" /><figcaption>Order Service and feign Client Steps</figcaption></figure><h4>5. API Gateway:</h4><p>API Gateway is the entry point for all requests. Instead of calling each service directly, the client sends requests to the API Gateway. The gateway then routes the request to the correct service, like:</p><ul><li>/users → User Service</li><li>/products → Product Service</li><li>/orders → Order Service</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*p1bf-nRucnethqzjrHNcUQ.png" /><figcaption>API Gateway Steps</figcaption></figure><blockquote>🔗<em> </em><a href="https://github.com/Praveena1406/microservice-task/tree/main"><em>View Source Code on Github</em></a></blockquote><h3>Challenges Faced while building Applications:</h3><ul><li>If the Feign Client path <strong><em>did not exactly match the controller path</em></strong>, it resulted in 404 errors.</li><li>DTO mapping issues caused null values when the field names or data were incorrect.</li><li>Testing multiple services on different ports was confusing before introducing the API Gateway.</li><li>Additionally, even small mistakes in API Gateway configuration, such as incorrect<strong><em> paths or spacing</em></strong>, led to errors.</li></ul><h3>Conclusion:</h3><p>This project helped me understand how microservices work. I learned how to create separate services and connect them using Eureka, Feign, and API Gateway. I also faced some challenges and learned how to solve them. Overall, microservices made the application smooth and easy to manage.</p><p>Thanks for Reading….. 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08e07ff31d40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regex in Java Explained in Simple Way]]></title>
            <link>https://medium.com/@praveenabaskar123/regex-in-java-explained-in-simple-way-b20c04569c4c?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b20c04569c4c</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Mon, 16 Mar 2026 13:56:50 GMT</pubDate>
            <atom:updated>2026-03-16T13:56:50.821Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, I will explain about Regex. Before learning regex patterns, I thought they were very difficult, like star patterns and similar things. But actually, Regex is really awesome and very interesting to learn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*UntgvQsV7Iyk77Dx.png" /><figcaption>Regex in java</figcaption></figure><h3>What is Regex?</h3><p>Regular Expression (Regex) in Java are sequence of characters that defines search patterns. It is essential for validating user inputs (email, password, mobile validation).</p><p>JDK has predefined package for Regex (i.e) java.util.regex.</p><h3>Important Classes in Regex</h3><p>There are 3 classes in regex, they are…</p><h4>(i) Pattern</h4><p>A Compiled Representation of regular expression.</p><p>It has compile() is used to create the pattern object. Because, pattern is private constructor.</p><h4>(ii) Matcher</h4><p>Matcher is used to compare the pattern to the input string. It provides the several methods,</p><ul><li>find() → search the next occurence of pattern in the string</li><li>group() → Return the matched text</li><li>start() → Return the starting position of the matched text</li><li>end() → Return the ending position of the matched text</li></ul><h4>(iii) PatternSyntaxException</h4><p>PatternSyntaxException occurs when pattern is written in incorrectly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*a7tePZBehDKxQxOr.PNG" /><figcaption>Important class in regex</figcaption></figure><h3>Character Class</h3><p>Character class is the set of characters enclosed within the square brackets [ ].<br> It is used to match one character from group of characters.</p><h4>Various Types of Character Classes</h4><p>(i) [abc] → match a or b or c<br>(ii) [^ab] → match any character except a or b<br>(iii) [a-z] → match any lowercase letter<br>(iv) [A-Z] → match any uppercase letter<br>(v) [0-9] → match any numbers<br>(vi) [a-zA-Z0-9] → matches any letters or numbers<br>(vii) [^a-zA-Z0-9] → match any character expect letters and numbers</p><h3>Predefined Character Class</h3><p>A predefined character class is a shorthand notation for common set of characters.</p><p>When we use regex inside a Java string, we must write two backslash (\\). This is because Java uses \ as an escape character. The Java compiler converts \\ into a single \.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*Lv9Kz7fhuo10RBlLqur_Og.png" /><figcaption>predefined character class</figcaption></figure><p>Refer this pdf how it is works? 👉<a href="https://drive.google.com/file/d/1n8uWODS0i_35unktNJcqXI1-nXBvFf9-/view?usp=sharing">click here</a></p><h3>Quantifiers</h3><p>Quantifiers are used to specify how many times a character or pattern should repeat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*rQTlKqJeQPuRgAarIcx4oQ.png" /><figcaption>Quantifiers in regex in java</figcaption></figure><h3>Important Methods in Regex → split()</h3><p>The split() method is used to divide a string into multiple parts using a delimiter or regular expression. It returns the result as an array of strings.</p><h3>Types of split() Method</h3><h4>1. String split()</h4><p>split() in the String class splits a string using a regex delimiter directly passed as an argument.</p><p><strong>Syntax :</strong></p><pre>string.split(&quot;regex&quot;);</pre><pre>String sentence2 = &quot;www.indiabix.com&quot;;<br>String[] str = sentence2.split(&quot;\\.&quot;); // Argument -&gt; regex<br>for(String s:str){<br>    System.out.println(s);<br>}</pre><h4>2. Pattern split()</h4><p>split() in the Pattern class first compiles the regex into a pattern and then splits the string.</p><p><strong>Syntax :</strong></p><pre>Pattern pattern = Pattern.compile(&quot;regex&quot;);<br>pattern.split(string);</pre><pre>String sentence1 = &quot;I like java&quot;;<br>Pattern p = Pattern.compile(&quot;\\s&quot;); // regex<br>String[] str1 = p.split(sentence1); // Augument -&gt; String<br>for(String s1:str1){<br>    System.out.println(s1);<br>}</pre><h3>StringTokenizer</h3><p>StringTokenizer is used to split a string into smaller parts called tokens using a delimiter. A token means a small part of a string.</p><h4>Object Creation Syntax</h4><p>The StringTokenizer object is created using the following syntax:</p><pre>StringTokenizer st = new StringTokenizer(String);</pre><p>or</p><pre>StringTokenizer st = new StringTokenizer(String, delimiter);</pre><p>or</p><pre>StringTokenizer st = new StringTokenizer(String, delimiter, true/false);</pre><h4>Important Methods</h4><ul><li>hasMoreTokens() → checks if more tokens are available</li><li>nextToken() → returns the next token</li><li>countTokens() → returns the number of tokens</li></ul><h3>Raised a Question here……!🤔</h3><p>I have two questions after learning regex,</p><p><strong>1. StringTokenizer also split the string. Then why split() method?</strong><em>StringTokenizer is useful for simple string splitting, but when we need multiple delimiters or more flexibility, the split() method is usually preferred.</em></p><p><strong>2. Already we have ready-made annotations in Spring Boot for email validation like </strong><strong>@Email. Then why do we use Regex patterns? </strong><br><em>Annotations are used for simple validations, but for custom or complex validation rules we use Regex patterns. <br>For example, in password validation we may require at least </em><strong><em>one uppercase letter, one lowercase letter, one special character, and a minimum of 8 characters</em></strong><em>.</em></p><h3>Conclusion:</h3><p>In conclusion, Regex is a powerful tool in Java for searching, matching, and validating text. By using classes like Pattern and Matcher, we can easily work with different patterns. Regex is very useful in real-world applications such as email validation, password checking. Once we understand the basic concepts like character classes, predefined classes, and quantifiers, working with Regex becomes much easier and more interesting.</p><p>Thanks for reading..!☺️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b20c04569c4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of Design Thinking]]></title>
            <link>https://medium.com/@praveenabaskar123/the-power-of-design-thinking-45f77c8f834d?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/45f77c8f834d</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Thu, 19 Feb 2026 08:21:55 GMT</pubDate>
            <atom:updated>2026-02-19T08:21:55.137Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Readers, I have attend the session in design Thinking. Have you already heard about the word “<strong>Design Thinking</strong>”?</p><p>But I already heard the word design thinking. Before attend the session, I will google it. What is design thinking? after saw few words related to that, then only comes to my mind, Hey you already studied!!!. But I don’t know what we studied? where we studied? I asked questioned myself 2 times where we study? finally I got an answer.</p><p>I thought during my third year in UI/UX subject I studied and also wrote 16marks question in exam. Be honestly, I simply memorize and scored marks.</p><p>But now, I clearly understand about that design thinking and how it plays an very important role while creating an application. Our Mentor <a href="https://medium.com/u/b19f3c2484a0">Senthil Kumar</a> sir, clearly explained about that design thinking and its steps. <br>Ok — Let’s Go!!!</p><h3>Design Thinking :</h3><p>Design thinking is the user — centered approach. It completely understand the user needs or problem and create the solution for it. There are<strong> 5 stages</strong> in design thinking…</p><blockquote>1. Emphasize<br>2. Define<br>3. Ideate<br>4. Build<br>5. Test</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxajT_3LBIuCDcf7JTUK1g.png" /><figcaption>Design Thinking Process</figcaption></figure><p>Imagine, we are now developing <strong><em>College Bus Tracking app</em></strong>, under these design thinking principles…</p><h3><strong>1. Empathize:</strong></h3><p>This is the first stage of design thinking. In this stage, we clearly understand the users, their needs, problems while interacting with them.<br><strong>Example: </strong><br>Before creating the app, we need to spoke the students or parents and bus drivers. Students said they were waiting for a long time without knowing when bus will arrive. Drivers said they receive too many calls asking about location. So, In this stage, understand the main problem.</p><h3><strong>2. Define:</strong></h3><p>Define is the Second stage of design thinking. In this stage, write or define the clear problem statement through gathering the empathize stage.<br><strong>Example:</strong><br>Students or Parents need to know the real-time location of the college bus to reduce the waiting time.</p><h3><strong>3. Ideate:</strong></h3><p>Ideate is the Third stage of design thinking process. In this stage, you and your teams can look at the problem from different perspectives and gave the innovations solution of your problem statement. In other words, Brainstorming without judging ideas.<br><strong>Example:</strong><br>Ok, Based on this stage, we need to brainstorm the possible solutions such as live GPS tracking on map, Send notification when bus 5mts away, Give the approximate bus arrival time etc…</p><h3><strong>4. Prototype:</strong></h3><p>Prototype is the fourth stage of design thinking process. In this stage, we build a simple model either wireframe or static app to test the idea. In simple words, create a basic version not a full product. <br><strong>Example:</strong><br>Let’s we create the basic version of app like login, Simple approximate bus arrival time, Send notification alert, Live bus location. It’s not fully advance — just basic to test main idea.</p><h3><strong>5. Test:</strong></h3><p>Test is the final stage of design thinking process. We need to test the basic app created in previous stage, with a small group of students, collect feedback and improve solutions.<br><strong>Example:</strong><br>After using Bus tracking app, they suggested, show delay reason, add option to track multiple buses using bus number, Reduce app loading time and so on.</p><h4>What’s Next?</h4><p>Design thinking is not one — time process. After testing the prototype, we will collect feedback, improve the app and test it again. This process will continue until the users are fully stasified.</p><h3><strong>Now, we have one question?</strong></h3><blockquote>If one user likes a feature and another user does not like that feature, then what we do? Here the <strong>“PERSONA”</strong> comes in.<br><strong>Example:</strong><br>In bus tracking app, one student often use that app so prefer fewer alerts and another student does not open app daily so wants more alerts. In this Situation, instead of choosing one side, we added the custom notification settings. Now, both type of personas are satified.</blockquote><h4><strong>Without Design Thinking:</strong></h4><p>If I create application without following these steps means, what happen? Think, If I add feature, to show top 10 Regular bus users in my app. This feature does not help for students, not used mostly and also waste of developers time and cost.</p><h3><strong>Conclusion:</strong></h3><p>Overall, Design Thinking help us to solve the right problem. We improve the app step by step based on user feedback. We continue process until the users are happy. From now on, I will follow these steps whenever I create any application.</p><p>Thankyou for reading☺️!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45f77c8f834d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLID Principles]]></title>
            <link>https://medium.com/@praveenabaskar123/solid-principles-ecf5f48533a3?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecf5f48533a3</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Thu, 08 Jan 2026 06:22:31 GMT</pubDate>
            <atom:updated>2026-01-08T06:22:31.752Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction:</h3><p>Today, I learned about the <strong>SOLID principles</strong>. We often hear that code should follow <strong>SOLID principles</strong>, but as beginners, we may not know what they really mean.<br> Don’t worry…… I will explain everything clearly in this blog.</p><h3>SOLID Principles:</h3><p>We write code for applications, and that’s fine! But that code should be clean, help developers understand it easily, and be easy to maintain.</p><p>SOLID stands for:</p><ul><li><strong>S</strong> → Single Responsibility Principle</li><li><strong>O</strong> → Open/Closed Principle</li><li><strong>L</strong> → Liskov Substitution Principle</li><li><strong>I</strong> → Interface Segregation Principle</li><li><strong>D</strong> → Dependency Inversion Principle</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5SQwISj4gubyyMQ4.jpeg" /></figure><h3>1. Single Responsibility Principle (SRP)</h3><blockquote><strong>Definition:</strong><br> A class should have only one reason to change. In short, one class → one responsibility.</blockquote><p><strong>Real-time Example:</strong><br>Assume there is a family. The father’s role is to earn money, the mother’s role is to take care of house responsibilities, expenses, and profit calculations, and the son’s role is to focus on studies.<br>If the son handles the father’s and mother’s jobs, it becomes hard and not scalable.</p><h4>Without SRP :</h4><pre>class Son {<br>   void study() {<br>        System.out.println(&quot;Son is studying&quot;);<br>    }<br>    void earnMoney() {<br>        System.out.println(&quot;Son is earning money for the family&quot;);<br>    }<br>}<br>public class WithoutSRP {<br>    public static void main(String[] args) {<br>        Son son = new Son();<br>        son.study();<br>        son.earnMoney();<br>    }<br>}</pre><p><strong>Problem:</strong></p><ul><li>Son class has multiple responsibilities (studying + earning money)</li></ul><h4>With SRP :</h4><pre>class Father {<br>    void earnMoney() {<br>        System.out.println(&quot;Father is earning money&quot;);<br>    }<br>}<br>class Son {<br>    void study() {<br>        System.out.println(&quot;Son is studying&quot;);<br>    }<br>}<br>public class WithSRP {<br>    public static void main(String[] args) {<br>        Father father = new Father();<br>        Son son = new Son();<br>        father.earnMoney();<br>        son.study();<br>    }<br>}</pre><h3>2. Open/Closed Principle (OCP)</h3><blockquote><strong>Definition:</strong><br>Software entities should be open for extension but closed for modification. This allows adding new functionality without changing existing code.</blockquote><p><strong>Real-time Example:</strong><br>Take Instagram as an example. First, they introduce the Notes feature (like adding a song). Later, they add the option to like the Notes. They don’t change existing features, they only add a new feature.</p><h4>Without OCP :</h4><pre>class InstagramNotes {<br>    void showNote() {<br>        System.out.println(&quot;Showing Instagram Note with song&quot;);<br>    }<br><br>    // New feature added by MODIFYING existing class<br>    void likeNote() {<br>        System.out.println(&quot;Liking the Instagram Note&quot;);<br>    }<br><br>}<br>public class WithoutOCP {<br>    public static void main(String[] args) {<br>        InstagramNotes notes = new InstagramNotes();<br>        notes.showNote();<br>        notes.likeNote();<br>    }<br>}</pre><h4>Problem</h4><ul><li>Old class is modified when a new feature is added</li><li>Risk of breaking existing functionality</li><li>Violates Open–Closed Principle</li></ul><h4>With OCP :</h4><pre>interface NotesFeature {<br>    void perform();<br>}</pre><pre>class ShowNotes implements NotesFeature {<br>   @Override<br>    public void perform() {<br>        System.out.println(&quot;Showing Instagram Note with song&quot;);<br>    }<br>}</pre><pre>class LikeNotes implements NotesFeature {<br>    @Override<br>    public void perform() {<br>        System.out.println(&quot;Liking the Instagram Note&quot;);<br>    }<br>}</pre><pre>public class WithOCP {<br>     public static void main(String[] args) {<br>        NotesFeature show = new ShowNotes();<br>        NotesFeature like = new LikeNotes();<br>        show.perform();   // old feature<br>        like.perform();   // new feature added without changing old code<br>    }<br>}</pre><h3>3. Liskov Substitution Principle (LSP)</h3><blockquote><strong>Definition:</strong><br> Objects of a superclass should be replaceable with objects of a subclass without affecting the correctness of the program.</blockquote><p><strong>Real-time Example:</strong><br> Both Humans and Robots can be considered types of Workers. Humans work, eat, and rest, while robots work and recharge. Even though their internal behavior is different, both can perform the common task of working.<br> A program expecting a Worker can use either a human or a robot without breaking functionality.</p><h4>Without LSP :</h4><pre>class Worker {<br>   void work() {<br>        System.out.println(&quot;Worker is working&quot;);<br>    }<br>    void eat() {<br>        System.out.println(&quot;Worker is eating&quot;);<br>    }<br>}<br><br>class Human extends Worker {<br>    void work() {<br>        System.out.println(&quot;Worker is working&quot;);<br>    }<br>    void eat() {<br>        System.out.println(&quot;Worker is eating&quot;);<br>    }<br>}<br><br>class Robot extends Worker {<br><br>    // Robot cannot eat<br>    void eat() {<br>        throw new UnsupportedOperationException(&quot;Robot cannot eat&quot;);<br>    }<br>}<br>public class WithoutLSP {<br>    public static void main(String[] args) {<br>        Worker w1 = new Human();<br>        w1.work();<br>        w1.eat();<br><br>        Worker w2 = new Robot();<br>        w2.work();<br>        w2.eat();   // breaks program<br>    }<br>}</pre><h4>Problem</h4><ul><li>Robots cannot eat. So here, it breaks substitution.</li></ul><h4>With LSP :</h4><pre>interface Worker {<br>    void work();<br>}</pre><pre>class Human implements Worker {<br>    public void work() {<br>        System.out.println(&quot;Human is working&quot;);<br>    }<br>    void eat() {<br>        System.out.println(&quot;Human is eating&quot;);<br>    }<br>}<br><br><br>class Robot implements Worker {<br>    public void work() {<br>        System.out.println(&quot;Robot is working&quot;);<br>    }<br>}</pre><pre>public class WithLSP {<br>    public static void main(String[] args) {<br>        Worker w1 = new Human();<br>        Worker w2 = new Robot();<br>        w1.work();   // works<br>        w2.work();   // works<br>    }<br>}</pre><h3>4. Interface Segregation Principle (ISP)</h3><blockquote><strong>Definition:</strong><br> Clients should <strong>not be forced to depend on interfaces they do not use</strong>. It encourages <strong>smaller, more specific interfaces</strong>. If a method is not needed, it can be avoided.</blockquote><p><strong>Real-time Example:</strong><br> Assume you like Biryani and Chicken 65, but your friend only likes Biryani. So, your friend only orders Biryani. This is like Interface Segregation Principle (ISP): instead of forcing everyone to use one big menu, each person can choose only what they need.</p><h4>Without ISP :</h4><pre>interface FoodMenu {<br>    void biryani();<br>    void chicken65();<br>}</pre><pre>class You implements FoodMenu {<br>    public void biryani() {<br>        System.out.println(&quot;You eat Biryani&quot;);<br>    }<br>    public void chicken65() {<br>        System.out.println(&quot;You eat Chicken 65&quot;);<br>    }<br>}<br><br><br>class Friend implements FoodMenu {<br>    public void biryani() {<br>        System.out.println(&quot;Friend eats Biryani&quot;);<br>    }<br><br>    // your friend does not like Chicken 65<br>    public void chicken65() {<br>        throw new UnsupportedOperationException(&quot;Friend does not like Chicken 65&quot;);<br>    }<br>}</pre><pre>public class WithoutISP {<br>    public static void main(String[] args) {<br>        FoodMenu you = new You();<br>        FoodMenu friend = new Friend();<br>        you.biryani();<br>        you.chicken65();<br>        friend.biryani();<br>        friend.chicken65();   // problem<br>    }<br>}</pre><h4>Problem</h4><ul><li>One big interface — everyone forced to use everything.</li><li>Here, your friend is forced to implement chicken65();</li></ul><h4>WITH ISP :</h4><pre>interface BiryaniLover {<br>    void biryani();<br>}</pre><pre>interface Chicken65Lover {<br>    void chicken65();<br>}</pre><pre>class You implements BiryaniLover, Chicken65Lover {<br>     public void biryani() {<br>        System.out.println(&quot;You eat Biryani&quot;);<br>    }<br>    public void chicken65() {<br>        System.out.println(&quot;You eat Chicken 65&quot;);<br>    }<br>}</pre><pre>class Friend implements BiryaniLover {<br>      public void biryani() {<br>        System.out.println(&quot;Friend eats Biryani&quot;);<br>    }<br>}</pre><pre>public class WithISP {<br>    public static void main(String[] args) {<br>        BiryaniLover you1 = new You();<br>        Chicken65Lover you2 = new You();<br>        BiryaniLover friend = new Friend();<br>        you1.biryani();<br>        you2.chicken65();<br>        friend.biryani();<br>    }<br>}</pre><h3>5. Dependency Inversion Principle (DIP)</h3><blockquote><strong>Definition:</strong><br> High-level modules should not depend on low-level modules. Both should depend on abstractions, not concrete implementations.</blockquote><p><strong>Real-time Example:</strong><br> You want to drink juice. Instead of buying a specific OrangeJuicer or AppleJuicer, you use a Juicer machine that can take any fruit.</p><h4>Without DIP :</h4><pre>class OrangeJuicer {<br>    void makeJuice() {<br>        System.out.println(&quot;Making Orange Juice&quot;);<br>    }<br>}<br><br>class JuiceShop {<br><br>    // Depends on concrete class<br>    OrangeJuicer juicer = new OrangeJuicer();<br><br>    void serveJuice() {<br>        juicer.makeJuice();<br>    }<br>}<br></pre><pre>public class WithoutDIP {<br>    public static void main(String[] args) {<br>        JuiceShop shop = new JuiceShop();<br>        shop.serveJuice();<br>    }<br>}</pre><h4>Problem</h4><ul><li>JuiceShop is tightly coupled to OrangeJuicer.</li><li>To add Apple juice → modify JuiceShop</li></ul><h4>With DIP :</h4><pre>interface Juicer {<br>    void makeJuice();<br>}</pre><pre>class OrangeJuicer implements Juicer {<br>    public void makeJuice() {<br>        System.out.println(&quot;Making Orange Juice&quot;);<br>    }<br>}</pre><pre>class AppleJuicer implements Juicer {<br>    public void makeJuice() {<br>        System.out.println(&quot;Making Apple Juice&quot;);<br>    }<br>}</pre><pre>class JuiceShop {<br><br>   private Juicer juicer;<br><br>    JuiceShop(Juicer juicer) {<br>        this.juicer = juicer;<br>    }<br><br>    void serveJuice() {<br>        juicer.makeJuice();<br>    }<br>}</pre><pre>public class WithDIP {<br>    public static void main(String[] args) {<br>        JuiceShop shop1 = new JuiceShop(new OrangeJuicer());<br>        shop1.serveJuice();<br>        JuiceShop shop2 = new JuiceShop(new AppleJuicer());<br>        shop2.serveJuice();<br>    }<br>}</pre><h3>Conclusion:</h3><p>That’s all about <strong>SOLID Principles</strong>. If we follow these principles while writing code, our code will be <strong>clean and scalable</strong>.<br> If a new developer joins the project, it will also be <strong>easy for them to understand</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecf5f48533a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[POM.xml in Maven]]></title>
            <link>https://medium.com/@praveenabaskar123/pom-xml-in-maven-3567351c9cac?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3567351c9cac</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 14:06:26 GMT</pubDate>
            <atom:updated>2026-01-05T14:06:26.014Z</atom:updated>
            <content:encoded><![CDATA[<p>We familiarly know that <strong>pom.xml</strong> file is used in Maven projects.<br> We also know that it contains <strong>dependencies and plugins</strong>.</p><p>But do you know what each and every element in pom.xml means?</p><p>Don’t worry 😊<br> In this blog, I will clearly explain <strong>pom.xml </strong>in a simple way.</p><h3>What is POM?</h3><p><strong>POM</strong> stands for <strong>Project Object Model</strong>.</p><p>It contains Maven project and configuration information needed to build a project, such as</p><ul><li>Dependencies</li><li>Plugins</li><li>Build directory</li><li>Source directory</li><li>Test source directory</li></ul><p>Before <strong>Maven 2</strong>, it was called <strong>project.xml</strong>.<br>From <strong>Maven 3</strong>, it is named <strong>pom.xml</strong>.</p><h3>&lt;groupId&gt; – Who Created the Project</h3><ul><li>groupId helps to identify the organization or group that owns the project.</li><li>It is written in reverse domain format.</li></ul><h4>Example:</h4><p>google.com =&gt; com.google</p><pre>&lt;groupId&gt;com.google&lt;/groupId&gt;</pre><h4>Why reverse domain?</h4><ul><li>To ensure global uniqueness</li><li>To avoid naming conflicts</li></ul><p>One groupId can have <strong>multiple artifactIds</strong>.</p><h3>&lt;artifactId&gt; – What the Project Is</h3><ul><li>artifactId is the name of the project.</li><li>It should be written in lowercase and usually uses hyphens.</li><li>It must be <strong>unique within the same groupId</strong>.</li></ul><h4>Artifact Output (JAR / WAR)</h4><p>When Maven builds a project, it creates a <strong>JAR or WAR file</strong>.</p><blockquote>The output file name is generated using:<br> for eg: artifactId-version.packaging</blockquote><h4>Example:</h4><pre>student-management-1.0.jar</pre><p>So, artifactId becomes the <strong>base name</strong> of the output file.</p><h3>Dependencies</h3><p>A <strong>dependency</strong> is an <strong>external library</strong> that our project needs to work.</p><h3>Flow of Dependencies</h3><ol><li>Declare dependency in pom.xml</li><li>Maven reads:</li></ol><ul><li>groupId</li><li>artifactId</li><li>version</li></ul><p>3. Maven checks Local Repository (.m2/repository folder)</p><ul><li>If found dependencies → use it</li><li>If not found dependencies → go to next step</li></ul><p>4. Maven checks <strong>Remote Repository</strong></p><ul><li>Maven Central Repository (<a href="https://mvnrepository.com/repos/central">https://mvnrepository.com/repos/central</a>)</li><li>Downloads the dependency</li><li>Stores it in .m2 directory</li><li>Reuses it next time</li></ul><p><strong>5. Transitive Dependencies</strong></p><ul><li>If a dependency depends on other libraries, Maven automatically downloads all required sub-dependencies</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2mNQGxs08VRN82wEfg6xzw.png" /></figure><h3>Why Dependencies?</h3><h4>Without Dependencies:</h4><ul><li>Download JAR files manually</li><li>Add them to classpath</li><li>Handle versions ourself</li></ul><h4>With Dependencies:</h4><ul><li>Just declare dependency in pom.xml</li><li>Maven handles everything</li></ul><h4>Example:</h4><ul><li><strong>Home without mom</strong> → we buy vegetables and cook ourselves</li><li><strong>Home with mom</strong> → we just ask, and mom prepares everything</li></ul><p>👉 Like that:</p><ul><li>Without dependencies → hard work</li><li>With dependencies → Maven does everything for us</li></ul><h3>Scope of Dependencies :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*4qBaB6VzOZTcM1iMJMPPvw.png" /></figure><h3>&lt;version&gt;</h3><ul><li>It represents the <strong>version of the project</strong>. Most of the time, we see <strong>SNAPSHOT</strong> in the version.</li></ul><h4>Example:</h4><pre>&lt;version&gt;1.0.1-SNAPSHOT&lt;/version&gt;</pre><h4>What is SNAPSHOT?</h4><ul><li>SNAPSHOT means the project is still under development</li><li>It is not a final release</li><li>Final release versions <strong>do not have SNAPSHOT</strong></li></ul><h3>&lt;packaging&gt;</h3><ul><li>It is <strong>optional</strong></li><li>It defines the <strong>output type</strong> of the project like Jar or War. If not specified, Maven generates a <strong>JAR file by default</strong>.</li></ul><h3>&lt;name&gt; and &lt;description&gt;</h3><ul><li>These are <strong>human-readable information</strong></li><li>Used for <strong>documentation purpose</strong></li><li>They <strong>do not affect the build process</strong></li></ul><h3>&lt;build&gt; – How Maven Builds the Project</h3><ul><li>It controls <strong>how the project is built d</strong>efines, Compilation, Testing, Packaging.</li><li>It is not mandatory.<strong> </strong>If not defined, Maven uses <strong>default plugins.</strong></li></ul><h3>Conclusion:</h3><p>I hope this blog helps you to get a clear and simple understanding of pom.xml. Even I learned and understood Maven better while writing this blog.<br>Thanks for reading….. 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3567351c9cac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Stream API]]></title>
            <link>https://medium.com/@praveenabaskar123/introduction-to-stream-api-fd06f9948f86?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd06f9948f86</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 11:41:47 GMT</pubDate>
            <atom:updated>2025-11-16T11:41:47.402Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Iw61paQ9p8NgEmkn.png" /></figure><h3>What is Stream API?</h3><p>Stream API is a Java feature used to process collections of data easily. It helps us to perform operations like filtering, sorting and transform data without using loops.</p><h3>How Stream API works?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pD0zrDMCWiD96ibD05iElw.png" /></figure><h3>Creating Stream:</h3><p>There are multiple ways to create stream:</p><h4>(i) Collections (List, Set, Map):</h4><pre>List&lt;String&gt; names = Arrays.asList(&quot;Lenovo&quot;, &quot;hp&quot;, &quot;Dell&quot;);<br>names.stream().forEach(System.out::println);</pre><h4>(ii) Arrays:</h4><pre>int[] numbers = {2,4,6,8,10};<br>IntStream numberStream = Arrays.stream(numbers);<br>numberStream.forEach(System.out::println)</pre><h4>(iii) Stream.of()</h4><p>It is used to directly create Stream from individual values.</p><pre>Stream&lt;String&gt; sample = Stream.of(&quot;Java&quot;, &quot;React&quot;, &quot;JWT&quot;);<br>sample.forEach(System.out::println);</pre><h4>(iv) Stream.generate()</h4><p>It is used to create the infinite stream of values.</p><pre>Stream&lt;String&gt; sample = Stream.generate(() -&gt; &quot;Welcome to Learning Stream API&quot;);<br>sample.forEach(System.out::println);</pre><h4>(v) Stream.iterate()</h4><p>It creates an infinite stream by starting with an initial value and then repeatedly applying a function to get the next value.</p><pre>Stream&lt;Integer&gt; sample = Stream.iterate(1, n -&gt; n + 1).limit(5);<br>sample.forEach(System.out::println);</pre><h3>Stream Operations</h3><h3>(i) Intermediate Operations:</h3><p>Intermediate operations return a new stream and are lazy (not executed until a terminal operation is called).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*Ct5w7qcNBGzvawHe0FuOSg.png" /></figure><ul><li>filter() → Filter elements based on the condition</li><li>map() → Transform the elements</li><li>sorted() → Arrange elements (default ascending order)</li><li>sorted(Comparator.reverseOrder()) → Arrange element in descending order</li><li>distinct() → Remove duplicate elements</li><li>flatMap() → If nested list occur it converts into single list</li></ul><h3>(ii) Terminal Operations:</h3><p>Terminal operations produce the final result and terminate the stream.</p><ul><li>forEach() → Perform an operation on each element</li><li>collect() → Collect elements like a List or Set</li><li>count() → Return number of elements in a stream</li><li>reduce() → Combine elements into a single value (sum, total, max, min)</li></ul><h3>Types of Stream:</h3><h4>(i) Sequential Stream:</h4><p>To process the data one by one. It is oftenly used for small data sets.</p><h4>(ii) Parallel Stream:</h4><p>It splits the elements into piece of code and process them. It is used in large data sets.<br> <strong>Example:</strong> A dataset has 10 million users.</p><h3>Why do we use Stream API?</h3><ul><li>It makes the code cleaner, faster and readable.</li><li>There is no storage, only processing the data.</li><li>Avoid the number of lines of code.</li></ul><h4>Without Stream:</h4><pre>List&lt;String&gt; names = Arrays.asList(&quot;John&quot;, &quot;Praveena&quot;, &quot;Marry&quot;);</pre><pre>for (String name : names) {<br>    if (name.startsWith(&quot;P&quot;)) {<br>        System.out.println(name); // output: Praveena<br>    }<br>}</pre><h4>With Stream:</h4><pre>List&lt;String&gt; names = Arrays.asList(&quot;John&quot;, &quot;Praveena&quot;, &quot;Marry&quot;);</pre><pre>names.stream()<br>     .filter(name -&gt; name.startsWith(&quot;P&quot;))<br>     .forEach(System.out::println);<br>// output: Praveena</pre><h3>Conclusion:</h3><p>In conclude, Stream API is very useful when working with lists, sets, arrays, or any collection. It helps perform tasks like filtering, sorting, and mapping with very little code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd06f9948f86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Custom Annotations in Spring Boot]]></title>
            <link>https://medium.com/@praveenabaskar123/how-to-create-custom-annotations-in-spring-boot-8d4eb5433645?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d4eb5433645</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 17:51:06 GMT</pubDate>
            <atom:updated>2025-11-10T17:51:06.971Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Are Annotations?</h3><p>Annotations in Java start with the symbol <strong>‘@’</strong>.<br>They tell Spring <strong>what to do</strong>, like creating objects or handling web requests.</p><p><strong>Example:</strong><br> @Autowired, @RestController</p><p>In simple terms,<strong> Java annotations</strong> are special notes or tags that we apply to our Java code.<br>They provide extra information but <strong>don’t affect the functionality</strong> of the program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/0*a48iy2pECBkPp2mT" /></figure><h3>What Are Custom Annotations?</h3><p><strong>Custom annotations</strong> in Spring Boot are a powerful feature. They allow developers to create <strong>their own annotations</strong> that provide metadata to <strong>classes, methods, or fields</strong>, and can be processed <strong>at </strong>runtime or compile time.</p><h3>Why Use Custom Annotations?</h3><ul><li>To avoid repeating the same code</li><li>To give special meaning or behavior to certain classes or methods</li><li>To make the code clean, readable, and simple</li></ul><h3>Types of Annotations</h3><h3>1. Marker Annotations</h3><ul><li>These annotations have <strong>no variables or methods</strong> inside.<br> <strong>Example:</strong> @Override</li></ul><h3>2. Single-Value Annotations</h3><ul><li>These contain <strong>a single variable</strong> inside the annotation.<br> <strong>Example:</strong></li></ul><pre>public @interface Annotation_name{<br>    String value();<br>}</pre><h3>3. Multi-Value Annotations</h3><ul><li>These contain <strong>multiple variables or methods</strong> inside.<br> <strong>Example:</strong></li></ul><pre>public @interface Annotation_name{<br>    String author();<br>    String version();<br>}</pre><h3>Adding Dependencies</h3><p>Add the following dependency to your <strong>pom.xml</strong> file:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-starter-aop&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><p>This dependency enables <strong>Aspect-Oriented Programming (AOP)</strong> in Spring Boot. AOP allows custom annotations to execute actions. Without AOP, custom annotations only act as markers and won’t perform any logic.</p><h3>Steps to Create Custom Annotations</h3><h3>Step 1: Create a Custom Annotation</h3><p>Use the @interface keyword to create your own annotation.<br><em>@interface Annotation_name</em></p><pre>public @interface Annotation_name{<br>   <br>}</pre><h3>Step 2: Create Aspect Class to handle the annotations</h3><h3>Step 3: Add Required Meta-Annotations</h3><p>Two annotations are essential when defining your custom annotation:</p><h4>@Retention</h4><p>It specifies the Retention policy. A retention policy determines at what time annotation should be discarded.</p><ul><li><strong>SOURCE</strong> — Retained only in source code, discarded at compile time.</li><li><strong>CLASS</strong> — Retained during compilation, discarded at runtime.</li><li><strong>RUNTIME</strong> — Available to the JVM at runtime.</li></ul><p>If not specified, the <strong>default</strong> retention policy is CLASS.</p><p><strong>Example:</strong></p><pre>@Retention(RetentionPolicy.RUNTIME)</pre><h4>@Target</h4><p>@Target annotation definition defines where to apply the annotation. It takes ElementType as an argument. <br>ElementType consists of Method, Field, Class, Package etc.</p><p><strong>Example:</strong></p><pre>@Target(ElementType.METHOD)</pre><p><strong>// Own annotation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*2sAFupQSwcBsuNob_DkIPw.png" /></figure><p><strong>// Aspect Class</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZqaLYdc9v3QkYWwP9oJ3ng.png" /></figure><p><strong>// using annotation in class</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*b9W7eQqOl90dfehHAv8Fwg.png" /></figure><p>In conclude, custom annotations make your Spring Boot applications avoid repeating code and powerful feature.</p><p><a href="https://medium.com/u/54d13afd404b">Senthil Kumar Thangavel</a></p><p><a href="https://medium.com/u/6ff84f1aab3e">Dhileepan</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d4eb5433645" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is JWT?]]></title>
            <link>https://medium.com/@praveenabaskar123/what-is-jwt-d4e89e5225bd?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4e89e5225bd</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Wed, 03 Sep 2025 09:17:18 GMT</pubDate>
            <atom:updated>2025-09-03T09:17:18.326Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction to Authentication</h3><p>When we use a website or an app, it needs to know <strong>who you are</strong>.</p><ul><li>Example: When you log in to Facebook, it checks <strong>email and password</strong> → then it knows it’s you.</li></ul><p>Earlier (old method):</p><ol><li>After login, the server remembers you.</li><li>But in modern apps , this is difficult because the server cannot remember everyone.</li></ol><p>So we use <strong>tokens</strong> instead.</p><ul><li>After login, the server gives you a <strong>token</strong>.</li><li>You must show this token <strong>every time</strong> you make a request.</li><li>If the token is correct → the server knows it’s you.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OwqT_05ZOK_I0Lvd.png" /></figure><h3>What is JSON Web Token (JWT)?</h3><ul><li>JWT is like a <strong>digital passport</strong>.</li><li>It generates a <strong>token</strong> that helps securely transmit information between the client and the server.</li></ul><h3>Structure of JWT</h3><p>A JWT looks like a long string of letters, numbers, and symbols.<br> It has three parts:</p><blockquote><strong><em>Header. Payload. Signature</em></strong></blockquote><h3>1. Header</h3><p>Contains information about how the token is made.</p><pre>{ <br>  &quot;alg&quot;: &quot;HS256&quot;,  <br>  &quot;typ&quot;: &quot;JWT&quot;  <br>}</pre><h3>2. Payload</h3><p>Contains the actual user data.</p><pre>{<br>  &quot;sub&quot;: &quot;praveena@gmail.com&quot;,<br>  &quot;role&quot;: &quot;USER&quot;<br>}</pre><h3>3. Signature</h3><ul><li>Ensures the token is not fake or changed.</li><li>When the user sends the token back, the server decodes the Header + Payload verifies the Signature confirms the token is valid.</li></ul><h3>Example JWT Token</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHdLlj5-4SSmAEWUAMDqwA.png" /></figure><h3>Adding Dependencies</h3><p>To use JWT in Spring Boot, we need to add some libraries. These libraries help us create and validate JWT tokens.</p><h3>1. Spring Security</h3><p>This provides the security framework to handle authentication and authorization.</p><pre>&lt;!-- <a href="https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security">https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-security</a> --&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;<br>    &lt;version&gt;3.5.5&lt;/version&gt;<br>&lt;/dependency&gt;</pre><h3>2. JWT (JSON Web Token)</h3><p>For JWT, we need to add <strong>3 dependencies</strong>:</p><pre>&lt;!-- <a href="https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api">https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api</a> --&gt;<br>&lt;!-- Core JWT API --&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.jsonwebtoken&lt;/groupId&gt;<br>    &lt;artifactId&gt;jjwt-api&lt;/artifactId&gt;<br>    &lt;version&gt;0.13.0&lt;/version&gt;<br>&lt;/dependency&gt;</pre><pre>&lt;!-- JWT Implementation --&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.jsonwebtoken&lt;/groupId&gt;<br>    &lt;artifactId&gt;jjwt-impl&lt;/artifactId&gt;<br>    &lt;version&gt;0.13.0&lt;/version&gt;<br>&lt;/dependency&gt;</pre><pre>&lt;!-- JSON Parser (Jackson) for JWT --&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.jsonwebtoken&lt;/groupId&gt;<br>    &lt;artifactId&gt;jjwt-jackson&lt;/artifactId&gt;<br>    &lt;version&gt;0.13.0&lt;/version&gt;<br>&lt;/dependency&gt;</pre><h3>Creating JwtUtil.java</h3><blockquote>JwtUtil -&gt; Token Generator + Token Validator</blockquote><h3>Why do we need it?</h3><ul><li>Every time we need to generate a token after login.</li><li>Every time we need to check a token when the user sends it back.</li><li>If we write this logic everywhere, it becomes messy.</li></ul><p>So, we keep all JWT-related code in one place → JwtUtil.java</p><h3>What will it contain?</h3><ul><li>Secret Key → like a password to lock/unlock the token.</li><li>Generate Token Method → create a JWT when login is successful.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VEpSyBatTAxq4-WxuppZsQ.png" /></figure><ul><li>Validate Token Method → check if the token is correct or fake.</li><li>Extract Email Method → read the email/username inside the token.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*010a-4poEItLbp9cM1kKDA.png" /></figure><h3>Creating JwtFilter</h3><h3>Why?</h3><ul><li>After login, the user gets the JWT token.</li><li>When the user calls another API (like /dashboard), we must check that token first.</li><li>If token is valid → allow request</li><li>If token is invalid → request blocked</li></ul><h3>Who checks the token?</h3><ul><li>Not the Controller</li><li>Not the Service</li><li>The JwtFilter intercepts every request, validates the JWT, and only then allows the request to reach the controller.</li></ul><h3>JWT Token (Postman Demo):</h3><h3>Example JWT Token</h3><p>When you log in successfully, the server generates a JWT token. It looks like this….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHdLlj5-4SSmAEWUAMDqwA.png" /></figure><h3>Copy the Token and Paste:</h3><p>We copy this token, paste it in the Authorization header, and if it is valid, the server gives us the requested data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAzIasm9RRIYiaHk2dJ0XA.png" /></figure><h3>Conclusion JWT with Story</h3><p>Imagine you are entering your college every day. Normally, the security would ask for your name and details every single time — so annoying!</p><p>Instead, the college gives you a student ID card after your first verification. Now, whenever you come back, you just show your ID card, and the security knows right away you can enter.</p><p>JWT works the same way. After login, the server gives you a “student ID card” (the token). Every request you make, you show the token, and the server says, “Yes, you can access”.</p><p>So JWT is like a digital student ID card — simple, secure, and saves everyone a lot of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hAJBJ76eQLpeKrXW.png" /><figcaption><strong>Flow of JWT</strong></figcaption></figure><p><a href="https://medium.com/u/54d13afd404b">Senthil Kumar Thangavel</a> <br><a href="https://medium.com/u/6ff84f1aab3e">Dhileepan</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4e89e5225bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some People Always Win? Why?]]></title>
            <link>https://medium.com/@praveenabaskar123/some-people-always-win-why-af5328fd5e88?source=rss-df1532e5c9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/af5328fd5e88</guid>
            <dc:creator><![CDATA[Praveenabaskar]]></dc:creator>
            <pubDate>Fri, 13 Jun 2025 06:31:38 GMT</pubDate>
            <atom:updated>2025-06-13T06:31:38.635Z</atom:updated>
            <content:encoded><![CDATA[<p>At any time, do you think some specific people always win?<br> <strong>Why? How? What is the secret of success?</strong></p><p>In my school days, one of my senior always won more than 3 or 4 competitions.<br> Me and my friends looked amazed — <em>how did she win all the competitions?</em><br> We jokingly told ourselves…<br> “But we win only one competition, that also very rarely.”</p><p>Now I understand,<br><strong><em>“Success is not a magic moment. It is a loop.”</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*3MlZ6AxNAxLyBKkw.jpeg" /></figure><h3>Loop of Success</h3><h3>1. Think</h3><p>All should begin here. First, observe everything before doing any work:</p><ul><li>What do we need to change?</li><li>Why we do the changes ?</li></ul><p>I want to share a related interesting true story.</p><p>Most of them watching movie <strong>“Soorarai Potru”</strong>. In that movie,</p><blockquote>Maara is working in the Airforce. He thinks,<br>“Why can’t poor people travel in a plane? Everyone should have a chance to fly!”<br>This question becomes the starting point of his success.</blockquote><h3>2. Idea</h3><p>“Idea is cheap. But executing the idea is expensive.”</p><p>Initially, don’t search for the perfect idea.<br>Execute your own idea — it automatically convert it perfect idea while working.</p><blockquote><strong><em>Story:</em></strong><br>He had one idea:<br><em> Low-cost airline — it is possible to make everyone fly.</em><strong> </strong>He said,<br><em>“I will make people fly for just ₹1.”<br> Everyone laughed at this idea.</em></blockquote><h3>3. Try</h3><p>Now it’s time to take a small step. Everyone have fear in this stage.</p><ul><li>What will others think?</li><li>What if it fails?</li></ul><p>But don’t bother about these questions. Because you’re doing something bravely.<br> Every failure teaches you more than 10 perfect plans.</p><blockquote><strong><em>Story:</em></strong><br>He tries first time, meets the investors, face the government rules. <br>He can’t buy the airplane and cheat him.<br>But he keep trying.</blockquote><h3>4. Do</h3><p><strong>“Trying is testing. Doing is building.”</strong></p><p>Start building based on your ideas.<br>It doesn’t matter whether it works or not — what matters is that you’re investing your <strong>energy, time, and even money. </strong>This will help you <strong>learn faster</strong>.</p><blockquote>Story:<br>Maara bought a small second-hand airplane.<br> His wife and friends helped him in different ways.<br> This action took him closer to success.</blockquote><h3>5. Do Again</h3><p>Now check the project again:</p><ul><li>What worked?</li><li>What didn’t work?</li><li>What needs to improve?</li></ul><p>This commitment <strong>changes the mindset</strong>.</p><blockquote>Story:<br>Maara faced a lot of struggles:<br>Airplane didn’t arrive and Government did not allow.<br>But still, he learned from these mistakes — and kept trying.</blockquote><h3>6. Keep Going</h3><p>At this stage, you’ve reached <strong>90% of the progress</strong>. You are <strong>near success</strong>. You’ve earned confidence. Don’t hesitate to take action now.</p><blockquote>Story:<br>Sometimes, Maara felt confused and lost confidence.<br><strong>But he never backed. </strong>He successfully created a <strong>low-cost airline for the poor</strong>.</blockquote><h3>Success</h3><p>Maara won <strong>not because he was smart</strong>, but because <strong>he never stopped trying</strong>.<br><strong>Similarly, success is not one big moment.<em> </em>It is many hard loops.</strong></p><h3>The Hard Loops:</h3><p><strong>Think → Idea → Try → Do → Again → Keep going → Success</strong></p><blockquote>for (int i = 0; i &lt; n; i++) { <br> think();<br> idea();<br> try();<br> do();<br> doAgain();<br> keepGoing();<br> }<br> success();</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af5328fd5e88" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>