<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>lixin的生活感悟</title>
    <description>渴望每天都进步！</description>
    <link>http://lixin.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>秒速5厘米</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/114096" style="color:red;">http://lixin.javaeye.com/blog/114096</a>&nbsp;
          发表时间: 2007年08月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          在各位圈友的推荐下特地看了新海诚的《秒速五厘米》，真的是很赞的片子。唯美而写实的画风，<br />
贯穿全片的淡淡的忧伤，真让人回味久久。情节一点不复杂，远野贵树在学校里与同是转校生的<br />
女孩蓧远明里成为了朋友，后来由于父亲工作变动，女孩再次转学。虽然分开在不同的城市中，两人<br />
还是通过邮件保持了联系，原野发现自己对女孩的思念与日俱增，于是他准备了一封信，然后踏上了<br />
去见女孩的长途电车。两人在凌晨时分风雪交加的站台终于重逢了。但是最终贵树并没有把哪封信交给明理<br />
，他明白两人今后不会相守，&ldquo;阻挡在两人前面的是庞大的人生，阻隔在他们中间的是广阔无际的时间&rdquo;，<br />
面对这些障碍两人无能为力。在相依偎着度过了一夜之后他又独自一人踏上回程的电车。随着<br />
时间的推移，远野成为了一名软件工程师（Orz...）生活在大城市中，有一名相交多年的女友，但是稳定的<br />
生活填补不了他的内心中的寂寞，他发现自己忘不了小时候哪个陪他一起看樱花、告诉他樱花每秒钟飘落五<br />
厘米的小姑娘；过了这么多年，往日的回忆还是在脑海中不停地萦绕，繁忙地工作也不能让他停止在街<br />
头巷尾寻找女孩的身影。在梦中他不止一次地回到十三岁那年，他与女孩重逢在风雪中的樱花树下，雪花纷<br />
纷洒洒就如夏日里飘落的樱花，两人毫不犹豫地紧紧拥抱在一起。<br />
情节的简洁，使这部片子看起更加地贴近生活，亮丽写实的画面、默默流露的情感不禁让人想起了自己读书<br />
时的青葱岁月，哪些懵懂的日子，还有哪些没能实现的诺言。远野的坚持，让人感觉到了他纯净内心的力量；<br />
只是对他成年后，略带颓废的生活有点看不过去；放下过去，微笑着拥抱新生活，我觉得才是对待爱情、对待<br />
生活的更好的态度；也许这就是片尾远野转身时嘴角的哪丝微笑要传递给我们的。<br />
<br />
秒速五厘米--再次推荐大家观赏！<br />
<br />
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/114096#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 19 Aug 2007 20:26:34 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/114096</link>
        <guid>http://lixin.javaeye.com/blog/114096</guid>
      </item>
      <item>
        <title>mysql的连接自动关闭问题</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/109076" style="color:red;">http://lixin.javaeye.com/blog/109076</a>&nbsp;
          发表时间: 2007年08月05日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          在工作中好几次遇见了mysql连接自动关闭的问题，最近系统中的一个模块又碰到了同样的&ldquo;conection failed症状&rdquo;。<br />
由于使用了动态表，该模块并没有使用系统标配的sessionFactory，而是自己构建了一个单独的Hibernate sessionFactory<br />
对动态表进行操作。开始时，我怀疑是不是多线程共用了session而导致的的session关闭问题，于是发起几位同事<br />
一同测试了一下，发现不是这个原因；再详细问一下错误产生时的状况：应用启动很长时间后，只有一个人在操作也有<br />
会出这个错。啊？一听到&ldquo;应用启动很长时间之后才出现&rdquo;，立马想起了mysql这个经典的&ldquo;连接关闭&rdquo;问题，立刻动手为<br />
sessionFactory配了个c3p0连接池，并设置了c3p0定期检查数据库连接：<br />
configuration.setProperty(&quot;<span lang="EN-US">idle_test_period</span>&quot;,&quot;1800&quot;);<br />
重启测试，问题解决。比较搞笑的是，mysql的启动参数中WaitTimeOut竟然和这个问题的出现有关系；这个参数默认设置是<br />
八小时，于是应用启动八小时后才会出现connection failed问题；我们将WaitTimeOut设成很小之后，顺利地在几秒钟内重现了<br />
这个Bug。对了别忘了：<span lang="EN-US">idle_test_period的值必须设得要比WaitTimeOut值小才管用。</span>
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/109076#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 05 Aug 2007 07:09:21 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/109076</link>
        <guid>http://lixin.javaeye.com/blog/109076</guid>
      </item>
      <item>
        <title>AMD64上安装ubuntu所遇到的问题</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/59367" style="color:red;">http://lixin.javaeye.com/blog/59367</a>&nbsp;
          发表时间: 2007年03月12日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          在新配的AMD双核机上安装ubuntu，在光盘启动后，进入安装界面时报错<br />
