Java Lobby Announcements

Subscribe to Java Lobby Announcements feed
Recent posts in Java on DZone.com
Updated: 5 hours 52 min ago

New Language Features on the JVM

Wed, 2016-05-18 12:31

Recently, I have noticed a trend where former Java developers are currently writing code for the JVM but not in Java. Full disclosure, I am one of them. We are using other languages like Scala or Clojure in place of Java.  Even newcomers like Kotlin and Xtend are getting support. So why, after Java has dominated the enterprise landscape for so many years, is there an explosion of new languages and features targeting the JVM. Furthermore, why are Java developers now using these new languages to write their software. Taking some time to look at what these new languages have in common can shed some light on why developers are moving to these new languages to program in.

Functions as Parameters

This has been one of the biggest features missing from Java so a very long time.  All of the new languages make it very clear that this feature is one of the main reason to use their language to write your software with. The consistency of these new languages all keying in on this feature signifies that it is a very important feature for the future.  Even with Java 8, functions as parameters support is a bolt on to the language and is currently limited in 3rd party library usage to date.

Categories: Java

Excerpt: Developing Reactive Microservices With Java

Wed, 2016-05-18 07:31

I am very happy to announce that I finished another O'Reilly Mini-Book a couple of weeks ago. After the success of the very first edition which introduced you to the overall problem space of microservices and the amazing book by Jonas Bonér about the architecture of reactive microservice systems, it was about time to share a little more about how to implement them in Java. I am very proud to have had Jonas write the foreword for this one and that I was able to write another 50+ pages in such a short time. The book uses Lagom as a framework to walk you through the service API, persistence API, and show you how to work with Lagom-Services. I can't wait to hear your feedback and get you to try out Lagom. Here is the complete abstract and you'll find some further reading and links at the very bottom of the post. Did I mention, it is free to download? It is! 

Abstract

With microservices taking the software industry by storm, traditional enterprises running large, monolithic Java EE applications have been forced to rethink what they’ve been doing for nearly two decades. But, how can microservices built upon reactive principles make a difference?

Categories: Java

Immutable Data Structures in Java

Tue, 2016-05-17 14:31

Before we are software developers, we are people – and thus creatures of habits. It’s hard for someone to change one’s own habits, it’s harder for someone to change someone else’s habits – and for some of us, it’s even harder.

This, week, during a code review, I stumbled upon this kind of structure:

Categories: Java

Test Methods Must Share Nothing

Tue, 2016-05-17 14:31

Constants... I wrote about them some time ago, mostly saying that they are a bad thing, if they are public. They reduce duplication, but introduce coupling. A much better way to get rid of duplication is by creating new classes or methods—a traditional OOP method. This seems to make sense, and, in our projects, I see less and less public constants. In some projects, we don't have them at all. But, one thing still bothers me: unit tests. Most programmers seem to think that when static analysis says that there are too many similar literals in the same file, the best way to get rid of them is via a private static literal. This is just wrong.

Unit tests, naturally, duplicate a lot of code. Test methods contain similar or almost identical functionality and this is almost inevitable. Well, we can use more of those @Before and @BeforeClass features, but sometimes it's just not possible. We may have, say, 20 test methods in one FooTest.java file. Preparing all objects in one "before" is not possible. So, we have to do certain things again and again in our test methods.

Categories: Java

The Top 10 Advanced Java Talks You Should See to Stay Relevant

Tue, 2016-05-17 12:31

Learn from the experts: watch some of the best Java videos available online!

One of the main resources for learning about new things in software development is online talks and videos. You can find Java experts sharing their experience with you, without getting off the couch.

Categories: Java

Rapid REST API Development With Dropwizard

Tue, 2016-05-17 12:31

As a developer, you all know about REST APIs. There are tons of frameworks available in Java to develop RESTful web services. Jersey, RESTeasy, and Spring are some of the popular frameworks available in the market. Have you ever felt your REST API development process was set up in a straight forward way? Probably not!

But one framework which I evaluated recently has mostly positive aspects, and it allowed me to focus on my business problems instead of the plumbing work to prepare the infrastructure. This is none other than “Dropwizard

