- 博客(3)
- 资源 (1)
- 收藏
- 关注
原创 优雅的判空操作_对需要频繁判空的对象entity的代码优化
优雅的判空操作 --> 对需要频繁判空的对象entity的代码优化 代码结构 entity是本文用到的对象,里面还用到了entityReturn作为field和getEntityReturn的返回值,如下图红框 Entity对应的接口:entity是Ientity的实现类,Nullentity也是这个接口实现类 相同的,entityReturn也是相似的套路 看红色箭头->...
2018-11-25 16:48:26 1736 1
原创 Native Code To Gget Expensive Resource Such As Database Connection(Self Protection Mechanism)
emm, in our common application scenario, getting system resource such as database connection seems to be easy , but when we program in high concurrent scenario , it would be disorder. How can we prot...
2018-11-30 22:03:37 192
原创 gracefully cancel/shutdown the thread
for something we should care it when you read this article 1. Interrupt operation in synchronized code block 使用synchronized关键字获取锁的过程中不响应中断请求,这是synchronized的局限性,如果这对程序是一个问题,应该使用显式锁,java中的Lock接口,它支持以响应中...
2018-11-29 17:04:14 161
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人