Archives by Tag 'java'
Using Hamcrest and JUnit
Lately I started using the core Hamcrest matchers bundled with the JUnit framework to create more readable unit tests.
Hamcrest matchers were created to improve the readability of unit testing code. It’s a framework which facilitates the creation of matcher objects to match rules specified in unit tests. Some examples will let it to be clearer:
[...]
JDK7 Tackles Java Verbosity
Interesting article showing some changes on the Java platform to address its verbosity, but keeping code readability safe.
I liked the new Collection’s literals syntax to create lists, sets and maps:
List powersOf2 = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024};
Map ages = {“John” : 35, “Mary” : 28, “Steve” : 42};
Although it [...]
A Brief History of Java and JDBC
From Javalobby, an interesting and short video showing the evolution of the Java platform since 1991.
Using Scala to update LiveJournal tags – Part I
Some days ago I started to use the Scala programming language to update my Livejournal tags using its XML-RPC protocol reference. First I had to check if some tags of mine were entered wrong, so I’ve done this Scala program to list all of them:
1:import org.apache.xmlrpc.client.XmlRpcClient;
2:import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
[...]
Twitter on Scala Interview
There is a nice interview with the Twitter development team on Artima about using Scala in production on Twitter code. The team talks about some issues and facilities regarding the chose of Scala to develop Twitter’s queueing system and how Scala affected the team’s programming style.
My personal highlights:
And Ruby, like many scripting languages, has trouble [...]
Bean Validation – Emmanuel Bernard on JSR 303
JavaLobby released an interesting interview with Emmanuel Bernard, the spec lead of of JSR-303: Bean Validation..
One of the important goals of the Bean Validation spec is, as Emmanuel Bernard says, is
to provide a default runtime engine that is used to validate the constraints around the domain model, in Java.
The development team decided to [...]
Joshua Block on How to Design a Good API & Why it Matters
In this talk (recorded at Javapolis), Joshua Block presents guidelines about how to design good APIs. I highlighted what i think are the most important parts of the talk:
Functionality should be easy to explain: If it’s hard to name, that’s generally a bad sign
Good names drive development
Be amenable to splitting and merging modules (If names [...]
Effective Java Programming with Joshua Bloch
Nice video from Joshua Block, Chief Java Architect at Google, talking about his Effective Java™ Programming Language Guide book and also about the consequences of adding new features on the Java language, like the closures’ proposals. He also offers an advice to the programmers, when designing API’s, classes or methods:
“When in doubt, leave it [...]
Is Java on a evolutionary dead end way?
Artima is running an article where Bruce Eckel talks about about Java’s objective on backwards compatibilities and the problem of combinatorial complexity when you combine a new feature in every possible way with the other language features already present.
It’s the combinatorial complexity that you get when you combine a new feature in every possible way [...]
Strongly Java typed safe delegates
This great post explores an interesting Java implementation about using the delegate programming feature, in a type safe way. Delegate is a form of function pointer, commonly used to implement callbacks. It specifies a method to call, which is dispatched in runtime. From Wikipedia, we have:
The short definition is that delegation defines method dispatching the [...]
My LinkedIn