Subscribe: Javalobby - The heart of the Java developer community
Added By: Feedage Forager Feedage Grade A rated
Language: English
boot  call  code  collections  endpoints  interface  java  method  methods  onion architecture  runtime images  spring boot  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


A Look at Java Collections

Mon, 27 Feb 2017 20:01:01 GMT

The Java Collections framework is an architecture for storing, managing, and manipulating collections of objects. It provides many data structures and algorithms commonly used for dealing with collections — searching and sorting, for instance. Many details about storing objects are abstracted away (meaning you do not have to deal with it in code). A unified interface is provided to manipulate them, for example for adding and removing entries.

The Collections Hierarchy

The Collections Framework is organized into a class hierarchy, which can be understood at a glance from the picture below.

Spring Boot Actuator: A Complete Guide

Mon, 27 Feb 2017 18:58:17 GMT

Spring Boot Actuator is a sub-project of Spring Boot. It provides several production-grade services to your application out of the box. Once Actuator is configured in your Spring Boot application, you can interact and monitor your application by invoking different HTTP endpoints exposed by Spring Boot Actuator such as application health, bean details, version details, configurations, logger details, etc.

Spring Boot includes a number of built-in endpoints, and you can also add your own or even configure existing endpoints to be exposed on any custom endpoints of your choice. It is obvious that all the endpoints cannot be exposed publicly, considering that there are many sensitive endpoints like beans, env, etc. Hence, Spring Boot also sets sensitive defaults to true for many endpoints that require a username/password when they are accessed over HTTP (or simply disabled if web security is not enabled). Health and info are not sensitive by default.

What's in a Name? Spelling Matters in Code

Mon, 27 Feb 2017 17:01:00 GMT

Think back to college (or high school, if applicable). Do you remember that kid that would sit near the front of the class and gleefully point out that the professor had accidentally omitted an apostrophe when writing notes on the white board? Didn’t you just love that kid? Yeah, me neither.

Fate imbues a small percentage of the population with a neurotic need to correct any perceived mistakes made by anyone. XKCD immortalized this phenomenon with one of its most famous cartoons, that declared, “someone is wrong on the Internet.” For the rest of the population, however, this tendency seems pedantic and, dare I say, unpleasant. Just let it go, man. It doesn’t matter that much.

Creating Custom JDK9 Runtime Images [Video]

Mon, 27 Feb 2017 11:01:00 GMT

For a brief overview of how to take advantage of a new feature in JDK9, namely the ability to create custom runtime images, please view the YouTube video that follows. As an addendum to this video, a recently published blog explains how the creation of runtime images can be automated inside a NetBeans project. Please check out Automating the Creation of JDK9 Reduced Runtime Images for further edification.

An Introduction to Functional Programming in Java 8 (Part 3): Streams

Mon, 27 Feb 2017 08:01:00 GMT

In the last part, we learned about the Optional type and how to use it correctly.

Today, we will learn about Streams, which you use as a functional alternative of working with Collections. Some method were already seen when we used Optionals, so be sure to check out the part about Optionals.

Onion Architecture Is Interesting

Mon, 27 Feb 2017 05:01:00 GMT

After Layered and Hexagonal architectures, the time has come to talk about their close cousin – the Onion Architecture initially introduced in series of posts by Jeffrey Palermo.

What is Onion Architecture?

As we said in the introduction, the concept of Onion Architecture is closely connected to two other architectural styles – Layered and Hexagonal. Similarly to the Layered approach, Onion Architecture uses the concept of layers, but they are a little different:

Spring Tips: Apache MyBatis [Video]

Sun, 26 Feb 2017 06:01:00 GMT

Speaker: Josh Long

Hi Spring fans! In this tip, we’ll look at mapping objects to and from SQL using Apache MyBatis and Spring Boot.

Building a Spring Boot RestController to Search Redis

Sat, 25 Feb 2017 06:01:00 GMT

I’ve just started taking a look at using Redis. I wondered what it would look like to build a simple REST interface with Spring Boot. Spring Data Redis makes this pretty simple.

First up, you need to configure a @Bean in your @SpringBootApplication class (full source is on GitHub here):

