Detailed information on Java 8

TechEmpower has posted a summary of expected changes in Java 8. So many of these features are long overdue, but I still be very thankful for them. Here’s a very short list of the highlights. If you develop in Java, check out the list, and let’s hope Java 8 actually ships in March 2014, and with all these features.

  • Interfaces can define static methods, and default methods.
  • Lambdas.
  • Better type inferencing.
  • Proper time library
  • Some functional additions to Collections
  • Concurrency additions
  • Annotations allowed in more places

[elink link=”http://www.techempower.com/blog/2013/03/26/everything-about-java-8/”]

Thucydides – What is its focus?

Thucydides isn’t about Browser based functional testing, but I’m not sure that everyone’s aware of that. Hence this entry.

Thucydides is a report generation structure around JUnit tests written
using JBehave, EasyB or Java. It provides easy integration of WebDriver
to do browser based testing, but that isn’t its primary goal. Its
primary goal is to foster communication between developers and their
clients. To provide living documentation of their code, and a high-level
view into their progress.

This can be applied using browser
based functional testing, but another great use would be during
development of a service. If one is creating a RESTful API, for example,
one would be (I hope) creating integration/functional tests for same.
By wrapping these tests in Thucydides, the Thucydides reports could be
published as both documentation and examples.

Just something to think about…

Inline Construction of Static Lists (and other classes)

I’m sure you’ve seen this form of initialization many times

but what if you want to have lists? or you want to have a list that builds upon another list?

Then odds are this is what you’ve written:

an alternative way to write it is this:

Personally, I think the above is cleaner, and easier to follow, so if you agree, consider using it the next time you want this type of construct.

To explain what’s happening here, basically, you are constructing an anonymous subclass of ArrayList, and whatever is inside the nested {} is the constructor.

You could, although I wouldn’t recommend it, do something like this:

One place where this syntax is put to use is JMock2 and construction of it’s expectations.