The Baeldung Weekly Review 28 – Baeldung周报》 28

最后修改: 2014年 7月 18日

中文/混合/英文(键盘快捷键:t)

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

在2014年年初,我决定开始更好地记录我的阅读习惯,并在这里与你们所有人分享

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.

希望在我们进入2014年下半年时,你会喜欢这些。

Here we go…

我们来了……

1. Java

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.

本周评论的一个坚实的开端–Petri介绍了一些测试应用程序的良好做法。关于事务性的第三点特别重要–不要用不同的事务语义进行测试。

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.

下一个列表–进一步讨论用JPA生成标识符–这个系列将是深入研究Hibernate和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

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.

这是其中一个领域,我现在的做法与几年前大不相同。我对测试和@Transactional的看法是否定的。

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.

为什么不呢?有几个原因–第一,我发现让测试使用与生产中实际使用的交易语义相同的系统和API是很有价值的;改变这些将使事情发生微妙的变化–根据我的经验,测试中的微妙变化是不好的

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.

`no`背后的第二个原因是,知道我将有垃圾数据和我的测试套件运行的结束,使我以某种方式编写测试逻辑,真正思考一些场景,总体而言,对测试的灵活性有积极影响。

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数据刚刚变得有点凉爽–不说了。

>> 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.

ALPS元数据对我来说是个新事物,这篇文章让它看起来相当有趣–也许是从超媒体类型获得标准化的缓慢步伐中前进了一步。

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).

值得一看–而且可能需要进行一些挖掘,以真正了解这种元数据对API的作用(我计划在周末进行挖掘)。

>> 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

3.技术与思考

>> 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.

第一篇面试技巧文章的良好延续–我一直在面试桌的两边,我个人发现,作为面试官要难得多(对我来说)。在你成为一个半成品的面试官之前,还有很长很长的路要走–这是一个很好的清单,当你处于这个位置时,你要牢记这些事情。