Home » Java (page 2)

Java

Java: Release of Speedment 3.2 – Now Enabling Lightweight Database Microservices

java-interview-questions-answers

Several traditional ORMs do not fully honor Java module encapsulation (JPMS). This often means a lot of unnecessary files and classes are used when deploying microservices. The latest major release 3.2 of open-sourceSpeedment solves this problem by introducing module system support allowing efficient deployment of cloud applications and providing a more stringent API. In this article, you will learn what’s ...

Read More »

Repeated code

Introduction It is usually not good to have copy/paste code in our Java application but sometimes it is unavoidable. For example the project License3j provides a method isXXX in the Feature class for each XXX type it supports. In that case, we can do no better than write 01 02 03 04 05 06 07 08 09 10 11 12 ...

Read More »

Java: How to Create Lightweight Database Microservices

java-interview-questions-answers

The number of cloud-based Java database applications grows by the minute. Many organizations deploy hundreds if not thousands of microservice instances. However, most applications carry an astounding amount of unnecessary overhead with respect to the runtime environment. This, in turn, makes the application slower and more expensive to run. In this article, I will demonstrate how to write a database ...

Read More »

Better integration tests with WireMock

spring-interview-questions-answers

No matter if you follow the classical test pyramid or one of the newer approaches like the Testing Honeycomb you should start writing integration tests at some point during development.There are different types of integration tests you can write. Starting with persistence tests, you can check the interaction between your components or you can simulate calling external services. This article ...

Read More »

First Past the Post

Often, we write code to work out the first answer of a bunch of available ones. Let’s look at that in Java. 01 02 03 04 05 06 07 08 09 10 11 12 public Widget getAppropriateWidget(CustomerRequest request) {     if (shelfstock.contains(request.getBarcode()) {         return new ShelfWidget();     }     if (backroomStock.contains(request.getBarcode()) {         return new BackroomWidget();     }     if (supplier.contains(request.getEan()) {         return new SupplierWidget();     } ...

Read More »

Build a Simple CRUD App with Java and JSF

java-interview-questions-answers

Easily deploy your app with Okta’s identity management platform Use Okta’s API to authenticate, manage, and secure users in any app within minutes. Try Okta today. JavaServer Faces (JSF) is a Java framework for building Web applications, centered on components as the building blocks for the user interface. JSF benefits from a rich ecosystem of tools and vendors, as well ...

Read More »

[MEGA DEAL] Oracle Java Certification Exam Preparation Courses + Tests Training Bundle (92%)

Become a Certified Programmer with an Oracle Java Certification & Take a Step Ahead Toward a Brighter Development Career Hey fellow geeks, This week, on our JCG Deals store, we have another extreme offer. We are offering a massive 92% off on Oracle Java Certification Exam Preparation Courses + Tests Training Bundle. Get it now with only $29,99, instead of ...

Read More »

A Surprising Injection

So, I owe Jim an apology. He’d written a working mockito and JUnit test, and I told him in review that I didn’t think it did what he expected it to. While I was wrong, this scenario reads like a bug to me. Call it desirable unexpected side effects. Imagine you have the following two classes: 01 02 03 04 ...

Read More »

To Infinity (Streams) and Beyond!

Java allows you to process data in collections or streams. It’s very easy to think of streams as a technique to turn one collection into another. This can lead to some rather casual code where streaming data is repeatedly collected to some sort of collection, passed as a whole collection, and then processed some more. For 6 elements, who cares! ...

Read More »