Using the Actor Model With DDD in Reactive Systems

Fri, 24 Feb 2017 20:01:00 GMT

Is the Actor Model just a new "shiny object" for developers to chase after, a fad soon to be abandoned? In fact, the Actor Model was first designed in 1973–over 20 years before brands like Yahoo! and Hotmail first showed up on the young internet. Created to address the long-term direction of computing and software development, the Actor Model is almost as old as object-oriented programming itself, and, according to Forrester Research in a recent webinar, is seeing “renewed interest as cloud concurrency challenges grow."

Fast forward to 2017, where we are faced with an online and mobile world that continues to grow exponentially, and a third wave of IoT aims to add hundreds of billions of connected devices to our lives.  To manage today’s demanding needs and to prepare for the coming wave, enterprises like Intel, Samsung, Walmart, PayPal, Hootsuite, and Norwegian Cruise Lines (read these case studies) are embracing distributed, Reactive systems deployed on hybrid cloud infrastructures. In this webinar, special guest Vaughn Vernon explains why actors are so vital to the future of developing Reactive systems. You will learn:

This Week in Spring: Spring Boot, jOOQ, and the Future of Enterprise Java

Fri, 24 Feb 2017 17:01:00 GMT

Welcome to another installment of This Week in Spring! This week, I’m in Atlanta, Georgia, for the incredible DevNexus event, and then it’s off to Geneva, Switzerland, for the Voxxed CERN event. As usual, don’t hesitate to say “Hi” if you’re around! Thomas Risberg just announced Spring Cloud Data Flow 1.2.M1 Spring IO Platform lead Andy Wilkinson has just announced the Spring IO Platform Brussels release which introduces Spring Kafka to the release train and updates several others. InfoQ’s Charles Humble takes a look at the future of Enterprise Java via the lens of the Geoffrey Moore’s Chasm metaphor in this article. Last week, in another installment of Spring Tips, we looked at how to use JOOQ with Spring Boot. Using Java FX? This nice post by Gregg Bolinger shows how to use Spring with JavaFX, and have it be your controller factory. Check out community hero Michael Simons’ German-language JAX talk introducing Spring Boot starters. Deepak Tyagi put together a nice post on building applications that carry on in the face of a cache failure using the Spring Cache abstraction. Aboullaite Mohammed put together an interesting look at using JWT with Spring Boot. It’s a good first cut! Want to test against an in-memory MongoDB database? This Brazillian-language blog explaining how to use Spring Boot and Fongo might be just for you. Matt McCandless does a nice job introducing Spring Boot in this post: “Just put them on and lace them up!” Interesting post on the OpenShift blog on how to use Spring Boot and their Hawkular APM tool. This is an interesting look at using Spring Boot with Hazelcast. Dhiraj Ray explains how to use Spring MVC (in a Spring Boot application) with Apache Tiles. Christoph Burmeister looks at how to load-balance Spring Boot applications with Nginx. This DZone post introduces basic dependency injection with Spring. [...]

Editable Tables in JavaFX

Fri, 24 Feb 2017 11:01:01 GMT

After hearing my colleague constantly talking about the editable grids that the company I work at designed a long time ago, I decided to do something to make him proud of me. So I wrote an application that creates an editable TableView in JavaFX that can be used to brainlessly enter in data, if that’s what you want to do. Unfortunately, JavaFX didn’t want to make this nice and simple, and I even found a bug in the JavaFX code while writing the example code… So buckle up, as there is a lot of code in this post. And don’t worry, I’ll put some explanations and even pictures in so you don’t get lost.

Check out Making Apps with JavaFX if your need some background knowledge in what will be explained in this post.

Tournaments and the Random Generator

Fri, 24 Feb 2017 08:01:00 GMT

As the college basketball season winds down, teams across the United States prepare for what is called March Madness. March Madness is the name that has been given to the National Collegiate Athletic Association (NCAA) men's basketball tournament to determine the championship team for a given season. There is also a tournament for the women's NCAA basketball teams as well.

How the Tournament Works

