17 Oct 2018

feedDZone Java Zone

Deploying Spring Boot to ECS (Part 2)

This post is a continuation from our previous post on deploying Spring Boot to ECS. In our second installment, we will cover how to deploy a Spring Boot application in the ECS container. We will be using a simple task planner application that is available on GitHub.

A Docker file is already available inside this project. Make sure you have Git, Docker, and AWS CLI installed wherever you are running the following commands. Check out this link for a Git clone.

17 Oct 2018 8:01pm GMT

FXRibbon Version 1.2 Released

Recently, there has been an update to the FXRibbon, a Microsoft like ribbon control for Java (JavaFX).

After an issue request to make FXRibbon better prepared to be updated to Java 9 and beyond, I took the opportunity to add new features, aesthetic adjustments, fix withstanding bugs, clean up the project, and give it an overall polish.

17 Oct 2018 4:09pm GMT

Subtyping vs. Parametrization for a Complex Domain

Introduction

The idea for writing this article came to me after a discussion from my previous article about the Filterer Pattern. The discussion concerned the validity of introducing subtype polymorphism (instead of parametric polymorphism) into a composition-based design.

The goal of this article is to present a case where subtype design works better than parametric design. From this, I can draw a conclusion that, in certain context, subtype design is better than a parametric one. However, it is a non-goal of this article to speculate how often such context occurs in the real world (I have encountered such context only twice so far).

17 Oct 2018 7:01am GMT

Create a Spreadsheet Web App With Keikai: Workflow Example

Introduction

Excel is - no doubt - the most commonly used business application in the world. It is so easy that almost anyone can pick it up without learning. It is powerful in the sense that anyone can design a template and style it nicely. Along with that, anyone can create custom reports or forms with its powerful built-in features like sorting, filtering, charting and conditional formatting - it even comes with advanced formula functions for professionals.

However, Excel Sheets are scattered among each user and require frequent uploading/downloading/emailing when traveling among systems and users.

17 Oct 2018 4:01am GMT

16 Oct 2018

feedDZone Java Zone

Behavioral Design Patterns: Command

Previously, we used the Chain of Responsibility pattern to handle a complex problem with road incidents in a region, solving the problem or forwarding it to another incident handler.

The command pattern is quite different from the CoR pattern since it helps us delegate an action/request to another object that is capable of executing it. Thus, there is no direct execution whatsoever.

16 Oct 2018 8:01pm GMT

Java Annotated Monthly — October 2018

The main news so far has been the release of Java 11. It's not a large release in terms of new developer functionality since Java 10, but it is the first Long Term Support Release since Java 8. So if you've been hanging around on Java 8, now's the time to look at all new things that made it into Java 9, 10, and 11. Java 11 also removes features. This, like, never happens in Java. Another noteworthy change is that Oracle changed its licensing and support model since Java 8. Read this month's Annotated Monthly to find out more.

Java License/Support Changes

I covered this topic in the last Annotated Monthly since it was an area of some concern in the community. Since then, the Java Champions (an independent group of experts) have released a comprehensive document covering the situation. I also wrote a summary of what I hope are the most relevant points for developers. Here are other relevant links, if you're interested.

16 Oct 2018 4:01pm GMT

Maven Artifact Checksums

If you are using Apache Maven, you might have faced issues like this:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on project cores-batch: Error creating shaded jar: invalid LOC header (bad signature) -> [Help 1]
...
.... (remove many lines for brevity).
...
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
    at java.util.zip.ZipFile.read(Native Method)
    at java.util.zip.ZipFile.access$1400(ZipFile.java:56)
    at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:679)
    at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:415)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
    at java.io.FilterInputStream.read(FilterInputStream.java:107)
...


16 Oct 2018 10:02am GMT

Spring IoC Container With XML

What Is the IoC Container?

The org.springframework.context.ApplicationContext interface represents the Spring IoC container. This container instantiates, configures, and assemble beans by using externally provided configuration metadata.

ApplicationContext and BeanFactory are the same, but the ApplicationContext adds more enterprise-related functionality. In short, the ApplicationContext is a superset of the BeanFactory.

16 Oct 2018 7:01am GMT

Using Java Flight Recorder With OpenJDK 11

Java Flight Recorder (JFR) used to be a commercial add-on of the Oracle JDK. As it's been open sourced along with Java Mission Control, everyone using OpenJDK 11 can now troubleshoot their Java apps with this excellent tool for free of charge. JFR, previous proprietary solution, might be lesser known for those relying on previous versions of OpenJDK. Therefore, I thought it was worth writing a fresh post on using JFR with OpenJDK 11.

