Subscribe: Javalobby - The heart of the Java developer community
Added By: Feedage Forager Feedage Grade B rated
Language: English
actor  api  cloning  copy constructors  copy  fixed delay  functional programming  java cloning  java  new  programming  reactive  spring 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Javalobby - The heart of the Java developer community

DZone Java Zone

Recent posts in Java on


The Optional Abomination

Fri, 20 Jan 2017 11:01:00 GMT

There’s this piece of code… I keep thinking about it. It shows up in my dreams. I open it every time I get to work. I learned it by heart already. It scares me. It reminds me of every bad thing that ever happened to me in my life. It reminds me of every line of crappy code that I ever wrote. It’s like a whisper in my ear: You can’t avoid me. Help! Please help!

public class PresenceCheck {
    public static boolean isPresent(Object val) {
        return Optional.ofNullable(val).isPresent();
    public static boolean isNotPresent(Object val) {
        return ! isPresent(val);

My (Dev) Morning Routine [Comic]

Fri, 20 Jan 2017 08:01:00 GMT

Fixed Delay Scheduling With Quartz

Fri, 20 Jan 2017 05:01:00 GMT

With this (Fixed Delay) kind of scheduling, there is always an identical fixed delay between the termination of one execution and the commencement of another, as can be shown in the following image.

Java supports this kind of scheduling inherently through java.util.Timer and java.util.concurrent.ScheduledExecutorService. However, achieving a fixed delay using Quartz is not that straight forward (especially when misfires are considered).

SKP's Java/JEE Gotchas: JAR File Dependencies

Thu, 19 Jan 2017 21:01:00 GMT

You might find yourself running into a problem where you want to refer to a JAR inside another JAR. Many developers would assume that by adding it to the Class-Path within MANIFEST.MF, it should be included in the classpath. But that doesn't work.


Java Performance Monitoring: 5 Open Source Tools You Should Know

Thu, 19 Jan 2017 17:01:01 GMT

For more like this, visit the Takipi blog.

One of the most important things for any application is performance. We want to make sure the users are getting the best experience they can, and to know that our app is up and running. That’s why most of us use at least one monitoring tool.

A Functional Programming Approach to Dynamic SQL With jOOQ

Thu, 19 Jan 2017 11:01:00 GMT

Typesafe embedded DSLs like jOOQ are extremely powerful for dynamic SQL because the query you’re constructing with the jOOQ DSL is a dynamic query by nature. You’re constructing a query expression tree using a convenient API (the “DSL”), even if you think your SQL statement is static. For instance:

for (Record rec :, ACTOR.LAST_NAME)
               + " " + rec.get(ACTOR.LAST_NAME));

Reactor 3.0, a JVM Foundation for Java 8 and Reactive Streams [Video]

Thu, 19 Jan 2017 08:01:01 GMT

The apparent simplicity of the publisher/subscriber model as exposed in Reactive Streams can be deceiving. The relatively fast release cycle for libraries in that space is not a myth, concurrency is hard. To keep out undesired side effects, most Reactive projects have adopted a vertical approach potentially excluding developers from decision-making around execution model or sometimes language.

What if we were able to leave the developer in control, positioning as a robust foundation and making the most of the now industrial standard Java 8?

Spring MVC and Java-Based Configuration

Thu, 19 Jan 2017 05:01:00 GMT

In this aicle, we will see how to configure a Spring MVC application without using a web.xml. We will use Java-based configuration.

For this example, we will use a simple Maven web project.

Kotlin Properties and the Vaadin 8 Beanbinder [Code Snippet]

Wed, 18 Jan 2017 21:01:00 GMT

Vaadin 8 (currently in beta) comes with a whole new DataBinding API that makes heavy use of Java 8 lambda features. 

Unfortunately, Java has no concept of a Property, so one of the new ways to bind a Bean Property is writing something like ( taken from the documentation):

This Week in Spring: Reactor 3.0, Open Source CD, and All Kinds of Cloud

Wed, 18 Jan 2017 17:01:00 GMT

Welcome to another installment of This Week in Spring! We’ve got a lot to get into this week - even more so than usual! So, let’s get into it!

This week there are a lot of great SpringOne Platform 2016 replays available online thanks to our very own Pieter Humphrey!

Java Cloning: Even Copy Constructors Are Not Enough

Wed, 18 Jan 2017 14:58:31 GMT

This is the third article in my Java Cloning series. In my previous articles, Java Cloning and Types of Cloning (Shallow and Deep) in Details with Example and Java Cloning: Copy Constructor versus Cloning, I discussed Java cloning in detail and explained every concept, like what cloning is, how it works, the necessary steps we need to follow to implement cloning, how to use Object.clone(), shallow and deep cloning, how to achieve cloning using serialization and copy constructors, and advantages copy of copy constructors over Java cloning.(image)

If you have read those articles, you can easily understand why it is good to use copy constructors over cloning or Object.clone(). In this article, I am going to discuss why copy constructors are not sufficient.

A Light RX API for the JVM [Video]

Wed, 18 Jan 2017 11:01:00 GMT

RxJava is a fully fledged and widely used solution to develop Reactive applications, but some interesting alternatives exist. After an overview of the main Reactive APIs available and of Spring Boot Reactive support, this workshop introduces how to develop Reactive applications using Reactor Core 2.5-a powerful and fast alternative. We will learn how to use Flux (N values) and Mono (single value) types with various exercises. This new API (which is the core of Reactor 2.5) is a game-changer in the world of Reactive API on the JVM thanks to its Reactive eXtensions-based API (natively based on Reactive Streams and Java 8) and its unmatched performance.

Recorded at SpringOne Platform 2016.

A Scalable Java Thread Pool Executor

Wed, 18 Jan 2017 09:01:00 GMT

Ideally, from any thread pool executor, the expectation would be the following:

  • An initial set of threads (core threads pool size) created up front, to handle the load.
  • If the load increases, then more threads should be created to handle the load up to max threads (Max pool size).
  • If the number of threads increases beyond Max Pool Size, then queue up the tasks.
  • If Bounded Queue is used, and the queue is full, then bring in some rejection policy.

The following diagram depicts the process; only initial threads are created to handle tasks (when load is very low).

A Comprehensive Walk Through Java Method References

Wed, 18 Jan 2017 05:01:00 GMT

In this post, we are going to discuss yet another feature of Java 8: Method References. In a previous post, we explored lambda expressions and learned how to use them to write better and more compact Java code, especially with the advent of functional interfaces.

Unless you are very well-versed with lambda expressions, I would highly recommend that you first go through my lambda expressions tutorial before continuing with this post.

Perfecting Your SOLID Meal With DIP

Tue, 17 Jan 2017 21:01:00 GMT

The codebase has improved so much lately that you’re famous now! Each day you come to WooMinus, you’re greeted with a different title: The One Dev To Satisfy Them All, The Grandparent of New Features, The Compatibility Guardian, or The Monolith Crusher. When you sit at your desk, a coffee and a croissant are waiting with a card wishing you a nice day. The helmet on top of your head was replaced by a crown. Your life is like an almost-perfect meal. We’ll make it perfect using DIP.

A Humble Request

One day, when you get into the office, your new office puppets, Ben and Tony, are kneeling next to your desk.

The Twisted Sisters of Overloadable Groovy Operators

Tue, 17 Jan 2017 17:01:00 GMT

Groovy supports operator overloading for a limited set of operators. Each supported operator corresponds to a particular method signature. If a type implements that method, then that operator is effectively overloaded for instances of that type.

The + operator, for example, corresponds to the plus method, enabling to be substituted with a + b. And thanks to the wonders of polymorphism, a type can define multiple plus methods to allow + to behave differently depending on the type on the right hand side of the operator (e.g. [1] + 2 inserts 2 at the end of the list while [1] + [2] joins the two lists together, resulting in [1, 2] for both).

Open Your Classes and Methods in Kotlin

Tue, 17 Jan 2017 11:01:00 GMT

Though Kotlin and Spring Boot play well together, there are some friction areas between the two. IMHO, chief among them is the fact that Kotlin classes and methods are final by default.

The Kotlin docs cite the following reason:

Functional Programming Is Not What You (Probably) Think

Tue, 17 Jan 2017 08:01:00 GMT

After seeing many of the comments from another article attempting to explain what FP (Functional Programming) is about, I thought I would take another attempt at my own explanation. First, just a little background about me: I am currently a Quality Engineer at Red Hat, and I have been writing Clojure off and on (mostly off) since 2010. I have just recently begun a journey learning PureScript which is (sort of) a dialect of Haskell that targets a JavaScript engine. My goal in this article is to give yet another explanation of FP and give at least a notion of the differences between "mostly" FP from pure FP. I welcome any comments, questions, or corrections (especially with regards to pure functional programming, which I am still fairly new at).

Definition of a Pure Function

So in the previous article mentioned above, the author wanted to convey the notion of what a pure function is: namely, a function which, given the same input, always yields the same output and without any side effects. A side effect can include mutating any variable or affecting the "outside" world (for example writing to a file or stdio). A related but orthogonal concept to a pure function is a total function, which perhaps I'll cover in another article.

Do the Many Types of Coding Languages Stifle Creativity?

Mon, 16 Jan 2017 23:01:00 GMT

How many types of coding languages can you name today? 15? 20? And these are just the ones that spring to mind, the household names. When I first got into IT over 20 years ago, there were just a few actively used programming languages, but there are dozens now. While new ways to express creativity are almost always a good thing — and the growing number of new programming languages certainly is a testament to that end — the current volume of languages out there may hinder IT stability in my opinion.

I remember working on a project the nature of which dictated using C++. C++ wasn't just the best language for the job; it was the only language suitable for the job, given the interfacing APIs and other factors. The problem was I was the only developer in our IT department who knew C++. On the one hand, my knowledge was great because as a "team," we were able to provide a solution to the business unit we supported. On the other hand, no one else on our team could support the solution, and after I left that company, no one in-house could extend it, and the company was not about to hire a C++ developer to support a single solution.

What 2017 Brings for a Java Developer

Mon, 16 Jan 2017 17:01:00 GMT

The new year and Christmas aren't far gone, so it’s a good time for Java developers to wear a warm sweater. And, of course, it’s an excellent time to summarize the previous year and make some plans and forecasts for the next. Personally, for me, it’s almost a tradition. I’m going to continue it and write a couple of thoughts about 2017 for Java developers.

But before this, let’s try to recall what happened in 2016.