Beginning in 1985, March Madness has been designed as a 64+ team, single-elimination tournament. There are four brackets of 16 teams, which are seeded so that the first team in the bracket plays the sixteenth team in the bracket. Doing so is intended to build up excitement as the better teams face each other later in the tournament.

Should I Implement the Arcane Iterator.remove() Method? Probably.

Fri, 24 Feb 2017 05:01:00 GMT

An interesting question was asked on Reddit's /r/java recently:

Should Iterators be used to modify a custom Collection?

Paraphrasing the question: The author wondered whether a custom java.util.Iterator that is returned from a mutable Collection.iterator() method should implement the weird Iterator.remove() method.

Git Guilt, Blame, and Code Review

Thu, 23 Feb 2017 21:01:00 GMT

I've been doing a bit of traveling lately on the second leg of the Getting Git Right tour. It's been a blast meeting so many devs from around the world. It's been particularly incredible to see how much git adoption has grown amongst attendees in the few months since we did the first leg of the tour. When we presented in July, almost all attendees raised their hand when we asked, "Who's using git?"

However, there is one low point during every evening that I've hosted: the moment after I ask the question "Who's doing code review at work?"

Spring Boot RestController Error: “No Converter Found for Return Value of Type”

Thu, 23 Feb 2017 17:01:00 GMT

Spring Boot RestControllers, by default, can return a POJO class as the return result from a mapped request method, and it is converted into a JSON result. I’ve run into this issue before though, and it’s not immediately obvious what’s wrong: ‘No converter found for return value of type’:

java.lang.IllegalArgumentException: No converter found for return value 
of type: class kh.springboot.redis.domain.RedisResult
at org.springframework.web.servlet.mvc.method.annotation
.writeWithMessageConverters( ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]

Interface Enhancement in Java 8

Thu, 23 Feb 2017 11:01:00 GMT

Interface was meant to define a contract before Java 8, where we were able to define the methods a class needed to implement if binding himself with the interface. Interface was only involved with abstract methods and constants.

But in Java 8, Interface has become much more, and now it can have methods defined using static or default. Remember that default methods can be overridden, while static methods cannot.

Groovy Goodness: Using The Call Operator

Thu, 23 Feb 2017 08:01:00 GMT

In Groovy, we can add a method named call to a class and then invoke the method without using the name call. We would simply just type the parentheses and optional arguments on an object instance. Groovy calls this the call operator: (). This can be especially useful in for example a DSL written with Groovy. We can add multiple call methods to our class, each with different arguments. The correct method is invoked at runtime based on the arguments.

In the following example, we have a User class with three call method implementations. Next, we see how we invoke the call methods, but without typing the method name and just using the parenthesis and arguments:

How to Avoid Messy Code

Thu, 23 Feb 2017 05:01:00 GMT

Few programmers explicitly intend to write poorly structured source code.

They don't sit down, whip out their Bad Code Design Patterns book, and wreak meticulous spaghettipocalypse. Rather, poorly structured code is what happens when programmers don't know what they're doing.

RuleBook: A Simple Rules Engine That Leverages Java 8

Wed, 22 Feb 2017 20:01:00 GMT

Early this year, I was leading the development efforts of a project that had acquired a lot of technical debt in the form of business rules. Like many projects in their early stages, these business rules were defined in a growing tangled mess of if/then/else statements. It didn't take long before it was obvious that all of those tightly coupled if/then/else rules needed an abstraction where each rule could be defined independently, while still somehow chained together. 

Finding the Perfect Rules Engine

First, we looked at Drools, but we quickly decided that Drools was much more than we needed. Besides that, many developers were unfamiliar with Drools. So, Drools would be yet another technical hurdle on a project that was already using a slew of new tech and with a team that was still struggling to keep up.

A Quick Overview of Optionals

Wed, 22 Feb 2017 17:01:00 GMT

We can limit the opportunities for NullPointerExceptions by following good practice like:

  • Don’t return nulls from methods
  • Don’t pass nulls as arguments

Another tool is to use java.lang.Optional. Java 8 Optionals formalize the approach used in other languages (and that already existed in some Java libraries). Optional is simply an object wrapper. The key to its use is to use the methods in the Optional classes.