Home » Author Archives: Steve Chaloner

Author Archives: Steve Chaloner

Fail-fast validations using Java 8 streams

java-logo

I’ve lost count of the number of times I’ve seen code which fail-fast validates the state of something, using an approach like:                     public class PersonValidator { public boolean validate(Person person) { boolean valid = person != null; if (valid) valid = person.givenName != null; if (valid) valid = person.familyName != ...

Read More »

Are recruiters generally all so bad?

career-logo

I have a friend who’s a recruiter. Yes, that can actually happen. I mentioned to him that I’d been contacted by a really annoying recruiter, and he responded with “Can I ask you a serious question? Are ‘they’ generally all so bad? I’m struggling a little to understand why there is so much bad feeling generally, towards them.”. I had ...

Read More »

Testing your plugin with multiple version of Play

scala-logo

So, you’ve written a plugin for Play…are you sure it works? I’ve been giving Deadbolt some love recently, and as part of the work I’ve added a test application for functional testing. This is an application that uses all the features of Deadbolt, and is driven by HTTP calls by REST-Assured. Initially, it was based on Play 2.3.5 but this ...

Read More »

JavaScript routing in Play 2 (Scala edition)

play-framework-logo

In my previous post, I covered using JavaScript routing in Play 2 Java applications. Here’s the Scala version. It’s pretty much a copy of the previous article, to make it independent. One of the nicest features in Play 2, but one which doesn’t seem to be widely covered, is the JavaScript routing that can be generated by the framework to ...

Read More »

A good, lazy way to write tests

java-interview-questions-answers

Testing. I’ve been thinking a lot about testing recently. As part of code reviews I’ve done for various projects, I’ve seen thousands of lines of untested code. This is not just a case of test coverage statistics pointing this out, it’s more a case of there not being any tests at all in this projects. And the two reason I ...

Read More »

Inferred exceptions in Java

java-logo

It’s always nice to borrow and steal concepts and ideas from other languages. Scala’s Option is one idea I really like, so I wrote an implementation in Java. It wraps an object which may or may not be null, and provides some methods to work with in a more kinda-sorta functional way. For example, the isDefined method adds an object-oriented ...

Read More »

Back to Basics – good comments are targeted comments

software-development-2-logo

I can’t think of a single person who enjoys writing comments in code. I don’t, my friends and colleagues don’t, and I’m pretty sure there isn’t a meetup group for fans of it. Outside of code that I write for blog posts, I can pretty much guarantee there are only place where I write comments is in interfaces. The simple ...

Read More »

Play 2 – modules, plugins, what’s the difference?

play-framework-logo

There seems to be some confusion regarding Play 2 modules and plugins. I imagine this is because the two are often synonymous. In Play (both versions – 1 and 2) there are distinct differences. In this post, I’m going to look at what a plugin is, how to implement one in Java and Scala, and how to import plugins from ...

Read More »

Publishing Play 2 modules on github

git-logo

Now you’ve doubtless followed my earlier guides on writing modules for Play 2, I imagine you’re keen to show your coding chops to the world. The problem is – and this is quite a big one, I’m afraid – there is no place to publish your modules to. When I first starting writing Play modules, the repository was already set-up ...

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