Subscribe: Javalobby - The heart of the Java developer community
Added By: Feedage Forager Feedage Grade A rated
Language: English
applications  book  cloud  code  development  it’s  java  methods  object  objects  private methods  project  spring boot  spring  week 
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


What the Singleton Pattern Costs You

Sat, 19 Aug 2017 05:02:00 GMT

Do you use the singleton pattern? If not, I’m assuming that you either don’t know what it is or that you deliberately avoid it. If you do use it, you’re probably sick of people judging you for it. The pattern is something of a lightning rod in the world of object-oriented programming.

You can always use Stack Overflow as a litmus test for programming controversy. Someone asked “what was so bad” about singletons, and voting, responding, and commenting went off the charts. Most of those responses fell into the negative category. Outside of Stack Overflow, people call singletons evil, pathological liars, and anti-patterns. People really seem to hate this design pattern — at least some of them do, anyway.

Oracle Opening Up Java EE

Fri, 18 Aug 2017 19:16:13 GMT

There's exciting news in the Java EE world! This morning, Oracle announced that Java EE will begin a transition to open sourcing. In case you didn't see it, here was the announcement from David Delabassee on The Aquarium:

We continue to make great progress on Java EE 8. Specifications are nearly complete, and we expect to deliver the reference implementation this summer. As we approach the delivery of Java EE 8 and the JavaOne 2017 conference, we believe there is an opportunity to rethink how Java EE is developed in order to make it more agile and responsive to changing industry and technology demands.

From Nonsense Mathematics to Awesome Visualization

Fri, 18 Aug 2017 14:06:29 GMT

Visualization is always a good way to learn things faster and make sense of conceptual things such as algorithms, mathematical formulas, or physical phenomena. You may have seen a lot of visualizations created by JavaScript and some other tools other than Java. Surely, they were more beautiful in comparison with Applets or Swing-based applications. That was true in the era before JavaFX!

Nowadays, you can create fancier UIs with JavaFX more easily. In this post, I am going to show you how to convert an abstract mathematical formula to an awesome JavaFX 3D visualization.

Solving Dependency Conflicts in Maven

Fri, 18 Aug 2017 14:06:10 GMT

Maven dependency conflicts can be really hard to solve. The purpose of this post is for readers to better understand what a version conflict is and why it is better to avoid them. I will start with a short story that most readers can probably relate to.

The Story

Firstly, imagine you have started working on a large and interesting project that uses a lot of different technology libraries that make your life easier as an engineer. As an additional benefit, Maven manages the library downloads, together with the library version of choice; so they can be easily updated. Development on the project continues, until one day you encounter a library that reduces the complexity of authentication development significantly; you then decide to include it in your project. 

Integrating Unmanaged Services in Lagom With Scala

Fri, 18 Aug 2017 10:01:01 GMT

So, you want to integrate an unmanaged service in Lagom using Scala.

Let’s first understand what an unmanaged service is first, and then we will see how we can integrate an unmanaged service with our Lagom service.

Java EE: Past, Present, and Future

Fri, 18 Aug 2017 07:01:01 GMT

In this article, you will find out about the history of the Java EE ecosystem: Where it came from and how it has changed over the last few decades. You will discover the major milestones in its development from J2EE 1.2 to its current incarnation Java EE 7 and we will peek into the future at what Java EE 8 has in store.

You will discover how to get involved with the development of the platform itself and how to join the to make an even greater contribution. Find out about the Java EE Guardians and how you can support the development and growth of the platform.

Code Smells: Deeply Nested Code

Fri, 18 Aug 2017 04:01:01 GMT

Or: I wants all your data, give it to me… my precious….

Continuing the series of code smells and what do about them, in this post, I examine some fairly innocent looking code that defies the obvious refactoring.  Although the code example itself is fairly trivial, it’s actually a symptom of a problem found again and again in this particular project: deep nesting of code. This can be for loops, if statements, even lambda expressions or inner classes, or combinations of all of the above.

Akka Message Delivery: At-Most, At-Least, and Exactly-Once

Fri, 18 Aug 2017 04:01:00 GMT

This article is the first in a series of three articles that dive into the some of the interesting aspects of messaging within distributed systems environments. While the particular focus of these articles covers messaging within an Akka distributed actor systems, the concepts covered here also apply to messaging within other distributed systems, such as messaging within microservice systems.

Object and Actor Messaging Basics

In object-oriented programming languages, objects respond to method calls. Object method calls are a form of sending messages to an object. The object philosophy is that “everything” is an object. In Akka, with its implementation of the actor model, the philosophy is that “everything” is an actor. (The term “everything” is used loosely here. Of course, not everything is an object or an actor; the idea is that these are the dominant players in these software systems.) Both objects and actors react to messages. However, things quickly diverge from there.