Categories: Java

Comparing Xamarin and Codename One

Tue, 2016-05-17 09:01

First, let's start with a big disclaimer: I'm the co-founder of Codename One so calling me biased would be an understatement. Having said that I would not have bothered comparing Codename One to Xamarin had I not thought that Xamarin is an excellent tool. 

Xamarin is an amazing product that I contrasted with Codename One in the past, but this is worth repeating. On its surface, Xamarin might seem like a similar tool to Codename One that uses C# instead of Java, but this is misleading because the tools are so different conceptually that they have very little in common.

Categories: Java

DZone's MVB of the Month: Erik Dietrich

Tue, 2016-05-17 04:01

This month we caught up with Erik Dietrich, whose content you will regularly find in both Agile and DevOps zones. Erik has a wealth of experience in software development and runs a consultancy while also producing books and video content. See how he balances it all in our interview.

DZone: Can you introduce yourself to our readers? 

Categories: Java

What Does Oracle v. Google Mean to You?

Mon, 2016-05-16 22:24

I remember feeling a great disturbance in the force back in 2010 when Oracle acquired Sun. I remember the groans and complaints of friends and colleagues, none of whom really developed software professionally. The fact that there was such pathos around an event that didn't affect these people's daily lives was odd. But it made sense. I myself felt a sense of worry for what the acquisition would mean for my favorite language.

You likely know that there is a(nother) Oracle v. Google lawsuit in court right now. That again, Oracle is claiming copyright infringement from Google on several APIs used in Android. And maybe that in 2012 the US Court of Appeals set precedence for the "copyrightability" of APIs; not necessarily single elements of an API, but at least the "overall structure of... API packages," which they deemed "creative, original, and '[resembling] a taxonomy.'"

Categories: Java

IntelliJ IDEA 2016.2 EAP Is Open

Mon, 2016-05-16 18:52

Great news, everyone: we’re opening IntelliJ IDEA 2016.2 EAP, a preview of the next IDE update planned for this summer! Besides fixing issues, we’ve also stayed busy working on new features that we hope you’ll like.

New feature highlights include:

Categories: Java

The End of Java.net Forge and Project Kenai

Mon, 2016-05-16 15:16

The overwhelming popularity of GitHub continues to lead to the demise of other, often much older project hosting sites. The recent confirmation of a 2015 announcement that "Kenai.com site will be closing permanently on April 28, 2017" and associated Java.net Forge Sunset is not terribly surprising given the previous shuttering of once-popular project-hosting sites such as Codehaus and Google Code. Back in 2010, there was the blog post announcement that Project Kenai was moving to Java.net after originally apparently communicating plans to close Kenai to outside projects.


Some projects have already moved (starting in 2010 with the previously mentioned announcement that was changed later) or have begun moving off of Kenai and Java.net and most of them, not surprisingly, seem to be moving to GitHub. Examples of these include Java Native Access (JNA), jawr, and MonkeyBars.

Categories: Java

The Basics of Akka

Mon, 2016-05-16 14:31

As the previous post explained, our system is based on Akka. Before going into more detail about our solution, I'd like to explain what Akka is about and why it is so awesome.

Akka is a toolkit and not a framework; you can simply use the bits that you need for your service. In this series, we'll focus on the core features and we won't go through Akka Streams, Akka-Http or Akka Cluster (since they're out of scope, not because they're not fantastic).

Categories: Java

ANTLR and Jetbrains MPS: Parsing files and Displaying Their ASTs Using Tree Notation

Mon, 2016-05-16 12:31

Itemis did it again: they just released a new, very cool plugin for Jetbrains MPS. This one allows you to define new tree editors.

They look like this:

Categories: Java

Scala EE: Bring the Hate

Mon, 2016-05-16 10:31
"Scala EE" or "Probably the fastest way to get hated by both functional programmers and enterprise devs"

