Posts Tagged: Java

Home » Java

“Paging with Spring Boot” by Tom Hombergs: A Guide to Paging and Pagination in Spring-based Web Applications

In his article Paging with Spring Boot software engineer Tom Hombergs (a former fellow student) provides an in-depth explanation of paging and pagination concepts and how to implement those in web applications with Spring Data and its Pageable interface. The article covers aspects such as sorting, usage with Spring Data repositories and testing. It's a useful reference for iteratively retrieving and displaying a larger amount of items from a database in a Spring Boot and Spring Data context in an efficient manner. There's ... Read more

OAuth 2.0 Authentication with Jira – A Spring Boot Example Application

When dealing with the specifics of authentication techniques and protocols such as OAuth the devil often is in the detail. While the OAuth 2.0 protocol generally is easy to grasp and simple to use implementation details for specific authentication providers can easily have you hit a snag fairly quickly. Documentation and examples sometimes are outdated or scattered across several - sometimes contradictory documents. Additionally, examples for the authentication provider you want to use might not have been written with your framework of ... Read more

R2DBC: Reactive Relational Database Connectivity for Java and Spring

As I mentioned in a blog post last week with Reactor and Spring WebFlux reactive programming has come to Java and the Spring platform. R2DBC is relatively new project that aims to "to bring a reactive programming API to relational data stores". While currently still considered experimental, R2DBC endeavours to introduce reactive programming to how we access relational databases (reactive relational, hence the R2 in the name). This means that instead of the traditional way of querying SQL databases imperatively with prepared statements ... Read more

Reactive Programming with Spring Boot and Spring WebFlux

Reactive Programming and its functional incarnation reactive functional programming are declarative programming paradigms that with the advent of reactive extensions for JavaScript such as RxJS have become immensely popular. The JavaScript event loop and the run-to-completion behaviour it entails as well as Node.js's non-blocking I/O calls lend themselves to an event-driven programming style that deals with asynchronous behaviour where both number and frequency of events aren't known beforehand. Reactor is a library that introduces this paradigm to Java. Spring WebFlux is a ... Read more

Using Spring JdbcTemplate Instead of Object-Relational Mapping

Spring JDBC and Spring JdbcTemplate in particular has become my go-to tool for accessing relational databases for quite some time now and for good reason in my opinion: The common way for using data from an RDBMS in an object-oriented context used to be and for the most part still is object-relational mapping (ORM) frameworks like the Java Persistence API (JPA) or Rails' ActiveRecord. As the name suggests these frameworks attempt to map data (and concepts) from relational, set-oriented data structures, which ... Read more

Testing REST Services with REST Assured

RESTful service testing can be unwieldy and difficult to get started with. Providing a REST API implies using a variety of technologies and techniques such as HTTP, JSON, authentication, various payload transfer mechanisms and content types. This is where a tool that abstracts over these technical details and facilitates their application comes in handy. REST Assured is a high-level DSL for testing REST APIs. It draws upon behaviour-driven development (BDD) and hence makes for readable test descriptions. A typical acceptance test with ... Read more

Deploying Spring Boot applications as old-fashioned WAR files

Spring Boot is an opinionated convention-over-configuration framework for creating stand-alone Spring-based Java applications. Its objective is to provide you with a preselected best practice choice of libraries (both from the Spring platform and by third parties) for a given task, e.g. building a web application that connects to a database and provides REST resources creating a scheduled batch task that exports and aggregates data from various data sources providing an API that connects to SOAP Web Services It both helps you with getting started quickly and ... Read more

Googling For Developers

I sometimes jokingly say: "I’m not a good programmer. I just know how to use Google effectively." When programming and being confronted with an unknown error, stack trace or a specific exception message I usually turn to Google in order to find out how other developers with similar problems previously approached these issues. While at face value this might sound easy this requires experience. You have to know enough about software development in general and the environment (language, framework, library, you name it ... Read more

Mockito 2 now available

Last week version 2.1.0 of the Mockito testing framework for Java has been released. For more information on this latest iteration check out this page. As the name suggests, Mockito allows you to mock object behaviour during unit tests. When writing unit tests you only want to test a particular unit's behaviour (hence the name). Depending on the programming language used such a unit might be a function, a procedure or - most commonly in today's object-oriented programming environments - a ... Read more

JHipster: A Spring / AngularJS App Generator

You're a boring, hoary Java developer but secretly always wanted to belong to that hip JavaScript-Single-Page-Application crowd? Well, with JHipster now you can! On a more serious note, JHipster is a Yeoman generator that lets you bootstrap integrated Java (for the back-end server stuff) / AngularJS (for everything front-end and UI) web apps. JHipster makes use of proven technologies such as: Grunt Bower AngularJS Maven Spring Boot Spring Web MVC The project's goal is to provide the means for easily creating a beautiful state-of-the-art HTML5 / CSS3 / JavaScript ... Read more
Next Page »