OnlyJava is your source for Blog Aggregation in the Java industry

Java Holiday Calendar 2016 (Day 10): MapStream

 Mark As Read    

Today's tip is about the open-source class MapStream, which allows us to stream not only over elements, but over a pair of key value elements and make changes either to the keys, values, or both. You can find the source code for MapStream here together with some examples of how to use it. It is free, so go ahead and use or copy it in your applicati...

Groovy Calamari - Issue 59 - 9th Dec 2016

 Mark As Read    

Comment I read and digested the Grails Guides. All-in in Grails in this issue. 8 links to Grails content. Let's go: Groovy Calamari Grails Shortcut...

GroovyBlogs.org 1 day ago

Grails Goodness: Writing Log Messages With Grails 3.2 (Slf4J)

 Mark As Read    

Grails 3.2 changed the logging implementation for the log field that is automatically injected in the Grails artefacts, like controllers and services. Before Grails 3.2 the log field was from Jakarta ...

GroovyBlogs.org 1 day ago

Code Looks Like a Chain

 Mark As Read    

As Aerosmith sang many years ago, “Code looks like a Chain.” No? They didn't say that? Maybe I'm remembering it wrong. Well, as you might have guessed, in this post, we'll talk about the Chain of Responsibility design pattern. This pattern is not one of the more popular ones, at least among the patterns defined by the Gang of Four, but modern depen...

Declarative Programming With Speedment 3.0

 Mark As Read    

Generally accessible in Java 8, higher order functions open up a whole new level of abstractions allowing us to reason about code and algorithms in a new way. When our code can operate on functions as input and output, we are given the power to easily express algorithms that modify behavior just like we have always done for data. The power to creat...

ModRun: Modularity for Java — Without Jigsaw

 Mark As Read    

Installing and running Java applications has been challenging in the past. There are several models, but none that have really made Java application installation and launching easy. Especially if you keep multiple servers up-to-date with the latest versions of various services. To meet that challenge, we (Nanosai) are now developing ModRun. ModRun ...

Java Holiday Calendar (Day 9): Event Sourcing

 Mark As Read    

Today's tip is about event sourcing, which is a relatively new way of designing database applications. Instead of seeing the database as a representation of the most current state, we would see it as a system of record for all transactions that ever took place in our applications. So, instead of saying "find person 3 and replace that person's...

Learn Drools (Part 5): Truth Maintenance

 Mark As Read    

In our previous article, we saw how Inferences are useful when we need to repetitively use a condition across our Drools rules. With an Inference, we insert the condition as a POJO and use that fact across the rules. It's a perfect way to separate the condition from its usage. But think about a condition where two rules are mutually exclusive. In t...

Broken Image T-Shirt

 Mark As Read    

Broken Image T-Shirtby MalaysiaGiftsShophttp://java2everyone.blogspot.com

Java2everyone 2 days ago

This Week in Spring: JUnit and Axon and Statemachine, Oh My!

 Mark As Read    

Welcome to another installment of This Week in Spring! This week, I’m in Brisbane, Australia, on the second leg of the YOW! conference circuit. If you’re around, please say hi or find me when YOW! moves to Sydney in a few days. We’ve got a lot to cover so let’s get to it!

Getting Started With Vaadin in Spring and Java EE

 Mark As Read    

One of the most interesting findings in the latest Vaadin Community Survey was that Java EE is used slightly more than Spring among developers. Although the differences between Java EE and Spring is small, if we combine both, we see that 73% of developers using Vaadin also use either Java EE or Spring: The good news for developers is that Vaadin of...

Java Holiday Calendar 2016 (Day 8): Use Traits in Java

 Mark As Read    

Today's tip is about defining your classes and interfaces using Traits. This allows you to simplify your code and reuse components efficiently without creating unnecessary coupling or inheritance between your classes. Suppose we have two interfaces, Table and Column, that both have names, then we would introduce a name trait — HasName — that both i...

(Data)Weaving Expressons In Java

 Mark As Read    

