3

Spring 里有不能把 dao 传给 pojo 这种规范吗

 3 years ago
source link: https://www.v2ex.com/t/778432
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Java

Spring 里有不能把 dao 传给 pojo 这种规范吗

  Leviathann · 1 天前 via iPhone · 883 次点击
有个可以配置的 filter 对象包含 n 条判定规则,如果某条规则没配置就不用判定,其中某几条规则的判断需要 io,所以把几个 dao 包了个 pojo 传给这个 filter,做一个延迟加载。
结果 reviewer 不给通过,说不能这么写。
我说那怎么改,他说把 filter 自带的 test 方法写到 service 里。。这个 test 方法大概有几十行,把所有内部属性的判定函数都用&&连接起来。

我想了下,把几个 dao 的调用都改成 lambda 传进去,多写了一堆 function supplier 之类的类型声明,然后就给通过了。。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK