<?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>Dominic.Xu&#039;s 博客 &#187; JAVA</title>
	<atom:link href="http://xuplus.com/article/category/java/feed" rel="self" type="application/rss+xml" />
	<link>http://xuplus.com</link>
	<description>Web 2.0 生活</description>
	<lastBuildDate>Wed, 24 Aug 2011 05:26:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>清除MyEclipse升级之后的残留文件</title>
		<link>http://xuplus.com/article/2009/11/a134.html</link>
		<comments>http://xuplus.com/article/2009/11/a134.html#comments</comments>
		<pubDate>Wed, 04 Nov 2009 03:41:26 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[软件应用]]></category>
		<category><![CDATA[MyEclipse]]></category>
		<category><![CDATA[升级残留]]></category>

		<guid isPermaLink="false">http://xuplus.com/article/2009/11/a134.html</guid>
		<description><![CDATA[MyEclipse 8.0 M2刚刚发布，MyEclipse自动升级成功之后发现硬盘竟然消耗掉了几百M，重启MyEclipse和计算机也没有减少我可怜D盘的空间占用，进入程序目录发现plugins目录竟然还遗留了非常多的8.0 M1的文件，明显特征是现在很多文件后缀是7.9.200，却还存在7.9.100的文件和文件夹。发现MyEclipse自动升级过程中竟然没有清除老的文件包，是在太弱了，而且和程序文件混杂在一起，叫人怎么清除这些没有用的文件哦。难道Eclipse也这样么？难怪Java就是占用空间，没有用的东西到处放，如果仅仅是备份就文件的话，移动到一个特定目录不就行了。 这次的目标是减少MyEclipse8.0 M1残留文件占用的空间，而保证M2正常运行。 经过分析，发现可以直接删掉MyEclipse 8.0 M2没有用到的文件即可，但是手工删除是在太慢，而且也容易删除错误。MyEclipse安装目录下configuration\org.eclipse.equinox.simpleconfigurator子目录的bundles.info 文件记录了MyEclipse所有加载plugin，于是找到从bundles.info找到所有MyEclipse 8.0 M2需要的文件的方法。具体步骤如下： 1、将bundles.info复制到桌面并重命名为bundles.csv； 2、用Excel打开bundles.csv，删除第一行#version=1,将C列拷贝到UltraEdit中，这样得到了诸如“file:/D:/Program Files/Genuitec/MyEclipse 8/Common/plugins/ca.ecliptical.emf.xpath_1.0.0.me200910150013.jar”的所有plugins列表； 3、在UltraEdit中替换路径前缀file:/D:/Program Files/Genuitec/MyEclipse 8/Common/为空，再替换所有\为/； 4、在Excel中新建一个sheet，将第三步得到的结果拷贝到B列； 5、进入MyEclipse 8.0 M2的Common目录，我的是D:\Program Files\Genuitec\MyEclipse 8\Common\，关闭MyEclipse程序之后将plugins目录重命名为plugins_prev（其他名称也可以但下面的步骤需要和这里的目录名称相同），并新建一个plugins目录 6、在UltraEdit中将第三步得到的结果中的plugins\替换为“move plugins_prev\”；（不包含引号） 7、将第六步得到的结果拷贝第四步的sheet到A列； 8、拷贝第四步的sheet到A列和B列到UltraEdit中新的编辑标签页中，并替换^t为空格，（需开启正则表达式选项，且使用UltraEdit引擎，下同），这样得到一系列的move命令行； 9、在运行对话框中输入cmd打开命令窗口，并将当前路径切换到MyEclipse 8.0 M2的Common目录（我的是D:\Program Files\Genuitec\MyEclipse 8\Common\），将第八步中的结果全部拷贝到cmd中执行，这样可以将所有需要的jar文件全部从plugins_prev目录移动到plugins目录中； 10、经过第9步我们发现所有的jar文件都移动了，但是原来的plugins目录下一些需要的目录并没有移动到新的plugins目录中去，我们还需要移动需要的目录，同样在第八步中的结果上面继续做文章，我们替换“move plugins_prev\*jar^p”为^p，消除所有已经移动过的jar文件条目，再多次替换^p^p为^p，消除所有多余的空行，再替换“plugins\*^p”为“plugins\^p”，即消除多余的目录名； 11、将第10步结果拷贝到第九步打开的cmd中执行，执行完成之后会将需要的目录也拷贝到新plugins目录下； 12、启动MyEclipse，不报错，大功告成！这个时候可以直接将plugins_prev目录给删除掉了，节约了好几百M空间。如果不放心也可以先将这个目录放着不删除 如果有些plugins目录没有放在MyEclipse 的Common下Plugins目录中，可先从bundles.csv中删除对应的条目。 其他MyEclipse或者Eclipse完善自动升级过程。 标签： MyEclipse, 升级残留]]></description>
			<content:encoded><![CDATA[<p><a href="http://xuplus.com/article/tag/myeclipse" class="st_tag internal_tag" rel="tag" title="标签 MyEclipse 下的日志">MyEclipse</a> 8.0 M2刚刚发布，MyEclipse自动升级成功之后发现硬盘竟然消耗掉了几百M，重启MyEclipse和计算机也没有减少我可怜D盘的空间占用，进入程序目录发现plugins目录竟然还遗留了非常多的8.0 M1的文件，明显特征是现在很多文件后缀是7.9.200，却还存在7.9.100的文件和文件夹。发现MyEclipse自动升级过程中竟然没有清除老的文件包，是在太弱了，而且和程序文件混杂在一起，叫人怎么清除这些没有用的文件哦。难道Eclipse也这样么？难怪Java就是占用空间，没有用的东西到处放，如果仅仅是备份就文件的话，移动到一个特定目录不就行了。</p>
<p>这次的目标是减少MyEclipse8.0 M1残留文件占用的空间，而保证M2正常运行。</p>
<p>经过分析，发现可以直接删掉MyEclipse 8.0 M2没有用到的文件即可，但是手工删除是在太慢，而且也容易删除错误。MyEclipse安装目录下configuration\org.eclipse.equinox.simpleconfigurator子目录的bundles.info 文件记录了MyEclipse所有加载plugin，于是找到从bundles.info找到所有MyEclipse 8.0 M2需要的文件的方法。具体步骤如下： <br /> 
<ol>
<li>1、将bundles.info复制到桌面并重命名为bundles.csv；</li>
<li>2、用Excel打开bundles.csv，删除第一行#version=1,将C列拷贝到UltraEdit中，这样得到了诸如“file:/D:/Program Files/Genuitec/MyEclipse 8/Common/plugins/ca.ecliptical.emf.xpath_1.0.0.me200910150013.jar”的所有plugins列表；</li>
<li>3、在UltraEdit中替换路径前缀file:/D:/Program Files/Genuitec/MyEclipse 8/Common/为空，再替换所有\为/；</li>
<li>4、在Excel中新建一个sheet，将第三步得到的结果拷贝到B列；</li>
<li>5、进入MyEclipse 8.0 M2的Common目录，我的是D:\Program Files\Genuitec\MyEclipse 8\Common\，关闭MyEclipse程序之后将plugins目录重命名为plugins_prev（其他名称也可以但下面的步骤需要和这里的目录名称相同），并新建一个plugins目录</li>
<li>6、在UltraEdit中将第三步得到的结果中的plugins\替换为“<font color="#FF0000">move plugins_prev\</font>”；（不包含引号）</li>
<li>7、将第六步得到的结果拷贝第四步的sheet到A列；</li>
<li>8、拷贝第四步的sheet到A列和B列到UltraEdit中新的编辑标签页中，并替换^t为空格，（需开启正则表达式选项，且使用UltraEdit引擎，下同），这样得到一系列的move命令行；</li>
<li>9、在运行对话框中输入cmd打开命令窗口，并将当前路径切换到MyEclipse 8.0 M2的Common目录（我的是D:\Program Files\Genuitec\MyEclipse 8\Common\），将第八步中的结果全部拷贝到cmd中执行，这样可以将所有需要的jar文件全部从plugins_prev目录移动到plugins目录中；</li>
<li>10、经过第9步我们发现所有的jar文件都移动了，但是原来的plugins目录下一些需要的目录并没有移动到新的plugins目录中去，我们还需要移动需要的目录，同样在第八步中的结果上面继续做文章，我们替换“<font color="#FF0000">move plugins_prev\*jar^p</font>”为^p，消除所有已经移动过的jar文件条目，再多次替换^p^p为^p，消除所有多余的空行，再替换“<font color="#FF0000">plugins\*^p</font>”为“<font color="#FF0000">plugins\^p</font>”，即消除多余的目录名；</li>
<li>11、将第10步结果拷贝到第九步打开的cmd中执行，执行完成之后会将需要的目录也拷贝到新plugins目录下；</li>
<li>12、启动MyEclipse，不报错，大功告成！这个时候可以直接将plugins_prev目录给删除掉了，节约了好几百M空间。如果不放心也可以先将这个目录放着不删除</li>
</ol>
<p>如果有些plugins目录没有放在MyEclipse 的Common下Plugins目录中，可先从bundles.csv中删除对应的条目。</p>
<p>其他MyEclipse或者Eclipse完善自动升级过程。</p>

	标签： <a href="http://xuplus.com/article/tag/myeclipse" title="MyEclipse" rel="tag">MyEclipse</a>, <a href="http://xuplus.com/article/tag/%e5%8d%87%e7%ba%a7%e6%ae%8b%e7%95%99" title="升级残留" rel="tag">升级残留</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2009/11/a134.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>POJO何解？</title>
		<link>http://xuplus.com/article/2009/10/a131.html</link>
		<comments>http://xuplus.com/article/2009/10/a131.html#comments</comments>
		<pubDate>Fri, 09 Oct 2009 09:20:28 +0000</pubDate>
		<dc:creator>Dominic</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[POJO]]></category>

		<guid isPermaLink="false">http://xuplus.com/article/2009/10/a131.html</guid>
		<description><![CDATA[因项目需要被逼捡起JAVA并深入学习一把。过程中很多地方看到POJO这个词语，其全称是Plain Old Java Object。当我询问一个Java做得不错的朋友时，告诉我POJO是JavaBean的一种，它除了private属性以及对这个属性方法的public的get和set方法之外没有其他任何东西。它只能装载数据，作为数据存储的载体，而不具有业务逻辑处理的能力。 感觉有些不对劲，Google了一把：POJO的叫法是Martin Fowler、Rebecca Parsons和Josh MacKenzie在2000年的一次演讲的时候提出来的。初始出处是http://martinfowler.com/bliki/POJO.html： The term was coined while Rebecca Parsons, Josh MacKenzie and I were preparing for a talk at a conference in September 2000. In the talk we were pointing out the many benefits of encoding business logic into regular java objects rather than using Entity Beans. We wondered [...]]]></description>
			<content:encoded><![CDATA[<p>因项目需要被逼捡起JAVA并深入学习一把。过程中很多地方看到POJO这个词语，其全称是Plain Old Java Object。当我询问一个Java做得不错的朋友时，告诉我POJO是JavaBean的一种，它除了private属性以及对这个属性方法的public的get和set方法之外没有其他任何东西。它只能装载数据，作为数据存储的载体，而不具有业务逻辑处理的能力。</p>
<p>感觉有些不对劲，Google了一把：POJO的叫法是Martin Fowler、Rebecca Parsons和Josh MacKenzie在2000年的一次演讲的时候提出来的。初始出处是http://martinfowler.com/bliki/<a href="http://xuplus.com/article/tag/pojo" class="st_tag internal_tag" rel="tag" title="标签 POJO 下的日志">POJO</a>.html：<br />
<blockquote>The term was coined while Rebecca Parsons, Josh MacKenzie and I were preparing for a talk at a conference in September 2000. In the talk we were pointing out the many benefits of encoding business logic into regular java objects rather than using Entity Beans. We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects lacked a fancy name. So we gave them one, and it&#8217;s caught on very nicely. </p></blockquote>
<p>其意思是说要给具有业务逻辑处理的规则的Java对象（regular java objects）但又不是Entity Beans（EJB的一种）起一个名字。他们就叫这样的Java对象为POJO，在http://www.webopedia.com/TERM/P/POJO.htm是这样定义POJO的：<br />
<blockquote>POJO, or Plain Old Java Object, is a normal Java object class (that is, not a JavaBean, EntityBean etc.)  and does not serve any other special role nor does it implement any special interfaces of any of the Java frameworks. This term was coined by Martin Fowler, Rebbecca Parsons and Josh MacKenzie who believed that by creating the acronym POJO, such objects would have a “fancy name”, thereby convincing people that they were worthy of use.  </p></blockquote>
<p>基本意思是说POJO一个正常的Java对象（不是JavaBean，EntityBean等），也不担当任何的特殊的角色，也不实现任何Java框架中特定的接口。</p>
<p>这个解释应该是POJO的准确解释，POJO不是Java Bean，更不是EJB，不应该依赖于框架（继承或实现某些框架类或接口），POJO不具有任何特殊角色。POJO是可以包含业务逻辑处理和持久化逻辑的，也可以包含与JavaBean类似的属性和对属性相应访问setter、getter的。</p>

	标签： <a href="http://xuplus.com/article/tag/pojo" title="POJO" rel="tag">POJO</a><br />
]]></content:encoded>
			<wfw:commentRss>http://xuplus.com/article/2009/10/a131.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