I previously wrote an article called Weaving it with Dataweave expressions in the MuleSoft blog, which explains the powerful Dataweave expression function dw() and its implementation outside a Dataweave Transform Message component. Dataweave has the ability to transform a message payload from one form to another and in any kind of format (XML, CSV,...

Learning to Live With Language FOMO

 Mark As Read    

Sitting in a room full of functional programmers, I feel somewhat out of my depth. Monads this, tail recursion optimization that, and immutability everywhere. Suddenly using plain old “if” statements ...

GroovyBlogs.org 2 days ago

Learning to Live With Language FOMO

 Mark As Read    

Sitting in a room full of functional programmers, I feel somewhat out of my depth. Monads this, tail recursion optimization that, and immutability everywhere. Suddenly using plain old “if” statements makes me obsolete. Reading blog posts about the latest (OK, latest in my world) languages like Kotlin, Scala, and Groovy, and I feel like I slept thr...

Why Your Java Career Is Looking Better and Better [Infographic]

 Mark As Read    

Java has helped build many careers because of its popularity with developers since the past two decades. What is more exciting is that this journey is not going to slow down anytime soon. As many as 12 countries are ready to pay a high salary for Java professionals even with no experience. It is not only developed countries like US and UK but also ...

Using Web Components in Plain Java

 Mark As Read    

Many Vaadin Framework users have been wondering why we have started the pure client side Elements project. As discussed last month, the ultimate plan is to start using these Web Components based client side components in the client side of an upcoming version of the framework. In that version, you’ll have plain Java API for all Vaadin Elements and ...

Image File Corrupt T-Shirt

 Mark As Read    

Image File Corrupt T-Shirtby MalaysiaGiftsShophttp://java2everyone.blogspot.com

Java2everyone 3 days ago

Creating Maps With Named Lambdas

 Mark As Read    

The Magical Map Wouldn't it be great if we could create Java maps like this? Map<String, Integer> map = mapOf( one -> 1, two -> 2 ); Map<String, String> map2 = mapOf( one -> "eins", two -> "zwei" );

Is Inheritance Dead?

 Mark As Read    

When object-oriented programming was introduced, inheritance was the main pattern used to extend object functionality. Today, inheritance is often considered a design smell. In fact, it has been shown that extending objects using inheritance often results in an exploding class hierarchy (see Exploding class hierarchy section). In addition, several ...

An Introduction to JBehave and BDD

 Mark As Read    

Testing is an important part of any project, and there are various types of testing available. JBehave is a nice tool for behavior-driven development, which actually tests from the stakeholder perspective. If you have participated in client/user meetings to measure requirements, in the waterfall model, for example, or a Sprint planning meeting in A...

Java Annotated Monthly: Jigsaw and Java 9, Being a Better Dev, and Kotlin

 Mark As Read    

The holidays are coming, but the news never stops. This month, we have articles about Java 8, 9 and beyond, as usual, and a mixed bag of fundamentals, popular libraries, and other JVM languages. As the end of the year is a good time for retrospectives (or it would be, if we weren’t so busy trying to finish everything before all the parties), we’re ...

Java Holiday Calendar 2016 (Day 7): Access Databases With Streams

 Mark As Read    

Today's tip is about querying databases using Java 8 streams. By adding both a runtime and plugin dependency to open-source Speedment in your application's Maven POM file, you get access to standard stream implementations of all the database's tables. For MySQL, your POM file could look like this: <properties> <speedment.version="...

IntelliJ IDEA Inspection Settings for Java 8 Refactoring

 Mark As Read    

I’ve been giving a talk this year showcasing how to use IntelliJ IDEA inspections to help you refactor existing code to Java 8. The initial version of this, the one I gave at DevoxxUK (video), is base...

GroovyBlogs.org 4 days ago

Java Holiday Calendar 2016 (Day 6): Be Lazy With Java 8

 Mark As Read    

Today's tip is about lazy initialization. Sometimes, we want our classes to do only what is absolutely necessary and nothing more. Immutable classes are particularly good candidates for laziness. Speedment, a Stream ORM Java toolkit and runtime, is using Lazy internally — and you can find the complete Lazy source code here. It's free, so steal it! ...

IntelliJ IDEA Inspection Settings for Java 8 Refactoring

 Mark As Read    

I’ve been giving a talk this year showcasing how to use IntelliJ IDEA inspections to help you refactor existing code to Java 8. The initial version of this, the one I gave at DevoxxUK (video), is based on my Migrating to Java 8 Tutorial. I’ve also written before about how IntelliJ IDEA can help you write more idiomatic Java 8 code. I’m revisiting t...

Spring Data Geode Is Out!

 Mark As Read    

On behalf of the Spring and Apache Geode communities, I am extremely pleased and excited to announce the release of Spring Data for Apache Geode 1.0.0-incubating. You can get the bits from Maven Centr...

GroovyBlogs.org 4 days ago

Spring Data Geode Is Out!

 Mark As Read    

On behalf of the Spring and Apache Geode communities, I am extremely pleased and excited to announce the release of Spring Data for Apache Geode 1.0.0-incubating. You can get the bits from Maven Central by including the following dependency in either your application Maven POM or Gradle build file.

Here's What Makes Vaadin Unique

 Mark As Read    

If you follow the world of Java and Open Source, there’s a big chance that you have stumbled upon articles, videos, forum answers, talks, and code from Stéphane Nicoll. I had the pleasure of meeting Stéphane some days ago at Vaadin’s headquarters in Finland and I interviewed him about Spring Boot and Vaadin. Hi Stéphane, it’s g...

Lambda Expressions in Java 8

 Mark As Read    

Lambda expressions are the most popular feature of Java 8. They introduce functional programming concepts to Java, which is a completely object-oriented and imperative programming language. How functional programming languages work is beyond the scope of this article, but we will extract a feature that will make the difference obvious for us who wo...

Java Holiday Calendar 2016 (Day 5): CRUD Operations

 Mark As Read    

Today’s tip is an introduction on how to use open-source Speedment to expand Java 8's Streams to support Creating, Reading, Updating and Deleting database entities. Head out to Speedment's GitHub page to see how to modify your project's POM file. Once you've made the changes, you can connect to an existing database and generate Java code automatica...

A Look at the Builder Pattern

 Mark As Read    

Builder is a part of the Creational pattern family, which is useful for creating complex objects with a lot of options — where all of them aren't necessary. In short, it's great when we need customized objects with optional inputs. Let's take a real world example to understand it. A Subway shop is well-known for its customized sandwiches — as per t...

Things to Know About ArrayLists

 Mark As Read    

The ArrayList is one of the more interesting things a Java programmer can learn. If you have experience coding in Java, you should know what how to use Array or List. However, if you are new to Java, things might not be as easy. So, what is Java ArrayList?

Bad, Bad Code! (And Tips to Avoid It)

 Mark As Read    

Due to my work as an instructor, I get to review a lot of code written by students. Their code's quality is different, of course, and most of them write just fine, but sometimes, I run into piece of code that is so erroneous and buggy that it's literally unforgettable. I'm not trying to make fun of someone, hence all examples will be anonymous and ...

Abstraction: The Forgotten Child of OOP

 Mark As Read    

Abstraction as a concept is easier to implement than it is to explain. Most trainers at the college level never bother to get into the need and benefits of a feature of technology. When I was talking to a friend from the industry, I came across a startling fact — they rarely use abstraction!

NetBSD cross compilation is a marvel

 Mark As Read    

While trying to get a patched variant of NetBSD 7.0.2 to run on my Raspberry Pi 3 I had to build NetBSD many times.And it was pretty amazing how this all worked.You have a single entry point: ./build.sh And it does everything! It builds the kernel, the userland apps up to the install image you write on the microSD card.Of course, having a top-level...

Emilian Bold's blog 6 days ago

Java Holiday Calendar 2016 (Day 4): Use RemoveIf in Java Collections

 Mark As Read    

Today's tip is to use the removeIf() method (that all collection classes like List have) rather than manually iterating over the elements and removing them. For large data sets, removeIf() can be orders of magnitudes faster than other methods. It also looks much better in your code. Why? Read more here and see for yourself! In the meantime, let's s...

The $1 Solution to Avoid the Null Pointer Exception

 Mark As Read    

This post is all about the null pointer exception, which we usually counter in our everyday programming. Before diving into the nitty-gritty of null, I want to go into why I named my post the $1 solution to avoid the null pointer exception. Tony Hoare invented the null reference, later admitting that it was a billion-dollar mistake. Rather than mak...

Tribblix and the new illumos loader

 Mark As Read    

Recently, a new boot loader was added to illumos, which will in time replace the old and venerable grub that we've been using for about a decade.I've been looking at how this will impact Tribblix.The boot loader's arrival was heralded long in advance. I actually released Tribblix milestone 18 when I did to ensure I didn't have to deal with any load...

NetBSD on Raspberry Pi 3

 Mark As Read    

I have used quite successfully a Raspberry Pi 2 running NetBSD 7 as a customer proxy and I assumed 7.0.2 would run on a Raspberry Pi 3.As it turns out, the Raspberry Pi 3 ARM Cortex-A53 processor is different enough from the previous Cortex A7 processor we have on the Pi 2 that it needs some kernel changes.And while the bleeding edge NetBSD current...

Emilian Bold's blog 7 days ago

Java Holiday Calendar 2016 (Day 3): Initializing Maps in the Smartest Way

 Mark As Read    

Today's tip is how to initialize Java Maps in a type-safe way with Java 8. With Java 9, we will get even better ways of creating immutable Maps. Until then, by defining two utility methods... public static <K, V> Entry<K, V> entry(K key, V value) { return new AbstractMap.SimpleEntry<>(key, value); } public stat...

Analyzing half a million Gradle build files

 Mark As Read    

Gradle is becoming the build automation solution of choice among developers, in particular in the Java ecosystem. With the Github archive published as a Google BigQuery dataset, it's possible to analy...

GroovyBlogs.org 7 days ago

Hamburger Lover T-Shirt

 Mark As Read    

Love Hamburger T-Shirtby MalaysiaGiftsShophttp://java2everyone.blogspot.com

Java2everyone 8 days ago

Kubernetes Software Components Architecture Diagram

 Mark As Read    

For a recent innovative project we were able to work with Kubernetes 1.3 as tool for automating deployment, scaling, and management of containerized applications. In our case (micro)services. A lot of documentation is available, but I was missing a as-complete-as-possible architecture picture of all components within k8s. Or sometimes the link bet...

Tech Team Lead News 8 days ago

Discover Your Developer Fantasy Character in the "State of the Developer Nation" Survey

 Mark As Read    

We’re proud to be supporting the State of the Developer Nation Survey run by our friends at VisionMobile! This is the 12th developer survey, focusing on a 360 view of developer tools, skills and salaries. The survey features questions on topics like programming languages, platforms, app categories, new technologies, revenue models, IoT verticals -...

Groovy Calamari - Issue 58 - 2nd Dec 2016

 Mark As Read    

Comment G3Summit finished yesterday. I still need time to digest the content. However two announcements came out. First the Grails Application Forge; a Web or API callable ser...

GroovyBlogs.org 8 days ago

Java Holiday Calendar 2016 (Day 2): Favor Composition Over Inheritance

 Mark As Read    

Today's tip is to avoid inheritance. For good reasons, there can only be one super class for any given Java class. Furthermore, exposing abstract or base classes in your API that are supposed to be inherited by client code is a very big and problematic API commitment. Avoid API inheritance altogether, and instead consider providing static interface...

How to Build an Image Extraction Webapp using Java

 Mark As Read    

Our second image extraction article, this time using a java webapp.

Merging Overlapping Intervals [Code Snippet]

 Mark As Read    

I recently came across a problem of merging data with overlapping lower and upperbound data. I tried multiple approaches. The below code uses the Double Linked List approach:

Does Your Code Speak English?

 Mark As Read    

No. How? What for? No, it is not a common feature yet. There are no standard libraries for natural language processing. You won't get good answers to natural language questions with both search engines and virtual assistants (like Siri). If you intend to integrate them in your application, you can use API for Siri, Google Assistant, or Cortana. But...

Java
Welcome!
OnlyJava aggregates blogs for the Java industry.
Custom Feeds
Add any RSS feed to the information you read daily.
Blocked Feeds
Block feeds to remove blogs you’re not interested in.
Account Settings
Customize the site by adding or removing feeds.

About Us

OnlyJava is your source for all your Java news.

Have a Suggestion for Us?
Know of a Java blog that we're missing? Let us know!

Share OnlyJava.com