Subscribe: Javalobby - The heart of the Java developer community
http://www.javalobby.org/rss/rssthreads.jsp?forumID=61
Added By: Feedage Forager Feedage Grade A rated
Language: English
Tags:
attribute  command line  command  counter  gradle  java  line  object oriented  object  option  part  spring  task  web app  web 
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 DZone.com



 



Finally! A Web App (Part 6, Finale)

Sun, 25 Sep 2016 05:01:00 GMT

Today we will finish (for now) our most recent iteration of our Shape Calculator component (or service, if you will). We have been on a long journey to this point.  Once we are done, we will move onto:

  • SOAP services.




Is Everything an Object?

Sat, 24 Sep 2016 07:01:04 GMT

I have been reading two great books, Object Thinking by David West and Clean Code by Robert C. Martin. In these two great books, the authors mention the phrase: “Everything is an object.” What caught my attention was that both express very different thoughts about this phrase. In his book, David West affirms that everything is an object and is a prerequisite if you want to be part of the object thinking culture. On the other hand, in his book, Robert C. Martin, says: “Mature programmers knows that the idea that everything is an object is a myth. Sometimes you really do want simple data structures with procedures operating on them”.

A bit of background of these two gentlemen. Robert C. Martin has written many books on software development, agile methodologies, and object oriented design and has founded Object Mentor, which is a company for mentoring and consulting on object oriented technologies. David West, Ph.D., is a consultant, educator and trainer in object oriented technologies. He founded and directed the Object Lab at the University of St. Thomas and cofounded the original Object Technology User Group.




Finally! A Web App (Part 5)

Sat, 24 Sep 2016 05:01:04 GMT

Introduction

Hopefully, you have been following along in this series of articles, and we are in the final stages of this iteration of a web-enabled Shape Calculator app. We have been pretending to enhance some in-house code that started out in your development team. I chose the Shape Calculator, but it could be anything.

Our first two rounds of the application were both command-line-interface and menu-driven.




New In Spring 5: Functional Web Framework

Fri, 23 Sep 2016 11:01:14 GMT

As mentioned yesterday in Juergen’s blog post, the second milestone of Spring 5.0 introduced a new functional web framework. In this post, I will give more information about this framework.

Example

We start with some excerpts from our sample application. Below is a reactive repository that exposes Person objects. It is quite similar to a traditional, non-reactive repository, except that it returns Flux where you would return a List traditionally, and Mono where you would return a Person. Mono is used as a completion signal: to indicate when the save has been completed. For more information on these Reactor types, refer to this blog post.




Spring(boot)ing to the Web With Java and Pom.xml

Fri, 23 Sep 2016 10:01:01 GMT

This blog presents instructions on how to quickly get started with Spring Boot Hello World with just one Java file and a Pom.xml.

Before getting to the files, make sure you have installed and configured the following:




Correcting the Server Shutdown Process: A Web App Detour (Part 2)

Fri, 23 Sep 2016 09:01:01 GMT

Introduction

In Part 1, we discussed the issue of resources not being cleaned up during shutdown and how to do this while dealing with the Root context and the Servlet context. If you want to actually try all this, check out the other article, as it has all the code.

How to Release Resources

We have our ShapeCalcServletContextListener that implements ServletContextListener, and we know that it has references to the two resources we are concerned about at shutdown:




How to Recognize Dates in PDFs

Fri, 23 Sep 2016 07:31:01 GMT

One of the “pleasures” of having your own business is dealing with accounting.

Now, to survive, I tried a few things like:




Java DSL for Spring Integration 1.2 Milestone 2 Is Available

Fri, 23 Sep 2016 06:31:01 GMT

I’m pleased to announce that the Java DSL for Spring Integration 1.2 M2 is available now!

First of all, I’d like to thank everyone who created issues, raised Pull Requests, provided feedback or just asked questions on StackOverflow. Especial thanks for early adopters since the previous Milestone 1. With their help, we have improved and fixed some issues with runtime flow registration.

The artifact org.springframework.integration:spring-integration-java-dsl:1.2.0.M2 is available in the Milestone repo. So, give it a shot and don’t hesitate to raise a GH issue for any feedback!




Functors in Scala

Fri, 23 Sep 2016 05:01:15 GMT

While programming in Scala, we often come across a term called a functor. A functor is an extremely simple, but powerful concept. In this blog, we'll discuss that in more detail.

Theoretically, a functor is a type of mapping between categories. Given two categories, A and B, a functor, F, maps the objects or entities of A to the objects or entities of B. We can simply call it a function of objects or entities.




Gradle Goodness: Use Command Line Options With Custom Tasks

Thu, 22 Sep 2016 13:55:37 GMT

Suppose we have a custom task with some properties that can be configured. Normally, we would add the configuration in the build script. But we can also use command line options to configure a task. So when we run the task from the command line, we can provide a configuration value for the task on the command line. To see which command line options are available for a task, we can use Gradle's built-in task help followed by the option --task and the task name. To indicate a property as a command line option, we use the @Option annotation. We can specify the name of the command line option, a short description, and also the order that is used to display the options with the help task.

Let's create a sample custom task and use the @Option annotation. In the following build file, we create a custom task GenerateVersionFile. This task generates a file with a default name of version.txt in the build/ directory. The file contains the project version value. We make the property that defines the output filename as a command line option. This way, the name can be defined when we run Gradle (and still, of course, using the default configuration in a build file).




