#java

How to handle URL Encoded Form Data in Spring REST?

Reading Time: 3 minutes Sometimes, our REST endpoint needs to consume data in the form of application/x-www-form-urlencoded or using multipart/form-data. The source of this data can probably be an HTML form. Now, the first question which should come to our mind is, what is exactly this application/x-www-form-urlencoded or using multipart/form-data and how can we let our spring application consume this. This blog will help you to find answers to Continue Reading

Java: back to basics.

Java Stream API tutorial

Reading Time: 3 minutes Java Stream API was one of the major features released with Java 8, that let you code in declarative style. It supports function-style operations on streams of elements, such as map, filter and various other transformations. Streams vs Collection It is a myth that Java Stream API have replaced Collections in Java. Most of the collections are a main source for the stream to work Continue Reading

Java 9: Getting started with Jshell in JAVA 9

Reading Time: 3 minutes Java Shell tool (JShell) has been introduced as a part of JAVA 9. It is a Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are entered and immediately shows the results. The tool is run from the command line. In this blog, we will learn about this interactive tool that can be used for learning the Java programming language and prototyping Java Continue Reading

Compile protocol buffers using maven

Reading Time: 3 minutes Hi Folks! As part of this blog, we will explore how we can compile protocol buffers using maven. We assume the reader has the basic idea about protocol buffers and maven. Google developed Protocol Buffers for use in their internal services. It is a binary encoding format that allows you to specify a schema for your data using a specification language, like so: The snippet defines the Continue Reading

Is Logback the Solution to Your Logging Problems?

Reading Time: 4 minutes What do you do when you get an error/issue with the code? What is the first thought that comes to your mind? What if you are trying to fix a code that was written by someone else?   That’s right. We check the logs. We all know that Useful logs can provide the developer ( especially when someone has to debug/maintain someone else’s code ) Continue Reading

Composition over Inheritance: Part 1

Reading Time: 4 minutes Inheritance Inheritance happens to be one of the prime features of the Java language and is one of the key requirements for Object-Oriented Programming. It provides a lot of help in reducing code repetition, helps in designing the application and whatnot. However, for the best use of this feature, we must also know when we shall avoid using it. Just like any other feature of Continue Reading

An Overview of the Stored Procedures in PostgreSQL

Reading Time: 4 minutes As you may know in all the versions up to PostgreSQL 10, it was not possible to create a procedure in PostgreSQL. In  PostgreSQL11, PROCEDURE was added as a new schema object which is a similar object to FUNCTION, but without a return value. Over the years many people were anxious to have the functionality and it was finally added in  PostgreSQL. Traditionally,  PostgreSQL has provided all Continue Reading

Functional Java: It’s good to be lazy

Reading Time: 5 minutes In Java, we are often tempted towards writing a code which is executed eagerly. There’s a good reason for that – eager code is easy to write and to reason about. But delaying commitments until the last responsible moment is a good agile practice. When executing the code, we can gain performance by being just a little lazy.  In this blog, we will try to Continue Reading