Java Weekly, Issue 184 – Java周刊》第184期

最后修改: 2017年 7月 7日

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

Lots of interesting writeups on Java 9 this week.

本周有很多关于Java 9的有趣文章。

Here we go…

我们来了……

1. Spring and Java

1.Spring和Java

>> Are Java 8 Streams Truly Lazy? Not Completely! [blog.jooq.org]

It turns out that the Java 8 Streams API is not as lazy as you might think – the flatmap() operation evaluates the inner Stream eagerly – which is not the case when working with Scala or Vavr.

事实证明,Java 8的Streams API并不像你想象的那样懒惰flatmap()操作会急切地评估内部Stream–在使用ScalaVavr.时,情况并非如此。

>> Simple Spring Boot Admin Setup [techblog.bozho.net]

The cool Spring Boot Admin dashboard setup can be slightly unintuitive – here a good overview of how to set it up.

炫酷的Spring Boot管理仪表板设置可能略显不直观–这里有一个关于如何设置的良好概述。

>> What’s new in JPA 2.2 – Stream the result of a Query execution [vladmihalcea.com]

The new addition to JPA 2.2 – returning Query results as Stream – is an interesting addition but still not as efficient as a paginated ResultSet.

JPA 2.2新增加的内容–将Query结果返回为Stream–是一个有趣的补充,但仍然不如一个分页的ResultSet高效。

>> Why you should avoid CascadeType.REMOVE for to-many associations and what to do instead [thoughts-on-java.org]

Using CascadeType.REMOVE can be quite dangerous – besides generating way too many queries, it can also remove more than expected.

使用CascadeType.REMOVE可能相当危险–除了生成太多的查询之外,它还可能删除超过预期的内容。

Also worth reading:

Webinars and presentations:

网络研讨会和演讲:

Time to upgrade:

升级的时间:

2. Technical

2.技术

>> A Basic Programming Pattern: Filter First, Map Later [jooq.org]

In order to leverage the laziness of the Stream API and keep the complexity of the operations down, it’s important to rely on well-placed limits as much as possible – although even this might not enforce laziness in all scenarios.

为了利用Stream API的懒惰性,并保持操作的复杂性,必须尽可能地依靠合理的限制–尽管即使这样也未必能在所有情况下加强懒惰性

>> ORMs Should Update “Changed” Values, Not Just “Modified” Ones [jooq.org]

Many ORMs update values that were “touched” but not necessarily changed – which is not ideal. Read the whole article to dive deeper into the problem and a few possible solutions.

许多ORM更新那些被 “触及 “但不一定被改变的值–这并不理想。阅读整篇文章,深入了解这个问题和一些可能的解决方案。

3. Musings

3.思索

>> A Look at 5 NoSQL Solutions [daedtech.com]

A quick and practical introduction to NoSQL and the most popular solutions.

对NoSQL和最流行的解决方案进行快速和实用的介绍。

>> Stop waiting for perfection and learn from your mistakes [allthingsdistributed.com]

Errors/mistakes happen and we need to learn how to embrace them in order to improve and innovate because they are the part of the process.

错误/失误会发生,我们需要学习如何接受它们,以便改进和创新,因为它们是过程的一部分。

Also worth reading:

还值得一读的是:

4. Comics

4.漫画

And my favorite Dilberts of the week:

还有本周我最喜欢的Dilberts。

>> You have a low opinion of people [dilbert.com]

>> Updating my friend resource [dilbert.com]

5. Pick of the Week

5 本周精选

>> Make Your Life Better by Saying Thank You in These 7 Situations [jamesclear.com]