使用Spring的最小好处
来源:互联网 发布:孕妇装春装2015淘宝网 编辑:程序博客网 时间:2024/04/29 01:53
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
现在自己是PM了(虽然手下只有自己一个人)向老板要了几周时间开始重构一个虽然质量上只能说是DEMO但却已经搭配其他软件卖给用户了的破程序。嗨,想当年可是连续2个月,天天10点以后才回家,熬出来的东东呀。
言归正传,最先引入Spring,只是看中它和hebernate集成的很好,web层又比struts简化得多。不过这几天还在重构逻辑层的代码,发现了他的一个可能非常微小的好处——读取配置文件。原先的配置文件是XML格式,各个模块的所有配置都写在里面,由一个singleton的Config类解析,提供访问。造成所有的模块都依赖于Config类,影响了代码的复用。现在用了Spring,所有的类需要配置信息的话只要提供Set方法,统一配置在Spring的context中,Spring会帮你解析配置,转化为你所需要的类型,然后set给你的类,而且还支持多个配置文件,refresh。
呵呵,IOC还是有些好处的,吾将上下而求索。
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 使用Spring的最小好处
- Spring使用的好处
- 使用spring的好处
- 使用Spring框架的好处
- 使用Spring框架的好处
- 使用Spring框架的好处(转帖)
- 使用Spring框架的好处(转帖)
- 使用Spring框架的好处(转帖)
- 使用Spring框架的好处(转帖)
- 使用Spring框架的好处是什么?
- spring框架的好处,为什么使用它?
- Spring框架的组成及使用spring的好处
- spring的好处--PropertyPlaceholderConfigurer
- spring的好处--PropertyPlaceholderConfigurer
- 用spring的好处
- Spring的好处
- Spring框架的好处
- spring注解的好处
- 工欲善其事,必先利其器——搭建J2ME开发环境
- 实例说明java中覆盖静态方法和非静态方法的不同
- 初碰J2EE:RMI灰头灰脑篇
- Java 实现MVC模式的例子
- 深入分析J2ME平台MIDP高级事件处理机制
- 使用Spring的最小好处
- 对于Java的看法
- 使用Java实现对dbf文件的简单读写
- JavaWebStudio系列开发工具Visaul Struts版本简介
- 单挑Weblogic和EJB---我的流水帐学习笔记(一)
- 用Java实现FTP服务器
- Struts单选框的实现
- Apache2+Tomcat5.0.24+Mysql4.0
- JDBC性能技巧(3)