Java is old. It's really, really old. In fact, most of today's students did not exist by the time it was released. Still, Java is the most popular enterprise language ever, and Java EE makes it even better providing a centralized way of creating the entire environment your application is intended to be run in. But it's still old. Java works well for kinda old-school people like me—I'm okay with declarations like the following:

public class Task implements Callable<String>, Serializable { @Override public String call() { String result = doSomething(); return result; } }

If you agree the snippet above is good, then you're probably, well, "old." We're not always old in a physical manner (well, not all of us, at least), but we recall those times we were sitting next to our company's review desk complaining about "those kids who broke it all again." We know verbosity saves the day and implicit mixins are the root of all evil, but everything is moving forward and our industry does as well. In fact, Java EE has figured it out a long time ago: CDI answers dependency injection and events handling, JAX-RS moves focus out of monstrous JSPs, async Servlet 3.0 knocks into JDBC drivers developers' doors and so on.

Categories: Java

Java Code Challenge: Node Degrees

Mon, 2016-05-16 09:01

Java Code Challenge is a new weekly segment taking the best challenge from Reddit's dailyprogrammer. Things are a little different here as we're focused on Java. A working solution is not enough; we're looking for the cleanest Java code with tests. 3rd party libraries are welcome but if you can do it without it will be easier for others to comprehend.

If you can fit your solution in the comments then go for it, but preferably put your answer in GitHub and link in the comments. Next week we'll be sharing the best solutions and sharing the best code practices we see!

Categories: Java

JavaServer Faces in Real-Life Applications

Sun, 2016-05-15 12:31

JavaServer Faces (JSF) is the current front-end technology for building web-based applications in the Java Enterprise Edition platform (JavaEE).

In this article, we will talk about the requirements and recommendations that should be taken into consideration for building production-ready JSF applications, including development environment setup and preparation, prototype and design, development and troubleshooting, and performance tuning.

Categories: Java

Customizing Spring Roo tagx

Sun, 2016-05-15 09:01
Do You Know How to Customize Spring Roo tagx? 

Spring Roo offers you the possibility of customizing the code that it generates with the purpose of extending its functioning. Sometimes you need to apply modifications over the tagx files defined by Spring Roo, because you need some operations that currently these tagx don’t accomplish. This is the main subject of this article: how can you customize tagx files?

To explain how to do it, I will use an example based on Spring Roo project. You will need:

Categories: Java

Garbage Collection Logging: Which Time Matters to the Customer?

Sat, 2016-05-14 12:31

In the Garbage Collection log file, 3 types of time are reported for every single GC event:

  • ‘user’
  • ‘sys’
  • ‘real’

Example: [Times: user=11.53 sys=1.38, real=1.03 secs].

Categories: Java

Java 8: Declare Private and Protected Methods in Interfaces

Sat, 2016-05-14 09:01
Learn How to Declare Private and Protected Methods in Java 8 Interfaces

When Java 8 was introduced, we could use default methods in interfaces. The main driver for this feature was to allow expansion of an interface while retaining backward compatibility for older interface versions. One example is the introduction of the stream() method in the existing Collection classes.

Sometimes, when we want to introduce several default methods, they may share some common code base and then it would be nice if we could use private methods in the interface. This way, we can reuse our code and also prevent it from being exposed to classes that are using or are implementing the interface.

Categories: Java

Using YAML in Spring Boot to Configure Logback

Fri, 2016-05-13 13:35

When it comes to logging in enterprise applications, logback makes an excellent choice – it’s simple and fast, has powerful configuration options, and comes with a small memory footprint. I have introduced logback in my introductory post, Logback Introduction: An Enterprise Logging Framework. YAML is just one option you can use for Spring Boot configuration. In a series of posts on logback, I’ve also discussed how to configure Logback using XML and Groovy and how to use Logback in Spring Boot applications. The posts are available as:

In my earlier post on Using Logback with Spring Boot, I used a properties file to configure logback. In this post, I’ll discuss how to configure Logback using Spring Boot’s YAML configuration file. If you’re a seasoned user of the Spring Framework, you’ll find YAML a relatively new configuration option available to you when using Spring Boot.

Categories: Java

Pages