Image for post
Image for post

Java 9 Features

- Immutable List

Creates a immutable list (read-only), cannot modify the list once it is created.

List.of(1,2,3);
  • Cannot add null value, it will throw NullPointerException.

- Immutable Set

Set.of(1,2,3);
  • Cannot add duplicate values like Set.of(1,1,2), it will throw IllegalArgumentException.

- Immutable Map

we can create immutable map in 2 ways:

Map.of(K1,V1,K2,V2);      // K refers to key and V refers to value

AND…


Collectors is a final class that extends Object class. It provides reduction operations, such as accumulating elements into collections, summarizing elements according to various criteria, etc. Java Collectors class provides various methods to deal with elements.

Image for post
Image for post

1. Creating list: toList()

It is used to accumulate elements into a list. It will create a new list (It will not change the current list).

List<Integer> integers = Arrays.asList(1,2,3,4,5,6,6);integers.stream().map(x -> x*x).collect(Collectors.toList());// output: [1,4,9,16,25,36,36]

2. Creating set: toSet()

It is used to accumulate elements into a set, It will remove all the duplicate entries.

List<Integer> integers = Arrays.asList(1,2,3,4,5,6,6);integers.stream().map(x -> x*x).collect(Collectors.toSet());// output: [1,4,9,16,25,36]

3. Creating specific collection: toCollection()

We can accumulate data in any specific collection as well. …


Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Image for post
Image for post

If you are working on any software project, then there are good chances that you already heard of GIT before. In this article we will deep dive into some useful but not so common git commands which can make out life easier.

Stashing in GIT

It is used to store all the local changes (staged and unstaged changes) for future use and reverts them from your working copy. It takes you back to the working directory HEAD (last commit). …


In this blog, we will learn about how we can containerize a react application. Here we will see the generic steps which we can follow with any react application. Just for the sake of completion, we will start from scratch, we will first create a react application and then we will containerize it.

If you just started working on docker, I will highly recommend you to check my other blog first which is moreover related to the basic of docker commands

https://medium.com/swlh/important-docker-commands-you-should-know-60735f821068

Image for post
Image for post

Creating react application

npx create-react-app my-app
cd my-app
npm install

The first command will create our project, the second command is just navigating to the right project directory and the third command will download all the dependencies required for the project. …


Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host.

Image for post
Image for post

What are a docker image and docker container?

As per the official website, a Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries, and settings.

And docker container is an instance of the docker image, docker container is a docker image brought to life.

Breakdown of docker commands syntax:

Every docker command can be broken down into 3 parts :

1. Keyword 'docker'
2. Main task (start, stop, build, etc).
3. Options (port, tty, interactive volumes, etc).
4. Reference to image or container with all the property flags.


As ECMAScript11 came, let’s quickly revise all the major features of ES6 to ES10.

Image for post
Image for post

ECMAScript6 -ECMAScript 2015

Its the protocol on which Javascript works. So we can say its javascript version.

Features introduced in EC6

let keyword

The let statement allows us to declare a variable with block scope and we cannot redeclare the same object in the same scope

var x = 10;
{
let x = 2;
let x = 4; // ERROR (cant redeclare)
x = 5; // works fine
// In this block x is equal to 5
}
// here x is 10

const keyword

The const statement is the same as let, the only difference is its value cant be changed. …


In the last blog, we looked at what is Quarkus. How it works internally. and ways to create a quarkus project. If you have not read that blog yet I will highly recommend you do that first.

Understanding the power of Quarkus

Image for post
Image for post

In this blog, we will see how we can integrate PostgreSQL with Quarkus and will create a CRUD application.

So let's start with the dependencies

Dependencies

        <dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-validator</artifactId>
</dependency>

These are the 3 dependencies we require for our database connection and validation.

Configuration

We need to provide the database name, driver name, username, and password. We can provide this information in the application.properties …


Quarkus is a full-stack, light-weight, superfast java framework for the JVM and the native application.

Image for post
Image for post

But why so hype about Quarkus? Why should we learn Quarkus? when we already have Spring boot like framework. which is an open-source framework. It gives a simple way to build, configure, and build web applications.

So let’s start out talking with the comparison between Quarkus and Spring boot.

Quarkus vs Spring boot

1. Start-up time :

If we compare the startup time between the Quarkus native, Quarkus JIT, and traditional native application(Spring boot). We can clearly see the difference.

Image for post
Image for post

2. Memory footprint

Memory footprint basically means the amount of main memory that a program uses or references while running. Here also we can see the drastic difference between the Quarkus the Spring boot or any other traditional native stack. …


Asynchronous programming is a programming paradigm that facilitates fast and responsive user interfaces. The asynchronous programming model in Java provides a consistent programming model to write programs that support asynchrony.

Image for post
Image for post

Why Asynchronous programming

Asynchronous programming provides a non-blocking, event-driven programming model. This programming model leverages the multiple cores in your system to provide parallelization by using multiple CPU cores to execute the tasks, thus increasing the application’s throughput.

In Java, there are many ways to achieve asynchronous programming or reactive programming like using RxJava, project Reactor, vertX, etc

Here we will discuss the project Reactor using the spring web-Flux module.

Spring webFlux module

Spring Framework 5 includes a new spring-webFlux module. We will achieve the asynchronous services using spring webFlux. It exposes 2 major API types: Flux and Mono. These API works on the concept of subscriber and publisher. …


Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution. All variable and function declarations are hoisted to the top of their scope

Image for post
Image for post

However, in contrast, undeclared variables do not exist until code assigning them is executed. Therefore, assigning a value to an undeclared variable implicitly creates it as a global variable when the assignment is executed. This means that all undeclared variables are global variables.

function hoist() {
a = 20;
var b = 100;
}

console.log(a); // error a is not defined

hoist();

console.log(a); // 20 a becomes global variable
console.log(b); …

About

Rohan Aggarwal

Full stack developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store