开发者

Java Project Template

We are starting to build a large middle tier java application (we开发者_如何学Gobservices, etc.,). I want to create a template project, so it can used for any other future projects.

Here is what i am thinking of defining in the template project:

  1. Caching mechanism (for look up and other meta information)
  2. Exception handling
  3. Logging
  4. Needed third party frameworks (build, test, spring) any thing else that can be included here?

I am looking for expert suggestions on each of these areas: 1)

  1. I am thinking ehCache, any comments on this? positives, negatives or alternatives?
  2. I dont want developers just to use blanket try/catch blocks.. some mechanism to automatically catch those and log it and configure in a way we want. any suggestions?
  3. log4j
  4. I think i will go with Maven, JUnit and Spring; any other 3rd party frameworks worth considering? I dont want to discuss maven versus ant, etc.,

Thank you,


Exception Handling: If you pick spring framework then you would get some help in this regards

  • I say spring provides exception translation for persistence layer so no boiler plate code
  • I think if you cannot recover and finish the task on hand why not just make it a RuntimeException
  • I am not big fan of expressing a business rule as an exception (ex: PatientNotFoundException just from my personal experience)

Log4j: I would just say use slf4j abstraction

Maven: I think Maven is a good build tool as any, I would recommend you to look into Gradle, Since it is a new project it might be worth while to have a look

I would also add that, It is worth while to invest some time into Continuous Integration and tools like Jenkins or Bamboo

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