<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MoDoFo.println(" &#187; Java</title>
	<atom:link href="http://zhangv.com/archives/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>http://zhangv.com</link>
	<description>Life for Idea - forever young</description>
	<lastBuildDate>Wed, 01 Sep 2010 10:44:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jdepend分析研究</title>
		<link>http://zhangv.com/archives/1429</link>
		<comments>http://zhangv.com/archives/1429#comments</comments>
		<pubDate>Sun, 31 Jan 2010 11:33:52 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jdepend]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/1429</guid>
		<description><![CDATA[jdepend使用起来还是比较容易的,但是report分析,以及背后的一些事情还是要弄明白的.否则report就真的成了只是report而没有任何实际价值.
使用jdepend的目的
分析包的依赖情况是否满足面向对象的依赖原则.其实面向对象,设计模式变出那么多花样最后无非就是要解决依赖的问题.但很多情况下,我们用了技巧却忘了为什么用,最后便的为了技巧而技巧,为了设计而设计,而忽略了最终目的.
也许这种感觉只有在深刻的体会过"混乱"之后才能理解吧.
如何分析jdepend的report
Abstractness - 抽象度,该包中抽象类所占的比例
Afferent coupling(Ca) - 被依赖度,有的翻译成传入耦合.我觉得传入耦合不是很清楚,很容易让人理解反了.指依赖该包的其他包的总数. 这个值越高说明他应该要么是公用包,要么是抽象(接口)包
Efferent coupling(Ce) - 依从度,有的翻译是传出耦合.指该包依赖于其他包的个数.通常越高表明依赖其他包越严重,如果这个包不是实现包,并不意味着ce就越大越好.依从度应该在一个合理的范围.同时依从的包应该是stable的.
Instability(I) - 不稳定性.公式 ce/(ce+ca).即依从度在所有依赖中的比例.还比较好理解,如果是完全抽象包(ca=N,ce=0),I=0,如果是完全具体实现包(ca=0,ce=N),I=1.
Distance - 指该包和理想情况的最大差距.这个有点绕.举个例子,如果一个包的A=1,也就是完全抽象的.那么他的I应该是=0的,但如果不是(也即是他还要依赖其他更抽象的包).那么distance=Instability-0(理想值).而如果一个包的A=0,即该包完全是实现,那么他的I应该是1,那么distance = 1(理想值)-Instability
而如果0&#60;A&#60;1,那么就不知道他的I的理想值是什么了.这个时候理想值应该是A,distance=&#124;A+I-1&#124;.
参考资料1


	Tags: Java, jdepend
]]></description>
		<wfw:commentRss>http://zhangv.com/archives/1429/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java获取昨天的日期</title>
		<link>http://zhangv.com/archives/1288</link>
		<comments>http://zhangv.com/archives/1288#comments</comments>
		<pubDate>Tue, 20 Oct 2009 07:46:49 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[canlendar]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/1288</guid>
		<description><![CDATA[如果不小心还是会栽跟头，看到网上有的人只是roll(Calendar.Date,-1)就了事了。要么就是判断日，月写一大堆。其实最简单的应该是：
GregorianCalendar cal = new GregorianCalendar();if(cal.get(Calendar.MONTH)==0 &#38;&#38; cal.get(Calendar.DAY_OF_YEAR)==1){&#160;&#160;&#160;&#160; cal.roll(Calendar.YEAR, -1);}cal.roll(Calendar.DAY_OF_YEAR, -1);
不知道是不是最简单的


	Tags: canlendar, Java
]]></description>
		<wfw:commentRss>http://zhangv.com/archives/1288/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>对Java技术面试非常有用的几本书</title>
		<link>http://zhangv.com/archives/1188</link>
		<comments>http://zhangv.com/archives/1188#comments</comments>
		<pubDate>Mon, 10 Aug 2009 04:10:33 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[面试]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[书]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/1188</guid>
		<description><![CDATA[Effective Java - 2002年的Jolt大奖，详细讲解了57个平时 不大会深入了解而又非常重要的知识点。作者Joshua Bloch还有一本类似的书 - Java PuzzlersEffective Enterprise Java - Effective Java的姊妹篇，专注于企业级Java应用的各种蹊跷和最佳实践。Bitter Java - 从负面学习，在教训和犯错中成长。作者列举了大量的反模式来挑战我们那些被动接受的先入为主。高质量Java程序设计：2003年的一本书，作者是几个国内的程序员。模仿Effective Java的组织形式，通过35个条款，讲解了一些在实际工作中经常会忽视的问题。SCEA study guide - 考试用书，如果可能遇到面试=笔试的情况，当然还可以把其他的study guide都拿出来看看。各种specification,直接到JCP找相应的JSR：

JSE： New I/O&#160;,Concurrency Utilities, Profiling Architecture,JAXP1.3,JavaTM SE 6 Release Contents,JavaTM Language Specification,JVM
JEE: EJB3.0,JSP2.1,  JavaEE 1.5,Servlet 2.4 Specification,JDBCTM 4.0 ,Servlet 3.0,JavaMail,             [...]]]></description>
		<wfw:commentRss>http://zhangv.com/archives/1188/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>facebook-java-api验证问题</title>
		<link>http://zhangv.com/archives/1093</link>
		<comments>http://zhangv.com/archives/1093#comments</comments>
		<pubDate>Sat, 20 Jun 2009 15:56:28 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[openAPI]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/1093</guid>
		<description><![CDATA[想要用facebook-java-api做一个简单的登录验证并获取用户信息，可是：
用facebook的login页面验证后，居然是自动跳转到app的中定义的callbackUrl（也就是app host的url）。这样就给本地调试带来很大的麻烦，难不成每次做了修改都要发布到host上然后再测试？

	Tags: facebook, Java, openAPI
]]></description>
		<wfw:commentRss>http://zhangv.com/archives/1093/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how big should the byte array be in java me(j2me)</title>
		<link>http://zhangv.com/archives/1020</link>
		<comments>http://zhangv.com/archives/1020#comments</comments>
		<pubDate>Wed, 20 May 2009 04:32:07 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JME]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/1020</guid>
		<description><![CDATA[Keep getting the out of memory error when handling the image file in emulator(wtk) and device(e61i)
Just had a simple test and here is what I found:
The code is simple:
for(int i=1000;i&#60;Integer.MAX_VALUE;i++){
System.out.println(i);
byte[] buf = new byte[i];
}
and see when your program will crash. - Actually it won't crash, as the OOME(out of memory error), is an Error rather [...]]]></description>
		<wfw:commentRss>http://zhangv.com/archives/1020/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关于java6中scripting engine的invoke和invokeFunction的问题</title>
		<link>http://zhangv.com/archives/976</link>
		<comments>http://zhangv.com/archives/976#comments</comments>
		<pubDate>Sun, 10 May 2009 05:42:48 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/976</guid>
		<description><![CDATA[在java6中加入了对scripts的支持（jsr223），并且捆绑了一种javascript的实现（来自mozilla的rhino)。
但是今天在使用时候发现一个小问题，jdk-6u12和jdk-6u13里的Invocable居然是不兼容的！
在jdk-6u12中是
invokeFunction(String name, Object... args)
而jdk-6u13中是
invoke(String name, Object... args)
在网上发现大多数的写法都是前一种(invokeFunction)，搞不清楚为什么会出现这样的问题。但如果这的出现开发环境和部署环境稍有不同岂不是搞的很不爽，明明只是一个很小的问题。却可能造成很奇怪的结果，还要改代码重新编译才行。
解决方法：
1.开发环境和部署环境的jdk版本统一。
2.干脆使用BSF或者BSH。
虽说两种方法和简单直接，但是总觉得因为这么一点点问题而动这么大的干戈真不应该。


	Tags: Java, script
]]></description>
		<wfw:commentRss>http://zhangv.com/archives/976/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google App Engine Java</title>
		<link>http://zhangv.com/archives/902</link>
		<comments>http://zhangv.com/archives/902#comments</comments>
		<pubDate>Tue, 14 Apr 2009 01:58:32 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[非技术(non-tech)]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/902</guid>
		<description><![CDATA[http://code.google.com/appengine/docs/java/overview.html

	Tags: gae, google, Java
]]></description>
		<wfw:commentRss>http://zhangv.com/archives/902/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nokia网站上的资源</title>
		<link>http://zhangv.com/archives/900</link>
		<comments>http://zhangv.com/archives/900#comments</comments>
		<pubDate>Sat, 11 Apr 2009 15:36:42 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JME]]></category>
		<category><![CDATA[nokia]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/900</guid>
		<description><![CDATA[pureMVC http://wiki.forum.nokia.com/index.php/Model-View-Controller_Architecture可以用于jme开发的MVC框架
nokia2008年的CallingAllInnovators比赛的获胜者，其中总冠军是来自中国的，居然一直都没听说过，Grand Prize: X Dancery，看了一下视频，震撼到了!http://www.callingallinnovators.com/previous_winners.aspx
eSWT貌似s60的runtime一直都支持eSWT，怎么没怎么见有人用过呢？可能还是见的太少了。http://wiki.forum.nokia.com/index.php/ESWTeRCP是nokia的开源项目http://www.eclipse.org/ercp &#160;&#160;&#160; * eSWT:&#160;&#160; The embedded Standard Widget Toolkit which is a subset of desktop SWT API. An eSWT implementation for Series 80 has been contributed. The development for s60 platform is in progress.&#160;&#160;&#160; * Core Runtime:&#160;&#160; Eclipse Core which provides OSGI and Extension Point Framework support.&#160;&#160;&#160; * eJFace:&#160;&#160; A set [...]]]></description>
		<wfw:commentRss>http://zhangv.com/archives/900/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>惭愧惭愧</title>
		<link>http://zhangv.com/archives/612</link>
		<comments>http://zhangv.com/archives/612#comments</comments>
		<pubDate>Thu, 05 Feb 2009 15:20:52 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[源码]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/612</guid>
		<description><![CDATA[今天才领略了一下HashMap的代码，原来HashMap是一个双重hash码为索引的数组，数组里放的是Entry的链表（也就是拥有相同hashcode的对象会存储于这个链表里，而不是被覆盖掉）。
因为上次被人问到，居然没有答上来。记录在此。

	Tags: Java, 源码
]]></description>
		<wfw:commentRss>http://zhangv.com/archives/612/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWT的布局管理小结</title>
		<link>http://zhangv.com/archives/611</link>
		<comments>http://zhangv.com/archives/611#comments</comments>
		<pubDate>Sun, 01 Feb 2009 10:52:00 +0000</pubDate>
		<dc:creator>zhangv</dc:creator>
				<category><![CDATA[技术(Tech)]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[swt]]></category>

		<guid isPermaLink="false">http://zhangv.com/archives/611</guid>
		<description><![CDATA[SWT的布局管理
FillLayout组件填满整个容器，当容器大小变化时，组件同时跟随变化。如果同时添加多个组件，则每个组件将平均分配容器空间。默认情况下filllayout会水平添加多个组件。可以通过设置来达到垂直加入。s.setLayout(new FillLayout(SWT.VERTICAL));
RowLayout组件会按行排列，当容器大小不够排列时，组件会自动排到第二排。如果不希望容器自动排列，可以通过设置wrap：rl.wrap = false;如果想要让一排中所有组件都同宽，可以通过设置pack：rl.pack = false;设置纵向排列RowLayout rl = new RowLayout(SWT.VERTICAL);
GridLayout可以设置参数决定组件加入容器时占多少行、列单元格，如何填充.设置列数：GridLayout gl = new GridLayout( );&#160;&#160;&#160;&#160;&#160;&#160;&#160; gl.numColumns=3;&#160;&#160;&#160;&#160;&#160;&#160;&#160; s.setLayout(gl);控制组件的尺寸和对齐方式：对齐方式：GridData gd = new GridData( );gd.horizontalAlignment = GridData.CENTER;//GridData.BEGINNING,GridData.ENDl1.setLayoutData(gd);组件填充方向：gd = new GridData(GridData.FILL_HORIZONTAL); //FILL_VERTICAL,FILL_BOTHt1.setLayoutData(gd);
FormLayout用来布局表单，也是最复杂的布局管理,在FormLayout中FormData和FormAttachment的设置是必需的。&#160;&#160;&#160; FormData fd = new FormData( );&#160;&#160;&#160;&#160;&#160;&#160;&#160; fd.top = new FormAttachment(10, 10);&#160;&#160;&#160;&#160;&#160;&#160;&#160; fd.left = new FormAttachment(0, 10);&#160;&#160;&#160;&#160;&#160;&#160;&#160; fd.bottom = new FormAttachment(30,0);&#160;&#160;&#160;&#160;&#160;&#160;&#160; fd.right = new FormAttachment(40,0);&#160;&#160;&#160;&#160;&#160;&#160;&#160; l1.setLayoutData(fd);上面这几行代码首先设置了组件的上下左右边缘的距离 - 上端位于整个容器的10%处，

	Tags: [...]]]></description>
		<wfw:commentRss>http://zhangv.com/archives/611/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
