Is it possible to have an abstract method in a final class?

This is one of the interesting core Java questions which was asked to one of my readers recently during a telephonic interview for Java developer job interview. Even though he knows that you cannot make an abstract class final in Java, he got confused by the wording of the methods. The answer is simple, No, it’s not possible to have an ...

Read More »

Outputting the given, when, then, Extending Spock

Spock is a Java testing framework, created in 2008 by Peter Niederwieser a software engineer with GradleWare, which facilitates amongst other things BDD.  Leveraging this example, a story may be defined as: Story: Returns go to stock As a store owner In order to keep track of stock I want to add items back to stock when they're returned. Scenario ...

Read More »

Basic API Rate-Limiting

java-interview-questions-answers

It is likely that you are developing some form of (web/RESTful) API, and in case it is publicly-facing (or even when it’s internal), you normally want to rate-limit it somehow. That is, to limit the number of requests performed over a period of time, in order to save resources and protect from abuse. This can probably be achieved on web-server/load ...

Read More »

Cloud Foundry Application manifest using Kotlin DSL

I had a blast working with and getting my head around the excellent support for creating DSL’s in Kotlin Language. This feature is now being used for creating gradle build files, for defining routes in Spring Webflux, for creating html templates using kotlinx.html library. Here I am going to demonstrate creating a kotlin based DSL to represent a Cloud Foundry Application Manifest content. A sample ...

Read More »

Java Bean Validation Basics

This post summarizes some quick and easy examples for the most common things you would want to do with the Java Beans Validation API (JSR 349, JSR 303). Remember, Beans Validation is independent of Java EE. Although it is built in as part of a Java EE compliant server, the API can also be used just as easily in a ...

Read More »

Software Architectural Decision Making

A common question I get asked is “How do I make architectural decisions?” and my standard answer is “it depends”. While it’s a tongue in cheek answer, there is a bit of truth to it. While there are frameworks and methodologies to try and reign this problem in, the reality is that the practice of “software architecture” is inherently a ...

Read More »

Creating Milestones with Iteration-Based Agile

I’ve been coaching several teams with a problem: they like to work in iterations. And, they have milestones that are not on a milestone boundary. What should they do? (I suggested flow and you should have heard their response. Well, maybe not.) Here’s why people want these milestones: The team can’t deliver (for whatever reason) as continuous delivery. The PO (or someone ...

Read More »

The Patterns of the Antipatterns: Architecture

We have been always looking for the best ways to architect our applications and platforms so they are maintainable, extensible, observable, adaptable and easy to evolve (this is by no means a complete list of the properties we would like to have but the foundational ones). Layered architecture, component-based architecture, hexagonal architecture, microservice architecture (and many others) advocate to use ...

Read More »