Skip to main content
View Archives: Homepage | Spotlights | Articles | Weblogs

java.net Spotlight

There are three ways to create new objects in Java programming language: * The telescoping constructor (anti)pattern; * The Javabeans pattern; * The builder pattern. I prefer the builder pattern over the other two methods. Why? Joshua Bloch described the builder pattern and the benefits of using it in Effective Java. He did an excellent job and I will not repeat these benefits in this blog post. Instead, I will describe three other reasons why I prefer the builder pattern over the telescoping constructor pattern and the Javabeans pattern. 1. It Helps You to Enforce Better Design...

[02/09/2014]

If you’re used to writing Groovy, this may appear “so 2003″ to you. We know. Groovy has known a very useful way to write string-based SQL since its early days. Here’s an example written in Groovy... Note also Groovy’s built-in String interpolation, where you can put expressions into strings. But we’re in Java land, and with Java 8, things get better in the Java / SQL integration as well, if we’re using third-party libraries, instead of JDBC directly...

[02/07/2014]

With Java 8 only round the corner (available in March), we wanted to give you a session on Java 8 and what is new that you can play with. Simon Ritter, the head Java Evangelist at Oracle, presents to us what has changed since Java 7, including lambdas, default methods, Streams and much much more. Descriptions and discussions are followed up with code samples and examples of how the new functionality can be used...

[02/05/2014]

When I talk about jOOQ at conferences, I always show this slide containing a bunch of very common JDBC mistakes that people often commit... Can you find the bugs? Some of them are obvious... But then, there’s another very subtle bug that most people are unaware of because the fix was only possible since the upgrade in Java 6 / JDBC 4.0. See the solution, below...

[02/04/2014]

The week of January 20, the International Oracle User Group Community (IOUC) met at the Oracle Redwood Shores campus for their annual leadership summit. The IOUC is a community of leaders representing Oracle users groups worldwide. Members include leaders from over 900 user groups representing individual countries in Europe, Middle East, Africa, Latin America, Asia Pacific, and North America...

[02/03/2014]

Hardware Transaction Memory has the potential to allow multiple threads to speculatively access the same data structure at the same time and let the cache coherence protocol determine if a conflict occurred. HTM aims to give you the scalability of fine grain locking, the simplicity of course grain locking, and performance close to no locking at all...

[02/02/2014]

We all know that writing code is the easiest part of application development. Tracking down problems, and especially those related to performance and concurrency, is what’s tricky. While I was always aware that the Java Virtual Machine provided great forensics tools, it was only when I worked with Python and C++ for three years that I was confronted with the sad reality outside of Java land. That reality is best summarized as: “You’re on your own dude, good luck!” Since there’s really not much to compare the Java profiling tools to...

[01/31/2014]

At the gamification session of the International Oracle User Group Community (IOUC), leaders discussed how to drive membership. Typically, they give away licenses, books and goodies to encourage attendance at monthly meetings. Others have used gamification to get their communities to brainstorm on mascot names, or post pictures and comments on social media... “Turn life into a game, drive engagement of audiences, make the experience more enjoyable and get users to come back ” are the key advantages of gamification according to user group leader Jim Bettencourt...

[01/29/2014]

The previous Java.next installment compared and contrasted functional coding styles in Scala, Groovy, and Clojure. This article delves more deeply into the filter, map, and reduce functions in the Java.next languages. A series of short coding examples help you to sort out the somewhat confusing differences in how the three languages name these key functional constructs...

[01/28/2014]

There is a lot of interest in the IoT trend, so it wasn't surprising that the "Internet of Things" session was full that at the Oracle International User Group Leader Summit. (The IOUC was held last week at Oracle's Headquarters in Redwood Shores, CA, and included over 20 Java User Group leaders.) Sharat Chander, Principal Product Director at Oracle, assembled a panel of experts to discuss IoT...

[01/27/2014]

Simply put, big data is a big deal. As the volume, velocity, and variety of big data continue to increase, so do the opportunities for creating new applications for big data. The new issue of Java Magazine is all about big data. The good news is that Java developers are well positioned to take advantage of this opportunity because so many of the tools for big data are built on the Java Virtual Machine (JVM)...

[01/26/2014]

In the air traffic management (ATM) domain, System Wide Information Management (SWIM) is a new open standard-based information infrastructure which will connect all ATM stakeholders, aircraft as well as all ground facilities. In the recently held annual SWIM innovation contest, where innovations in software related to this domain are highlighted, Barco Orthogon won the top prize, in one of the two categories, namely "applications", with a NetBeans Platform solution....

[01/25/2014]

Congratulations to the newest Star Spec Lead, Brian Goetz. Brian is the Spec Lead for JSR 335, Lambda Expressions for the Java Programming Language, and won the 2013 Outstanding Spec Lead Award as part of the 11th Annual JCP Program Awards during JavaOne 2013. JSR 335 is part of upcoming release of Java SE 8, the next version of the Java Platform, Standard Edition, and...

[01/22/2014]

Now that the confetti has settled, I thought it would be a good time to talk with industry mavens about what lies ahead in the coming year for developers, both the challenges and the opportunities. Not surprisingly, many of the industry watchers I spoke to agreed that machine-to-machine learning (M2M) and the Internet of Things (IoT) offered enormous opportunities for developers to get into the embedded space...

[01/21/2014]