Overview

About the Java Flight Recorder

JFR is a profiling tool used to gather diagnostics and profiling data from a running Java application. Its performance overhead is negligible and that's usually below 1 percent. For short running apps, this overhead might be above that because JFR requires some warm-up time on the start.

16 Oct 2018 4:01am GMT

15 Oct 2018

feedDZone Java Zone

Making the Java Fluent API More Flexible

With the appearance of Java 8 lambdas, and even before that, a lot of APIs appeared that used the fluent API pattern (that started as a pattern explained in this post from Martin Fowler). To name a few of these API instances in Java includes:

There are a lot of articles about it on DZone and other sources:

15 Oct 2018 8:24pm GMT

How to Use the Spring 5.0 @PostConstruct and @PreDestroy

In this article, we will discuss how to use method-level annotations @PostConstruct and @PreDestroy to manage Spring bean lifecycle.

Note that the @PostConstruct and @PreDestroy annotation does not belong to Spring, it's located in the J2ee library - common-annotations.jar.

15 Oct 2018 8:01pm GMT

How to Become a Java Software Architect

Step 1: Understanding the Software Architect Role

A software architect is a software technology expert who makes high-level design choices and dictates technical standards, including software coding standards, tools, and platforms. The leading expert is referred to as the chief architect. Their day-to-day tasks include:

15 Oct 2018 4:06pm GMT

Sort Maps by Value in Java 8 [Snippet]

The following demonstrates how to sort a given map based on the value using Java 8. One important thing to keep in mind is that you cannot sort a map in the Hashmap object.

map.entrySet().stream().sorted((o1, o2) -> o1.getValue().compareTo(o2.getValue())).map(e -> e.getKey()).collect(Collectors.toList()).forEach(k -> sortedMap.put(k, map.get(k)));

15 Oct 2018 10:01am GMT

Why Is the Spring Framework so Popular?

Spring Framework Features

Spring is a powerful, lightweight framework used for application development. In broader terms, you can say that the Spring framework is a well-defined tool that supports several web applications using Java as a programming language.

Before the launching of the framework in the IT Sector, the applications were developed using JEE standards. With these standards, we can deploy an application on any JEE application server. But, it had several problems, including:

15 Oct 2018 4:01am GMT

14 Oct 2018

feedDZone Java Zone

My OCAJP Java Certification Success Story

I just cleared my OCAJP certification for Java SE 8 with an 88 percent score. Thanks to my friends for sharing good study materials for my success.

I have been a passionate learner of Java since my first year of college and my dream is to become a software architect. Though it is too early to think about this role, my hard work in design skills definitely will help me to achieve this goal.

14 Oct 2018 4:01am GMT

13 Oct 2018

feedDZone Java Zone

Book Review: Java by Comparison

I accepted the invitation to review Java by Comparison: Become a Java Craftsman in 70 Examples (2018, The Pragmatic Bookshelf) because the premise of this book interested me. The book Software Craftsmanship: The New Imperative had a significant effect on me when I was a less-experienced software developer, and I looked forward to reviewing Java by Comparison because of its connection with the concept of software craftsmanship and its examples being provided in the Java programming language. I was provided with the electronic version of the book and I chose the PDF format for my review.

Java by Comparison is written by Simon Harrer, Jörg Lenhard, and Linus Dietz and has over 160 pages of substantive content (not counting prefaces, forewords, table of contents, etc.). Java by Comparison features nine chapters and the 70 cases covered span the first eight of those nine chapters.

13 Oct 2018 4:01am GMT

10 Nov 2011

feedPlanetJava

OSDir.com - Java: Red Hat's top secret Java Killer/Successor: The Ceylon Project

From the Ceylon dept.:

Gavin King of Red Hat/Hibernate/Seam fame recently unveiled the top secret project that he has been working on over the past two years, a new language and SDK designed to replace Java in the enterprise. The project came out of hiding without much fanfare or publicity at QCon Beijing in a keynote titled "The Ceylon Project - the next generation of Java language?".

10 Nov 2011 6:01am GMT

OSDir.com - Java: Oracle Introduces New Java Specification Requests to Evolve Java Community Process

From the Yet Another dept.:

To further its commitment to the Java Community Process (JCP), Oracle has submitted the first of two Java Specification Requests (JSRs) to update and revitalize the JCP.

10 Nov 2011 6:01am GMT

OSDir.com - Java: No copied Java code or weapons of mass destruction found in Android

From the Fact Checking dept.:

