Home » Java

Java

Implementing White-Labelling

java-interview-questions-answers

Sometimes (very often in my experience) you need to support white-labelling of your application. You may normally run it in a SaaS fashion, but some important or high profile clients may want either a dedicated deployment, or an on-premise deployment, or simply “their corner” on your cloud deployment. White-labelling normally includes different CSS, different logos and other images, and different ...

Read More »

Build a Photo Gallery PWA with Spring Boot, JHipster, and React

spring-interview-questions-answers

“I love writing authentication and authorization code.” ~ No Java Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. At its core, React is just a UI toolkit, ala GWT, but it has a very healthy ecosystem around it that provides everything you need to build ...

Read More »

Build a Serverless “Hello World” Function

java-interview-questions-answers

Serverless, Function as a Service (FaaS) or just cloud functions allows you to write code that will run in the cloud. You can use a number of different languages such as JavaScript (Node.js), Swift, Python, Java, PHP and others to write the function code.  What’s nice is that you don’t need to worry about servers, containers, deployment, etc. You write ...

Read More »

Java NIO Tutorial

1. Introduction Java NIO is a library introduced from Java 1.4. Java NIO has since its launch provided an alternative way to handle I/O and networking transactions. It is considered to be an alternative to Java Networking and Java IO libraries. Java NIO was developed with the goal to make the transactions for input and output asynchronous and non-blocking. The ...

Read More »

Fixing the if smell

From time to time we might end up with some huge if statements in our codebase. Those statements have to be maintained and change the same code block over and over again. This is common also in cases where the if statement checks if a variable belongs in a certain range of values. Supposing you have an enum public enum ...

Read More »

Deferred Execution with Java’s Predicate

In the previous posts “Deferred Execution with Java’s Supplier” and “Deferred Execution with Java’s Consumer“, I looked at easily deferring execution in Java via standard Java APIs that accept, respectively, Suppliers and Consumers. In this post, I take a similar look at how standard JDK-provided APIs allow for deferred execution via the standard functional interface Predicate. The Predicate is described ...

Read More »

Spring State Machine: what is it and do you need it?

spring-interview-questions-answers

State machine is a model of computation based on the finite states, as Wikipedia very obligingly says. Usually there are workflows to go with the states, meaning that you can’t just go from any state to any other state: there are rules one should follow. The transitions between these states are limited by the rules. The Spring framework has a ...

Read More »

Model Serving: Stream Processing vs. RPC / REST with Java, gRPC, Apache Kafka, TensorFlow

java-interview-questions-answers

Machine Learning / Deep Learning models can be used in different ways to do predictions. My preferred way is to deploy an analytic model directly into a stream processing application (like Kafka Streams or KSQL). You could e.g. use the TensorFlow for Java API. This allows best latency and independence of external services. Several examples can be found in my Github project: Model ...

Read More »

Reduce GC Overhead With These 5 Simple Hacks

Five simple ways to write code that’s more memory efficient, without spending more time on it or reducing code readability How much overhead does garbage collection add to your application? You might not know the exact number off the top of your head, but you do know that there’s always room for improvement. Although automated GC is a mostly efficient ...

Read More »