Posts
Equals and HashCode in Java
The parent of all ‘Object’ classes in Java has, among many, two notable methods: equals and hashCode. For the most of the part, we can go about without tinkering/overriding these methods, but they play a significant role when we are dealing with any kind of data structure whose implementation depends on hashing. Maps, Sets, and their various derivatives and implementations of the Java Collection framework depend on the hashing of objects.
read morePosts
Leveraging Lombok Annotations to spice up Java
Java is heavily criticized and hated for its verbosity. Even for things such as reading/writing files we have to ceremoniously write a lot of generic stuff. The increasingly popular Java library Lombok has been hugely successful in addressing this issue. It’s an annotation based Java library that plugs itself into editors, IDE, and build tools at compile time, facilitating the generation of boilerplate code and making the code clean and more readable.
read morePosts
SSH tunnelling using ngrok!
So, what if you want to expose your locally running server to the bigger world wide web (WWW)? The answer: “port forwarding on your router and time setting up dynamic DNS solutions”. I am glad that there is a tool now which allows developers to expose their local server to the internet using a single command with a plethora of options: over secure channel, with authentication enabled and also live inspection of the requests coming to the server to name a few.
read morePosts
Database Connection Pooling
DB Connections are expensive Normally following things happen when your backend service talks to a database:
service initiates a connection to DB using the database driver db does the authentication and establishes a network session (tcp) if succeeded program/service performs some db operation (CRUD) which follows authorization (if user/role is allowed to perform the requested operation) Now if the service decides to close the connection, it has to do these all over again which is quite an expensive process.
read more