Java Code Challenge: Chemical Symbol Naming (Part 2) — Solution

Thu, 22 Sep 2016 10:01:04 GMT

If you need a reminder of what's involved in the challenge, check out the article here.

This week's challenge was a nice, easy one, assuming you had completed part one of the challenge, as it was very much leveraging the same code.




Can We Have OOP Without Classes?

Thu, 22 Sep 2016 09:01:19 GMT

I interviewed David West, the author of the Object Thinking book, a few weeks ago, and he said that classes were not meant to be in object-oriented programming at all. He actually said that earlier; I just didn't understand him then. The more I've thought about this, the more it appears obvious that we indeed do not need classes.

(image)
Battleship Potemkin (1925) by Sergei M. Eisenstein

Here is a prototype.




Correcting the Server Shutdown Process: A Web App Detour (Part 1)

Thu, 22 Sep 2016 06:31:01 GMT

Introduction

We were well on our way in the previous article toward completing our third round of applications that utilize an in-house component, but we noticed an issue when shutting down the server. We'll get on with the web app completion after we handle this shutdown issue.

Here is what we noticed:




JUnit vs. TestNG: Which Testing Framework Should You Choose?

Thu, 22 Sep 2016 05:01:11 GMT

JUnit vs. TestNG: The Testing Framework Showdown

Testing is an inseparable part of the software release cycle in well-balanced developer teams. And it wasn’t always like that. Unit tests, integration test, system tests, and others weren’t always around. Today, we’re lucky to be in a place in time where testing matters and the value is known to most of the stakeholders.

In this post, we put testing at the center and explore Java testing through the eyes of JUnit and TestNG, while comparing their main features and use cases.




Favor Skeletal Implementation in Java

Thu, 22 Sep 2016 04:01:00 GMT

Skeletal implementation is a design by which we can use the benefits of the interface and abstract class together.

The Java Collection API has adopted this kind of design: AbstractSet, AbstractMap, etc. are examples of Skeletal interfaces. Also, Joshua Bloch mentions skeletal interfaces in his book “Effective Java.




Thoughts on the Java EE 8 Update

Wed, 21 Sep 2016 12:01:01 GMT

At the keynote of this JavaOne, Oracle presented a long-awaited reaction to the progress of Java EE in the form of a suprisingly extensive update to the future roadmap.

Java EE Roadmap Update

Anil Gaul presented the updates to the overall plan for EE 8 and 9 in his keynote showing the proposed changes to the overall scope and target of Java EE in general and changes to the JSRs in particular. The changes are justified by the allegedly demanding changes in the days of cloud and microservices.




Awesome Asciidoctor: Use Counters in Markup

Wed, 21 Sep 2016 10:31:04 GMT

In Asciidoctor we can create a document attribute as a counter attribute. The attribute is automatically incremented each time we use it in our markup. We can choose to use numbers or characters. Only Latin characters from 'a' to 'z' or 'A' to 'Z' are allowed. By default, the counter will start at 1, but we can define another start value when we use the counter attribute for the first time.

To define a counter attribute we must prefix the attribute name with counter:. Each time we use this syntax with the counter: prefix, the value is incremented and displayed. To only display the current value, without incrementing, we simply refer to the document attribute without the counter: prefix. For example, if we want to add a counter attribute with the name steps, we would use the following markup in Asciidoctor: {counter:steps}.




Gradle Goodness: Change Gradle Wrapper Script Name

Wed, 21 Sep 2016 09:01:16 GMT

With the Gradle Wrapper task, we can specify the name of the generated script files. By default, the names are gradlew and gradlew.bat. The Wrapper task has the property scriptFile. We can set a different value for this property to let Gradle generate the script files with a different name.

In the following example, we use the value mvnw (they will be surprised the build is so fast...) as the value:




Ceylon 1.3.0 Is Now Available

Wed, 21 Sep 2016 08:01:00 GMT

Ceylon 1.3.0 is a major release of the Ceylon language, with over 330 issues closed. This is the first release of Ceylon that supports Android development, the Node Package Manager (npm), and Wildfly Swarm.

  • For the JVM, this release is backwards-compatible with all releases of Ceylon 1.2 (1.2.0 to 1.2.2).




Apache NetBeans?

Wed, 21 Sep 2016 06:31:01 GMT

It's fairly common to have significant announcements related to the world of Java released in the days and weeks leading up to JavaOne. With that in mind, it's not surprising that we're seeing some significant Java-related announcements just prior to JavaOne 2016 that begins next week. One announcement is Mark Reinhold's Proposed schedule change for JDK 9 in which Reinhold proposes "a four-month extension of the JDK 9 schedule, moving the General Availability (GA) milestone to July 2017." Another major proposal, the subject of this post, is the proposal by Oracle for Oracle to "contribut[e] the NetBeans IDE as a new open-source project within the Apache Incubator."

The Apache NetBeans proposal is summarized on NetBeans.org, but additional details are available on Apache Software Foundation's Incubator Wiki page called NetBeansProposal. The NetBeansProposal Wiki page provides several details related to the benefits, costs, and risks associated with moving NetBeans to the Apache Software Foundation.