Java Lobby Announcements

Subscribe to Java Lobby Announcements feed
Recent posts in Java on
Updated: 12 hours 22 min ago

A Little Lazy Lambda Tutorial

Mon, 2017-05-01 13:01

Everyone is a bit lazy, so why not our code? Lambda expressions in Java 8 allow us to make our code that bit lazier, In this short post, I will cover how using Lambda expressions can make code more lazy.

If you have not used Lambda expressions before have a look at my some of my previous posts A Little Lambda Tutorial and Java 8 Streams for some background information not in this post.

Categories: Java

Java 9 (Part 5): Flow With the New Reactive Streams, First Look

Mon, 2017-05-01 10:01

Welcome back to my Java 9 series! We are going to cover another cool and new concept in Java 9 — a concise interface for Reactive streams, which contains the ability for non-blocking back pressure. You see, Reactive streams are all around us in all up-to-date languages and libraries. The main challenge, however, in Reactive streams is not the implementation, but a concise interface. Let's see how Java 9 will handle it.

Java 9 Reactive Streams

The main components of Java 9 Reactive streams are:

Categories: Java

Building, Packaging, and Distributing Java EE Apps in 2017 (Part 1)

Mon, 2017-05-01 07:01

A few decades ago, in this very galaxy, the first computer languages and compilers were written, enabling developers to create programs faster and in comfort. Quickly, quite a lot of programs were created. The more observant programmers could not unsee that many problems repeated across those programs. The same solution to the very same problem was written again and again. The solution was simple -> write the repeating code once and only use references in the new code that was actually different and solved something new. For example, GUIs: Many programs spawn new windows with forms inside them. Therefore, the code to create GUI elements was separated and reused.

However, that is not the end to our problems. As every developer knows, for a program’s instructions to be executed, they must be loaded into memory from a persistent state. Then they go into a CPU’s memory and are then executed by the CPU. So, developers were no longer writing repeating parts again and again, but those parts still had to be shipped with the code, because the resulting instructions were, of course, required for the program to run correctly. If the same example with GUI libraries is used, the library had to be become part of the resulting program translated by the compiler into something executable by the target machine. So, at compile time — actually, in the last phases of compilation — those libraries were included in the resulting “executable program package.” Such programs could be distributed.

Categories: Java

The Tale of ‘Tail Recursion’

Sun, 2017-04-30 08:01

Recursion in computer science is a method where the solution to a problem depends on solutions to smaller instances of the same problem (as opposed to iteration).

Recursions are really cool and highly expressive. For example, consider this factorial function:

Categories: Java