kernel panic-not syning:io-Apic+timer doesn't work:try using the 'noapic'<br />
kernel parameter。<br />
我google了一下这个错误，据说AMD64上都有这个问题，解决方案是<br />
在启动加载kernel时, 需要noapic作为参数传递给kernel。请问该怎么加这个<br />
启动参数？特别是在光盘启动安装时。。
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/59367#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 12 Mar 2007 21:10:16 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/59367</link>
        <guid>http://lixin.javaeye.com/blog/59367</guid>
      </item>
      <item>
        <title>提前几个小时祝各位javaeyer春节快乐，新年大吉！</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/54721" style="color:red;">http://lixin.javaeye.com/blog/54721</a>&nbsp;
          发表时间: 2007年02月17日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          祝大家在新的一年里面：技术进步，爱情甜蜜，身体健康！<img src="/images/smiles/icon_idea.gif"/>
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/54721#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sat, 17 Feb 2007 14:12:46 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/54721</link>
        <guid>http://lixin.javaeye.com/blog/54721</guid>
      </item>
      <item>
        <title>下午很高兴地参加了BJUG与Agile China的活动</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/52179" style="color:red;">http://lixin.javaeye.com/blog/52179</a>&nbsp;
          发表时间: 2007年02月04日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          下午非常高兴地参加了BJUG与Agile China联合举办的活动。地方很远，<br />
不幸迟到了半小时。不过还好两个session的大部分都听到了。第一个<br />
是乔梁介绍agile在实际项目中的应用，乔梁在他的项目中并没有采用全<br />
套的敏捷方法，而是有选择地采用了一些:每日构建、单元测试，快速迭<br />
代等等。让我映像深刻的是每日十五分钟的短会，每个人站在工位上简<br />
短地汇报自己昨天做了什么，遇到了什么问题，今天准备做什么。通过这<br />
样的交流，PM会对项目的状态有个准确地把握。第二个session是冰云主<br />
讲的BA in agile。BA指得是Business analyst，这对我来说是个很新鲜的<br />
词，冰云的原话我不太记得了，在这里写一点我自己的理解，BA的主要职<br />
责是挖掘客户需求并将其转化为一个个写在卡片上的的user story.以下是一<br />
个user story的句式as a..I want...so that..。 user story写完后，交给程序员<br />
开发。最后QA根据user story来进行测试。我个人觉得BA的工作与现在公司<br />
中的应用设计师&amp;界面设计师&amp;功能设计师有点像，带有一定的设计职责。<br />
呵呵，中间休息时间和冰云闲聊了一阵，发现他非常善于交流，也许这也是<br />
ThoughtWorks敏捷编程的一个标志吧。<br />
本来这次去以为会有技术方面的专题，结果两个session全是方法学上的，<br />
不过收获还是很大的，TDD，单元测试等敏捷方法都是值得程序员学习的，<br />
它们可以极大的提高个人工作效率。总而言之，参加这种活动还是很值得，<br />
这么多人无私地和你分享思想，下次也一定不能错过呀！<br />
<br />
在结尾重复一下敏捷编程的原则：个体与交流&gt;&gt;过程与文档<br />
<br />
<br />
注:user story的来源是process modeling或domain modeling。<br />
user story的编写规则：INVEST(I - Independent<br />
N - Negotiable,V - Valuable,E - Estimable,S - Small,T - Testable)
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/52179#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 04 Feb 2007 20:05:04 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/52179</link>
        <guid>http://lixin.javaeye.com/blog/52179</guid>
      </item>
      <item>
        <title>问个貌似很简单的问题，关于在Spring下运行关于Quartz的单元测试</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/51616" style="color:red;">http://lixin.javaeye.com/blog/51616</a>&nbsp;
          发表时间: 2007年02月01日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          通过在Spring配置文件中配置了以下各个bean以后，如何在Junit的testcase中使quartz运行起来？<br />在setup()方法中，已建立了applicationContext。我试图通过显式调用SchedulerFactoryBean.start()<br />方法来运行quartz，没有成功。<br /><pre name="code" class="java">