ZDNET: Sometimes the sheer wrongness of what is posted on the web leaves us speechless. Especially when it's picked up and repeated as gospel by otherwise reputable sites like Engadget. "Google copied Oracle's Java code, pasted in a new license, and shipped it," they reported this morning.



Sorry, but that just isn't true.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Released

From the Grande dept.:

Oracle today announced the availability of Java Platform, Standard Edition 7 (Java SE 7), the first release of the Java platform under Oracle stewardship.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Passes JCP

From the Jitters dept.:

The next edition of Java has been approved by a Java Community Process executive committee, but not without some acrimony.

10 Nov 2011 6:01am GMT

OSDir.com - Java: JDK 7 RC1 Released

From the JDK dept.:

After an initial round of testing we've declared build 147 to be the first Release Candidate of JDK 7.



There are only thirteen changes in this build. Over half of them are administrivial updates that don't affect the actual code; the remainder are true showstoppers, including several hard VM crashes and a JIT correctness bug identified by an Eclipse unit test.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Google Files Sizzling Answer to Oracle's Amended Java Complaint

From the Counter dept.:

Google has filed its answer to Oracle's amended complaint and its memorandum opposing Oracle's Motion to Dismiss. And we find out why Google didn't just roll over and pay Oracle for a license. Oracle asked in its motion to dismiss that the counterclaims alleging that Oracle's patents are invalid be dismissed. So Google explains more thoroughly why it believes they are in fact invalid. First, Google asserts:



Each of the Patents-in-Suit is invalid under 35 U.S.C. § 101 because one or more claims are directed to abstract ideas or other non-statutory subject matter.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache loses Java showdown vote to Oracle

From the Dis Harmony dept.:

The Apache Software Foundation - one of tech's most influential open-source groups - is closer to quitting Java's governing body after losing a stand-off vote against Oracle on Java.



The Reg has learned that with 75 per cent of qualifying Java Community Process (JCP) members having voted on whether to ratify Oracle's proposed roadmap for Java 7 and 8, Oracle's plan has been accepted.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache Software Foundation Resigns from Java Community Process

From the So Long dept.:

The Apache Software Foundation has resigned its seat on the Java SE/EE Executive Committee. Apache has served on the EC for the past 10 years, winning the JCP "Member of the Year" award 4 times, and recently was ratified for another term with support from 95% of the voting community. Further, the project communities of the ASF, home to Apache Tomcat, Ant, Xerces, Geronimo, Velocity and nearly a 100 mainstay java components have implemented countless JSRs and serve on and contribute to many of the JCPs technical expert groups.



We'd like to provide some explanation to the community as to why we're taking this significant step.



The recent Java SE 7 vote was the last chance for the JCP EC to demonstrate that the EC has any intent to defend the JCP as an open specification process, and demonstrate that the letter and spirit of the law matter. To sum up the issues at stake in the vote, we believe that while continuing to fail to uphold their responsibilities under the JSPA, Oracle provided the EC with a Java SE 7 specification request and license that are self-contradictory, severely restrict distribution of independent implementations of the spec, and most importantly, prohibit the distribution of independent open source implementations of the spec. Oracle has refused to answer any reasonable and responsible questions from the EC regarding these problems.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Apache Discontinues Independent Java Implementation 'Harmony'

From the DisHarmony dept.:

After the resignation of Apache from the Java SE/EE Executive Committee, the time has now come for Harmony to be added to the Apache Attic. Harmony was 'the project to produce an open source cleanroom implementation of Java.' An open vote was taken within the Project Management Committee, which resulted in a 20-2 majority to discontinue development.

10 Nov 2011 6:01am GMT

Javable: YourKit Java Profiler 7.0 released

The major update to YourKit Java Profiler has been released. Version 7.0 includes

10 Nov 2011 6:01am GMT

Javable: Sun phases out mobile Java

Sun will gradually phase out mobile Java (Java Micro Edition) and move respective services to Standard Edition. "We're trying to converge

10 Nov 2011 6:01am GMT

Javable: Google Android SDK is available

The development kit and API for Google mobile platform, Android, has been released.

10 Nov 2011 6:01am GMT

Javable: Consumer JRE Early Access

Sun has started an early access program to Java SE 6 Update N (formerly known as the "Consumer

10 Nov 2011 6:01am GMT

Javable: NetBeans 6.0 released

New version of pure Java IDE has been released, with support for many new

10 Nov 2011 6:01am GMT

Javable: Happy New Year!

We wish a Happy New Year to all our readers and contributers. Hope to see you all in 2008.

10 Nov 2011 6:01am GMT