Concourse Caching for Java Maven and Gradle Builds

Thu, 17 Aug 2017 20:01:01 GMT

Concourse CI 3.3.x has introduced the ability to cache paths between task runs. This feature helps speed up tasks which cache content in specific folders — here I will demonstrate how this feature can be used for speeding up Maven- and Gradle-based Java builds.

The code and the pipeline that I am using for this post is available at my GitHub repo here.

New RegEx Features in Java 9

Thu, 17 Aug 2017 16:01:01 GMT

I recently received my complimentary copy of the book “Java 9 Regular Expressions” from Anubhava Srivastava published by Packt. The book is a good tutorial and introduction to anyone who wants to learn what regular expressions are and start from scratch. For those who know how to use RegEx, the book may still be interesting to reiterate the knowledge and to deepen into more complex features like zero length assertions, back references, and the like.

In this article, I will focus on the few regular expression features that are specific to Java 9 and were not available in earlier version of the JDK.

What Is (Part 1)

Thu, 17 Aug 2017 10:01:01 GMT

The JAX-RS API provides a very handy mechanism to inject a range of useful resources, such as HTTP Headers, into your endpoint. The @Context annotation is an all purpose annotation that injects instances of the following objects:

  • HttpHeaders -> HTTP header parameters and values
  • UriInfo -> Captures path variables and query parameters
  • SecurityContext -> Provides access to security related information for a request
  • ResourceContext -> Provides access to instances of resource classes
  • Request -> Precondition request processing
  • Application, Configuration, and Providers -> Provide information about the JAX-RS application environment
  • HttpServletRequest -> Provides access to the HttpServletRequest instance
  • HttpServletResponse -> Provides access to the HttpServletResponse instance
  • ServletConfig -> Provides access to the ServletConfig
  • ServletContext -> Provides access to the ServletContext

Let's examine each in turn with working code examples.

jOOQ Tuesdays: Let's Talk About Spring Data

Thu, 17 Aug 2017 07:01:01 GMT

Welcome to the jOOQ Tuesdays series. In this series, we’ll publish an article on the third Tuesday every other month where we interview someone we find exciting in our industry from a jOOQ perspective. This includes people who work with SQL, Java, open source, and a variety of other related topics.

I’m very excited to feature today Oliver Gierke, the Spring Data Project Lead at Pivotal with strong opinions on DDD and REST.

9 Best Practices to Handle Exceptions in Java

Thu, 17 Aug 2017 04:01:01 GMT

Exception handling in Java isn’t an easy topic. Beginners find it hard to understand and even experienced developers can spend hours discussing how and which exceptions should be thrown or handled.

That’s why most development teams have their own set of rules on how to use them. And if you’re new to a team, you might be surprised how different these rules can be to the ones you’ve used before.

The Best Java IDEs and What to Expect From Them [Infographic]

Wed, 16 Aug 2017 17:01:01 GMT

As you know, Java IDEs allow developers to write and debug Java programs with ease. A good IDE will have a number of features that help developers to write code easily. The features include debugging, easy editing, toggling of views, and so on.

Your choice of an IDE will depend on a number of factors — nature of the project, your team/organization’s preference, and so on. But there are some basic, non-negotiable requirements that every good IDE has to meet.

Handling Custom Objects With JAX-RS SSE API

Wed, 16 Aug 2017 13:01:26 GMT

Information sent using JAX-RS 2.1 SSE support (in Java EE 8) does not only have to be of String type – it supports Java primitives (Integer , Long etc.), JSON-B and JAX-B annotated types as well as custom objects whose encoding process (Java object to on-wire format) is defined using a MessageBodyWriter implementation

Here is a simple example you can try out – no need to setup anything except Docker !

This Week in Spring - August 15th, 2017

Wed, 16 Aug 2017 05:02:15 GMT