Interfaces are completely abstract classes in Java that provide you with a uniform way to properly delineate the structure or inner workings of your program from its publicly available interface, with the consequence being a greater amount of flexibility and reusable code as well as more control over how you create and interact with other classes. More precisely, they are a special construct in Java that allows you to perform a kind of multiple inheritance i.e. classes that can be upcast to more than one class...

[01/20/2014]

The most popular technical articles published on OTN in 2013 shows the variety in Java technologies. The top article, by a large margin, was about the internet of things. The rest of the list shows lots of interest in the new Java EE 7 functionality. In honor of the upcoming Java SE 8 release, here are the top 8 articles of 2013...

[01/19/2014]

Lambda expressions have taken the programming world by storm in the last few years. Most modern languages have adopted them as a fundamental part of functional programming. JVM based languages such as Scala, Groovy and Clojure have integrated them as key part of the language. And now, Java 8 is (finally) joining in on the fun...

[01/17/2014]

The JCP 2014 Calendar has been published with some key dates for the coming year. Look for the 2013 Year in Review next week! There were four Java SE 8 JSRs that passed their JSR Public Review ballots, and subsequently published Proposed Final Draft milestones as of yesterday, and eight JSR Maintenance Review ballots that passed JCP EC vote. Also this week, the JSR 354, Money and Currency API, Public Review, led by Credit Suisse, is on the JCP EC ballot...

[01/15/2014]

The Java Development Kit 7 Update 51 (JDK 7u51) release with JavaFX 2.2.51 is available and can be downloaded from the Java SE Downloads page. For information about this release, see the JDK 7u51 Release Notes. Documentation has been updated for the following changes to the JDK...

[01/14/2014]

The second part of the Java EE 8 Community Survey is now open! During the last 5 weeks, we have been positively surprised by the community responses on the first part of the survey. We have received a lot of valuable feedback! Thanks to all who participated! If you haven't, there still time to answer Part 1. Thanks in advance for helping us to set the initial directions of Java EE 8 by participating in Part 2 of the Community Survey...

[01/13/2014]

Google Guava is an useful library that offers many different but unrelated features... However, this article is not about those features but about offering a single heavyweight Uber JAR for all. From Google’s point-of-view, providing an Uber library for all projects makes sense... However, from my point of view, this is just making my applications heavier. Cohesion is at the root of good software development...

[01/12/2014]

At Data Geekery, we love Java. And as we’re really into jOOQ’s fluent API and query DSL, we’re absolutely thrilled about what Java 8 will bring to our ecosystem. We have blogged a couple of times about some nice Java 8 goodies, and now we feel it’s time to start a new blog series, the… Java 8 Friday. Every Friday, we’re showing you a couple of nice new tutorial-style Java 8 features, which take advantage of lambda expressions, extension methods, and other great stuff...

[01/10/2014]

On December 27th, I did a virtual session via Google Hangout on the Java API for WebSocket (JSR 356) for JogloCon 2013. Organized by JUG Joglosemar, JogloCon is one of the largest Java conferences in the Yogyakarta area of Indonesia. This year, the conference focused on everything Java EE! Enjoy the slideshow below of the conference...

[01/08/2014]

What you should know before installing an agent, and how it affects your code - When building a scalable server-side application we spend considerable amount of time thinking about how we’ll monitor, operate and update our code in production. A new breed of tools have evolved to help Java and Scala developers do just that. Many of them are built on one of the most powerful ways in which external code can integrate with the JVM at runtime – Java agents.

[01/07/2014]

Twitter4J is a Java wrapper around Twitter API. While Twitter supports simple request-response interactions, in this article we will explore streaming APIs. In contrary to request-response model which is always initiated by the client, streaming API pushes data from Twitter server to the clients as soon as they are available... The question is, how would you design a Java API for streaming purposes? No surprise here: callbacks...

[01/06/2014]

An essential part of a well-written unit test is a well-written assertion. The assertion states the behavior you expect out of the system. It should tell you at a glance what a test is trying to demonstrate. It should be simple and obvious. You should not have to decipher conditional logic or sift through for loops to understand what it is doing. In addition, any non-trivial logic in a test case increases the risk of the test itself being wrong...

[01/05/2014]

It's around this time of year that people ask you to make predictions for what'll happen in the middleware market in the New Year. There's something about Christmastime that makes you throw away your usual caution and allow yourself to make predictions about technology futures, something that is fraught with danger and the potential for personal humiliation a year from now. Well, here go my predictions for Java middleware in 2014...

[01/04/2014]

We’re all used to employing reflection in our everyday work, either directly, or through frameworks that leverage it. Its a main aspect of Java and Scala programming that enables the libraries we use to interact with our code without hard-coded knowledge of it. But our use of reflection is only limited to Java and Scala code that runs inside the JVM. What if we could use reflection to look not only into our code at run-time, but into the JVM’s code as well? When we began building Takipi...

[01/02/2014]

At the end of each calendar year, I like to summarize some of the most significant developments in the software development industry that happened during the year that is ending. The choice of these is entirely subjective and obviously colored by my own experience, background, perceptions, and preferences... I now present the developments in software development that I consider most significant in 2013...

[01/01/2014]

JAX-RS 2.0 aka JSR 339 not also specifies the API to build up a RESTful webservice but also enhances the client side API to easen up the process of writing a client for a REST service. In the following tutorial we’re building up a client for a ready-to-play REST service and explore the different new options, e.g. ...

[12/30/2013]