Java Record
Java Deep | Pure Java, what else
by Peter Verhas
4y ago
The https://openjdk.java.net/jeps/359 outlines a new Java feature that may/will be implemented in some future versions of Java. The JEP suggests having a new type of “class”: record. The sample in the JEP reads as follows: Essentially a record will be a class that intends to have only final fields that are set in the constructor ..read more
Visit website
Handling repeated code automatically
Java Deep | Pure Java, what else
by Peter Verhas
4y ago
In this article I will describe how you can use Java::Geci generator Repeated to overcome the Java language shortage that generics cannot be primitive. The example is a suggested extension of the Apache Commons Lang library. Introduction When you copy-paste code you do something wrong. At least that is the perception. You have to create ..read more
Visit website
Box old objects to be autoclosable
Java Deep | Pure Java, what else
by Peter Verhas
5y ago
Since Java 7 we can use try-with-resources and have any object automatically closed that implements the Autocloseable interface. If the resource is Autocloseable. Some of the classes need some wrap-up but are not Autocloseable. These are mainly old classes in some legacy framework that still get in our way to make us trip up. Nobody ..read more
Visit website
Lazy assignment in Java
Java Deep | Pure Java, what else
by Peter Verhas
5y ago
Programmers are inherently lazy and similis simili gaudet also like when the programs are lazy. Have you ever heard lazy loading? Or lazy singleton? (I personally prefer the single malt version though.) If you are programming in Scala or Kotlin, which is also a JVM language you can even evaluate expressions in a lazy way ..read more
Visit website
Handling exceptions functional style
Java Deep | Pure Java, what else
by Peter Verhas
5y ago
Java supports checked exceptions from the very start. With Java 8 the language element lambda and the RT library modifications supporting stream operations introduced functional programming style to the language. Functional style and exceptions are not really good friends. In this article, I will describe a simple library that handles exceptions somehow similar to how ..read more
Visit website
How to generate source code?
Java Deep | Pure Java, what else
by Peter Verhas
5y ago
In this article, I will talk about the different phases of software development where the source code can be generated programmatically and I will compare the different approaches. I will also describe the architecture and the ideas (the kind of eureka moment) of a specific tool that generates code at a specific phase. Manually This ..read more
Visit website

Follow Java Deep | Pure Java, what else on FeedSpot

Continue with Google
Continue with Apple
OR