Tag: featured

  • Are we using mutable objects too much?

    By default any object you create in java is mutable. And so we end up using mutable objects more often. But Java team themselves suggest to use Immutable objects more. From https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html : Maximum reliance on immutable objects is widely accepted as a sound strategy for creating simple, reliable code One reason why developers wouldn’t…

  • Rest API vs HTTP API – Are your REST APIs really REST APIs?

    Let’s say you want to create a REST API using a framework like Spring Boot. You create a class annotated with @RestController. And then you create APIs using @RequestMapping/@GetMapping/@PostMapping annotation. Are these really REST APIs? No. They are just HTTP APIs. What is the difference between the two? HTTP is one of the ways information…

  • How to create a command line tool using Java?

    How to create a command line tool using Java?

    Java applications can be run using command line , but you can pass only arguments . Based on the position of the arguments , you can retrieve them in your application and code your logic. What if you can pass flags to your java application and let it execute logic based on that. Like in…