Java 10 overview March 2018 saw the latest semi-annual release of Java: Java 10. In this article, we’ll examine the big changes introduced in this version, as well as talk about some of the smaller improvements that will make life easier for developers and ops alike. Java 10: Big changes The two big stories in Java 10 are: the new …
A Start to Finish Guide to Docker with Java
Intro to managing and running a containerized Java Spring Boot application Docker is a platform for packaging, deploying, and running applications in containers. It can run containers on any system that supports the platform: a developer’s laptop, systems on “on-prem,” or in the cloud without modification. Images, the packages Docker uses for applications, are truly cross-platform. Java microservices are a …
Java vs. Python: Coding Battle Royale
While we all started to learn how to code with HTML, developing a sophisticated app requires a more advanced language. Java and Python are two of the hottest programming languages in the market right now because of their versatility, efficiency, and automation capabilities. Both languages have their merits and their flaws, but the main difference is that Java is statically …
Design Patterns Explained – Service Locator Pattern with Code Examples
The service locator pattern is a relatively old pattern that was very popular with Java EE. Martin Fowler described it in 2004 on his blog. The goal of this pattern is to improve the modularity of your application by removing the dependency between the client and the implementation of an interface. Interfaces are one of the most flexible and powerful …
The State of Logging in Java
When developing an application, chances are that it won’t perform as expected on the first run. In order to check what went wrong, developers in general use debuggers. But experienced developers know that if it happens in production, most debuggers won’t be available. Hence, they pepper the source code with logging statements to help their future self debug the next …
SOLID Design Principles Explained: Dependency Inversion Principle with Code Examples
The SOLID design principles were promoted by Robert C. Martin and are some of the best-known design principles in object-oriented software development. SOLID is a mnemonic acronym for the following five principles: Single Responsibility Principle Open/Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle Each of these principles can stand on its own and has the goal to …
Optional Parameters in Java: Common Strategies and Approaches
Introduction to optional parameters in Java Unlike some languages such as Kotlin and Python, Java doesn’t provide built-in support for optional parameter values. Callers of a method must supply all of the variables defined in the method declaration. In this article, we’ll explore some strategies for dealing with optional parameters in Java. We’ll look at the strengths and weaknesses of …
Understanding and Leveraging the Java Stack Trace
Stack traces are probably one of the most common things you’re regularly running into while working as a Java developer. When unhandled exceptions are thrown, stack traces are simply printed to the console by default. Nevertheless, it’s easy to only have a surface-level understanding of what these are and how to use them. This article will shed light on the …
SOLID Design Principles Explained: Interface Segregation with Code Examples
The Interface Segregation Principle is one of Robert C. Martin’s SOLID design principles. Even though these principles are several years old, they are still as important as they were when he published them for the first time. You might even argue that the microservices architectural style increased their importance because you can apply these principles also to microservices. Robert C. …
SOLID Design Principles Explained: The Liskov Substitution Principle with Code Examples
The Open/Closed Principle, which I explained in a previous article, is one of the key concepts in OOP that enables you to write robust, maintainable and reusable software components. But following the rules of that principle alone is not enough to ensure that you can change one part of your system without breaking other parts. Your classes and interfaces also …
A Detailed Guide to Enterprise Java Beans w/Code Examples
A Brief History of EJB By 1996, Java had already become popular among developer for its friendly APIs and automated Garbage Collection and was starting to be widely used in back-end systems. One problem, however, was that most of these systems needed the same set of standard capabilities – such as persistence, transaction integrity, and concurrency control – which the …
SOLID Design Principles Explained: The Open/Closed Principle with Code Examples
The Open/Closed Principle is one of five design principles for object-oriented software development described by Robert C. Martin. They are best known as the SOLID principles: Single Responsibility Principle Open/Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion All 5 of these design principles are broadly used, and all experienced software developers should be familiar with them. But don’t worry, …
The State of Java in 2018
2017 has been a turbulent year in the Java world. The long-awaited release of Java 9 brought a lot of changes and interesting new features, and Oracle announced a new release schedule for the JDK. And that was just the beginning. In the past, developers often complained that Java wasn’t developing fast enough. I don’t think you will hear these …
Generics and Type Erasure on the JVM
Introduction In UML, it’s possible to parameterize types in a class. Those types can then be used in different locations: attribute types, parameter types and return types. This is called a template class. Here’s an example of such a class in UML: This Foo class should be read as the following: The bar attribute is of type T The baz() …
Learn to Fully Leverage JavaServer Faces
JavaServer Faces as a Web Framework The focus of this article is to introduce and explain the JavaServer Faces framework. We’re going to start with a high-level look and them move on to the core details of JSF, on a practical example. JavaServer Faces is not just a web component framework. It also provides the whole programming model of interaction …
The Java vs .NET Comparison (Explained with Cats)
Comparing technologies is always fun. Not that we want to start yet another programming language war, but it is really quite interesting to take a fresh look at a familiar technology and put it into perspective. Plus, it’s quite common for developers and business owners to be faced with the choice between two or more options, be it a fresh …
Is Java Optional Only Smoke and Mirrors?
There are a lot of misconceptions in the software development world. Today we are going to address this one: “Java 8, for example, introduced the Optional class. It’s a container that may hold a value of some type, or nothing. In other words, it’s a special case of a Monad, known in Haskell as the Maybe Monad. You can now …
OOP Concepts for Beginners: What is Composition?
Composition is one of the fundamental concepts in object-oriented programming. It describes a class that references one or more objects of other classes in instance variables. This allows you to model a has-a association between objects. You can find such relationships quite regularly in the real world. A car, for example, has an engine and modern coffee machines often have …
The Java Performance Testing Guide With Code
1. Introduction In this article, we’ll discuss Java performance testing approaches that can be helpful for improving the performance of a Java application. We’ll start with how to define measurable performance goals and then look at different tools to measure, monitor application performance and identify bottlenecks. We’ll also look at some of the common Java code level optimizations as well …