&lt;beans>
	&lt;description>This  is a start! &lt;/description>
	&lt;bean id="testSpring" class="com.test.app.TestSpring">

	&lt;/bean>
	
	&lt;bean id="exampleJob" class="org.springframework.scheduling.quartz.JobDetailBean">
		&lt;property name="jobClass" value="com.test.app.ExampleJob"/>
		&lt;property name="jobDataAsMap">
			&lt;map>
				&lt;entry key="nameofjob" value="leexin's TEST!"/>
			&lt;/map>
		&lt;/property>
	&lt;/bean>
	
	&lt;bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
		&lt;property name="jobDetail" ref="exampleJob"/>
		&lt;property name="startDelay" value="10000"/>
		&lt;property name="repeatInterval" value="500000"/>
	&lt;/bean>
	
	&lt;bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		&lt;property name="triggers">
			&lt;list>
				&lt;ref bean="simpleTrigger"/>
			&lt;/list>
		&lt;/property>
	&lt;/bean>

&lt;/beans>
</pre>
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/51616#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 01 Feb 2007 15:06:18 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/51616</link>
        <guid>http://lixin.javaeye.com/blog/51616</guid>
      </item>
      <item>
        <title>偶然的感悟</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/41321" style="color:red;">http://lixin.javaeye.com/blog/41321</a>&nbsp;
          发表时间: 2006年12月28日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>刚刚在robbin的博客看到了他的一些小时候照片，也不禁想起了自己的<br />
