Code Review 痛并享受着

Categories: Java; Tagged with: ; @ September 12th, 2013 0:06

1. Interface

几乎所有的Class都是某些Interface的实现, 但我从来没有认真考虑过接口应该怎么用, 用到什么程度.

举例说, 有接口IDatabase, 还有具体类DefaultDatabase, Oracle, DB2…

理论上, 除了配置文件/Factory中可能会用到具体实现, 初次之外, 就不应该在任何Class中使用具体实现!

但事实上, 尤其是在不假思索, 取名叫做DefaultDataBase时,  经常会使用DefaultDataBase而不是IDatabase…

 

2. SVN

模块/文件夹 需要重构+重新命名.

由于担心SVN出现莫名其妙的问题, 所以新建了文件夹, 然后将新的文件逐步复制进去.

所有文件的历史记录将丢失.

 

3. Exception

WebService的Exception应该继续抛出, 而不是处理. 这样客户端在收到Exception后可以进行后续处理, 譬如重定向到某一个错误页面.

CodeReview using Crucible and JIRA 使用Crucible,JIRA进行代码审查

Categories: Development NotesJava; Tagged with: ; @ June 17th, 2012 13:41

Crucible is a tool that facilitates code review. It can be as valuable to organisations that already have a formal inspection process as it is to teams that don’t review at all.

Regular peer review is a proven process with demonstrable return on investment (ROI). The benefits vary from team to team but commonly include:

  • Identifying bugs and defects early.
  • Sharing expertise and encouraging knowledge transfer.
  • Improving system-wide knowledge.
  • Encouraging adherence to internal standards and style conventions.
  • Identifying individual strengths and weaknesses.

In my previous post “Link code change list and issue with FishEye and JIRA 关联代码变更与Issue/BacklogItem’’, test report a bug, and I submit my code change, and linked the code changes to the issue.  and now, we need to review the codes I submitted before.

  1. [David] Create a new code review by click ‘Create review’, select project, and input name, select the reviewers, and we can config weather anyone can join the review. we invite a guy named ‘admin’ to review my code.
  2. [David] Add content to review:  we can add a changeset, a file in the repositorie, or attachements, etc,.
    image
    Select the code change, and start the review.
  3. [Admin] ‘admin’ login into curcible, and see the review:
    image

    In the left tree, there are the codes need to be review, click one:
    image
    Then mark as ‘Complete’

  4. [David] And now, David can check the result:
    image
    It’s really cool!
  5. [David ]  summarize and close this review by clikc ‘summarize’ :
    image
  6. And what more, JIRA will link this review to the bug:
    image



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.