Author: Nicolas Frankel

Avatar
Nicolas Frankel

Nicolas is a developer advocate with 15+ years experience consulting for many different customers, in a wide range of contexts (such as telecoms, banking, insurances, large retail and public sector). Usually working on Java/Java EE and Spring technologies, but with focused interests like Rich Internet Applications, Testing, CI/CD and DevOps. Currently working for Hazelcast. Also double as a trainer and triples as a book author.

  • A Real-World Example of a Stream Collector

    You can solve most use cases with one of the out-of-the-box collectors provided in the Collectors class.

    However, some require to implement a custom Collector, e.g., when you need to collect more than a single collection or a single scalar.

    While it may seem complicated if you never developed one before, it’s not. You only need a bit of practice.

    I hope this article might help you with it!

    Avatar
    N. Frankel
    Read more
  • A Close Look at Kotlin’s Delegation

    Kotlin offers many exciting features.

    In general, developers tend to cite null safety as their favorite. For me, it’s function extensions. But delegation comes a close second.

    The delegate pattern is ubiquitous in the Object-Oriented Programming world. Some languages, such as Kotlin, provides a native implementation.

    But delegation doesn’t stop at the class level. Kotlin does provide delegation at the property level. It provides some out-of-the-box delegates, but you can easily create your own.

    Avatar
    N. Frankel
    Read more
  • An Example of Overengineering: Keep it WET

    This week’s post is pretty short. I’ve already written about overengineering, but this adds a personal touch.

    I had to rewrite my Jet Train demo to use another data provider, switching from a Swiss one to a Bay Area one. One of the main components of the demo is a streaming pipeline.

    Avatar
    N. Frankel
    Read more
  • Hazelcast, from Embedded to Client-Server

    Java developers are particularly spoiled when using Hazelcast. Because Hazelcast is developed in Java, it’s available as a JAR, and we can integrate it as a library in our application.

    Just add it to the application’s classpath, start a node, and we’re good to go. However, I believe that once you start relying on Hazelcast as a critical infrastructure component, embedding limits your options. In this post, I’d like to dive a bit deeper into the subject.

    Avatar
    N. Frankel
    Read more
  • Your own custom Spring Data repository

    Functional Programming is becoming more and more popular. Spring provides a couple of DSLs for the Kotlin language. For example, the Beans DSL and the Routes DSL allow for a more functional approach toward Spring configuration. On the type side, Vavr (previously Javaslang) is pretty popular in Java, while Kotlin has Arrow.

    In this post, I’d like to describe how one can use Arrow’s type system with Spring Data. Ultimately, you can benefit from the explanations to craft your custom Spring Data repository.

    Avatar
    N. Frankel
    Read more
  • Changing a Field’s Type in Recent JDKs

    A couple of years ago, I attended a talk by my former colleague (but still friend) Volker Simonis. It gave me the idea to dig a bit into the subject of how to secure the JVM. From the material, I created a series of blog posts as well as a talk.

    From that point on, I submitted the talk at meetups and conferences, where it was well-received. Because I like to explore different areas, I stopped to submit other proposals. Still, the talk is in my portfolio, and it was requested again in 2021. I have already presented it twice since the beginning of the year at the time of this writing.

    It allowed me to update the demo with version 16 of the JDK. In this blog post, I want to share some findings regarding the security changes regarding changing a field’s type across JDK versions.

    Avatar
    N. Frankel
    Read more
  • A (Definitive?) Guide to LazyInitializationException

    Posts that have been written about Hibernate’s LazyInitializationException could probably fill whole books.

    Yet, I believe each of them focuses on a particular aspect of it: some on a specific solution, some on how to solve it with Spring Boot, etc.

    I’d like this post to be the definitive guide on the subject, even though I’m pretty sure it won’t.

    At least, I’ll be able to point others to it!

    Avatar
    N. Frankel
    Read more
  • Kicking Spring Native’s Tires

    I’ve been playing with GraalVM Ahead-Of-Time compilation capability since I became aware of it.

    As a long-time Spring aficionado, I carefully monitored the efforts that the engineers at Tanzu have put into making Spring AOT-compatible. Recently, they announced the beta version of the integration.

    In this post, I want to check how easy it is to produce a (working!) Docker image from an existing Spring Boot application.

    Avatar
    N. Frankel
    Read more
  • Monitoring Across Frameworks: Spring Boot, Micronaut, Quarkus, and Helidon

    Gone are the times when developers’ jobs ended with the release of the application. Nowadays, developers care more and more about the operational side of IT: perhaps they operate applications themselves, but more probably, their organizations foster increased collaboration between Dev and Ops.

    I started to become interested in the Ops side of software when I was still a consultant. When Spring Boot released the Actuator, I became excited. Via its convention-over-configuration nature, it was possible to add monitoring endpoints with just an additional dependency.

    Since then, other frameworks have popped up. They also provide monitoring capabilities. In this article, I’d like to compare those frameworks concerning those capabilities.

    Avatar
    N. Frankel
    Read more
  • Optional.stream()

    This week, I learned about a nifty “new” feature of Optional that I want to share in this post. It’s available since Java 9, so its novelty is relative.

    We start with a sequence to compute the total price of an order, for which it is nowadays more adequate to use streams instead of iterations.

    Optional makes the code less readable! I believe that readability should trump code style every single time.

    Fortunately, Optional offers a stream() method (since Java 9). It allows to simplify the functional pipeline. Functional code doesn’t necessarily mean readable code. With the last changes, I believe it’s both.

    Avatar
    N. Frankel
    Read more
  • Creating Self-Contained Executable JARs

    When your application goes beyond a dozen of lines of code, you should probably split the code into multiple classes.

    At this point, the question is how to distribute them. In Java, the classical format is the Java ARchive, better known as the JAR. But real-world applications probably depend on other JARs.

    This article aims to describe ways to create self-contained executable JARs, also known as uber-JARs or fat JARs.

    Avatar
    N. Frankel
    Read more

Subscribe to foojay updates:

https://foojay.io/feed/
Copied to the clipboard