小时候。时间过的真快呀；还没有整明白怎么回事，时间已经把成长的<br />
压力带到了面前。在工作后才明白什么是自己所要追求的，才明白自己想</p>
<p>要过什么样的生活，才明白了目标的所在，才明白时间才是真正宝贵的东西。</p>
<br />
<p>我认为生命的壮美就在勇敢地与风浪搏斗，在于为实现自己的理想而自强不息；</p>
<p>厉兵秣马，枕戈而旦，并不是宗教式的狂热，而是对自己心中信念的坚持。是的，</p>
<p>生活就是这样，你可以选择整日嘻嘻哈哈、在网游中开心每一分钟；也可以选择</p>
<p>找到自己的目标，并为之付出不懈的努力。</p>
<p><br />
</p>
<p>希望一切都顺利，我会努力的。</p>
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/41321#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 28 Dec 2006 22:39:32 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/41321</link>
        <guid>http://lixin.javaeye.com/blog/41321</guid>
      </item>
      <item>
        <title>JDK1.5[转载]</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/22718" style="color:red;">http://lixin.javaeye.com/blog/22718</a>&nbsp;
          发表时间: 2004年11月11日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          I have been writing JDK 5.0 code for over six months now, so I thought I would take some time to reflect on my experience and draw a few conclusions on the features that were introduced. <br /><br />Enhanced for loop <br />The undisputed winner. I can't even begin to describe how good it feels to use the new for loop everywhere (well, almost everywhere). I mentally cringe the few times when I am forced to use the old for loop, typically when I need the index or that I want the Iterator to be visible outside the loop. <br /><br />The code is much more readable and feels less cluttered with noise (e.g. indices when you don't need them or incrementation exposing the underlying implementation). This latter point was an unexpected benefit of the new loop, by the way. Imagine that you have: <br /><br />String[] names = ...;<br />for (String name : names) {<br />  // ...<br />}<br /><br />and you decide that you want to change the type of names to a Collection. How do you modify your code? <br /><br />List&lt;String> names = ...;<br />for (String name : names) {<br />  // ...<br />}<br />That's right, just one line. It doesn't get better than that. <br />Annotations <br /><br />Obviously, I am partial to annotations since they are at the heart of TestNG but I am a firm believer that annotations are going to change the way we build software in Java. We have been relying for far too long on reflection hacks to introduce meta-data in our programs, and annotations are finally going to provide an excellent solution to this problem. <br /><br />Also, I haven't felt the need to use some of the predefined annotations such as @Override, so I haven't formed an opinion on them yet. <br /><br />It seems inescapable to me that in a couple of years, most of the Java code that we will be reading and writing will contain annotations. <br /><br />Static imports <br />I hardly use them at all, except in my annotations type for Retention and Target. I am still not convinced that the original intent that motivated the addition of this feature (discourage the anti-pattern of implementing an interface to be able to reuse its constants without having to qualify them) justifies the introduction of a new language feature, but time will tell. <br /><br />I guess that in some way, the use of an IDE in my day-to-day programming makes imports absolutely obsolete, so I can't really get myself to feel strongly about this feature anyway. <br /><br />Variable-length arguments <br />I haven't had the need for this feature at all so far. It might come in handy once in a while but I'm really not convinced it warranted a change in the language. <br /><br />Enums <br />While I definitely give Enums a theoretical nod of approval, I haven't really converted my code to them yet, and I haven't acquired the reflex to use them either. I believe that when I do, I'll be happy with the result and it will make my code a tad more robust. <br /><br />Generics <br />I left the best for the end... but since this entry is getting a bit long, I will save the Generics discussion for tomorrow. <br /><br />Autoboxing <br />I have stayed away from autoboxing so far, probably because I have a vague feeling of losing control of the performance of my code. I don't think it is justified, though, so autoboxing can come in handy and make your code a little bit more readable. I think I would encourage developers to flag their code when such autoboxing is happening, and I am pretty sure that IDE's will soon be able to do the same. <br /><br />Generics <br />Where to start? <br /><br />Well, first of all, nobody can dispute that Generics are a solid concept that tends to improve the robustness of your code. The reason why they are so usually controversial regardless of the language is because of their implementation. And for having been a member of the C++ committee for many years , I can definitely vouch for the difficulty of getting them right. <br /><br />In a nutshell, I have this to say about Java generics: my code feels more robust, but it's harder to read. <br /><br />So what's the problem? <br /><br />Redundancy. <br /><br />First of all, I have always had a hard time with the redundancy introduced by the necessity of casting in general. For example, instead of writing: <br /><br />Map accounts = new HashMap();  // no generics<br />...<br />Account a = (Account) accounts.get("Cedric");<br /><br />why can't I just write: <br /><br />Map m = new HashMap();  // no generics<br />...<br />Account a = m.get("Cedric");<br /><br />and let the compiler introduce a silent cast, since obviously, it's an object of type Account that I am trying to retrieve from the Map? <br />Obviously, Generics don't solve this problem entirely but they make a decent job at alleviating it somewhat. But they also make it worse in some other ways: <br /><br />Map&lt;String, List&lt;Account>> accounts =<br />  new HashMap&lt;String, List&lt;Account>>();<br /><br />Ouch. <br />Not only is the code significantly harder to read, but it fails to obey the DRY principle ("Don't repeat yourself"). What if I need to change the value type of this map from List&lt;Account> Collection&lt;Account>? I need to replace all these statements everywhere in my code. While IDE refactoring will help, it's still an awful lot of code for a modification of this kind that hardly impacts the semantics of this code. <br /><br />Admittedly, there is no nice way to avoid this syntax when you are creating a new object, but what I am driving at is that I think Generics would have been better off if typedefs had been introduced with them. <br /><br />Or so I thought at first. <br /><br />But after thinking about it more, I realized that typedefs were the wrong solution to the problem, because simply put, they don't add anything to the use of a separate class to define your complex Generic type. <br /><br />class AccountMap extends HashMap&lt;String, List&lAccount>> {<br /> ...<br />}<br /><br />Except for the fact that you need to extend an implementation (HashMap, and not Map, obviously), this solution is probably better than introducing typedef, which has its own quirks. <br /><br />I haven't gone to this trouble so far, but my recommendation would be: do it if you write the type more than three times (twice in the initialization and you use it more than once in your code). <br /><br />Except for this little annoyance, I am quite happy with Generics overall and I particulary enjoy reading the TestNG Javadocs so nicely typed. <br /><br />Conclusion <br />I am very happy with the new features of JDK 5.0 and I am quite proud to have had a chance to influence it with my participation in JSR 175 and JSR 201. Like all radical evolutions, not all of the new features will be popular with everyone, but as long as most developers find some of these features useful and that backward compatibility is preserved, I think JDK 5.0 is a very solid step toward more solid Java code.
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/22718#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 11 Nov 2004 13:02:08 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/22718</link>
        <guid>http://lixin.javaeye.com/blog/22718</guid>
      </item>
      <item>
        <title>咳！</title>
        <author>lix23</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://lixin.javaeye.com">lix23</a>&nbsp;
          链接：<a href="http://lixin.javaeye.com/blog/22717" style="color:red;">http://lixin.javaeye.com/blog/22717</a>&nbsp;
          发表时间: 2004年11月11日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          我的blog!!hehe
          <br/>
          <span style="color:red;">
            <a href="http://lixin.javaeye.com/blog/22717#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/106' target='_blank'><span style="color:blue;font-weight:bold;">JavaEye问答大赛开始了！ 从6月23日 至 7月6日，奖品丰厚 ！</span></a></li><li><a href='/adverts/92' target='_blank'><span style="color:red;font-weight:bold;">快来参加7月17日在成都举行的SOA中国技术论坛</span></a></li><li><a href='/adverts/97' target='_blank'><span style="color:blue;font-weight:bold;">Oracle专区上线，有Oracle最新文章，重要下载及知识库等精彩内容，欢迎访问。</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Thu, 11 Nov 2004 12:59:16 +0800</pubDate>
        <link>http://lixin.javaeye.com/blog/22717</link>
        <guid>http://lixin.javaeye.com/blog/22717</guid>
      </item>
  </channel>
</rss>