Hi Spring fans and welcome to another installment of This Week in Spring! It’s been a busy week! I started last week talking to a group of developers in North Carolina, then gave a VJUG presentation with Matt Raible in San Francisco, then spoke to developers in Saint Louis, then flew to New York City to shoot a video on continuous delivery for three days in a hot studio (over the weekend no less!) and now as I wing back to San Francisco I look forward to spending a blissful 14 hours on the ground before I’m off to Asia (Hangzhou, Shanghai, Beijing, Shenzhen, Hong Kong, and Singapore) for about four weeks! I’m not the only one who’s been busy, though! As usual, we’ve got a lot to cover this week so let’s get to it! My friend and Spring Framework lead Juergen Hoeller gave a talk introducing reactive programming with Spring at Devoxx PL 2017. I hope you’ll watch this one if you watch anything. My buddy Matt Raible and I did a presentation last week that looked at building progressive web applications and robust backend services with Angular and Spring Boot. Matt and I have given this talk a few times and it’s always fun. We do the talk live. I write the backend services and he writes the front-end client. I write the backend service using Apache Groovy, Kotlin, and Java. He uses TypeScript in the front-end. I think Matt’s the real hero here, of course, because even though I wrote 3 services, Matt ended up writing reams more TypeScript to get a client working! This video was crazy fun. I hope you’ll check it out. Cloud Native Java is finally done and shipping! My friend Kenny Bastani and I wrote a little book for O’Reilly - Cloud Native Java - on how to build cloud native Java applications in terms of Spring Boot, Spring Cloud, and Cloud Foundry. The book took us two years, has been reviewed a zillion different ways by folks on the Spring team, has forwards by Spring creator Rod Johnson and Cloud Foundry legend James Watters. It’s not the worst book that you could buy, and I hope you’ll consider it. Thanks so much for your patience, Spring fans! SpringOne Platform 2017, held in the Moscone center in beautiful San Francisco, CA, is in four short months! I’m going and I hope you will too. If you need more convincing, read this. If you’re already convinced then click that link for the ridiculous animated .gif that the marketing team put together! I am absolutely loving the Spring Framework 5 reference documentation I liked this pull-request. It’s by no means a definitive look at what will be supported or not supported, but the comments are interesting. It looks at what Spring Boot 2 might support HTTP 2 by default. Perhaps it’s a Java 9-only feature? Maybe there’s an appetite to explore some of the truly wretched options required to make it work on Java 8? If you have ideas or want to learn more, check out this issue! Have you seen the new Spring Getting Started guide on messaging with Google Cloud Pub/Sub? This Codecentric post looks at how to parse Java 8 LocalDate query parameters with a given date format. Matthew Casperson looks at adding Spring Security to a Spring Boot-based project. Short and sweet - just the way it should be! Nice job Matthew! This DZone RefCard is a pretty good introduction to using Google Cloud. I have really grown to like Google Cloud - it provides a lot of business-differentiating functionality all while being an amazing place to run Cloud Foundry. My friend John Willis looks at different models - PDCA and OODA - for organizational orientation; how to figure out what to do next based on what’s happened. This has nothing to do with Spring, per [...]

Default and Private Methods in Interfaces

Tue, 15 Aug 2017 16:01:01 GMT

In this tutorial, we will look at default and private methods within interfaces. Default methods were added in Java 8, allowing methods to be added to an interface that comes with a default implementation that could be used, overridden, or ignored without causing issues to existing classes that have implemented an interface.

Private methods were missing when default methods were added, preventing code from being split out into smaller methods within an interface. This is something that was a bit off-putting to me, as if you had a default method that became a bit long, there was no way to tidy it up. So now that both default and private methods can exist within an interface, we can write methods like we are used to, although if you haven’t used default methods yet, then you will first need to get past the fact that there is now actual code living in an interface.

How Memory Leaks Happen in Java Apps

Tue, 15 Aug 2017 10:01:00 GMT

One of the core benefits of Java is the JVM, which is an out-of-the-box memory management. Essentially, we can create objects and the Java Garbage Collector will take care of allocating and freeing up memory for us.

Nevertheless, memory leaks can still occur in Java applications.

7 Reasons Converting COBOL to Java to Save Cash Is a Red Herring

Tue, 15 Aug 2017 07:01:00 GMT

Companies are having discussions about reducing CPU costs through the wholesale conversion of COBOL applications to Java. Inviting as it seems at first glance, this option of reducing costs may be short-lived and is a red herring because of unrealized issues and problems that occur when converting entire applications to Java.

This first of a series of blogs starts with an overview of what’s involved in converting COBOL to Java, with emphasis on pitfalls that may not be obvious. Some information about major conversion issues is presented and discussed at a high level with references to pertinent literature.

An Intro to Spring Boot With Spring Data Mongo

Tue, 15 Aug 2017 04:01:01 GMT

Dark times are ahead for the Justice League with the formidable Darkseid coming over to conquer human kind. Batman, with the help of Wonder Woman, is on a quest to get the league together with one critical aspect missing — a proper Justice League member management system.

As time is not on their side, they do not want to go through the cumbersome process of setting up a project from scratch with all the things they need. Batman hands over this daunting task of building a rapid system to his beloved trusted Alfred (as Robin is so unpredictable), who tells Batman that he recalls coming across something called Spring Boot, which helps set up everything you need so you can get to writing code for your application rather than being bogged down with the minor nuances of setting up the configuration for your project.