Home » Author Archives: Shaun Abram

Author Archives: Shaun Abram

An introduction to REST

software-development-2-logo

REST, or Representational State Transfer is an architectural style, or more simply, a set of constraints. We will look at the constraints REST imposes for web apps, but some highlights are:               Uniform interfaces: all resources are identified by URIs (think: links) It relies on a stateless, client-server, cacheable communications protocol (think: HTTP). Interaction with resources is ...

Read More »

AssertJ > Fest > Hamcrest

java-logo

I have previously blogged about Hamcrest, and using its assertThat methods in preference to JUnit’s Assert. However, I quickly after discovered FEST Assertions, and happily switched to it. It provides the same improved test readability and improves failure messages as Hamcrest, but has the extra benefit of enabling IDE auto completion, rather than having to search through package and class docs to find the right matcher. Unfortunately, Fest seems to ...

Read More »

Microservices

software-development-2-logo

A microservice is a small, focussed piece of software that can be developed, deployed and upgraded independently. Commonly, it exposes it functionality via a synchronous protocol such as HTTP/REST. That is my understanding of microservices, at least. There is no hard definition of what they are, but they currently seem to be the cool kid on the block, attracting increasing attention ...

Read More »

Keyboard shortcuts in IntelliJ

jetbrains-intellijidea-logo

I attended a talk by Hadi Hariri at JavaOne last week. He introduced a whole bunch of IntelliJ keyboard shortcuts I was not aware of. Very useful talk. I have listed some of the most useful ones below. Cmd-1: Move focus to the Project window While there, type any class name (including using Camel Case e.g. HW to find HelloWorld), ...

Read More »

Live Templates in IntelliJ

jetbrains-intellijidea-logo

As described here, IntelliJ’s live templates let you easily insert predefined code fragments into your source code. I have posted some of my most used templates below, a link to my complete list of template files on GitHub (as a reference for myself when I setup new IntelliJ environments) and the steps I took to add the IntelliJ settings file ...

Read More »

How to add an IntelliJ project to GitHub

github-logo

Although the GitHub docs contains good info on how to add an existing GitHub project to your local machine, how to add an existing (unversioned) project from your local machine to GitHub was a little less clear to me. Here are the steps I use. From IntelliJ Select ‘VCS’ menu -> Import in Version Control -> Share project on GitHub. ...

Read More »

Testing for expected exceptions in JUnit

junit-logo

Unit tests are used to verify that a piece of code operates as the developer expects it to. Sometimes, that means checking that the code throws expected exceptions too. JUnit is the standard for unit testing in Java and provides several mechanisms for verifying exceptions were thrown. This article explores the options and their relative merits.   Take the following ...

Read More »

Java7 – A look back

java-logo

I started writing a blog post on what’s new in the upcoming Java8 release, and thought I would start by doing a quick look back at what Java7 brought to us. Java7 was released back in July 2011, and was described as “more evolutionary than revolutionary”. “There are some significant improvements, but no really earth-shattering or ground-breaking kinds of features.” ...

Read More »

Java8

java-logo

Java8 isn’t scheduled for for release until March 2014, but early release versions have been available for a while. Some of the most interesting new features are: Streams Functional interfaces Default methods Lambdas Java Time     Streams The new java.util.stream package contains “classes to support functional-style operations on streams of elements”. Streams aren’t a new type of collection and ...

Read More »

Stacks and Queues in Java

java-logo

I have been working on some Java code recently that required both a stack and a queue. The choices to use aren’t immediately obvious. There is a Queue interface, but no clear concrete implementation to use. There is also a Stack class, but the javadocs point out that other classes “should be used in preference to this class”. So, what ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close