Functional Interface Explained in Detail Introduced From Java 8

Originally published August 2020

Functional interfaces are introduced as part of Java 8. It is implemented using the annotation called @FunctionalInterface. It ensures that the interface should have only one abstract method. The usage of the abstract keyword is optional as the method defined inside the interface is by default abstract. It is important to note that a functional interface can have multiple default methods (it can be said concrete methods which are default), but only one abstract method. The default method has been introduced in interface so that a new method can be appended in the class without affecting the implementing class of the existing interfaces. Prior to Java 8, the implementing class of an interface had to implement all the abstract methods defined in the interface.

Java Development in 2022: Predictions and Selected Trends

Last year was interesting — a new LTS release, some amazing successes, but also a global vulnerability was discovered.  In this article, we will try to guess and predict how the industry will face the new challenges, and what innovations and developments will affect it the most.

General Trends

1. Migration From Java 8

A lot of apps still work on Java 8 — and it is easy to see why. It is still supported by many vendors, and there are many steps you need to take to migrate from 8 to 9 and higher because of radical changes introduced in Java 9. But we think that 2022 could be the year many people will finally decide to move to the latest LTS version for several reasons.

How To Do GC Log Analysis?

Analyzing garbage collection logs provides several advantages like it reduces GC pause time, reduces cloud computing cost, predicts outages, provides effective metrics for capacity planning. To learn about the profound advantages of GC log analysis, please refer to this post. In this post let’s learn how to analyze GC logs?

Basically, there are 3 essential steps when it comes to GC log analysis:

Using Java @Annotations to Build Full Spring Boot REST API

Here's more on building Java annotations for full Spring Boot REST APIs

This post aims to demonstrate important Java @annotations used to build a functional Spring Boot REST API. The use of Java annotation gives developers the capability to reduce the code verbosity by a simple annotation.

As an example, we can refer to a transaction. By the standard pro-grammatically process with a transaction template, this requires a more complex config and boilerplate code to write, while this can be achieved with a simple @Transactional declarative annotation.

Java 17 Features and Migration Considerations

A few months from now in March 2022, Java 8 will lose its Oracle Premier Support. It doesn’t mean that it won’t receive any new updates, but Oracle’s effort put into maintaining it will likely be significantly smaller than it is right now.

That means there’ll be a good reason to make the move to a new version, especially since on September 14th, 2021, Java 17 was released. This is the new Long Term Support version, with Oracle Premier Support to last until September 2026 (at least). What does Java 17 bring? How difficult will the migration be? Is it worth it? I’ll try to answer those questions in this article.

An Overview Between Java 8 and Java 11

One of the great news introduced in the Java world is related to the version cycle, of which we have a release every six months and a version of Long Term Support every three years. Currently, the LTS version is Java 11, from which many companies are moving towards its use. First, this movement is significant because new frameworks will not support Java 8 and will consider Java 11 as a minimum beyond the point that the next LTS will be in September 2021 with Java 11. The purpose of this article is to talk a little about the basic APIs that happens between Java 8 and Java 11.

The Functions Classes

An important point that will serve as a basis, starting with Java 8, is the new interfaces within the java.util.function package, in this overview, we'll see covert four interfaces:

Mock Java Date/Time for Testing

Referencing the current date/time in your source code makes testing pretty difficult. You have to exclude such references from your assertions, which is not a trivial task to complete.

Time mocking is a viable solution to avoiding current time inconveniences during testing, which can be accomplished by using the new Java 8 Date/Time API (JSR 310).

Functional Programming Patterns With Java 8

It’s been four years since functional programming became feasible in Java. The means we have had four years to play with Java 8.

And we've played... and played. After developing several large enterprise projects that made heavy use of Lambdas and Streams, consulted many other projects in doing so, and taught these concepts to hundreds of developers as an independent trainer, I think it’s time to summarize patterns, best practices, and anti-patterns.

How to Use Kotlin to Create a Secure Ktor Application

Today I will be showing you how to use a modern JVM stack to build your own Nano Blogging Service, or nabl. You will be using the Ktor web framework, Kotlin programming language, and securing it with Okta. Your users will be able to sign up/login, as well as browse chronological feeds and post updates without the inclusion of ads.

Often Kotlin is described as a better alternative to Java due to its efficient Java interoperability. This is important as it then allows for you to employ the largest ecosystem of existing libraries written and designed for Java, as well as JVM frameworks in your Kotlin application, or vice-versa. Kotlin also is compatible with Spring Boot, Jersey, Dropwizard, and more. Any framework that is “Kotlin-native” provides high-level language support, additional type-safety, and other competitive advantages. 

Difference Between InitialRAMPercentage, MinRAMPercentage, MaxRAMPercentage

This article attempts to clarify the difference between InitialRAMPercentage, MinRAMPercentage, MaxRAMPercentage JVM arguments. These arguments have been introduced since Java 8 update 191. They are used to configure your Java application’s heap size when you are running it in the Physical server or in the container. In this article, let’s review their differences.

InitialRAMPercentage

‘-XX:InitialRAMPercentage’ is used to compute the initial heap size of your java application. Say suppose you are configuring -XX:InitialRAMPercentage=25 and overall physical memory (or container memory) is 1GB then your java application’s heap size will be ~250MB (i.e., 25% of 1GB).

Use Both JWT and Opaque Access Tokens With Spring Boot

How can one validate OAuth 2.0 access tokens? This question frequently comes up — along with the topic of validating JSON Web Tokens (JWT) based access tokens— however, this is NOT part of the OAuth 2.0 specification. JWTs are used so commonly that Spring Security supported them before adding support for remotely validating tokens. 

This article will introduce how to build a simple application that utilizes both types of validation.

Java Streams: An Implementation Approach

In this tutorial, we will learn what Streams are in Java and how we can develop an implementation approach. We will compare the Stream API to SQL statements as an implementation approach.

Audience

All Java Developers who want to learn the new feature of Java 8 i.e. Streams API.

Refactoring Java 8 Code With Collector

I am planning to refactor a code that is based on Java 7 to Java 8 using the functional components, specifically Collector. The plan is simple: learn it by coding it. Let’s get started…

Overview of the Java Object We Are Dealing With

Java object to refactor

FHIR Code in 10 Minutes

You have read tons of articles on FHIR and the tell-tale signs have appeared on hairs on the back of your neck. Your gut tells you to get your feet wet (you got to admit that is funny, gut talking to feet) and ease out that angst. You may be an Architect (hands-on or not) or hands-on Engineer or may be rusty on coding or even deep into it, you could be coming from any such background but FHIR is the beast that you are looking to wrestle. If this speaks to you then let's work together for 10 minutes and then you can go back to the world of FHIR with a renewed goal like Robert the Bruce from the famous spider legend. 

This code is for FHIR Facade pattern meaning that we are not going for full FHIR Restful Server implementation and our objective here is to only retrieve data. We will use Spring Boot just because those Booties are so awesome and simple. We will also use our friendly HAPI FHIR library to create our java application. 

Concatenating Strings in Java 9

Have you ever had the need to build a comma-separated list of values from a list or an array in Java or wanted to create a file path using concatenated folder names and a file path delimiter? Well, in the article Cocatenating Strings in Java 8, I have described a convinient way to use Java 8 APIs to do the job.

This not only reduces your development time and prevents additional errors, but it also let's you write more readable and understandable code. But what exactly happened since Java 9 was released, and does it apply to the code presented in the cases described in the aforementioned article.