Welcome to the new service release of the Spring Cloud Camden Release Train. Camden.SR1 can be found in our Spring Release repository or in Maven Central. You can check out the Camden release notes for more information.
Highlights of the Camden SR1 Release Train
After finishing a pair of articles last week on Karaf features, I felt that I had done a poor job of explaining the context in which all of this bundling and featurizing was taking place. Instead I pretty much started in the middle, assuming the existence of OSGi bundles with proper manifests, all snug in their Maven repositories.
So I'm going to correct that and at the same time illustrate another cool OSGi technology: declarative services. To do that will take some time and will require help from a detailed example.
The biggest obstacle to overcome when starting out with a new tool is to get your head around how to do the little things. By now, you might feel confident in how the new Java 8 Stream API works, but you might not have used it for database querying yet. To help you get started creating, modifying and reading from your SQL database using the Stream API, I have put together this quick start. Hopefully, it can help you take your streams to the next level!Background
Speedment is an Open Source toolkit that can be used to generate Java entities and managers for communicating with a database. Using a graphical tool, you connect to your database and generate a complete ORM tailored to represent your domain model. But Speedment is not only a code generator, but also a runtime that plugs into your application and makes it possible to translate your Java 8 streams into optimized SQL queries. That is the part that I will focus on in this article.
For the past couple of years, government and societies have been trying to make “Geek” cool again. Presidents and prime ministers are recommending that computer programming be part of schools’ curriculum. Politics aside, becoming a competent programmer today is more challenging than ever. Just being an introvert genius no longer suffices.
Companies and organizations are looking for people with cognitive skills to add to their technical abilities. It is difficult to put a number on this as it is very company-dependent, but the 70/30 rule could be applied here. That means that people should possess roughly 70% technical skills and 30% soft (cognitive) skills. A “hardcore” developer hardly moves into management if he/she lacks the soft skills required. I have managed many teams across multiple verticals and developed some job descriptions and career progression paths along the way that are in use in some of the largest companies in the world. Let’s try to sum up a few aspects of what seems to be the pattern when companies are recruiting or promoting.
Just recently, after one of my sessions at JavaDay Kyiv, I was asked by an attendee what the reasons were for my use of Java EE. In the session, I mentioned that in the past, I was also a heavy user of Spring.
Actually, I always enjoyed programming in Spring, and I liked the declarative programming model with annotations and the fact that the technology evolves quite fast. I used Spring up to version 4 in real-world projects, and we always tried to use the latest approaches — like @RestControllers, or Java-based configuration back then.
Welcome to another installment of This Week in Spring! This week, I’ll be in Des Moines, Iowa, for the Prairie.Code conference. If you’re nearby, stop by and say hi!
As usual, we’ve got a lot to cover so let’s get to it.
As discussed in that article, Karaf has its own XML format for a "feature repository," an XML file that lists one or more features. Each feature lists features or bundles that it relies on, with support for versioning. The whole thing works because Karaf can retrieve both the feature repository XML files and the OSGi bundles from a variety of sources, including Maven.
In the object-oriented world, each developer who wants to live long and prosper should know the SOLID rules. SOLID is just an acronym of basic tips for writing maintainable, readable code. We all know many developers who follow these rules. And we all know many who know them, but don't use them. And finally, plenty of programmers have heard something about SOLID, but don't bother to learn anything about it. However well we use it, we can agree that sticking to SOLID is a good practice. But there are always compromises.
In fact, in the real world, we have to know that each letter in SOLID has own shades and gradients — they are not simply white or black. In this article, I want to tell you something about the Single Responsibility Principle (SRP), which covers the first letter in our acronym. What is it?
With the introduction of Java 8, we got the long-awaited Stream library. One of the advantages with streams is that it is very easy to make streams parallel. Basically, we could take any stream and then just apply the method parallel() and we get a parallel stream instead of a sequential one. By default, parallel streams are executed by the common ForkJoinPool.
Parallel streams are good if the work items to be performed in the parallel stream pipelines are largely uncoupled and when the effort of dividing up the work in several threads is relatively low. Equally, the effort of combining the parallel results must also be relatively low.
This article introduces the JTemplate framework and provides an overview of its key features.
For a recent project requiring WebSockets and JMS, I needed to make use of IBM’s WAS Liberty Profile server, as WAS 8.5 ND only supports JEE 6. I want to share some of my learnings with you, starting with the basics: a short intro on what to expect and setting up a server.Highlights
Some highlights of WAS Liberty are:
Let's say we're dealing with a number of input fields that require validation. The validation logic might be simple or complex, involving many different factors or parameters to validate a single field. Normally, we use a number of if...else blocks to validate each and every input field. This approach will lead to concerns regarding maintainability, readability, and extensibility. Hence, I would like to discuss the best approach using the Strategy pattern, but using Enum for the implementation. This approach was already used in one of my previous projects and proved to be useful. Let's start our discussion.Problem Statement
Let's assume that we ask the user to provide some of his personal and bank details when he applies for a loan. Once we receive the details, we might want to validate those. In real life, it might be many more fields and more complex validations. But, for our simple example, we will take around 10 fields and will perform simple validations — like whether the fields are empty.