WEB开发网
开发学院WEB开发Jsp Java企业应用开发实践TOP10 阅读

Java企业应用开发实践TOP10

 2008-01-05 10:31:41 来源:WEB开发网   
核心提示:1.使用MVC.2. 在每一层建议写自动测试代码;3. 根据规范开发,不要依靠具体应用服务器的实现;4. 从一开始考虑J2EE的安全问题;5. 团队成员负责自己熟悉的模块开发;6. 使用session Facades,假如使用EJB;7. 使用Stateless Session Bean,Java企业应用开发实践TOP

  1.使用MVC.
  2. 在每一层建议写自动测试代码;
  3. 根据规范开发,不要依靠具体应用服务器的实现;
  4. 从一开始考虑J2EE的安全问题;
  5. 团队成员负责自己熟悉的模块开发;
  6. 使用session Facades,假如使用EJB;
  7. 使用Stateless Session Bean, 尽量少用Stateful SessionBean;
  (上次GavinKing提出了相反的观点,可以查看GavinKing的Blog;Stateful Session Beans Rock http://blog.hibernate.org/cgi-bin/blosxom.cgi/2004/04/);
  8. 使用容器治理事务;
  9. 建议使用jsp作为表现层的首要技术选择。
  10.假如使用HttpSession,不要什么东西都往里面放,只有确实需要的对象。
  12. 使用CMP Entity生产效率高,相对于ORM产品.
  
  我的观点:
  1、使用MVC确实不错,尤其对于项目大,而且以后修改方便。
  2、确实是很好的建议,目前没有在实际工作中没有实践过,零碎地写过
  6、7、SPRing是个不错的候选者,简单易用,易测试。
  9、很好的建议,也许Tapestry很好,很多项目使用JSP已经够用;
  12、不同意。是不是想要推销IBM Websphere,呵呵。
  其他的不了解,假如大家由这方面的经验,和大伙说说吧。
  
  翻译的不好,原文档如下:
  java代码:
  
  The best practices
  
  1. Always use MVC.
  2. Apply automated unit tests and test harnesses at every layer.
  3. Develop to the specifications, not the application server.
  4. Plan for using J2EE security from Day One.
  5. Build what you know.
  6. Always use Session Facades whenever you use EJB components.
  7. Use stateless session beans instead of stateful session beans.
  8. Use container-managed transactions.
  9. Prefer JSPs as your first choice of presentation technology.
  10. When using HttpSessions, store only as mUCh state as you need for the current business transaction and no more.
  11. In WebSphere, turn on dynamic caching and use the WebSphere servlet caching mechanism.
  12. Prefer CMP Entity beans as a first-pass solution for O/R mapping due to the programmer productivity benefits.

Tags:Java 企业 应用开发

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接