The Baeldung Weekly Review 28 – 巴尔东周报》 28

最后修改: 2014年 7月 18日

At the very beginning of 2014 I decided to start better documenting my reading habits and sharing them here with all of you.


The point is two fold – by curating and documenting, my reading has become more purposeful and diverse. Also – I believe that curation of good content brings a lot of value, helps people explore and allows the best stuff to raise to the top.


Hopefully you’ll enjoy these as we move in the latter half of 2014.


Here we go…


1. Java


>> Writing Tests for Data Access Code – Green Build Is Not Good Enough

A solid start for this weeks review – Petri goes over some good practices for testing an application. The 3rd point about transactionality is especially important – don’t test with different transaction semantics.


It’s also quite funny: “We have two options: the right one and wrong one”.


>> State of the Specialization

Generics over primitives are comming to Java (perhaps reification as well) – Brian Goetz published a very early proposal that’s definitely worth reading.

基元上的泛型即将进入Java(也许也是重构)–Brian Goetz发表了一份非常早期的提案,绝对值得一读。

>> From JPA to Hibernate’s legacy and enhanced identifier generators

Next on the list – further on generation of identifiers with JPA – this series is going to be a great resource to go deep into persistence with both Hibernate and JPA.


>> Introduction to writing custom collectors in Java 8

Who says that Java 8 is deprecating Guava – here’s a good primer on collectors that shows they can play well together.

谁说Java 8要废弃Guava–这里有一个关于收集器的很好的入门读物,显示它们可以很好地一起玩。

>> Turning recursive file system traversal into Stream

An elegant use of streams to flatten and traverse an directory on the file system.


2. Spring


>> Should my tests be @Transactional?

This is one of these areas where I’m doing things so much differently now than I was even a few years ago. My view on tests and @Transactional is no.


Why not? A few reasons – one, I find it valuable to have the tests consume my system and my APIs with the same transaction semantics that they’re actually consumed in production; changing these will make things subtly different – and subtle differences in tests are – in my experience – not good.


A second reason behind the `no` is that knowing that I’ll have junk data and the end of my test suite run makes me write the test logic in a certain way, really think through some scenarios and, overall, has a positive effect on the flexibility of the tests.


But that’s my own preference, and as Marco opens the article with – it depends. All in all – a good article to read.


>> SpEL support in Spring Data JPA @Query definitions

Spring Data just got a little bit cooler – nuff said.


>> Spring Data REST now comes with ALPS metadata

ALPS metadata is new to me, and this article makes it look quite interesting – perhaps a step forward from the slow pace the hypermedia types are getting standardized.


Worth a look – and will probably require some digging to really get a good idea of what this kind of metadata can do for an API (digging that I’m planning to do during the weekend).


>> Spring Tool Suite and Groovy/Grails Tool Suite 3.6.0 released

A new STS is out – and since it’s a tool I use every day, I was quick to upgrade; if you’re on Eclipse and doing Spring – there’s really no reason to not give it a go.

新的STS出来了 – 因为它是我每天都在使用的工具,所以我很快就升级了;如果你在Eclipse上做Spring – 真的没有理由不给它一个机会。

3. Technical and Musings


>> TDD Chess Game Part 9: God Save the Queen

While I didn’t have the chance to see this part yet, I’ve been covering the entire series in my weekly reviews since the very start, so I have no qualms recommending it even before I see it this weekend. The series is jam packed – and, if I’m being honest, it’s something that should probably be productized and sold – but since it’s free – go through it and you’ll pick up a lot.

虽然我还没有机会看到这一部分,但我从一开始就在我的每周评论中涵盖了整个系列,所以即使在我本周末看到它之前,我也毫无顾虑地推荐它。这个系列是jam packed–而且,如果我是诚实的,它是可能应该被产品化和销售的东西–但由于它是免费的–通过它,你会得到很多。

>> What not to do in an interview, part 2: Interviewer Edition

Nice continuation of the first interview tips article – I’ve been on both sides of the interview table and what I found personally is that being the interviewer is much harder (for me). There’s a long, long way to go until you’re a half decent interviewer – and this is a decent list of things to keep in mind when you’re in that position.