4 a2 Z, E/ M! z y0 Y6)、 事务处理 / ^2 E# q+ c- `, U; q2 F事务范围是否合理;或者说,是否把不必要的操作放到了同一个事务中( v8 c0 f. c+ N& g- c r! j6 E7 }
事务传播方式是否合理(required,never,new等配置)+ A% P1 E8 L% N2 [& c
; l4 L! Y# w$ a: L% S7)、sql语句 " C& y+ G5 a( I0 T1 p) ?7 y- dsql语句是否正确" B* g% ?8 Z8 j7 P
使用mybatis的动态语句时,是否有潜在的sql语法问题 , l) X' U% ?; f9 F% W5 P, P& H - p1 Y; O4 F' X8)、第三方组件 8 A0 H# |6 {8 d( s7 j使用Redis,RabbitMQ等组件,是否真的对组件完全了解,在使用的过程中是否正确执行了开启与关闭操作。3 ^* x1 V6 b& v, r* O4 W
/ j* X( H6 \; z' u
3. 可继承性。代码重用性,根据新的功能不用修改目前代码或是很少修改吧所需要的功能添加上去。 , d2 @: o2 j! i/ D# L+ ~0 z a# n/ O' ]* M$ E
4. 可测性、可配置性和已修复bug。把所设计的代码根据功能进行,尽量少的bug。项目模块化,根据模块的配置进行项目的组装,成为新的项目。3 Y1 G" @- a) X) ~4 w% ^; D" e
+ d2 \8 l# x2 t9 [- m8 t) v" w G& H% h2 ~ i$ h1 c + u1 P" D! S# l+ t7 A) V 关于其他方面的说明定义:- p* _' N: O% _' n1 p S
9 @+ K/ y7 }: w9 C
'Good code' is code that works, is bug free, and is readable and maintainable. Some organizations have coding 'standards' that all developers are supposed to adhere to, but everyone has different ideas about what's best, or what is too many or too few rules. There are also various theories and metrics, such as McCabe Complexity metrics. It should be kept in mind that excessive use of standards and rules can stifle productivity and creativity. 'Peer reviews', 'buddy checks' code analysis tools, etc. can be used to check for problems and enforce standards. 3 S% V7 X5 g9 _ / z2 \" y' g6 b 另外,来自 MSDN END BRACKET 栏目的作者 Paul DiLascia ,也列出了优秀代码应有的物质:不管你用什么语言进行开发,所有的优秀代码都会展示出共有的经典品质:简练,易于理解,模块化,层次性,设计良好,高效,优雅,并且清晰。 3 B) L3 A- | N* r% w# @* b--------------------- : F8 m0 L$ w5 V3 r% R
作者:美丽海洋 & E# h' ~3 G- |+ }" X1 a$ [! v
来源:CSDN ! H& Z& M) z2 }$ s( g, {! Q. v! t0 g. {4 _3 }6 a
- o% D: L# |; L" O1 Q' `" `8 D% a
$ i/ O5 y- l- t* a& m& T* o% Z/ o : D2 z2 `0 |2 g0 U+ e