Java
Clean Code: Write Methods with No Side-effects
·4 mins read
Mayukh Datta
Technical
Java
Spring Boot
I was listening to Uncle Bob Martin’s lecture on YouTube last night. His No ‘side-effects’ advice hit me and made me realize that I was doing something in my code that I shouldn’t be doing it that way.
Get Remote Server Logs of Your Spring Boot Application via REST API
·5 mins read
Mayukh Datta
Technical
Java
Spring Boot
I’m currently working on a microservices-based Spring Boot application, where I’m using Logback as my logging framework. The application is now running live on a remote server. Since I don’t have access to the server, I don’t get to see the logs when I want to see them or when there is some error. I have to ask someone from the sysadmin team to send me the log file every time and wait for their response. This kind of human dependency eats up a decent amount of time in any software development lifecycle. I try to avoid such dependencies and seek to circumvent them. So, I have written a simple snippet of code that can read the log file from the server filesystem and send it back to me in an API response.
When to Use Enums Instead of If-else or Switch Statements to Make the Code Cleaner?
·3 mins read
Mayukh Datta
Technical
Java
Spring Boot
We usually use if-else or switch statements to write our logical conditions in our code. There is nothing to worry about as long as your list of logical conditions is short.