<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1540591164274661106</id><updated>2012-02-09T13:44:20.569-08:00</updated><category term='knowledge'/><category term='JPA'/><category term='java'/><category term='ESB'/><category term='security'/><category term='example'/><category term='junit'/><category term='how to'/><category term='activeMQ'/><category term='Developer'/><category term='first'/><category term='my reading'/><category term='data warehousing'/><category term='design pattern'/><category term='powerbuilder'/><category term='TDD'/><category term='configuration'/><category term='xml schema'/><category term='spring'/><category term='adapter'/><category term='OOP'/><category term='JSF'/><category term='architecture'/><category term='project management.'/><category term='notes'/><title type='text'>James world</title><subtitle type='html'>James Liu is a technical professional who has a lot of passion on software development, both technology and process.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>82</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-9102722076920602317</id><published>2012-02-09T13:44:00.000-08:00</published><updated>2012-02-09T13:44:20.576-08:00</updated><title type='text'>What are required for Leadership</title><content type='html'>Good leader requires two things.&lt;br /&gt;1. Version&lt;br /&gt;2. Smart Followers&lt;br /&gt;&lt;br /&gt;A good leader is a person who has a version and also group of skilled and smart people which follow him, and help him to achieve his versions.&lt;br /&gt;&lt;br /&gt;A leader without a version is just a manager. A good manager does not need a version, but people skills, and can be a good follower.&lt;br /&gt;&lt;br /&gt;A expert or specialist can help leaders to achieve something, but not necessary need either version or people skills. &lt;br /&gt;&lt;br /&gt;In some cases, a good leader may not have people skills, and still having many followers, also still can be attractive to smart experts and specialists, like Steven Jobs. But he need a clear version.&lt;br /&gt;&lt;br /&gt;In my opinion, Version is the most important factor to be a good leader. As clear and good version will attractive more smart people to follow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-9102722076920602317?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/9102722076920602317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2012/02/what-are-required-for-leadership.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/9102722076920602317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/9102722076920602317'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2012/02/what-are-required-for-leadership.html' title='What are required for Leadership'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3173053739637034796</id><published>2012-02-09T13:23:00.000-08:00</published><updated>2012-02-09T13:23:45.930-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><title type='text'>JSF Managed Bean</title><content type='html'>Today I made some changes JSF managed beans using annotation instead of XML. Below it is the example.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@ManagedBean(name="themeSwitcherBean")  -- Declare it as managed bean&lt;br /&gt;@RequestScoped&lt;br /&gt;public class MyThemeSwitcherBean {&lt;br /&gt; &lt;br /&gt; @ManagedProperty(value = "#{userAccountService}")  -- How to reference spring bean or other managed bean.&lt;br /&gt; UserAccountService userAccountService;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3173053739637034796?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3173053739637034796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2012/02/jsf-managed-bean.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3173053739637034796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3173053739637034796'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2012/02/jsf-managed-bean.html' title='JSF Managed Bean'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7487875699351273380</id><published>2012-01-10T08:08:00.000-08:00</published><updated>2012-01-10T08:08:04.535-08:00</updated><title type='text'>Eclipse errors and solutions</title><content type='html'>1. javax.el.PropertyNotFoundException: /index.xhtml @12,39 value="#{user.name}": Target Unreachable, identifier 'user' resolved to null &lt;br /&gt;&lt;br /&gt;reason: it could not load jsf bean.&lt;br /&gt;&lt;br /&gt;Solution: a. check project--&gt;properties --&gt; build --&gt; source code, if it is checked.&lt;br /&gt;b. removed the tomcat server.&lt;br /&gt;c. mvn eclipse:eclipse&lt;br /&gt;d. add resources&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7487875699351273380?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7487875699351273380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2012/01/eclipse-errors-and-solutions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7487875699351273380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7487875699351273380'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2012/01/eclipse-errors-and-solutions.html' title='Eclipse errors and solutions'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2651332584479405448</id><published>2012-01-09T05:57:00.000-08:00</published><updated>2012-01-09T05:57:13.728-08:00</updated><title type='text'>How to create two doamins in one Tomcat instance</title><content type='html'>&lt;a href="http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html"&gt;Virtual Hosting and Tomcat&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2651332584479405448?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2651332584479405448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2012/01/how-to-create-two-doamins-in-one-tomcat.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2651332584479405448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2651332584479405448'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2012/01/how-to-create-two-doamins-in-one-tomcat.html' title='How to create two doamins in one Tomcat instance'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3782908920090821388</id><published>2012-01-06T13:06:00.000-08:00</published><updated>2012-01-06T13:06:25.067-08:00</updated><title type='text'>How to deal with Warning: This page calls for XML namespace primefaces.org/ui declared with prefix p but no taglibrary exists for that namespace.</title><content type='html'>Yesterday I did a example using PRISMFACE, JSF2, and I got below error:&lt;br /&gt;&lt;br /&gt;Warning: This page calls for XML namespace primefaces.org/ui declared with prefix p but no taglibrary exists for that namespace.&lt;br /&gt;&lt;br /&gt;After I copied primeface jar into lib directory, everything is working. So wired.&lt;br /&gt;&lt;br /&gt;I think this might be a Maven issue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3782908920090821388?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3782908920090821388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2012/01/how-to-deal-with-warning-this-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3782908920090821388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3782908920090821388'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2012/01/how-to-deal-with-warning-this-page.html' title='How to deal with Warning: This page calls for XML namespace primefaces.org/ui declared with prefix p but no taglibrary exists for that namespace.'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3308173144192201623</id><published>2011-11-16T11:34:00.001-08:00</published><updated>2011-11-16T11:34:53.283-08:00</updated><title type='text'>Where to put named queries in JPA?</title><content type='html'>Please check below &lt;a href="http://jdevelopment.nl/put-named-queries-jpa/"&gt;link&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3308173144192201623?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3308173144192201623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/11/where-to-put-named-queries-in-jpa.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3308173144192201623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3308173144192201623'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/11/where-to-put-named-queries-in-jpa.html' title='Where to put named queries in JPA?'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3168474961774967226</id><published>2011-11-14T08:27:00.000-08:00</published><updated>2011-11-14T10:28:58.228-08:00</updated><title type='text'>How to configure multiThread MDB in websphere</title><content type='html'>The maximum sessions property determines how many messages an MDB can process simultaneously. The default value for this property is 1, which means that an MDB must finish processing the first message on the queue before it can process the second, and so on (for you programmers, this essentially means that an MDB is single-threaded).&lt;br /&gt;&lt;br /&gt;If the application server is not under a heavy load, you might want to increase the throughput of messages. In this situation, you can increase the value of the maximum sessions property to enable an MDB to process more than one message at once (this makes the MDB multi-threaded). It is worth noting, though, that increasing the value of maximum sessions will increase the load on your system, since you will now have multiple instances of the MDB running at the same time!&lt;br /&gt;&lt;br /&gt;Details please check below &lt;a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0602_kesavan/0602_kesavan.html"&gt;link&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3168474961774967226?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3168474961774967226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/11/how-to-configure-multithread-mdb-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3168474961774967226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3168474961774967226'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/11/how-to-configure-multithread-mdb-in.html' title='How to configure multiThread MDB in websphere'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2000568061857681266</id><published>2011-11-11T06:04:00.001-08:00</published><updated>2011-11-11T06:04:16.897-08:00</updated><title type='text'>Spring reference card</title><content type='html'>http://refcardz.dzone.com/refcardz/spring-configuration?oid=sb001&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2000568061857681266?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2000568061857681266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/11/spring-reference-card.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2000568061857681266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2000568061857681266'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/11/spring-reference-card.html' title='Spring reference card'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-8851631085184801446</id><published>2011-11-11T05:54:00.001-08:00</published><updated>2011-11-11T05:54:37.725-08:00</updated><title type='text'>Design Pattern for Java resources</title><content type='html'>http://www.dzone.com/links/r/design_patterns_object_oriented_design_repository.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-8851631085184801446?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/8851631085184801446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/11/design-pattern-for-java-resources.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8851631085184801446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8851631085184801446'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/11/design-pattern-for-java-resources.html' title='Design Pattern for Java resources'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1217640624852731717</id><published>2011-10-27T06:46:00.000-07:00</published><updated>2011-10-27T06:46:24.608-07:00</updated><title type='text'>Why project failed</title><content type='html'>Below it is a very interesting &lt;a href="http://www.dzone.com/links/r/project_managers_is_yellow_the_new_green.html"&gt;article&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;1. Reduce co-location makes communication difficult.&lt;br /&gt;2. Loss of key players will take months to recovery.&lt;br /&gt;3. new technology learning curve.&lt;br /&gt;4. New team need to time to build.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1217640624852731717?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1217640624852731717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/10/why-project-failed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1217640624852731717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1217640624852731717'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/10/why-project-failed.html' title='Why project failed'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3748696687588626942</id><published>2011-10-08T17:57:00.000-07:00</published><updated>2011-10-08T20:06:03.237-07:00</updated><title type='text'>HTML 5 Magic</title><content type='html'>Today I did some research regaridng HTML5, it is really impressive. I have the feeling HTML 5 will be the next wave on web. Below are some features:&lt;br /&gt;&lt;br /&gt;1. SVG&lt;br /&gt;2. VIDEO&lt;br /&gt;3. GEOLOCATION&lt;br /&gt;4. Cache and Database&lt;br /&gt;5. Web wroker&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3748696687588626942?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3748696687588626942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/10/html-5-magic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3748696687588626942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3748696687588626942'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/10/html-5-magic.html' title='HTML 5 Magic'/><author><name>James</name><uri>http://www.blogger.com/profile/11175701368737156200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1050330970301085355</id><published>2011-10-03T08:46:00.001-07:00</published><updated>2011-10-03T08:46:35.627-07:00</updated><title type='text'>Why Software Is Eating The World</title><content type='html'>Today I read a article which is very useful to inspire the developers.&lt;br /&gt;&lt;br /&gt;Please check the &lt;a href="http://online.wsj.com/article/SB10001424053111903480904576512250915629460.html"&gt;link.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1050330970301085355?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1050330970301085355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/10/why-software-is-eating-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1050330970301085355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1050330970301085355'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/10/why-software-is-eating-world.html' title='Why Software Is Eating The World'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1017270614794835483</id><published>2011-09-30T12:54:00.000-07:00</published><updated>2011-09-30T12:55:43.562-07:00</updated><title type='text'>Best way to use Constractor</title><content type='html'>I had been working as consultant for about two months already. One interesting thing I found in those days regarding how to use consultant effectively.&lt;br /&gt;&lt;br /&gt;1. Hire technical expert as technical leader, so other team members can learn from him. This way is better than hiring a trainer. This works very well if this company run into a new technical area.&lt;br /&gt;2. Hire Junior consultants doing heavy load and lower technical tasks. Also those works are perfect for outsourcing.&lt;br /&gt;3. Team members should include both full-time and contractors. A team contains only contractors will face long term maintainability issues in the long run. Some one in the team should audit the quality.&lt;br /&gt;&lt;br /&gt;"Knowledge can be conveyed, but wisdom is only earned by experience of trying"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1017270614794835483?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1017270614794835483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/09/best-way-to-use-constractor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1017270614794835483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1017270614794835483'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/09/best-way-to-use-constractor.html' title='Best way to use Constractor'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4978573962619277095</id><published>2011-09-23T05:59:00.001-07:00</published><updated>2011-09-23T05:59:32.664-07:00</updated><title type='text'>Check List for new project before coding</title><content type='html'>I recently read a article talking about check list before coding, it is very interesting, please check the &lt;a href="http://www.javacodegeeks.com/2011/09/this-comes-before-your-business-logic.html"&gt;link &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4978573962619277095?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4978573962619277095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/09/check-list-for-new-project-before.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4978573962619277095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4978573962619277095'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/09/check-list-for-new-project-before.html' title='Check List for new project before coding'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-5796737927651154851</id><published>2011-09-15T06:14:00.001-07:00</published><updated>2011-09-15T06:14:32.632-07:00</updated><title type='text'>Mutable and Immutable Objects for Java</title><content type='html'>Below it is a nice &lt;a href="http://www.javaranch.com/journal/2003/04/immutable.htm"&gt;article&lt;/a&gt; regarding this topic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-5796737927651154851?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/5796737927651154851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/09/mutable-and-immutable-objects-for-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5796737927651154851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5796737927651154851'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/09/mutable-and-immutable-objects-for-java.html' title='Mutable and Immutable Objects for Java'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7915082965573603598</id><published>2011-08-11T19:06:00.001-07:00</published><updated>2011-08-11T19:06:45.359-07:00</updated><title type='text'>what is portalet and portal (JSR168)</title><content type='html'>Please reference this &lt;a href="http://oreilly.com/pub/a/java/archive/what-is-a-portlet.html?page=1"&gt;article.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7915082965573603598?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7915082965573603598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/08/what-is-portalet-and-portal-jsr168.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7915082965573603598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7915082965573603598'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/08/what-is-portalet-and-portal-jsr168.html' title='what is portalet and portal (JSR168)'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-6333743230117924859</id><published>2011-08-04T19:17:00.000-07:00</published><updated>2011-08-04T19:17:14.980-07:00</updated><title type='text'>4 mistakes regarding tomcat</title><content type='html'>I just read a article regarding tomcat, please &lt;a href="http://www.tomcatexpert.com/blog/2011/08/03/4-mistakes-avoid-apache-tomcat"&gt;check&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-6333743230117924859?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/6333743230117924859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/08/4-mistakes-regarding-tomcat.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/6333743230117924859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/6333743230117924859'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/08/4-mistakes-regarding-tomcat.html' title='4 mistakes regarding tomcat'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2767845661587221806</id><published>2011-07-20T08:59:00.000-07:00</published><updated>2011-07-20T08:59:57.073-07:00</updated><title type='text'>About session security</title><content type='html'>Today I read a good article regarding session security, I want to share with you.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wblinks.com/notes/secure-session-management-tips"&gt;Please click for article&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Below it is the summary.&lt;br /&gt;&lt;br /&gt;Always regenerate a session ID (SID) when elevating privileges or changing between HTTP and HTTPS.&lt;br /&gt;Check for suspicious activity and immediately destroy any suspect session.&lt;br /&gt;Store all session information server-side, never store anything except the SID in the client-side cookie.&lt;br /&gt;Confirm SIDs aren't from an external source, and verify the session was generated by your server.&lt;br /&gt;Don't append the SID to URLs as a GET parameter.&lt;br /&gt;Expire sessions on the server side, don't rely on cookie expiration to end a user session.&lt;br /&gt;Use long and unpredictable session IDs.&lt;br /&gt;Properly sanitize user input before setting headers with them.&lt;br /&gt;When a user logs out, destroy their session explicitly on the server.&lt;br /&gt;Check your session configuration.&lt;br /&gt;Force users to re-authenticate on any destructive or critical actions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2767845661587221806?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2767845661587221806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/07/about-session-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2767845661587221806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2767845661587221806'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/07/about-session-security.html' title='About session security'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4909011518150190947</id><published>2011-07-19T17:57:00.000-07:00</published><updated>2011-07-19T17:57:35.836-07:00</updated><title type='text'>Spring singleton and prototype</title><content type='html'>Recently I was asked something regarding spring singleton, below are some of my thought.&lt;br /&gt;&lt;br /&gt;1. First Spring singleton is not same as java singleton. For example.&lt;br /&gt;&lt;br /&gt;SampleBean beanOne = (SampleBean)context.getBean(“sampleBean1”);&lt;br /&gt;SampleBean beanTwo = (SampleBean)context.getBean(“sampleBean2”);&lt;br /&gt;&lt;br /&gt;Evern in spring application context, samepleBean1 and sampleBean2 refer to the same implementation, they are still not the same.&lt;br /&gt;&lt;br /&gt;In Java singleton, they are the same thing.&lt;br /&gt;&lt;br /&gt;2. For exmaple:&lt;br /&gt;SampleBean beanOne = (SampleBean)context.getBean(“sampleBean”);&lt;br /&gt;SampleBean beanTwo = (SampleBean)context.getBean(“sampleBean”);&lt;br /&gt;&lt;br /&gt;Under singleton scope, beanOne is the same as beanTwo.&lt;br /&gt;Under prototype scope, beanOne &lt;&gt; beanTwo&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4909011518150190947?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4909011518150190947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/07/spring-singleton-and-prototype.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4909011518150190947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4909011518150190947'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/07/spring-singleton-and-prototype.html' title='Spring singleton and prototype'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1295399166633766522</id><published>2011-06-21T06:44:00.000-07:00</published><updated>2011-06-21T06:50:33.469-07:00</updated><title type='text'>tomcat class loading thining</title><content type='html'>In the last couple years, I have been working with TOMCAT, we always use fat war file, which each web application use their own lib, there are very few library in common tomcat lib directory.&lt;br /&gt;&lt;br /&gt;Good: Different application can use different version library, easy to configure, no library conflict issue.&lt;br /&gt;Bad: I guess memory might be a issue. As every web application will start their own version.&lt;br /&gt;&lt;br /&gt;Today I check one of the web application implementation in websphere, in web library, there are lot of common libraries.&lt;br /&gt;&lt;br /&gt;Good: I guess most EJB related library should be in common.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1295399166633766522?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1295399166633766522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/06/tomcat-class-loading-thining.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1295399166633766522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1295399166633766522'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/06/tomcat-class-loading-thining.html' title='tomcat class loading thining'/><author><name>James</name><uri>http://www.blogger.com/profile/11175701368737156200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-8308525625956188191</id><published>2011-06-16T07:51:00.000-07:00</published><updated>2011-07-26T08:09:26.243-07:00</updated><title type='text'>Software development methods Funny words</title><content type='html'>1. KISS: Keep it simple stupid&lt;br /&gt;2. DRY: Do not repeat yourself&lt;br /&gt;3. YAGNIl: You ain't gonna need it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For point one and point three, I really experienced a lot in the last 10 years. Most of the time, system is getting complicated just because of poor design, overdesign. Also the system was built a lot of extra nice features which never been used, it also makes simple application complicated.&lt;br /&gt;&lt;br /&gt;4. Law of Demeter - Code components should only communicate with their direct relations (e.g. classes that they inherit from, objects that they contain, objects passed by argument, etc.) http://en.wikipedia.org/wiki/Law_of_Demeter&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-8308525625956188191?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/8308525625956188191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/06/software-development-methods-funny.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8308525625956188191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8308525625956188191'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/06/software-development-methods-funny.html' title='Software development methods Funny words'/><author><name>James</name><uri>http://www.blogger.com/profile/11175701368737156200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7190801666087077756</id><published>2011-06-08T14:38:00.000-07:00</published><updated>2011-06-08T14:42:05.273-07:00</updated><title type='text'>How to mitivate a developer</title><content type='html'>Today I read a article which I totally agree with it. Details please check below link.&lt;br /&gt;&lt;br /&gt;http://www.theserverside.com/tip/Five-ways-to-motivate-your-development-team&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Give your developers the resources they need.&lt;br /&gt; &lt;/b&gt;&lt;b&gt;2. Recognize a job well done&lt;br /&gt;&lt;/b&gt;&lt;b&gt;3. Get rid of dead wood&lt;br /&gt;&lt;/b&gt;&lt;b&gt;4. Push for new software releases&lt;/b&gt;&lt;br /&gt;&lt;b&gt;5. Let developers develop&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7190801666087077756?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7190801666087077756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/06/how-to-mitivate-developer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7190801666087077756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7190801666087077756'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/06/how-to-mitivate-developer.html' title='How to mitivate a developer'/><author><name>James</name><uri>http://www.blogger.com/profile/11175701368737156200</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4516686663248135074</id><published>2011-05-18T08:35:00.000-07:00</published><updated>2011-05-18T08:38:30.046-07:00</updated><title type='text'>use maven to create a basic project</title><content type='html'>mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.2 -DgroupId=com.travelsoft.services -DartifactId=HostServices&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4516686663248135074?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4516686663248135074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/05/use-maven-to-create-basic-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4516686663248135074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4516686663248135074'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/05/use-maven-to-create-basic-project.html' title='use maven to create a basic project'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-9004453171938032768</id><published>2011-05-18T06:30:00.000-07:00</published><updated>2011-05-18T06:34:45.511-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>When Agile/Scrum should NOT be used</title><content type='html'>Today I read this article, it is very interesting. And I agree most of the points he list there. Details please check. http://blog.matrixresources.com/blog/when-agilescrum-should-not-be-used&lt;br /&gt;&lt;br /&gt;Below are the list of quotes which I think are useful.&lt;br /&gt;&lt;br /&gt;   1. Non-High Profile Project&lt;br /&gt;   2. Stable Technology&lt;br /&gt;   3. No Major Process Innovation&lt;br /&gt;   4. Requirements are Stable&lt;br /&gt;   5. Quick Time to Market not Needed&lt;br /&gt;&lt;br /&gt;Resource Characteristics: &lt;br /&gt;&lt;br /&gt;   1. Inability to Co-located&lt;br /&gt;   2. Low Cost Talent Available&lt;br /&gt;   3. Team Size Varies&lt;br /&gt;Company Characteristics:&lt;br /&gt;&lt;br /&gt;   1. Command and Control Company Culture: “dictator” type project management&lt;br /&gt;   2. Contracts Require Full Scope and Documentation&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-9004453171938032768?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/9004453171938032768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/05/when-agilescrum-should-not-be-used.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/9004453171938032768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/9004453171938032768'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/05/when-agilescrum-should-not-be-used.html' title='When Agile/Scrum should NOT be used'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3087147147332668440</id><published>2011-05-17T08:10:00.000-07:00</published><updated>2011-05-17T08:19:44.360-07:00</updated><title type='text'>Encrypt a password in JPA persistent.xml</title><content type='html'>Below is a example how to encrypt password in JPA persistent.&lt;br /&gt;&lt;br /&gt;1. Generate a encrypted password (See previous blog)&lt;br /&gt;2. Add below entrance into spring applicationcontext.xml&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;bean id="strongEncryptor" class="org.jasypt.encryption.pbe.PooledPBEStringEncryptor"&gt;&lt;br /&gt;     &lt;property name="algorithm"&gt;&lt;br /&gt;         &lt;value&gt;PBEWithMD5AndDES&lt;/value&gt;&lt;br /&gt;     &lt;/property&gt;&lt;br /&gt;     &lt;property name="password"&gt;&lt;br /&gt;         &lt;value&gt;JAMES_PWD&lt;/value&gt;&lt;br /&gt;     &lt;/property&gt;&lt;br /&gt;     &lt;property name="poolSize"&gt;&lt;br /&gt;         &lt;value&gt;4&lt;/value&gt;&lt;br /&gt;     &lt;/property&gt;&lt;br /&gt;   &lt;/bean&gt;&lt;br /&gt;  &lt;br /&gt;   &lt;bean id="hibernateStringEncryptor" class="org.jasypt.hibernate.encryptor.HibernatePBEStringEncryptor"&gt;&lt;br /&gt;     &lt;property name="registeredName"&gt;&lt;br /&gt;         &lt;value&gt;strongHibernateStringEncryptor&lt;/value&gt;&lt;br /&gt;     &lt;/property&gt;&lt;br /&gt;     &lt;property name="encryptor"&gt;&lt;br /&gt;         &lt;ref bean="strongEncryptor" /&gt;&lt;br /&gt;     &lt;/property&gt;&lt;br /&gt;   &lt;/bean&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;3. change persistent.xml&lt;br /&gt;&lt;br /&gt;&lt;!--  &lt;property name="hibernate.connection.password" value="8707449" /&gt; --&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;property name="hibernate.connection.password" value="ENC(GFqFtViRYgoCyvuXCSaTrA==)"/&gt;&lt;br /&gt;            &lt;property name="hibernate.connection.provider_class"&lt;br /&gt;           value="org.jasypt.hibernate.connectionprovider.EncryptedPasswordDriverManagerConnectionProvider"/&gt;&lt;br /&gt;            &lt;property name="hibernate.connection.encryptor_registered_name" value="strongHibernateStringEncryptor"/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3087147147332668440?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3087147147332668440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/05/encrypt-password-in-jpa-persistentxml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3087147147332668440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3087147147332668440'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/05/encrypt-password-in-jpa-persistentxml.html' title='Encrypt a password in JPA persistent.xml'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4854766949063593820</id><published>2011-05-17T06:15:00.001-07:00</published><updated>2011-05-17T06:25:58.604-07:00</updated><title type='text'>How to encrypt password in spring configuration file</title><content type='html'>I just finish a project which use "jasypt" to encrypt the password in spring configuration file. Below are the steps and notes.&lt;br /&gt;&lt;br /&gt;1. Regarding Maven entrance, please check below&lt;br /&gt;     &lt;dependency&gt;&lt;br /&gt;      &lt;groupId&gt;org.jasypt&lt;/groupId&gt;&lt;br /&gt;      &lt;artifactId&gt;jasypt&lt;/artifactId&gt;&lt;br /&gt;      &lt;version&gt;1.7.1&lt;/version&gt;&lt;br /&gt;     &lt;/dependency&gt;&lt;br /&gt;2. Develop a program to encrypt password.&lt;br /&gt;&lt;br /&gt;   StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();&lt;br /&gt;   encryptor.setAlgorithm("PBEWithMD5AndDES");&lt;br /&gt;   encryptor.setPassword("JAMES_PWD"); // could be got from web, env variable...&lt;br /&gt;   return encryptor.encrypt(input) ;&lt;br /&gt;3. Create a environment variable to hold temporary password &lt;br /&gt;   APP_ENCRYPTION_PASSWORD = JAMES_PWD&lt;br /&gt;&lt;br /&gt;4. Change your spring configuration file to read property from file.&lt;br /&gt;&lt;br /&gt;   &lt;!--  Need to setup environment ariable as APP_ENCRYPTION_PASSWORD --&gt;&lt;br /&gt;   &lt;bean id="environmentVariablesConfiguration"&lt;br /&gt;      class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig"&gt;&lt;br /&gt;      &lt;property name="algorithm" value="PBEWithMD5AndDES" /&gt;&lt;br /&gt;      &lt;property name="passwordEnvName" value="APP_ENCRYPTION_PASSWORD" /&gt;&lt;br /&gt;    &lt;/bean&gt;&lt;br /&gt;  &lt;br /&gt;&lt;!-- The will be the encryptor used for decrypting configuration values.  --&gt;&lt;br /&gt;  &lt;bean id="configurationEncryptor"&lt;br /&gt;     class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor"&gt;&lt;br /&gt;     &lt;property name="config" ref="environmentVariablesConfiguration" /&gt;&lt;br /&gt;  &lt;/bean&gt;&lt;br /&gt;                                                                     --&gt;&lt;br /&gt; &lt;!-- The EncryptablePropertyPlaceholderConfigurer will read the           --&gt;&lt;br /&gt; &lt;!-- .properties files and make their values accessible as ${var}         --&gt;&lt;br /&gt; &lt;!--                                                                      --&gt;&lt;br /&gt; &lt;!-- Our "configurationEncryptor" bean (which implements                  --&gt; &lt;br /&gt; &lt;!-- org.jasypt.encryption.StringEncryptor) is set as a constructor arg.  --&gt;&lt;br /&gt; &lt;!--                                                                      --&gt;&lt;br /&gt; &lt;bean id="propertyConfigurer"&lt;br /&gt;     class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer"&gt;&lt;br /&gt;   &lt;constructor-arg ref="configurationEncryptor" /&gt;&lt;br /&gt;   &lt;property name="locations"&gt;&lt;br /&gt;     &lt;list&gt;&lt;br /&gt;       &lt;value&gt;classpath:connection.properties&lt;/value&gt;&lt;br /&gt;     &lt;/list&gt;&lt;br /&gt;   &lt;/property&gt;&lt;br /&gt;   &lt;br /&gt; &lt;/bean&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4854766949063593820?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4854766949063593820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/05/how-to-encrypt-password-in-spring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4854766949063593820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4854766949063593820'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/05/how-to-encrypt-password-in-spring.html' title='How to encrypt password in spring configuration file'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4968955644714475094</id><published>2011-04-26T09:05:00.000-07:00</published><updated>2011-04-26T09:12:41.193-07:00</updated><title type='text'>Comments after reading Test First development blog</title><content type='html'>Today, I read this very interesting blog regarding Test first development, link is below.&lt;br /&gt;http://xebee.xebia.in/2011/04/26/take-aways-from-dr-venkats-session-on-test-first-development/&lt;br /&gt;&lt;br /&gt;There are something really draw my attentions:&lt;br /&gt;&lt;br /&gt;1. the importance of creating an environment to make people do the right thing than to force them to do it. The right environment can be created through leading by example and assertive communication&lt;br /&gt;2. Hiring by attitude, and train for skill. &lt;br /&gt;3. he gave a magnificent example by citing a movie "A Few Good Men". He told that during an argument inside the court in the movie, someone quoted a rule. And then, Tom Cruise came with the rule book in his hand asking the other person to show him rules for each and everything that he did ( "You eat 3 times a day, can you show it in the rule book. Oh God, How can you eat 3 times a day when its not written in the rule book").&lt;br /&gt;4. in the end, he said, sometimes its almost impossible to correct things and then you can say to yourself that its just a job. In my home, I can do and will do things exactly the way I like, however, in a job, this might not be the case.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4968955644714475094?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4968955644714475094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/04/comments-after-reading-test-first.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4968955644714475094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4968955644714475094'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/04/comments-after-reading-test-first.html' title='Comments after reading Test First development blog'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1381243130450859954</id><published>2011-04-20T08:43:00.000-07:00</published><updated>2011-04-20T08:47:05.871-07:00</updated><title type='text'>How to get file from filename</title><content type='html'>Recently I had a issue regarding how to read a file, as in eclipse environment and actually server environment, the relative directory is different, it caused a lot of problem, below it is a example which works for both environment.&lt;br /&gt;&lt;br /&gt;File file ;&lt;br /&gt;URL url = this.getClass().getClassLoader().getResource(fileName);&lt;br /&gt;  &lt;br /&gt;try {&lt;br /&gt; file = new File(url.toURI());&lt;br /&gt;} catch(URISyntaxException e) {&lt;br /&gt; file = new File(url.getPath());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;or to a string&lt;br /&gt;&lt;br /&gt;URL loadedResource = this.getClass().getClassLoader().getResource(fileName);&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  InputStream inputStream = loadedResource.openStream();&lt;br /&gt;    &lt;br /&gt;     BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));&lt;br /&gt;     StringBuilder sb = new StringBuilder();&lt;br /&gt;     String line = null;&lt;br /&gt;     while ((line = reader.readLine()) != null) {&lt;br /&gt;       sb.append(line + "\n");&lt;br /&gt;     }&lt;br /&gt;     inputStream.close();&lt;br /&gt;     return sb.toString();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1381243130450859954?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1381243130450859954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/04/how-to-get-file-from-filename.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1381243130450859954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1381243130450859954'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/04/how-to-get-file-from-filename.html' title='How to get file from filename'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3966556638656087673</id><published>2011-04-12T11:37:00.001-07:00</published><updated>2011-04-12T11:37:49.530-07:00</updated><title type='text'>How to get salary increase by Eric spiegel</title><content type='html'>5) A developer’s best chance at achieving a maximum salary increase is to negotiate during the hiring process. Once you are on board, you are at the company’s mercy unless you bail&lt;br /&gt;&lt;br /&gt;Very interesting idea I have to agree&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3966556638656087673?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3966556638656087673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/04/how-to-get-salary-increase-by-eric.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3966556638656087673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3966556638656087673'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/04/how-to-get-salary-increase-by-eric.html' title='How to get salary increase by Eric spiegel'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2574642707785530696</id><published>2011-04-11T10:30:00.001-07:00</published><updated>2011-04-11T10:49:40.186-07:00</updated><title type='text'>Failure and innovative</title><content type='html'>Woody Allen :&lt;br /&gt;&lt;br /&gt;If you are not failing every now and again, it is a sign you are not doing anything very innovative.&lt;br /&gt;&lt;br /&gt;The only real failure in life is one not learned from&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2574642707785530696?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2574642707785530696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/04/failure-and-innovative.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2574642707785530696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2574642707785530696'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/04/failure-and-innovative.html' title='Failure and innovative'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2706098332573318254</id><published>2011-03-29T08:46:00.001-07:00</published><updated>2011-03-29T08:47:25.000-07:00</updated><title type='text'>Command and control</title><content type='html'>Smart people does not like to be controlled. And also can not be controlled.&lt;br /&gt;&lt;br /&gt;People who close to work can make better decision than most of the managers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2706098332573318254?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2706098332573318254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/03/command-and-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2706098332573318254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2706098332573318254'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/03/command-and-control.html' title='Command and control'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7949566808194110689</id><published>2011-03-08T10:30:00.000-08:00</published><updated>2011-03-08T10:55:02.970-08:00</updated><title type='text'>Comments on how to Manage developers</title><content type='html'>Below are some ideas and experience I want to blog about how to be a good developer manager&lt;br /&gt;&lt;br /&gt;1. Manager is not about managing people, no one want to be managed. Good manager should know manage himself first, create a better environment for developers to manage themselves too. Lead by example and show people the direction, let others to follow themselves.&lt;br /&gt;&lt;br /&gt;2. You have to know your team better. &lt;br /&gt;   a. Knows who is key people in the group, identify the key people is very important, you will know whom you should invest more time and money into. &lt;br /&gt;   b. Knows who is the expert but not a team player, who perform best inside a team, who perform best individual. &lt;br /&gt;   c. Knows each one's color (color theory)&lt;br /&gt;   d. Understand your team's ability and capacity. Do not try to stretch too much, as it will demotivate people.  &lt;br /&gt;&lt;br /&gt;3. Treat people with respect, never manipulate other people. If you do not want others do to you, do not do it to other people.&lt;br /&gt;&lt;br /&gt;4. Social activity, such as lunch each Friday together if it is possible.&lt;br /&gt;5. Learning activity, ask one developer to do a presentation each week. Helps to exchange the knowledge between developers.&lt;br /&gt;&lt;br /&gt;6. Provide best equipment to developers will help them to high productivity.&lt;br /&gt;&lt;br /&gt;7. Provide best working environments you can get, do not underestimate any complains about desk, noise, or other small things, as that could cause big issues to some people.&lt;br /&gt;&lt;br /&gt;8. Prepare some group contest, or mind games once a month? or two weeks to enhance team work. &lt;br /&gt;&lt;br /&gt;9. Only assign 80% of your capacity most of the time, if some developers tell you they are not in the mood, then you have room to give them some time to step back. Making sure they are working in high spirit. As developers productivity are not measured by hours.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7949566808194110689?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7949566808194110689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/03/comments-on-how-to-manage-developers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7949566808194110689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7949566808194110689'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/03/comments-on-how-to-manage-developers.html' title='Comments on how to Manage developers'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-8888275916658821427</id><published>2011-03-01T07:28:00.000-08:00</published><updated>2011-03-01T11:42:07.348-08:00</updated><title type='text'>Hiring strategy</title><content type='html'>hire-above-the-mean (or Lake Wobegon). Always hire people better than yourself.(???)&lt;br /&gt;&lt;br /&gt;a. Always hire developers better than we have currently (IQ + EQ) at the same level. &lt;br /&gt;b. When we measure the skill, we also need to consider the future grow. &lt;br /&gt;c. For Senior position, skill + experience = 60%, EQ = 20%, 20%= future grow&lt;br /&gt;   For Intermediate position, skill + experience = 40%, EQ = 30%, 30%= future grow&lt;br /&gt;   For Junior position, skill + experience = 20%, EQ = 30%, 50%= future grow&lt;br /&gt; &lt;br /&gt;Low EQ means low team spirit. Depends on the position, some senior position which does not require high EQ, and those experts can and prefer individually, if we have those positions, then EQ is not really required. &lt;br /&gt;&lt;br /&gt;Reference below link for more details.&lt;br /&gt;&lt;br /&gt;http://lifeofaprogrammanager.blogspot.com/2006/06/good-reading-for-development-managers.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-8888275916658821427?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/8888275916658821427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/03/hiring-strategy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8888275916658821427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8888275916658821427'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/03/hiring-strategy.html' title='Hiring strategy'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7791892144869774842</id><published>2011-02-28T06:48:00.000-08:00</published><updated>2011-02-28T06:52:54.814-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>Regarding how to prioritize a bug fix</title><content type='html'>Today I read a very interesting article regarding regression testing.&lt;br /&gt;&lt;br /&gt;Details please check http://www.ericsink.com/articles/Four_Questions.html&lt;br /&gt;&lt;br /&gt;Every bug you found in your application, before you work on a fix, you should ask yourself below four questions:&lt;br /&gt;&lt;br /&gt;Question One: When this bug happens, how bad is the impact? (Severity)&lt;br /&gt;&lt;br /&gt;Question Two: How often does this bug happen? (Frequency)&lt;br /&gt;&lt;br /&gt;Question Three: How much effort would be required to fix this bug? (Cost)&lt;br /&gt;&lt;br /&gt;Question Four: What is the risk of fixing this bug? (Risk)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7791892144869774842?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7791892144869774842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2011/02/regarding-how-to-prioritize-bug-fix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7791892144869774842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7791892144869774842'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2011/02/regarding-how-to-prioritize-bug-fix.html' title='Regarding how to prioritize a bug fix'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-945093086620562061</id><published>2010-09-01T10:51:00.001-07:00</published><updated>2010-09-01T10:51:52.950-07:00</updated><title type='text'>Reference: Normalization or Denormalization</title><content type='html'>Databases: Normalization or Denormalization. Which is the better technique?&lt;br /&gt;&lt;br /&gt;by ovais.tariq&lt;br /&gt;&lt;br /&gt;This has really been a long debate as to which approach is more performance orientated, normalized databases or denormalized databases. So this article is a step on my part to figure out the right strategy, because neither one of these approaches can be rejected outright. I will start of by discussing the pros and cons of both the approaches.&lt;br /&gt;Pros and Cons of a Normalized database design.&lt;br /&gt;&lt;br /&gt;Normalized databases fair very well under conditions where the applications are write-intensive and the write-load is more than the read-load. This is because of the following reasons:&lt;br /&gt;&lt;br /&gt;    * Normalized tables are usually smaller and have a smaller foot-print because the data is divided vertically among many tables. This allows them to perform better as they are small enough to get fit into the buffer.&lt;br /&gt;    * The updates are very fast because the data to be updated is located at a single place and there are no duplicates.&lt;br /&gt;    * Similarly the inserts are very fast because the data has to be inserted at a single place and does not have to be duplicated.&lt;br /&gt;    * The selects are fast in cases where data has to be fetched from a single table, because normally normalized tables are small enough to get fit into the buffer.&lt;br /&gt;    * Because the data is not duplicated so there is less need for heavy duty group by or distinct queries.&lt;br /&gt;&lt;br /&gt;Although there seems to be much in favor of normalized tables, with all the pros outlined above, but the main cause of concern with fully normalized tables is that normalized data means joins between tables. And this joining means that read operations have to suffer because indexing strategies do not go well with table joins.&lt;br /&gt;&lt;br /&gt;Now lets have a look at the pros and cons of a denormalized database design.&lt;br /&gt;Pros and cons of denormalized database design.&lt;br /&gt;&lt;br /&gt;Denormalized databases fair well under heavy read-load and when the application is read intensive. This is because of the following reasons:&lt;br /&gt;&lt;br /&gt;    * The data is present in the same table so there is no need for any joins, hence the selects are very fast.&lt;br /&gt;    * A single table with all the required data allows much more efficient index usage. If the columns are indexed properly, then results can be filtered and sorted by utilizing the same index. While in the case of a normalized table, since the data would be spread out in different tables, this would not be possible.&lt;br /&gt;&lt;br /&gt;Although for reasons mentioned above selects can be very fast on denormalized tables, but because the data is duplicated, the updates and inserts become complex and costly.&lt;br /&gt;&lt;br /&gt;Having said that neither one of the approach can be entirely neglected, because a real world application is going to have both read-loads and write-loads. Hence the correct way would be to utilize both the normalized and denormalized approaches depending on situations.&lt;br /&gt;Using normalized and denormalized approaches together.&lt;br /&gt;&lt;br /&gt;The most common way of mixing denormalized and normalized approaches is to duplicate related columns from one table into another table. Let me show you by example:&lt;br /&gt;&lt;br /&gt;Suppose you have a products table and an orders table.&lt;br /&gt;The normalized approach would be to only have the product_id in the orders table and all the other product related information in the products table.&lt;br /&gt;&lt;br /&gt;But that would make the query that filters by product_name and sorts by order_date inefficient because both are stored in different tables.&lt;br /&gt;&lt;br /&gt;In a fully normalized schema, such a query would be performed in the following manner:&lt;br /&gt;&lt;br /&gt;SELECT product_name, order_date&lt;br /&gt;FROM orders INNER JOIN products USING(product_id)&lt;br /&gt;WHERE product_name like 'A%'&lt;br /&gt;ORDER by order_date DESC&lt;br /&gt;&lt;br /&gt;As you can see MySQL here will have to scan the order_date index on the orders table and then compare the corresponding product_name in the products table to see if the name starts with A.&lt;br /&gt;&lt;br /&gt;The above query can be drastically improved by denormalizing the schema a little bit, so that the orders table now includes the product_name column as well.&lt;br /&gt;&lt;br /&gt;SELECT product_name, order_date&lt;br /&gt;FROM orders&lt;br /&gt;WHERE product_name like 'A%'&lt;br /&gt;ORDER by order_date DESC&lt;br /&gt;&lt;br /&gt;See how the query has become much simpler, there is no join now and a single index on columns product_name, order_date can be used to do the filtering as well as the sorting.&lt;br /&gt;&lt;br /&gt;So can both the techniques be used together? Yes they can be, because real word applications have a mix of read and write loads.&lt;br /&gt;Final words.&lt;br /&gt;&lt;br /&gt;Although, denormalized schema can greatly improve performance under extreme read-loads but the updates and inserts become complex as the data is duplicate and hence has to be updated/inserted in more than one places.&lt;br /&gt;&lt;br /&gt;One clean way to go about solving this problem is through the use of triggers. For example in our case where the orders table has the product_name column as well, when the value of product_name has to be updated, then it can simply be done in the following way:&lt;br /&gt;&lt;br /&gt;    * Have a trigger setup on the products table that updates the product_name on any update to the products table.&lt;br /&gt;    * Execute the update query on the products table. The data would automatically be updated in the orders table because of the trigger.&lt;br /&gt;&lt;br /&gt;However, when denormalizing the schema, do take into consideration, the number of times you would be updating records compared to the number of times you would be executing SELECTs. When mixing normalization and denormalization, focus on denormalizing tables that are read intensive, while tables that are write intensive keep them normalized.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-945093086620562061?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/945093086620562061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/09/reference-normalization-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/945093086620562061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/945093086620562061'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/09/reference-normalization-or.html' title='Reference: Normalization or Denormalization'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3774853503146467901</id><published>2010-08-17T13:24:00.000-07:00</published><updated>2010-08-17T13:34:04.955-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>Oracle Locks</title><content type='html'>1. Pessimistic Locking = select for update no wait&lt;br /&gt;2. Optimistic Locking Using a Version Column, &lt;br /&gt;3. Optimistic Locking Using a Checksum, CPU time&lt;br /&gt;&lt;br /&gt;DEADLOCK is because foreign key is not indexed.&lt;br /&gt;&lt;br /&gt;delete a parent will cause lock child table.&lt;br /&gt;&lt;br /&gt;update or delete primary key will cause the same issue, when using ORM, the sql generated might do that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3774853503146467901?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3774853503146467901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/08/oracle-locks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3774853503146467901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3774853503146467901'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/08/oracle-locks.html' title='Oracle Locks'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3140495565531229430</id><published>2010-05-19T06:56:00.000-07:00</published><updated>2010-05-19T06:57:32.776-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>5 low-risk, high-reward experiments for IT</title><content type='html'>Just read one article which is very interesting.&lt;br /&gt;&lt;br /&gt;http://www.infoworld.com/d/developer-world/5-low-risk-high-reward-experiments-it-454&lt;br /&gt;&lt;br /&gt;Low-risk IT experiment No. 1: APIs&lt;br /&gt;Low-risk IT experiment No. 2: Social networks&lt;br /&gt;Low-risk IT experiment No. 3: Mobile apps&lt;br /&gt;Low-risk IT experiment No. 4: Geocoding&lt;br /&gt;Low-risk IT experiment No. 5: NoSQL&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3140495565531229430?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3140495565531229430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/05/5-low-risk-high-reward-experiments-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3140495565531229430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3140495565531229430'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/05/5-low-risk-high-reward-experiments-for.html' title='5 low-risk, high-reward experiments for IT'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-6866551780340769384</id><published>2010-05-13T08:47:00.001-07:00</published><updated>2010-05-13T08:47:50.862-07:00</updated><title type='text'>Scalability</title><content type='html'>A Word on Scalability&lt;br /&gt;By Werner Vogels on March 30, 2006 5:21 PM | Permalink | Comments (7) | TrackBacks (3)&lt;br /&gt;&lt;br /&gt;Scalability is frequently used as a magic incantation to indicate that something is badly designed or broken. Often you hear in a discussion “but that doesn’t scale” as the magical word to end an argument. This is often an indication that developers are running into situations where the architecture of their system limits their ability to grow their service. If scalability is used in a positive sense it is in general to indicate a desired property as in “our platform needs good scalability”.&lt;br /&gt;&lt;br /&gt;What is it that we really mean by scalability? A service is said to be scalable if when we increase the resources in a system, it results in increased performance in a manner proportional to resources added. Increasing performance in general means serving more units of work, but it can also be to handle larger units of work, such as when datasets grow.&lt;br /&gt;&lt;br /&gt;In distributed systems there are other reasons for adding resources to a system; for example to improve the reliability of the offered service. Introducing redundancy is an important first line of defense against failures. An always-on service is said to be scalable if adding resources to facilitate redundancy does not result in a loss of performance.&lt;br /&gt;&lt;br /&gt;Why is scalability so hard? Because scalability cannot be an after-thought. It requires applications and platforms to be designed with scaling in mind, such that adding resources actually results in improving the performance or that if redundancy is introduced the system performance is not adversely affected. Many algorithms that perform reasonably well under low load and small datasets can explode in cost if either requests rates increase, the dataset grows or the number of nodes in the distributed system increases.&lt;br /&gt;&lt;br /&gt;A second problem area is that growing a system through scale-out generally results in a system that has to come to terms with heterogeneity. Resources in the system increase in diversity as next generations of hardware come on line, as bigger or more powerful resources become more cost-effective or when some resources are placed further apart. Heterogeneity means that some nodes will be able to process faster or store more data than other nodes in a system and algorithms that rely on uniformity either break down under these conditions or underutilize the newer resources.&lt;br /&gt;&lt;br /&gt;Is achieving good scalability possible? Absolutely, but only if we architect and engineer our systems to take scalability into account. For the systems we build we must carefully inspect along which axis we expect the system to grow, where redundancy is required, and how one should handle heterogeneity in this system, and make sure that architects are aware of which tools they can use for under which conditions, and what the common pitfalls are.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-6866551780340769384?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/6866551780340769384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/05/scalability.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/6866551780340769384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/6866551780340769384'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/05/scalability.html' title='Scalability'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-9025686726436226897</id><published>2010-05-07T07:04:00.000-07:00</published><updated>2010-05-07T07:05:04.991-07:00</updated><title type='text'>How we solved – GC every 1 minute on Tomcat</title><content type='html'>Then I researched the JVM Options and found this option&lt;br /&gt;&lt;br /&gt;-XX:+DisableExplicitGC&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-9025686726436226897?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/9025686726436226897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/05/how-we-solved-gc-every-1-minute-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/9025686726436226897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/9025686726436226897'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/05/how-we-solved-gc-every-1-minute-on.html' title='How we solved – GC every 1 minute on Tomcat'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-5291534087265890068</id><published>2010-04-28T07:51:00.000-07:00</published><updated>2010-04-28T07:52:37.042-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>zt: How to Keep Crappy Programmers</title><content type='html'>This is a follow-up to the popular How to Find Crappy Programmers.  If you’re interested in having a team of crappy programmers, instead of those annoyingly bright and passionate good ones, you probably want to start there.&lt;br /&gt;&lt;br /&gt;Despite your best efforts, some good programmers slip through the cracks – how can you get rid of them while keeping your coveted crappy programmers around?&lt;br /&gt;&lt;br /&gt;1. Focus on Punctuality and Butt-In-Seat Time&lt;br /&gt;&lt;br /&gt;Never mind that a good programmer can produce more valuable work in a 30-hour workweek from home than a crappy programmer can toiling 60 hours in the office.  There’s no point in getting useful software in a timely manner if you don’t get the all-important face time.&lt;br /&gt;&lt;br /&gt;Good products are nice, but there’s nothing more fulfilling in a manager’s life than seeing a roomful of people, heads-down, typing away in tiny cubicles at 8:00 am in the morning.  Coming in at 9:30 am is wholly unacceptable – those guys are just having too much fun.&lt;br /&gt;&lt;br /&gt;You get people on salary so that they aren’t on the clock, and that way you don’t have to pay extra when they work longer than 8 hour days.  Then again, don’t be afraid to insist that they work at least 8 hour days all the time.  Who cares if they have nothing to do, or if they have already gotten way more done than the guy next to them, surfing the internet?  It’s butt-in-seat time, baby.&lt;br /&gt;&lt;br /&gt;2. Set Their Salary Based on Their Age or Time at the Company&lt;br /&gt;&lt;br /&gt;Setting salary based on your age makes a lot of sense since you, the manager, are probably old.  That way you get more money.  Since that’s illegal, you should base the pay on “years of experience” which equates to age for everyone who didn’t go on a 5-year+ sabbatical.  Don’t worry, that’s pretty much only working moms, and you probably don ‘t want to pay them much either.&lt;br /&gt;&lt;br /&gt;You might have an employee who’d rather be paid based on their productivity or the value of their work or even their skill level.  Blasphemy! Clearly, that person is just looking for a free ride, without having to pay their dues.  Say it with me people: “We care about everything except for the actual work you produce.”&lt;br /&gt;&lt;br /&gt;3. Reduce Time Spent Coding&lt;br /&gt;&lt;br /&gt;It’s important for developers to spend a lot of time in meetings.  That way they can get a complete understanding of the minutia in the business side of things.  And also, it’s more fun to have a big audience when you ramble on in meetings.  Don’t worry that we won’t have any time left to do actual work (ie. coding), we’ll just come in early and stay late to get that part done.&lt;br /&gt;&lt;br /&gt;Another fun thing is having your programmers do your desktop support.  Really, anytime your Outlook or your iPhone is acting up, feel free to call them over to troubleshoot the issue.  It’s so handy having geeks around.&lt;br /&gt;&lt;br /&gt;4. Monitor and filter their Internet usage&lt;br /&gt;&lt;br /&gt;Developers just can’t be trusted, everyone knows that.  We are always hacking things and downloading illegal music and that sort of thing.  So, you should definitely install a program to monitor their internet usage.  You could also block sites that you deem to be a waste of time, but then that might tip your hand that you’re monitoring them.&lt;br /&gt;&lt;br /&gt;For that matter, you ought to go ahead and dictate what development environment and tools they have to use.  After all, you picked the setup with the longest feature list (not to mention the sales guy took you to lunch) so those developers shouldn’t have anything to complain about.  Anyone who wants to use anything else is just a prima donna.&lt;br /&gt;&lt;br /&gt;5. Make Them Build Crappy Software&lt;br /&gt;&lt;br /&gt;This is the most important one of all.  A crappy programmer can only make crappy software.  However, a good programmer has the ability to make both good software and crappy software, right?  Wrong!&lt;br /&gt;&lt;br /&gt;Good programmers hate writing crappy software.  They’re always yammering on about code design and trying to test everything, what a pain.&lt;br /&gt;&lt;br /&gt;Force them to write inline queries, develop in VB on the command line and fix bugs in 1,000 line methods.  They may fight it at first, but pretty soon they either leave or become a crappy programmer also.  You’ll know that they’ve come over to the dark side when you see that empty look in their eyes and when they see a Dilbert cartoon they laugh … maniacally.&lt;br /&gt;&lt;br /&gt;The reality is that not everyone is interested in managing good programmers. Sure they get things done and know a lot about technology … yadda yadda.   They also challenge your assumptions and push to improve the system and that’s just not going to work in your business.&lt;br /&gt;&lt;br /&gt;The fact that it’s been done that way before and hasn’t imploded yet (or lately) is good enough for you. You can use these handy tips to keep your crappy programmers while firmly excluding the good ones.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-5291534087265890068?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/5291534087265890068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/04/zt-how-to-keep-crappy-programmers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5291534087265890068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5291534087265890068'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/04/zt-how-to-keep-crappy-programmers.html' title='zt: How to Keep Crappy Programmers'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-6384157814077198119</id><published>2010-03-05T06:59:00.000-08:00</published><updated>2010-03-05T07:01:37.373-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>Testing what Errors</title><content type='html'>http://agile.dzone.com/news/alternatives-acceptance&lt;br /&gt;&lt;br /&gt; * Programmer errors occur when a programmer knows what to program but doesn't do it right. His algorithm might be wrong, he might have made a typo, or he may have made some other mistake while translating his ideas into code.&lt;br /&gt;&lt;br /&gt;    * Design errors create breeding grounds for bugs. According to Barry Boehm (PDF), 20% of the modules in a program are typically responsible for 80% of the errors. They're not necessarily the result of an outright mistake, though. Often a module starts out well but gets crufty as the program grows.&lt;br /&gt;&lt;br /&gt;    * Requirements errors occur when a programmer creates code that does exactly what she intends, but her intention was wrong. Somehow she misunderstood what needed to be done. Or, perhaps, no one knew what needed to be done. Either way, the code works as intended, but it doesn't do the right thing.&lt;br /&gt;&lt;br /&gt;    * Systemic errors make mistakes easy. The team's work habits include a blind spot that lets subtle defects escape. In this environment, everybody thinks they're doing the right thing--programmers are confident that they're expressing their intent, and customers are confident that programmers are doing the right thing--yet defects occur anyway. Security holes are a common example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-6384157814077198119?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/6384157814077198119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/03/testing-what-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/6384157814077198119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/6384157814077198119'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/03/testing-what-errors.html' title='Testing what Errors'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1509304762603216533</id><published>2010-03-01T06:23:00.000-08:00</published><updated>2010-03-01T06:25:02.497-08:00</updated><title type='text'>How to split a log file in tomcat</title><content type='html'>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Cjliu%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5Cjliu%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5Cjliu%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;ZH-CN&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;    &lt;w:usefelayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:宋体; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-fareast-font-family:SimSun; 	mso-bidi-font-family:"Times New Roman";} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph 	{mso-style-priority:34; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:.5in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-fareast-font-family:SimSun; 	mso-bidi-font-family:"Times New Roman";} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt; 	mso-ascii-font-family:Calibri; 	mso-fareast-font-family:SimSun; 	mso-hansi-font-family:Calibri;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:957568044; 	mso-list-type:hybrid; 	mso-list-template-ids:-401964188 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 	{mso-level-tab-stop:none; 	mso-level-number-position:left; 	text-indent:-.25in;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Calibri","sans-serif";} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal"&gt;Tomcat log file splitter procedure:&lt;/p&gt;  &lt;p class="MsoListParagraph" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;1.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Replace tomcat-juli&lt;span style=""&gt;   &lt;/span&gt;inside bin\&lt;/p&gt;  &lt;p class="MsoListParagraph" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;2.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Copy commons-logging-1.1.1, log4j.jar, and tomcat-juli-adapters to lib directory&lt;/p&gt;  &lt;p class="MsoListParagraph" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;3.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Change log4j.p file in lib&lt;/p&gt;  &lt;p class="MsoListParagraph" style="text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;&lt;span style=""&gt;4.&lt;span style="font: 7pt &amp;quot;Times New Roman&amp;quot;;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Delete logging.properties in conf directory&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1509304762603216533?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1509304762603216533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/03/how-to-split-log-file-in-tomcat.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1509304762603216533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1509304762603216533'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/03/how-to-split-log-file-in-tomcat.html' title='How to split a log file in tomcat'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3331065568499861227</id><published>2010-03-01T06:21:00.000-08:00</published><updated>2010-03-01T06:23:18.312-08:00</updated><title type='text'>Difference between junior or Senior developer</title><content type='html'>Width and Depth.&lt;br /&gt;&lt;br /&gt;Senior can see the forest, not only trees. They have more tools in their skill set. They know where to find a bug, not only fix a one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3331065568499861227?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3331065568499861227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/03/difference-between-junior-or-senior.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3331065568499861227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3331065568499861227'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/03/difference-between-junior-or-senior.html' title='Difference between junior or Senior developer'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-522358313855195688</id><published>2010-01-04T07:34:00.000-08:00</published><updated>2010-01-04T07:35:03.895-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>How to mitivate developers.</title><content type='html'>&lt;a href="http://agile.dzone.com/news/how-motivate-developers-three"&gt;here is the detail.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-522358313855195688?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/522358313855195688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2010/01/how-to-mitivate-developers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/522358313855195688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/522358313855195688'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2010/01/how-to-mitivate-developers.html' title='How to mitivate developers.'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-5935835008270416428</id><published>2009-12-07T11:04:00.001-08:00</published><updated>2009-12-07T11:04:33.577-08:00</updated><title type='text'>Difference between labor and professional</title><content type='html'>The difference between a laborer and a professional is that a laborer takes orders from his boss, and a professional provides input to his superiors. Laborers are hired to take direction. Professionals are hired to ensure that the direction chosen makes sense.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-5935835008270416428?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/5935835008270416428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/12/difference-between-labor-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5935835008270416428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5935835008270416428'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/12/difference-between-labor-and.html' title='Difference between labor and professional'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7452863123789077226</id><published>2009-11-18T11:32:00.001-08:00</published><updated>2009-11-18T11:32:55.138-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>A guide to Java SimpleDateFormat in examples</title><content type='html'>http://www.javablogging.com/java-simpledateformat-examples/&lt;br /&gt;&lt;br /&gt;    &lt;span class="postmeta date"&gt;November 17, 2009  - Author: ppow&lt;/span&gt;     &lt;div class="postcontent"&gt;      &lt;p&gt;Today I want to show you some examples of how you can use &lt;a href="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html"&gt;SimpleDateFormat&lt;/a&gt; class in your code. I hope some of them will be new and surprising!&lt;/p&gt; &lt;h1&gt;The basic example&lt;/h1&gt; &lt;p&gt;First the most basic usage of the class. Lets use it to format Date object into a simple string showing day, month and a year:&lt;/p&gt; &lt;table class="code" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre class="line_numbers"&gt;1:&lt;br /&gt;2:&lt;br /&gt;3:&lt;br /&gt;4:&lt;br /&gt;5:&lt;br /&gt;6:&lt;/pre&gt; &lt;/td&gt; &lt;td&gt; &lt;pre class="sh_java sh_sourceCode"&gt;&lt;span class="sh_usertype"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;simpleDateFormat &lt;span class="sh_symbol"&gt;=&lt;/span&gt;&lt;br /&gt;       &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"dd/MM/yy"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;String&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;dateAsString &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;format&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;Date&lt;/span&gt;&lt;span class="sh_symbol"&gt;());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;dateAsString&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "12/11/09"&lt;/span&gt; &lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;h1&gt;Slightly more advanced&lt;/h1&gt; &lt;p&gt;Obviously we can use more complicated patterns than that (see &lt;a href="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html"&gt;SimpleDateFormat&lt;/a&gt; JavaDoc for the full list). Besides adding more data to be shown we can also add some regular text – to do that in a pattern you need to escape the text with an apostrophe. So here is a fancy way of printing the time and date:&lt;/p&gt; &lt;table class="code" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre class="line_numbers"&gt;1:&lt;br /&gt;2:&lt;br /&gt;3:&lt;br /&gt;4:&lt;br /&gt;5:&lt;br /&gt;6:&lt;/pre&gt; &lt;/td&gt; &lt;td&gt; &lt;pre class="sh_java sh_sourceCode"&gt;&lt;span class="sh_usertype"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;simpleDateFormat &lt;span class="sh_symbol"&gt;=&lt;/span&gt;&lt;br /&gt;       &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"hh:mm 'o''clock on' MMMM dd yyyy"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;String&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;dateAsString &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;format&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;Date&lt;/span&gt;&lt;span class="sh_symbol"&gt;());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;dateAsString&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "06:49 o'clock on November 12 2009"&lt;/span&gt; &lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;h1&gt;Now with Locale&lt;/h1&gt; &lt;p&gt;SimpleDateFormat is Locale dependent, so by providing one you can get the Date string localized for specific language or country. This is a date in French:&lt;/p&gt; &lt;table class="code" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre class="line_numbers"&gt;1:&lt;br /&gt;2:&lt;br /&gt;3:&lt;br /&gt;4:&lt;br /&gt;5:&lt;br /&gt;6:&lt;/pre&gt; &lt;/td&gt; &lt;td&gt; &lt;pre class="sh_java sh_sourceCode"&gt;&lt;span class="sh_usertype"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;simpleDateFormat &lt;span class="sh_symbol"&gt;=&lt;/span&gt;&lt;br /&gt;       &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"dd MMMM yyyy zzzz G"&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt; Locale&lt;span class="sh_symbol"&gt;.&lt;/span&gt;FRENCH&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;String&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;dateAsString &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;format&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;Date&lt;/span&gt;&lt;span class="sh_symbol"&gt;());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;dateAsString&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "12 novembre 2009 Heure du méridien de Greenwich ap. J.-C."&lt;/span&gt; &lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;h1&gt;Parse String to Date&lt;/h1&gt; &lt;p&gt;Good thing about the SimpleDateFormat class is that it can be used not only for formatting, but also for parsing string into a Date object. In this example the used pattern is exactly the same as used by &lt;i&gt;Date.toString()&lt;/i&gt; method. With it we can parse the strings created by &lt;i&gt;Data.toString()&lt;/i&gt; back into dates:&lt;/p&gt; &lt;table class="code" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre class="line_numbers"&gt;1:&lt;br /&gt;2:&lt;br /&gt;3:&lt;br /&gt;4:&lt;br /&gt;5:&lt;br /&gt;6:&lt;br /&gt;7:&lt;br /&gt;8:&lt;br /&gt;9:&lt;br /&gt;10:&lt;br /&gt;11:&lt;br /&gt;12:&lt;/pre&gt; &lt;/td&gt; &lt;td&gt; &lt;pre class="sh_java sh_sourceCode"&gt;&lt;span class="sh_comment"&gt;// SimpleDateFormat that works exactly like Date.toString()&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;simpleDateFormat &lt;span class="sh_symbol"&gt;=&lt;/span&gt;&lt;br /&gt;       &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"E MMM dd HH:mm:ss zzz yyyy"&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt; Locale&lt;span class="sh_symbol"&gt;.&lt;/span&gt;ROOT&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;Date&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;today &lt;span class="sh_symbol"&gt;=&lt;/span&gt; &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;Date&lt;/span&gt;&lt;span class="sh_symbol"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;String&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;dateAsString_format &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;format&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;today&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;String&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;dateAsString_native &lt;span class="sh_symbol"&gt;=&lt;/span&gt; today&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;toString&lt;/span&gt;&lt;span class="sh_symbol"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Both strings are: "Thu Nov 12 18:49:36 GMT 2009"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;Date&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;parsedDate &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;parse&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;dateAsString_native&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;parsedDate&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;toString&lt;/span&gt;&lt;span class="sh_symbol"&gt;());&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "Thu Nov 12 18:49:36 GMT 2009"&lt;/span&gt; &lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;h1&gt;Setting the default time zone&lt;/h1&gt; &lt;p&gt;Notice that when you parse a string into a Date the result may be ambiguous. For example the string &lt;i&gt;“11:23 1 Jan 2001″&lt;/i&gt; is a different moment in time depending whether you live in Japan or Canada. By default Java resolves this by using your local time zone obtained from the default Locale.&lt;/p&gt; &lt;p&gt;Since the time zone may not be a part of the parsed string you may want to set it manually instead using the default one. You can do this with &lt;i&gt;setTimeZone()&lt;/i&gt; method:&lt;/p&gt; &lt;table class="code" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre class="line_numbers"&gt;1:&lt;br /&gt;2:&lt;br /&gt;3:&lt;br /&gt;4:&lt;br /&gt;5:&lt;br /&gt;6:&lt;br /&gt;7:&lt;br /&gt;8:&lt;br /&gt;9:&lt;br /&gt;10:&lt;/pre&gt; &lt;/td&gt; &lt;td&gt; &lt;pre class="sh_java sh_sourceCode"&gt;&lt;span class="sh_usertype"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;simpleDateFormat &lt;span class="sh_symbol"&gt;=&lt;/span&gt;&lt;br /&gt;       &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"dd-MM-yyyy"&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt; Locale&lt;span class="sh_symbol"&gt;.&lt;/span&gt;ENGLISH&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;Date&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;date &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;parse&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"13-07-1999"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;date&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "Tue Jul 13 00:00:00 GMT 1999"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;setTimeZone&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;TimeZone&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;getTimeZone&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"PST"&lt;/span&gt;&lt;span class="sh_symbol"&gt;));&lt;/span&gt;&lt;br /&gt;date &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;parse&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"13-07-1999"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;date&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "Tue Jul 13 08:00:00 GMT 1999"&lt;/span&gt; &lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;h1&gt;Setting the century&lt;/h1&gt; &lt;p&gt;Similar ambiguity occurs when parsing two-digit year dates. Whether &lt;i&gt;“01/01/59″&lt;/i&gt; is the new year’s day of 1959 or 2059 can be set by specifying the century to the SimpleDateFormat object. To be specific with &lt;i&gt;set2DigitYearStart()&lt;/i&gt; method you can specify the 100 year period in which the parsed date will be placed. By default the 100 year period is &lt;i&gt;[today - 80 years, today + 20 years]&lt;/i&gt;. See the example:&lt;/p&gt; &lt;table class="code" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre class="line_numbers"&gt;1:&lt;br /&gt;2:&lt;br /&gt;3:&lt;br /&gt;4:&lt;br /&gt;5:&lt;br /&gt;6:&lt;br /&gt;7:&lt;br /&gt;8:&lt;br /&gt;9:&lt;br /&gt;10:&lt;br /&gt;11:&lt;br /&gt;12:&lt;br /&gt;13:&lt;br /&gt;14:&lt;br /&gt;15:&lt;br /&gt;16:&lt;br /&gt;17:&lt;br /&gt;18:&lt;br /&gt;19:&lt;br /&gt;20:&lt;br /&gt;21:&lt;/pre&gt; &lt;/td&gt; &lt;td&gt; &lt;pre class="sh_java sh_sourceCode"&gt;&lt;span class="sh_usertype"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;simpleDateFormat &lt;span class="sh_symbol"&gt;=&lt;/span&gt;&lt;br /&gt;       &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"dd MMMM yy"&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt; Locale&lt;span class="sh_symbol"&gt;.&lt;/span&gt;ENGLISH&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;Date&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;date &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;parse&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"1 November 45"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;date&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// By default the year 45 will be taken from period 1929 - 2029&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "Thu Nov 01 00:00:00 GMT 1945"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;Date&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;startOf19thCentury &lt;span class="sh_symbol"&gt;=&lt;/span&gt; &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;GregorianCalendar&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_number"&gt;1801&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt;&lt;span class="sh_number"&gt;1&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt;&lt;span class="sh_number"&gt;1&lt;/span&gt;&lt;span class="sh_symbol"&gt;).&lt;/span&gt;&lt;span class="sh_function"&gt;getTime&lt;/span&gt;&lt;span class="sh_symbol"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;Date&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;startOf21stCentury &lt;span class="sh_symbol"&gt;=&lt;/span&gt; &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;GregorianCalendar&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_number"&gt;2001&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt;&lt;span class="sh_number"&gt;1&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt;&lt;span class="sh_number"&gt;1&lt;/span&gt;&lt;span class="sh_symbol"&gt;).&lt;/span&gt;&lt;span class="sh_function"&gt;getTime&lt;/span&gt;&lt;span class="sh_symbol"&gt;();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;set2DigitYearStart&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;startOf19thCentury&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;date &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;parse&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"1 November 45"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;date&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// After invoking set2DigitYearStart() the period is now 1801 - 1901&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "Thu Nov 01 00:00:00 GMT 1845"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;set2DigitYearStart&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;startOf21stCentury&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;date &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;parse&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"1 November 45"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;date&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// This time the period is 2001 - 2101&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "Thu Nov 01 00:00:00 GMT 2045"&lt;/span&gt; &lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;h1&gt;Make the parsing more strict&lt;/h1&gt; &lt;p&gt;By default the parse method of SimpleDateFormat is very forgiving. If the provided string is not entirely compatible with the pattern, SimpleDateFormat instead of giving up tries with many tricky heuristics to guess what would be the correct answer. In many situations this behavior is more than welcome, but if you do not like this you can disable it. With &lt;i&gt;setLenient()&lt;/i&gt; method you can make the parsing obey exactly the pattern and throw an exception if string is invalid.&lt;/p&gt; &lt;table class="code" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre class="line_numbers"&gt;1:&lt;br /&gt;2:&lt;br /&gt;3:&lt;br /&gt;4:&lt;br /&gt;5:&lt;br /&gt;6:&lt;br /&gt;7:&lt;br /&gt;8:&lt;br /&gt;9:&lt;br /&gt;10:&lt;br /&gt;11:&lt;br /&gt;12:&lt;/pre&gt; &lt;/td&gt; &lt;td&gt; &lt;pre class="sh_java sh_sourceCode"&gt;&lt;span class="sh_usertype"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;simpleDateFormat &lt;span class="sh_symbol"&gt;=&lt;/span&gt;&lt;br /&gt;       &lt;span class="sh_keyword"&gt;new&lt;/span&gt; &lt;span class="sh_function"&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"dd MMMM yyyy"&lt;/span&gt;&lt;span class="sh_symbol"&gt;,&lt;/span&gt; Locale&lt;span class="sh_symbol"&gt;.&lt;/span&gt;ENGLISH&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_usertype"&gt;Date&lt;/span&gt;&lt;span class="sh_normal"&gt; &lt;/span&gt;date &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;parse&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"31 April 1999"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;System&lt;span class="sh_symbol"&gt;.&lt;/span&gt;out&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;println&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;date&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Since April has only 30 days the parser will assume&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// user meant April 30th + one day = May 1st&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Result: "Sat May 01 00:00:00 GMT 1999"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// Make the parsing more strict&lt;/span&gt;&lt;br /&gt;simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;setLenient&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_keyword"&gt;false&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span class="sh_comment"&gt;// This throws java.text.ParseException: Unparseable date: "31 April 1999"&lt;/span&gt;&lt;br /&gt;date &lt;span class="sh_symbol"&gt;=&lt;/span&gt; simpleDateFormat&lt;span class="sh_symbol"&gt;.&lt;/span&gt;&lt;span class="sh_function"&gt;parse&lt;/span&gt;&lt;span class="sh_symbol"&gt;(&lt;/span&gt;&lt;span class="sh_string"&gt;"31 April 1999"&lt;/span&gt;&lt;span class="sh_symbol"&gt;);&lt;/span&gt; &lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7452863123789077226?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7452863123789077226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/11/guide-to-java-simpledateformat-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7452863123789077226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7452863123789077226'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/11/guide-to-java-simpledateformat-in.html' title='A guide to Java SimpleDateFormat in examples'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2409047620205843766</id><published>2009-11-18T11:00:00.000-08:00</published><updated>2009-11-18T11:01:17.777-08:00</updated><title type='text'>10 Java Regular Expression Examples You Should Know</title><content type='html'>http://www.mkyong.com/regular-expressions/10-java-regular-expression-examples-you-should-know/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2409047620205843766?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2409047620205843766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/11/10-java-regular-expression-examples-you.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2409047620205843766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2409047620205843766'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/11/10-java-regular-expression-examples-you.html' title='10 Java Regular Expression Examples You Should Know'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2872021189064995347</id><published>2009-10-21T06:49:00.000-07:00</published><updated>2009-10-21T06:52:21.024-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='project management.'/><title type='text'>Manager manage the system, not the people</title><content type='html'>Here is the &lt;a href="http://www.itjoblog.co.uk/2009/10/management.html"&gt;article&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Manager should create a system which:&lt;br /&gt;&lt;br /&gt;1. People can do their job efficient.&lt;br /&gt;2. People can get and give feedback.&lt;br /&gt;3.  People can grow. &lt;a id="publishButton" class="cssButton" href="javascript:void(0)" target="" onclick="if (this.className.indexOf(&amp;quot;ubtn-disabled&amp;quot;) == -1) {var e = document['stuffform'].publish;(e.length) ? e[0].click() : e.click(); if (window.event) window.event.cancelBubble = true; return false;}"&gt;&lt;div class="cssButtonOuter"&gt;&lt;div class="cssButtonMiddle"&gt;&lt;div class="cssButtonInner"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2872021189064995347?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2872021189064995347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/10/manager-manage-system-not-people.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2872021189064995347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2872021189064995347'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/10/manager-manage-system-not-people.html' title='Manager manage the system, not the people'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-8552339131817254009</id><published>2009-10-14T07:50:00.000-07:00</published><updated>2009-10-14T07:51:37.204-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>How to get property value using spring</title><content type='html'>Today I read a useful posting regarding using property file.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://anshu-manymoods.blogspot.com/2009/10/recipe-how-to-get-property-value-in.html"&gt;Article&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-8552339131817254009?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/8552339131817254009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/10/how-to-get-property-value-using-spring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8552339131817254009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8552339131817254009'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/10/how-to-get-property-value-using-spring.html' title='How to get property value using spring'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-733384300953462681</id><published>2009-10-07T07:39:00.000-07:00</published><updated>2009-10-07T07:40:13.499-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='project management.'/><title type='text'>Agile vs Lean</title><content type='html'>&lt;span id="quote_31769"&gt;The 4 principles of Lean Development are:&lt;br /&gt;&lt;br /&gt;-Add Nothing But Value (Eliminate Waste)&lt;br /&gt;-Center On The People Who Add Value&lt;br /&gt;-Flow Value From Demand&lt;br /&gt;-Optimize Across Organizations&lt;br /&gt;&lt;br /&gt;The Agile Manifesto says:&lt;br /&gt;&lt;br /&gt;-Individuals and interactions over processes and tools&lt;br /&gt;-Working software over comprehensive documentation&lt;br /&gt;-Customer collaboration over contract negotiation&lt;br /&gt;-Responding to change over following a plan&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-733384300953462681?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/733384300953462681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/10/agile-vs-lean.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/733384300953462681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/733384300953462681'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/10/agile-vs-lean.html' title='Agile vs Lean'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1425190912943254211</id><published>2009-10-07T07:20:00.000-07:00</published><updated>2009-10-07T07:25:41.314-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>waterfall vs rup vs scrum vs lean</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_faRFH48mUek/Ssyk2o090yI/AAAAAAAAAAM/nYPfHNiLFMg/s1600-h/the-difference-between-waterfall-iterative-waterfall-scrum-and-lean.jpg.jpeg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 175px; height: 320px;" src="http://2.bp.blogspot.com/_faRFH48mUek/Ssyk2o090yI/AAAAAAAAAAM/nYPfHNiLFMg/s320/the-difference-between-waterfall-iterative-waterfall-scrum-and-lean.jpg.jpeg" alt="" id="BLOGGER_PHOTO_ID_5389864112635106082" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Recently I got a very interesting &lt;a href="http://agile101.net/2009/09/08/the-difference-between-waterfall-iterative-waterfall-scrum-and-lean-in-pictures/"&gt;blog&lt;/a&gt; regarding difference between above project methods.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here’s a VERY simple overview of the main differences between &lt;strong&gt;Waterfall Development&lt;/strong&gt;, &lt;strong&gt;Iterative Waterfall Developm&lt;/strong&gt;ent, &lt;strong&gt;Scrum/Agile Development&lt;/strong&gt; and &lt;strong&gt;Lean&lt;/strong&gt;.&lt;/p&gt; &lt;h2&gt;Waterfall Development&lt;/h2&gt; &lt;p&gt;‘Waterfall Development’ is another name for the more &lt;strong&gt;traditional approach to software development&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;It’s called ‘waterfall’ as this type of development is often planned using a Gantt chart – &lt;strong&gt;you complete one phase (e.g. planning) before moving on to the next phase (e.g. development&lt;/strong&gt;).&lt;/p&gt; &lt;p&gt;In Waterfall approaches, you &lt;strong&gt;will rarely aim to re-visit a ‘phase’ once it’s completed&lt;/strong&gt;. As such, &lt;strong&gt;you better get whatever you’re doing right the first time&lt;/strong&gt;!&lt;/p&gt; &lt;p&gt;This approach is &lt;strong&gt;highly risky&lt;/strong&gt;, often &lt;strong&gt;more costly&lt;/strong&gt; and generally &lt;strong&gt;less efficient&lt;/strong&gt; than more Agile approaches.&lt;/p&gt; &lt;p&gt;The &lt;strong&gt;main issues with this approach&lt;/strong&gt; include:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;You don’t realise any value until the end of the project (when you deploy) &lt;strong&gt;(See: &lt;/strong&gt;&lt;a href="http://agile101.net/2009/07/22/self-funding-projects-a-benefit-of-agile-software-development/"&gt;&lt;strong&gt;Self-Funding Projects, a Benefit of Agile Software Development&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;You leave the testing until the end, which means you’re leaving issue discovery until late in the day&lt;/li&gt;&lt;li&gt;You don’t seek approval from the stakeholders until late in the day – their requirements might have changed&lt;/li&gt;&lt;li&gt;You’re heavily reliant upon a plan, which you can/will often follow to the detriment of the end result&lt;/li&gt;&lt;li&gt;You’re heavily reliant upon a project manager driving the way – the power of one&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Iterative Waterfall Development&lt;/h2&gt; &lt;p&gt;This approach carries &lt;strong&gt;less risk than a traditional Waterfall approa&lt;/strong&gt;ch but is still far &lt;strong&gt;more risky and less efficient than a more Agile approaches&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;The &lt;strong&gt;focus is on delivering a sprint of work &lt;/strong&gt;as opposed to a series of valuable/shippable features.&lt;/p&gt; &lt;p&gt;The most &lt;strong&gt;commonly occurring issue in this type of scenario (in my experience) is&lt;/strong&gt; &lt;strong&gt;bottle necking&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;For example, you deliver loads of code a little bit behind schedule (?) and you leave it until the last minute to test everything. &lt;strong&gt;One issue takes longer than expected to resolve, you miss your sprint deadline and you deliver nothing&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;Another &lt;strong&gt;common symptom of this type of approach is over-commitment&lt;/strong&gt;.  It’s really &lt;strong&gt;difficult to estimate&lt;/strong&gt; the &lt;strong&gt;total&lt;/strong&gt; effort associated with a particular User Story/Feature when approaching delivery in this phased way. &lt;/p&gt; &lt;p&gt;You’re more or less &lt;strong&gt;forced to estimate each phase separately&lt;/strong&gt; (e.g. estimate development separately to testing in this instance) – this doesn’t work as the &lt;strong&gt;phases are not separate, they’re totally intertwined&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;For example, if you find an issue with the test, you must return to development. The &lt;strong&gt;whole team must remain focused on delivering the end goal&lt;/strong&gt;, not the separate phases.&lt;/p&gt; &lt;p&gt;It’s also worth noting that &lt;strong&gt;velocity and burn downs are far less (if at all) useful in this type of environment – you don’t benefit from early-warning-signs as you don’t find out whether you’re on track until the end of the sprint.&lt;/strong&gt;&lt;/p&gt; &lt;h2&gt;Scrum Development&lt;/h2&gt; &lt;p&gt;This approach &lt;strong&gt;carries far less risk than Waterfall appro&lt;/strong&gt;aches.&lt;/p&gt; &lt;p&gt;We &lt;strong&gt;focus on delivering fully-tested, independent, valuable, small features&lt;/strong&gt;. As such, we &lt;strong&gt;diversify our risk&lt;/strong&gt; – if one feature goes wrong, it should not impact another feature.&lt;/p&gt; &lt;p&gt;With that said, we &lt;strong&gt;still plan our work in iterations&lt;/strong&gt; and we will &lt;strong&gt;still release at the end of each iteration&lt;/strong&gt;.&lt;/p&gt; &lt;h2&gt;Lean Development&lt;/h2&gt; &lt;p&gt;Lean is very similar to Scrum in the sense that we &lt;strong&gt;focus on features as opposed to groups of features&lt;/strong&gt; – however Lean takes this one step further again.&lt;/p&gt; &lt;p&gt;In Lean Development, &lt;strong&gt;you select, plan develop, test and deploy one feature (in its simplest form) before you select, plan, develop, test and deploy the next feature&lt;/strong&gt;. By doing this, you further isolate risk to a feature-level.&lt;/p&gt; &lt;p&gt;In these environments, you &lt;strong&gt;aim to eliminate ‘waste’ wherever possible&lt;/strong&gt; – you therefore do nothing until you know it’s necessary or relevant.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1425190912943254211?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1425190912943254211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/10/waterfall-vs-rup-vs-scrum-vs-lean.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1425190912943254211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1425190912943254211'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/10/waterfall-vs-rup-vs-scrum-vs-lean.html' title='waterfall vs rup vs scrum vs lean'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_faRFH48mUek/Ssyk2o090yI/AAAAAAAAAAM/nYPfHNiLFMg/s72-c/the-difference-between-waterfall-iterative-waterfall-scrum-and-lean.jpg.jpeg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-808043136747182143</id><published>2009-10-06T06:45:00.000-07:00</published><updated>2009-10-06T06:48:25.869-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>Why software is expensive</title><content type='html'>I just read a post from http://itscommonsensestupid.blogspot.com/2009/10/why-software-is-expensive.html, it is very interesting, below it is the points.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;Software is expensive because there are huge overhead costs associated with software development&lt;/b&gt;. Computer equipments are expensive. And the fact that software developers need to stay on the cutting edge of the technology means that they need to always upgrade their hardware. Also, software methodologies and tools change very often, software developers need to invest a lot of time and money to just to keep up with the development so that they can provide better service to their clients next time.&lt;br /&gt;For those of you who think that hardware cost is "&lt;i&gt;just of small fraction of the total cost&lt;/i&gt;", let me tell you that hardware is &lt;i&gt;not&lt;/i&gt; cheap in third world countries; a mere &lt;a href="http://buylaptop.com.my/web/products.asp?Id=757"&gt;acer laptop&lt;/a&gt; is costing as much as a programmer's one month salary here in Malaysia.&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;Software is expensive because there are a lot of research going into it.&lt;/b&gt; Some express puzzle at software developer apparent "low productivity" (&lt;a href="http://www.codinghorror.com/blog/archives/000365.html"&gt;20 lines of code per day&lt;/a&gt;). Assuming that you are charging USD 50 per hour, your rate is USD 20/line. This is awfully expensive to the business owners who measure productivity in terms of quantity produced. What they miss out is that programming productivity is all about &lt;a href="http://stackoverflow.com/questions/324150/how-many-lines-of-code-do-you-write-modify-per-day/324165#324165"&gt;writing less code to get your job done&lt;/a&gt;. A programmer could spend one billable month reinventing the wheel and produce a 10 million line-of-code ORM  that is buggy, or spend &lt;a href="http://itscommonsensestupid.blogspot.com/2009/08/should-programming-work-be-billed-in.html"&gt;one non-billable month&lt;/a&gt; to look for an open source implementation that is mature and well-developed, and endure the complain of low productivity. The way business owners complain about "research time" is encouraging the wrong type of behavior.&lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;Software is expensive because the product owners don't know what they want.&lt;/b&gt; &lt;a href="http://www.pcuf.fi/%7Epjt/pink/software-architecture.html"&gt;Imagine if you go to an  architect, asking him to provide a blue print, and after he comes out with that you ask him to change it according to your latest taste-- even though it is contrary to the original specification, and you repeat this process,.. &lt;/a&gt; No one would dare to do this, but everyone seems to have no problem asking the software developers to change their code at last minute &lt;i&gt;and&lt;/i&gt; expect everything to work just fine &lt;i&gt;and&lt;/i&gt; the product ships in time &lt;i&gt;and&lt;/i&gt; worse of all, is not willing to pay extra. &lt;/li&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;Software is expensive because it is customized only for you&lt;/b&gt;. The reason why Microsoft Office and Windows Vista is so cheap, is because the development cost is spread over million of users. The consequence of this is that there is no competitive advantage associated with the ordinary office or Windows Vista users. Your customized application, on the other hand, is designed especially for &lt;i&gt;you&lt;/i&gt;, and you-- and no one else-- can enjoy the returns and benefits bring forth by the application.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-808043136747182143?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/808043136747182143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/10/why-software-is-expensive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/808043136747182143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/808043136747182143'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/10/why-software-is-expensive.html' title='Why software is expensive'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-242384108507875129</id><published>2009-09-29T08:22:00.001-07:00</published><updated>2009-09-29T08:22:37.963-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='knowledge'/><title type='text'>URI, URL, URN</title><content type='html'>&lt;p&gt;Have you ever carefully noticed the string in the address bar of your browser? What is it? Is it a URI or URL or URN? Some of us can’t differentiate between URI and URL and URN. Some non technical persons even don’t know the terms URI and URN. They just call that string a URL. Let’s understand this concept in deep.&lt;span id="more-379"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Full Forms:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;URI&lt;/strong&gt; - Uniform Resource Indicator&lt;br /&gt;&lt;strong&gt;URL&lt;/strong&gt; - Uniform Resource Locator&lt;br /&gt;&lt;strong&gt;URN&lt;/strong&gt; - Unifrorm Resource Name&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Definition:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;URI:&lt;/strong&gt; A URI indicates the name and the address of the resource on the web. The URI is further subdivided into URL and URI. It means URL and URI are the components of URI. definition &lt;/p&gt; &lt;p&gt;&lt;strong&gt;URL:&lt;/strong&gt; A URL is the address of some resource on the web. A URL defines how the resource can be obtained and from where it can be obtained.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;URN:&lt;/strong&gt; A URN is the name of some resource on the web. A URN does not imply the availability of the identified resource and never tells about how the resource can be obtained.&lt;/p&gt; &lt;p&gt;So, one can say &lt;strong&gt;URI = URL + URN&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Example: &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;If i say “My name is Roy”, then it will be a URN, just telling the name of a person not the proper location.&lt;br /&gt;If i say “I live in New York”, then it will be a URL, telling me the location of a person.&lt;br /&gt;If i say “My name is Roy and I live in New York”, then its proprer URI. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Ambiguity:&lt;/strong&gt; Its the matter of ambiguity whether the term URL is deprecated or not. Some argue yes and some no. Some say that the more correct term is URI, used in technical documentation. All URIs are means to access a resource on the Internet and are a technical short hand used to link to the resource. URIs always designate a method to access the resource and designate the specific resource to be accessed. So should we use the term URI instead of most popular term URL?&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Conclusion: &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;URI is an abstract concept while URL and URN are the concrete implementations of a URI and one should always know the difference among all the three.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-242384108507875129?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/242384108507875129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/09/uri-url-urn.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/242384108507875129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/242384108507875129'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/09/uri-url-urn.html' title='URI, URL, URN'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2851588850740594226</id><published>2009-09-28T11:14:00.000-07:00</published><updated>2009-09-28T11:18:48.374-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><title type='text'>What is difference between n-tiered and n-layered</title><content type='html'>Tiered is physical separation, for example client tier, database tier, application server tier&lt;br /&gt;Layered is logical separation, for example presentation layer, business layer, DAO layer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2851588850740594226?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2851588850740594226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/09/what-is-difference-between-n-tiered-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2851588850740594226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2851588850740594226'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/09/what-is-difference-between-n-tiered-and.html' title='What is difference between n-tiered and n-layered'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7287258072076495762</id><published>2009-09-17T05:59:00.000-07:00</published><updated>2009-09-17T06:00:10.196-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP'/><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>OOP principal</title><content type='html'>The first five principles are principles of &lt;i&gt;class design&lt;/i&gt;.  They are:&lt;br /&gt;&lt;table border="1" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;SRP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/srp.pdf"&gt;The Single Responsibility Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;A class should have one, and only one, reason to change.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;OCP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/ocp.pdf"&gt;The Open Closed Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;You should be able to extend a classes behavior, without modifying it.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;LSP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/lsp.pdf"&gt;The Liskov Substitution Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Derived classes must be substitutable for their base classes.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;DIP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/dip.pdf"&gt;The Dependency Inversion Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Depend on abstractions, not on concretions.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;ISP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/isp.pdf"&gt;The Interface Segregation Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Make fine grained interfaces that are client specific.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The next six principles are about packages. In this context a package is a binary deliverable like a .jar file, or a dll as opposed to a namespace like a java package or a C++ namespace.&lt;br /&gt;&lt;br /&gt;The first three package principles are about package &lt;i&gt;cohesion&lt;/i&gt;, they tell us what to put inside packages:&lt;br /&gt;&lt;br /&gt;&lt;table border="1" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;REP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/granularity.pdf"&gt;The Release Reuse Equivalency Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;The granule of reuse is the granule of release.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;CCP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/granularity.pdf"&gt;The Common Closure Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Classes that change together are packaged together.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;CRP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/granularity.pdf"&gt;The Common Reuse Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Classes that are used together are packaged together.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The last three principles are about the couplings between packages, and talk about metrics that evaluate the package structure of a system.&lt;br /&gt;&lt;br /&gt;&lt;table border="1" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;ADP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/granularity.pdf"&gt;The Acyclic Dependencies Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;The dependency graph of packages must have no cycles.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;SDP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/stability.pdf"&gt;The Stable Dependencies Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Depend in the direction of stability.&lt;/i&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;b&gt;SAP&lt;/b&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://www.objectmentor.com/resources/articles/stability.pdf"&gt;The Stable Abstractions Principle&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Abstractness increases with stability.&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7287258072076495762?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7287258072076495762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/09/oop-principal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7287258072076495762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7287258072076495762'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/09/oop-principal.html' title='OOP principal'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-5184124601446457764</id><published>2009-09-09T08:27:00.000-07:00</published><updated>2009-09-09T08:55:28.803-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><title type='text'>What is architecture</title><content type='html'>Fowler statement:&lt;br /&gt;&lt;br /&gt;In most successful software project, the expert developer working on the project have a shared understanding of the system design. The shared system design is called "Architecture". The shared understanding includes how the system is divided into components and how those components interacts through interfaces. Those components are usually composed of small components, but the architecture only includes those components and interfaces that understandable by all developers. Architecture is about important stuff, whatever is.&lt;br /&gt;&lt;br /&gt;Booch said:&lt;br /&gt;&lt;br /&gt;All architecture are design, but not all design is  architecture. Architecture represents the significant  design decision that shapes a system where significant is measured by the cost of change.&lt;br /&gt;&lt;br /&gt;The goal of architecture is  eliminate  the impact and cost of change.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Making everything easy to change makes the entire system complex.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-5184124601446457764?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/5184124601446457764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/09/what-is-architecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5184124601446457764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5184124601446457764'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/09/what-is-architecture.html' title='What is architecture'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2344127819310008056</id><published>2009-08-24T07:08:00.000-07:00</published><updated>2009-08-24T07:24:08.412-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>Insteresting reading points</title><content type='html'>A. Once you have a direction, you stick to it. But no matter how far you traveled to a wrong direction, turn around.&lt;br /&gt;B. If the only tool you have is a hammer, then everything looks like a nail.&lt;br /&gt;C. Nothing is permanent than  temporary patch in a system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2344127819310008056?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2344127819310008056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/08/insteresting-reading-points.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2344127819310008056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2344127819310008056'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/08/insteresting-reading-points.html' title='Insteresting reading points'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-454513269923999439</id><published>2009-08-18T12:11:00.000-07:00</published><updated>2009-08-18T12:12:39.107-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xml schema'/><title type='text'>Attribute vs element, XML schema</title><content type='html'>Data goes to element, metadata goes to attribute&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-454513269923999439?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/454513269923999439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/08/attribute-vs-element-xml-schema.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/454513269923999439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/454513269923999439'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/08/attribute-vs-element-xml-schema.html' title='Attribute vs element, XML schema'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4660521550835509940</id><published>2009-08-17T12:57:00.000-07:00</published><updated>2009-08-17T12:58:47.580-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powerbuilder'/><title type='text'>powerbuilder path</title><content type='html'>jonview_socket&lt;br /&gt;&lt;br /&gt;T:\jonview_soket\jonview_socket.pbl;&lt;br /&gt;T:\jonview_soket\proxy_socket_call.pbl;&lt;br /&gt;&lt;br /&gt;jonview_remote&lt;br /&gt;&lt;br /&gt;T:\jonview_remote\jonview_remote.pbl;&lt;br /&gt;T:\jonview_remote\remote_call.pbl;&lt;br /&gt;T:\jonview_remote\remote_fun.pbl;&lt;br /&gt;T:\jonview_remote\remote_call_new.pbl;&lt;br /&gt;T:\jonview_remote\remote_fun_new.pbl;&lt;br /&gt;&lt;br /&gt;jonviewhostclient&lt;br /&gt;&lt;br /&gt;T:\jonviewclient\client\jonviewclient\jonviewhostclient.pbl;&lt;br /&gt;T:\jonviewclient\client\jonviewclient\voucher.pbl;&lt;br /&gt;T:\jonviewclient\client\jonviewclient\jonview_report.pbl;&lt;br /&gt;T:\jonviewclient\client\jonviewclient\jonview_report_win.pbl;&lt;br /&gt;T:\jonviewclient\client\jonviewclient\jonview_report2.pbl;&lt;br /&gt;T:\jonviewclient\client\jonviewclient\jonviewclient_proxy.pbl;&lt;br /&gt;T:\jonviewclient\client\jonviewclient\library.pbl;&lt;br /&gt;T:\jonviewclient\client\jonviewclient\jonview_common.pbl;&lt;br /&gt;&lt;br /&gt;jonviewhostserver_trion&lt;br /&gt;&lt;br /&gt;T:\jonviewhost_xml\jonviewhostserver_allian.pbl;&lt;br /&gt;T:\jonviewhost_xml\xml_exchange.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonviewproxy.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonview_common.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonview_xml_parent.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_common.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_product.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_trion.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_h2h.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_string.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_login.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_tariff.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonview_xml_download.pbl;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;jonviewhostserver_xml&lt;br /&gt;&lt;br /&gt;T:\jonviewhost_xml\jonviewhostserver.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonview_xml_parent.pbl;&lt;br /&gt;T:\jonviewhost_xml\xml_exchange.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonviewproxy.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonview_allian_proxy.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonview_common.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_common.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_product.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_trion.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_h2h.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_string.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_login.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_tariff.pbl;&lt;br /&gt;T:\jonviewhost_xml\jonview_xml_download.pbl;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;jonviewhostserver&lt;br /&gt;&lt;br /&gt;T:\jonviewhost_all\jonviewhostserver.pbl;&lt;br /&gt;T:\jonviewhost_all\jonview_core_proxy.pbl;&lt;br /&gt;T:\jonviewhost_all\jonview_common.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_paxspecial.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_nvo.pbl;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;jonviewhostserver_voucher&lt;br /&gt;&lt;br /&gt;T:\jonviewclient\jonviewhostserver_voucher.pbl;&lt;br /&gt;T:\jonviewclient\jonviewhostserver_father.pbl;&lt;br /&gt;T:\jonviewclient\jonview_common_fun.pbl;&lt;br /&gt;T:\jonviewclient\voucher.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_common.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_product.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_string.pbl;&lt;br /&gt;&lt;br /&gt;jonviewhostserver_report&lt;br /&gt;&lt;br /&gt;T:\jonviewclient\jonviewhostserver_report.pbl;&lt;br /&gt;T:\jonviewclient\jonviewhostserver_father.pbl;&lt;br /&gt;T:\jonviewclient\jonview_common.pbl;&lt;br /&gt;T:\jonviewclient\jonview_common_fun.pbl;&lt;br /&gt;T:\jonviewclient\jonview_report2.pbl;&lt;br /&gt;T:\jonviewclient\jonview_report.pbl;&lt;br /&gt;&lt;br /&gt;jonviewhostserver(jonviewclient)&lt;br /&gt;&lt;br /&gt;T:\jonviewclient\jonviewhostserver.pbl;&lt;br /&gt;T:\jonviewclient\jonviewhostserver_father.pbl;&lt;br /&gt;T:\jonviewclient\jonview_core_proxy.pbl;&lt;br /&gt;T:\jonviewclient\jonview_common.pbl;&lt;br /&gt;T:\jonviewclient\jonview_common_fun.pbl;&lt;br /&gt;T:\jonviewclient\jonviewhost_xmlproxy.pbl;&lt;br /&gt;T:\jonviewclient\jonviewhost_pdfproxy.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_common.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_product.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_string.pbl;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;jonview_trion&lt;br /&gt;&lt;br /&gt;T:\jonview_trion\jonview_trion.pbl;&lt;br /&gt;T:\jonview_trion\jonview_trion_common.pbl;&lt;br /&gt;T:\jonview_trion\jonview_proxy.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_string.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_common.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_reference.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_product.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_trion.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_h2h.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_login.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_paxspecial.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_report.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_itinerary.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_transportation.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_nvo.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_tariff.pbl;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;jonview_pdf&lt;br /&gt;&lt;br /&gt;T:\jonview_pdf\jonview_pdf.pbl;&lt;br /&gt;T:\jonview_pdf\proxy_mail.pbl;&lt;br /&gt;&lt;br /&gt;jonview_public&lt;br /&gt;&lt;br /&gt;T:\jonview_web\public\jonview_public.pbl;&lt;br /&gt;T:\jonview_web\public\jonview_public_alternate.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_common.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_login.pbl;&lt;br /&gt;T:\jonview_web\common\jonview_public_tariff.pbl;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4660521550835509940?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4660521550835509940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/08/powerbuilder-path.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4660521550835509940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4660521550835509940'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/08/powerbuilder-path.html' title='powerbuilder path'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-8808028680892913817</id><published>2009-08-17T07:41:00.000-07:00</published><updated>2009-08-17T07:46:59.348-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='how to'/><category scheme='http://www.blogger.com/atom/ns#' term='activeMQ'/><title type='text'>how to fix activeMq inactive errors.</title><content type='html'>Change configuration file under transportConnectors tag&lt;br /&gt;from&lt;br /&gt;transportConnector name="openwire" uri="tcp://localhost:61616" discoveryUri="multicast://default"&lt;br /&gt;to&lt;br /&gt;transportConnector name="openwire" uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"&lt;br /&gt;&lt;br /&gt;&lt;transportconnectors&gt;&lt;transportconnector name="openwire" uri="tcp://localhost:61616" discoveryuri="multicast://default"&gt;&lt;transportconnector name="openwire" uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"&gt;&lt;transportconnector name="openwire" uri="tcp://localhost:61616" discoveryuri="multicast://default"&gt;&lt;transportconnector name="openwire" uri="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"&gt;&lt;/transportconnector&gt;&lt;/transportconnector&gt;&lt;/transportconnector&gt;&lt;/transportconnector&gt;&lt;/transportconnectors&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-8808028680892913817?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/8808028680892913817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/08/how-to-fix-activemq-inactive-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8808028680892913817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8808028680892913817'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/08/how-to-fix-activemq-inactive-errors.html' title='how to fix activeMq inactive errors.'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-8823956597847013346</id><published>2009-08-13T07:38:00.000-07:00</published><updated>2009-08-13T07:50:34.997-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='design pattern'/><title type='text'>Inversion of control and dependency injection</title><content type='html'>The caller eventually get the results, but how and when is out of its control. The callee decide when and how. This is a technique separating  execution of a certain task from its implementation.&lt;br /&gt;&lt;br /&gt;1. decoupling execution and its implementation&lt;br /&gt;2. Every system focus on what it is designed for.&lt;br /&gt;3. Every system does not what other system will do or should do.&lt;br /&gt;4. Changing one system will not affect others.&lt;br /&gt;&lt;br /&gt;Techniques:&lt;br /&gt;&lt;br /&gt;1. Factory pattern.&lt;br /&gt;2. setter injection&lt;br /&gt;3. Constructor injection.&lt;br /&gt;4. Services Locater&lt;br /&gt;5. Interface injection&lt;br /&gt;&lt;br /&gt;Dependency Injection is decoupling high level modules from low level services.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-8823956597847013346?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/8823956597847013346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/08/inversion-of-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8823956597847013346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8823956597847013346'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/08/inversion-of-control.html' title='Inversion of control and dependency injection'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7565999047485970144</id><published>2009-08-10T13:04:00.000-07:00</published><updated>2009-08-10T13:07:33.580-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='design pattern'/><title type='text'>template VS stragety</title><content type='html'>&lt;span style="font-family: verdana;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-size: 100%;"&gt;he Template pattern is similar to the Strategy pattern. These two patterns differ in scope and in methodology.&lt;br /&gt;&lt;br /&gt;Strategy is used to allow callers to vary an entire algorithm, like how to calculate different types of tax, while Template Method is used to vary steps in an algorithm. Because of this,&lt;strong&gt; Strategy is more coarsely grained&lt;/strong&gt;. The Template allows finer-grained controls in the sequent of operations, and yet allows the implementations of these details to vary.&lt;br /&gt;&lt;br /&gt;The other main difference is that &lt;strong&gt;Strategy uses delegation while Template Method uses inheritance&lt;/strong&gt;. In Strategy, the algorithm is delegated to the another xxxStrategy class that the subject will have a reference to, but with Template you subclass the base and override methods to make changes.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="font-size: 85%;"&gt;&lt;span style="font-size: 100%;"&gt;&lt;strong&gt;Strategy pattern example:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;Class MainSubject&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;blockquote&gt;&lt;p&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;ITaxStrategy taxCalculator = GetStrategy(taxType); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;//strategy is member class.&lt;br /&gt;taxCalculator.Calculate();&lt;br /&gt;&lt;br /&gt;private GetStrategy(string taxType)&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;if (taxType == "incometax")&lt;br /&gt;return new IncomeTaxStrategy();&lt;br /&gt;else if (taxType == "propertytax")&lt;br /&gt;return new PropertyTaxStrategy();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt; &lt;span style="font-family: courier new; font-size: 85%;"&gt;}&lt;br /&gt;&lt;br /&gt;Class IncomeTaxStrategy : ITaxStrategy&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;&lt;/span&gt; &lt;blockquote&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;public Calculate()&lt;br /&gt;{&lt;br /&gt;//calculate based on income tax rates.&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;}&lt;br /&gt;&lt;br /&gt;Class PropertyTaxStrategy : ITaxStrategy&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;&lt;/span&gt; &lt;blockquote&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;public Calculate()&lt;br /&gt;{&lt;br /&gt;//calculate based on property tax&lt;br /&gt;policies.&lt;br /&gt;} &lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family: verdana;"&gt;Template pattern example:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: 85%;"&gt;&lt;br /&gt;abstract Class TaxCalculator&lt;br /&gt;{&lt;br /&gt;&lt;blockquote&gt;public CalculateTax()&lt;br /&gt;{&lt;br /&gt;&lt;blockquote&gt;CalculateIncome();&lt;br /&gt;tax =+ CalculateTax();&lt;br /&gt;tax =+ CalculateRelief();&lt;/blockquote&gt;&lt;br /&gt;}&lt;br /&gt;abstract CalculateTax();&lt;br /&gt;abstract CalculateRelief();&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Class IncomeTaxCalculator : TaxCalculator&lt;br /&gt;{ &lt;blockquote&gt;&lt;br /&gt;override CalculateTax() { //calculate income tax. }&lt;br /&gt;override CalculateRelief() { //calculate personal relief }&lt;/blockquote&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Class PropertyTaxCalculator : TaxCalculator&lt;br /&gt;{ &lt;blockquote&gt;&lt;br /&gt;override CalculateTax() { //calculate property tax. }&lt;br /&gt;override CalculateRelief() { //do nothing; no relief. }&lt;/blockquote&gt;&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7565999047485970144?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7565999047485970144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/08/template-vs-stragety.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7565999047485970144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7565999047485970144'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/08/template-vs-stragety.html' title='template VS stragety'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1238409219084835676</id><published>2009-07-29T08:56:00.001-07:00</published><updated>2009-07-29T08:57:15.304-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>String.substring is dangerous</title><content type='html'>String.substring() will create a new string and old one can not be garbage collected. Please use below.&lt;br /&gt;&lt;br /&gt;&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="java" style="font-family: monospace;"&gt;     &lt;span style="color: rgb(0, 51, 153);"&gt;String&lt;/span&gt; sub &lt;span style="color: rgb(51, 153, 51);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(0, 51, 153);"&gt;String&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;(&lt;/span&gt; oldString.&lt;span style="color: rgb(0, 102, 51);"&gt;substring&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(204, 102, 204);"&gt;0&lt;/span&gt;, &lt;span style="color: rgb(204, 102, 204);"&gt;4&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(51, 153, 51);"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1238409219084835676?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1238409219084835676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/stringsubstring-is-dangerous.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1238409219084835676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1238409219084835676'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/stringsubstring-is-dangerous.html' title='String.substring is dangerous'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7917004734106659319</id><published>2009-07-28T06:35:00.000-07:00</published><updated>2009-07-28T06:37:19.421-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Developer'/><title type='text'>Good Developer</title><content type='html'>A good Developer should be able to learn, adapt, and apply but not be&lt;br /&gt;limited to past experience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7917004734106659319?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7917004734106659319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/good-developer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7917004734106659319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7917004734106659319'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/good-developer.html' title='Good Developer'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2694176596666585920</id><published>2009-07-27T11:35:00.001-07:00</published><updated>2009-07-27T11:39:36.594-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='adapter'/><category scheme='http://www.blogger.com/atom/ns#' term='design pattern'/><title type='text'>What is the difference between class adapter and object  adapter design pattern</title><content type='html'>Object adapter contains adaptee , and class adapter inherits from adaptee.&lt;br /&gt;If you have multiple adaptees, then you have to use object adapter.&lt;br /&gt;&lt;br /&gt; &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span class="comment"&gt;// Object adapter version&lt;/span&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="keyword"&gt;class&lt;/span&gt; ReportGenerator &lt;span class="keyword"&gt;implements&lt;/span&gt; OldReporter {  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;    &lt;span class="keyword"&gt;private&lt;/span&gt; NewReportWriter newReporter = &lt;span class="keyword"&gt;new&lt;/span&gt; NewReportWriter()&lt;st1:personname st="on"&gt;;&lt;/st1:PersonName&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;    &lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="keyword"&gt;void&lt;/span&gt; writeHeader(String headerData) {  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;        newReporter.generateHeaderLines(headerData)&lt;st1:personname st="on"&gt;;&lt;/st1:PersonName&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;    }  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;}  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span class="comment"&gt;// Class adapter version&lt;/span&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="keyword"&gt;class&lt;/span&gt; ReportGenerator &lt;span class="keyword"&gt;extends&lt;/span&gt; NewReportWriter   &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;        &lt;span class="keyword"&gt;implements&lt;/span&gt; OldReporter {  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;    &lt;span class="keyword"&gt;public&lt;/span&gt; &lt;span class="keyword"&gt;void&lt;/span&gt; writeHeader(String headerData) {  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;        generateHeaderLines(headerData)&lt;st1:personname st="on"&gt;;&lt;/st1:PersonName&gt;  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;    }  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;}  &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2694176596666585920?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2694176596666585920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/what-is-difference-between-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2694176596666585920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2694176596666585920'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/what-is-difference-between-class.html' title='What is the difference between class adapter and object  adapter design pattern'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7987373117742862627</id><published>2009-07-24T06:56:00.000-07:00</published><updated>2009-07-24T06:58:46.831-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='example'/><category scheme='http://www.blogger.com/atom/ns#' term='design pattern'/><title type='text'>design pattern Singleton</title><content type='html'>&lt;ol class="dp-j" start="1"&gt;&lt;li class="alt"&gt;&lt;span&gt;&lt;span class="keyword"&gt;public&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="keyword"&gt;class&lt;/span&gt;&lt;span&gt; SimpleSingleton {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;    &lt;span class="keyword"&gt;private&lt;/span&gt;&lt;span&gt; SimpleSingleton singleInstance = &lt;/span&gt;&lt;span class="keyword"&gt;null&lt;/span&gt;&lt;span&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;    &lt;span class="comment"&gt;//Marking default constructor private&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;    &lt;span class="comment"&gt;//to avoid direct instantiation.&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;    &lt;span class="keyword"&gt;private&lt;/span&gt;&lt;span&gt; SimpleSingleton() {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;    }  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;    &lt;span class="comment"&gt;//Get instance for class SimpleSingleton&lt;/span&gt;&lt;span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;    &lt;span class="keyword"&gt;public&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="keyword"&gt;static&lt;/span&gt;&lt;span&gt; SimpleSingleton getInstance() {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;        &lt;span class="keyword"&gt;if&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span class="keyword"&gt;null&lt;/span&gt;&lt;span&gt; == singleInstance) {  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;            singleInstance = &lt;span class="keyword"&gt;new&lt;/span&gt;&lt;span&gt; SimpleSingleton();  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;        }  &lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;        &lt;span class="keyword"&gt;return&lt;/span&gt;&lt;span&gt; singleInstance;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="alt"&gt;&lt;span&gt;    }  &lt;/span&gt;&lt;/li&gt;&lt;li class=""&gt;&lt;span&gt;} &lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;in multi-thread environment, please use:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span class="keyword"&gt;public&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="keyword"&gt;static&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="keyword"&gt;synchronized&lt;/span&gt;&lt;span&gt; SimpleSingleton getInstance() { }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7987373117742862627?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7987373117742862627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/design-pattern-singleton.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7987373117742862627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7987373117742862627'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/design-pattern-singleton.html' title='design pattern Singleton'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-279790355709408128</id><published>2009-07-23T13:15:00.000-07:00</published><updated>2009-07-23T13:31:18.306-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><title type='text'>How to do as architect</title><content type='html'>1. Management of non-functional requirement&lt;br /&gt;a. help the stakeholders to list all non-functional requirement:&lt;br /&gt;    performance, security, scalability, availability, maintainability, audit, extensibility and I18N&lt;br /&gt;&lt;br /&gt;2. Architecture definition&lt;br /&gt;    Every system has a architecture, but not every has a architecture defined. The architecture definition process lets you think about how you're going to take the requirements plus any constraints imposed upon you and figure out how you're going to solve the problem. Architecture definition is about introducing structure, guidelines, principles and leadership to the technical aspects of a software project.&lt;br /&gt;&lt;br /&gt;3. Technology selection&lt;br /&gt;&lt;br /&gt;4. Architecture evaluation&lt;br /&gt;    Risk, benefit.&lt;br /&gt;&lt;br /&gt;5. Architecture collaboration&lt;br /&gt;    Go through it and make sure everybody involved understand it and buy in.&lt;br /&gt;&lt;br /&gt;6. Ownership of big picture.&lt;br /&gt;&lt;br /&gt;7.  leadership&lt;br /&gt;   Taking responsibility, providing technical guidance, making technical decisions and having the authority to make those decisions&lt;br /&gt;&lt;br /&gt;8. Coaching and mentoring&lt;br /&gt;    Sharing experience with other members.&lt;br /&gt;&lt;br /&gt;9. Design, development and testing&lt;br /&gt;&lt;br /&gt;10. Quality assurance&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-279790355709408128?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/279790355709408128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/how-to-do-as-architect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/279790355709408128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/279790355709408128'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/how-to-do-as-architect.html' title='How to do as architect'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4586194543992521238</id><published>2009-07-23T12:43:00.000-07:00</published><updated>2009-07-23T12:44:52.561-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><title type='text'>hands-on software architect</title><content type='html'>&lt;a href="http://www.codingthearchitecture.com/pages/book/role.html"&gt;http://www.codingthearchitecture.com/pages/book/role.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4586194543992521238?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4586194543992521238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/hands-on-software-architect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4586194543992521238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4586194543992521238'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/hands-on-software-architect.html' title='hands-on software architect'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2941310549541656914</id><published>2009-07-21T07:14:00.000-07:00</published><updated>2009-07-21T07:16:34.914-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>String, Stringbuilder, and stringbuffer</title><content type='html'>String is good for substring, not add extra time.&lt;br /&gt;For concat(), string builder is better, but JVM automatically does it for you.&lt;br /&gt;Stringbuilder is not thread-safe&lt;br /&gt;Stringbuffer is thread-safe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2941310549541656914?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2941310549541656914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/string-stringbuilder-and-stringbuffer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2941310549541656914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2941310549541656914'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/string-stringbuilder-and-stringbuffer.html' title='String, Stringbuilder, and stringbuffer'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-5456184469508657163</id><published>2009-07-21T06:52:00.000-07:00</published><updated>2009-07-21T06:55:15.537-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>TDD steps</title><content type='html'>1. Write the test&lt;br /&gt;2. Write the comments inside the test to describe the function&lt;br /&gt;3. Write sub-test for each function inside the test.&lt;br /&gt;4. Run the test, make the testing running automatically.&lt;br /&gt;5. Write the code.&lt;br /&gt;6. re-factory the test.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-5456184469508657163?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/5456184469508657163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/tdd-steps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5456184469508657163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5456184469508657163'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/tdd-steps.html' title='TDD steps'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-8751033608289874913</id><published>2009-07-20T11:48:00.000-07:00</published><updated>2009-07-20T11:51:05.460-07:00</updated><title type='text'>reading comments: Lazy Load</title><content type='html'>&lt;strong&gt;Lazy Load&lt;/strong&gt; is one of the object relational behavioral patterns. With lazy load, an object does not contain all of the data you need but knows how to get it when it is needed. This pattern is commonly found in most of the OR mappers, e.g. Hibernate.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;lazy initialization&lt;/strong&gt;&lt;br /&gt;With lazy initialization, every &lt;a style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll center bottom; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px;" name="AdBriteInlineAd_access" id="AdBriteInlineAd_access" target="_top"&gt;access&lt;/a&gt; to the field is &lt;a href="http://click.adbrite.com/mb/click.php?sid=789311&amp;amp;banner_id=12724662&amp;amp;variation_id=1412881&amp;amp;uts=1248115771&amp;amp;cpc=302e30333336&amp;amp;keyword_id=42750&amp;amp;inline=y&amp;amp;ab=168362037&amp;amp;sscup=1903c2b5880204d009b75d47c4ad80b1&amp;amp;sscra=7e61916478df0389cabd74bbbee90f63&amp;amp;ub=3479231045&amp;amp;guid=94f6234f-02ba-44d0-8a89-4691c8af9607&amp;amp;odc=vrx&amp;amp;rs=&amp;amp;r=" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll center bottom; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px;" name="AdBriteInlineAd_checked" id="AdBriteInlineAd_checked" target="_top"&gt;checked&lt;/a&gt; against a &lt;a href="http://click.adbrite.com/mb/click.php?sid=789311&amp;amp;banner_id=11975372&amp;amp;variation_id=961836&amp;amp;uts=1248115751&amp;amp;cpc=302e30343136&amp;amp;keyword_id=60924&amp;amp;inline=y&amp;amp;ab=168362124&amp;amp;sscup=b34b14da6d21df20d66096404ee52fc1&amp;amp;sscra=7e61916478df0389cabd74bbbee90f63&amp;amp;ub=3479231045&amp;amp;guid=71bc8e9e-d60a-4779-9855-c6c68cd908c0&amp;amp;odc=vrx&amp;amp;rs=&amp;amp;r=" style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll center bottom; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px;" name="AdBriteInlineAd_special" id="AdBriteInlineAd_special" target="_top"&gt;special&lt;/a&gt; value, e.g. null value. If the value is not found, then the object needs to perform some logic, e.g. lookup from database, before returning.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;virtual proxy&lt;/strong&gt;&lt;br /&gt;A virtual proxy is an object that looks like the object that should be in the field, but actually doesn’t contain anything. Only when one of it’s methods is called does it load the correct object from the database.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;value holder&lt;/strong&gt;&lt;br /&gt;A value holder is used as a generic Lazy Load. It is an object that wraps some other object. To get the underlying object you ask the value holder for the value, and the first access will pull the data from the database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-8751033608289874913?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/8751033608289874913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/reading-comments-lazy-load.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8751033608289874913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/8751033608289874913'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/reading-comments-lazy-load.html' title='reading comments: Lazy Load'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4122512441237766106</id><published>2009-07-20T11:04:00.000-07:00</published><updated>2009-07-20T11:26:42.439-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='configuration'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><title type='text'>XmlBeanFactory vs ClassPathXmlApplicationContext</title><content type='html'>In my previous blog, I explained how to use ClassPathXmlApplicationContext. Today when I debug a application, I found below issues regarding XmlBeanFactory.&lt;br /&gt;&lt;br /&gt;When we use XmlBeanFactory, TX annotation is not working. and it does not even load when you say &lt;tx-annotation&gt; in XML file.&lt;br /&gt;&lt;br /&gt;So if you want to use annotation, please use ClassPathXmlApplicationContext. I believe in WEB application,  tomcat system actually uses ClassPathXmlApplicationContext. So in order to make your code testing separately, please do not  use  XmlBeanFactory.&lt;br /&gt;&lt;br /&gt;Below it is the example of XmlBeanFactory and ClassPathXmlApplicationContext&lt;br /&gt;&lt;br /&gt;XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource(&lt;br /&gt;        "applicationContext2.xml"));&lt;br /&gt;        InvoiceProcessDao process = (InvoiceProcessDao)factory.getBean("invoiceProcess"); &lt;br /&gt;       &lt;br /&gt;       &lt;br /&gt;       ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext3.xml");&lt;br /&gt;        InvoiceProcessDao process = (InvoiceProcessDao)ctx.getBean("invoiceProcess");&lt;br /&gt;        process.checkPayment();&lt;br /&gt;        System.out.println(" Over") ;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4122512441237766106?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4122512441237766106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/xmlbeanfactory-vs-classpathxmlapplicati.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4122512441237766106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4122512441237766106'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/xmlbeanfactory-vs-classpathxmlapplicati.html' title='XmlBeanFactory vs ClassPathXmlApplicationContext'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-5222595890723237928</id><published>2009-07-13T05:45:00.000-07:00</published><updated>2009-07-13T05:50:39.979-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><category scheme='http://www.blogger.com/atom/ns#' term='junit'/><title type='text'>Junit best pratise</title><content type='html'>&lt;h1&gt;JUnits - Do’s and Dont’s&lt;/h1&gt;         &lt;div class="iteminfo"&gt;         Posted by:         &lt;a href="http://www.theserverside.com/user/userthreads.tss?user_id=804769" title="view Mahesh Tabib's recent threads ..."&gt;          Mahesh Tabib         &lt;/a&gt;         on         July 10, 2009             &lt;a title=" Add this page to digg.com bookmarks " style="border: 1px solid rgb(153, 153, 153); text-decoration: none; padding-left: 6px; padding-right: 6px; display: inline; width: 30px; background-color: rgb(255, 255, 255);" href="javascript:location.href=_parseDiggURL();"&gt;DIGG&lt;/a&gt;  &lt;script type="text/javascript"&gt; function _parseDiggURL() {   var _diggURL = "http://digg.com/submit?phase=2&amp;topic=Programming&amp;url="    _diggURL    += encodeURIComponent(location.href);    _diggURL    += "&amp;title=";    _diggURL    += escape ( "JUnits - Do’s and Dont’s") ;    _diggURL    += "&amp;bodytext=";    _diggURL    += escape ( "After the Junit cleanup last whole month, here are my few cents.&lt;br /&gt;&lt;br /&gt;A JUnit test case can contain multiple tests. Each test is implemented by a method. The declaration of a test method must comply to a set of conventions in order to help JUnit and associated tools to automate the discovery and execution of tests. These conventions are:&lt;br /&gt;1. The name of the method must begin with “test”, like in “testValidateOperator”,&lt;br /&gt;2. The return type of a test method must be null,&lt;br /&gt;3. A test method must not throw any exception,&lt;br /&gt;4. A test method must not have any parameter.&lt;br /&gt;&lt;br /&gt;There are a few details of which you should be aware of when writing JUnit tests. First of all, when executing a test case, JUnit will instantiate the test case class as many time as there are test methods. That is, each test method will be executed on a different instance of the test case class. Before calling the test method, JUnit will call the setUp() method. The tearDown() method will be called after the test method completes – successfully or not. The setUp() and tearDown() methods should be used to create and then clean up the test environment.&lt;br /&gt;&lt;br /&gt;Good practices to be followed while writing a JUnit:&lt;br /&gt;&lt;br /&gt;• Write tests for methods that have the fewest dependencies first. If you start by testing a high-level method, your test may fail because a subordinate method may return an incorrect value to the method under test. This increases the time spent finding the source of the problem, and you will still have to test the subordinate method anyway to be sure it does not contain other bugs.&lt;br /&gt;&lt;br /&gt;• Tests should be logically simple as possible, preferably with no decisions at all. Every decision added to a test method increases the number of possible ways that a test method can be executed. Testing is meant to be a controlled environment; the only thing you want to change is the input to the method under test, not the test method itself.&lt;br /&gt;&lt;br /&gt;• Wherever possible, use constant as expected values in your assertions instead of computed values. Consider these two assertions:&lt;br /&gt;&lt;br /&gt;returnVal = getDiscountCode(input);&lt;br /&gt;assertEquals(returnVal, computeDiscountCode(input));&lt;br /&gt;assertEquals(returnVal, “023”);&lt;br /&gt;&lt;br /&gt;In order for computeDiscountCode() to return the proper result it probably has to implement the same logic as the getDiscountCode(), which is what you are trying to test for in the first place. Further, suppose you fixed a defect in the getDiscountCode (). Now you have to change computeDiscountCode () in the same manner. The second assertion is easier to understand and maintain.&lt;br /&gt;&lt;br /&gt;• Each unit test should be independent of all other tests.&lt;br /&gt;A unit test should execute one specific behavior for a single method. Validating behavior of multiple methods is problematic as such coupling can increase refactoring time and effort. Consider the following example:&lt;br /&gt;&lt;br /&gt;void testAdd()&lt;br /&gt;{&lt;br /&gt;int return1 = myClass.add(1,2);&lt;br /&gt;int return2 = myclass.add(-1,-2);&lt;br /&gt;assertTrue (return1 – return2 == 0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;If the assertions fails in this case, it will be difficult to determine which invocation of add() caused the problem.&lt;br /&gt;&lt;br /&gt;• Each unit test should be clearly named and documented.&lt;br /&gt;The name of the test method should clearly indicate which method is being tested because improperly named tests increase maintenance and refactoring efforts. Comments should also be used to describe the test or any special conditions.&lt;br /&gt;&lt;br /&gt;• All methods, regardless of visibility, should have appropriate unit tests.&lt;br /&gt;Public, private and protected methods that contain data and decisions should be unit tested in isolation.&lt;br /&gt;&lt;br /&gt;• One assertion per test case.&lt;br /&gt;Avoid using multiple assertions in one test case. For example, if a test case with five assertions fails on the first assertion, then the remaining four are not executed. Only when the first assertion is corrected will the other assertions execute. If assertion two fails, then that also must be corrected before the remaining three assertions are verified. Although the unit test file may be large, it will be easier to find and fix defects.&lt;br /&gt;&lt;br /&gt;• Create unit tests that target exceptions.&lt;br /&gt;Exceptions are thrown when a method finds itself in a state it cannot handle. These cases should be tested just like a method’s normal state of operations. If a method is declared to throw one or more exceptions, then unit tests must be create that simulate the circumstances under which those exceptions could be thrown. The unit tests should assert that the exceptions are thrown as expected.&lt;br /&gt;&lt;br /&gt;Please let me know if this helps. Happy coding Junits…!!").substring(0,300);   return _diggURL ; } &lt;/script&gt;         &lt;/div&gt;                              After the Junit cleanup last whole month, here are my few cents.&lt;br /&gt;&lt;br /&gt;A JUnit test case can contain multiple tests. Each test is implemented by a method. The declaration of a test method must comply to a set of conventions in order to help JUnit and associated tools to automate the discovery and execution of tests. These conventions are:&lt;br /&gt;1. The name of the method must begin with “test”, like in “testValidateOperator”,&lt;br /&gt;2. The return type of a test method must be null,&lt;br /&gt;3. A test method must not throw any exception,&lt;br /&gt;4. A test method must not have any parameter.&lt;br /&gt;&lt;br /&gt;There are a few details of which you should be aware of when writing JUnit tests. First of all, when executing a test case, JUnit will instantiate the test case class as many time as there are test methods. That is, each test method will be executed on a different instance of the test case class. Before calling the test method, JUnit will call the setUp() method. The tearDown() method will be called after the test method completes – successfully or not. The setUp() and tearDown() methods should be used to create and then clean up the test environment.&lt;br /&gt;&lt;br /&gt;Good practices to be followed while writing a JUnit:&lt;br /&gt;&lt;br /&gt;• Write tests for methods that have the fewest dependencies first. If you start by testing a high-level method, your test may fail because a subordinate method may return an incorrect value to the method under test. This increases the time spent finding the source of the problem, and you will still have to test the subordinate method anyway to be sure it does not contain other bugs.&lt;br /&gt;&lt;br /&gt;• Tests should be logically simple as possible, preferably with no decisions at all. Every decision added to a test method increases the number of possible ways that a test method can be executed. Testing is meant to be a controlled environment; the only thing you want to change is the input to the method under test, not the test method itself.&lt;br /&gt;&lt;br /&gt;• Wherever possible, use constant as expected values in your assertions instead of computed values. Consider these two assertions:&lt;br /&gt;&lt;br /&gt;returnVal = getDiscountCode(input);&lt;br /&gt;assertEquals(returnVal, computeDiscountCode(input));&lt;br /&gt;assertEquals(returnVal, “023”);&lt;br /&gt;&lt;br /&gt;In order for computeDiscountCode() to return the proper result it probably has to implement the same logic as the getDiscountCode(), which is what you are trying to test for in the first place. Further, suppose you fixed a defect in the getDiscountCode (). Now you have to change computeDiscountCode () in the same manner. The second assertion is easier to understand and maintain.&lt;br /&gt;&lt;br /&gt;• Each unit test should be independent of all other tests.&lt;br /&gt;A unit test should execute one specific behavior for a single method. Validating behavior of multiple methods is problematic as such coupling can increase refactoring time and effort. Consider the following example:&lt;br /&gt;&lt;br /&gt;void testAdd()&lt;br /&gt;{&lt;br /&gt;int return1 = myClass.add(1,2);&lt;br /&gt;int return2 = myclass.add(-1,-2);&lt;br /&gt;assertTrue (return1 – return2 == 0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;If the assertions fails in this case, it will be difficult to determine which invocation of add() caused the problem.&lt;br /&gt;&lt;br /&gt;• Each unit test should be clearly named and documented.&lt;br /&gt;The name of the test method should clearly indicate which method is being tested because improperly named tests increase maintenance and refactoring efforts. Comments should also be used to describe the test or any special conditions.&lt;br /&gt;&lt;br /&gt;• All methods, regardless of visibility, should have appropriate unit tests.&lt;br /&gt;Public, private and protected methods that contain data and decisions should be unit tested in isolation.&lt;br /&gt;&lt;br /&gt;• One assertion per test case.&lt;br /&gt;Avoid using multiple assertions in one test case. For example, if a test case with five assertions fails on the first assertion, then the remaining four are not executed. Only when the first assertion is corrected will the other assertions execute. If assertion two fails, then that also must be corrected before the remaining three assertions are verified. Although the unit test file may be large, it will be easier to find and fix defects.&lt;br /&gt;&lt;br /&gt;• Create unit tests that target exceptions.&lt;br /&gt;Exceptions are thrown when a method finds itself in a state it cannot handle. These cases should be tested just like a method’s normal state of operations. If a method is declared to throw one or more exceptions, then unit tests must be create that simulate the circumstances under which those exceptions could be thrown. The unit tests should assert that the exceptions are thrown as expected.&lt;br /&gt;&lt;br /&gt;Please let me know if this helps. Happy coding Junits…!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-5222595890723237928?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/5222595890723237928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/junit-best-pratise.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5222595890723237928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5222595890723237928'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/junit-best-pratise.html' title='Junit best pratise'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-1294275508294620482</id><published>2009-07-08T08:16:00.000-07:00</published><updated>2009-07-08T08:18:22.159-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>SOA Security post</title><content type='html'>http://domagojtechtips.blogspot.com/2007/08/cxf-spring-and-ws-security-putting-it.html&lt;br /&gt;http://cwiki.apache.org/CXF20DOC/ws-security.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-1294275508294620482?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/1294275508294620482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/soa-security-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1294275508294620482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/1294275508294620482'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/soa-security-post.html' title='SOA Security post'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4449347985224741298</id><published>2009-07-07T12:03:00.000-07:00</published><updated>2009-07-07T12:30:38.746-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='notes'/><category scheme='http://www.blogger.com/atom/ns#' term='data warehousing'/><title type='text'>Notes for Data Warehousing</title><content type='html'>1. Type of Data&lt;br /&gt;   a. Operational Data ( OLTP)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Data that works&lt;/li&gt;&lt;li&gt;Frequent updated and queried&lt;/li&gt;&lt;li&gt;Normalized for efficient search and update&lt;/li&gt;&lt;li&gt;Fragmented and local relevance.&lt;/li&gt;&lt;li&gt;Point query, query access individual tables.&lt;/li&gt;&lt;/ul&gt;    Examples:&lt;br /&gt;       What is the salary of John?&lt;br /&gt;       What is the phone number of the person who is in charge of Depta&lt;br /&gt;      How many people are rated as excellent?&lt;br /&gt;&lt;br /&gt;   b. Historical Data (OLAP)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Data that tells&lt;/li&gt;&lt;li&gt;Very infrequent update&lt;/li&gt;&lt;li&gt;Integrated data set with global relevance.&lt;/li&gt;&lt;li&gt;Analytical queries that require huge amounts of aggregation.&lt;/li&gt;&lt;li&gt;performance issue, need quick response time.&lt;/li&gt;&lt;/ul&gt;    Examples:&lt;br /&gt;       How is the trend in the past 2 years?&lt;br /&gt;       How is summary of something?&lt;br /&gt;&lt;br /&gt;2. What is Data Warehousing?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An infrastructure of manage historical data&lt;/li&gt;&lt;li&gt;Designed to support OLAP queries involving gratuitous use of aggregation&lt;/li&gt;&lt;li&gt;Post retrival processing(reporting)&lt;/li&gt;&lt;/ul&gt;3. OLTP --&gt; Data cleaning and Integration --&gt; Data Warehousing&lt;br /&gt;&lt;br /&gt;4. Data Marts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Segments of OLTP&lt;/li&gt;&lt;li&gt;Data Warehouse is a collection of data marts&lt;/li&gt;&lt;/ul&gt;5. Data Cleaning&lt;br /&gt;&lt;br /&gt;   a. Dirt Data&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Lack of standardization&lt;/li&gt;&lt;li&gt;Missing or duplicate data&lt;/li&gt;&lt;li&gt;Inconsistent.&lt;/li&gt;&lt;/ul&gt;     b. Issue of Data cleaning&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Can not be fully automated&lt;br /&gt;&lt;/li&gt;&lt;li&gt;GIGO&lt;/li&gt;&lt;li&gt;Require data considerable knowledge&lt;/li&gt;&lt;li&gt;Complex&lt;/li&gt;&lt;/ul&gt;    c. Steps of cleaning process.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Data analysis&lt;/li&gt;&lt;li&gt;Definition of transformation rule&lt;/li&gt;&lt;li&gt;Rules verification&lt;/li&gt;&lt;li&gt;Transformation&lt;/li&gt;&lt;li&gt;Backflow: re-populate data&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;5. Integration&lt;br /&gt;   Schema: Forming an integrated schema structure from different data source, cleaning data and managing from different DS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4449347985224741298?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4449347985224741298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/notes-for-data-warehousing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4449347985224741298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4449347985224741298'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/notes-for-data-warehousing.html' title='Notes for Data Warehousing'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-3130920122621527070</id><published>2009-07-07T11:52:00.000-07:00</published><updated>2009-07-07T11:55:22.165-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>Reading: Tomcat security for clear password</title><content type='html'>&lt;h2&gt;How to Secure Tomcat Database Passwords for Java&lt;/h2&gt;               &lt;p class="subtitle"&gt;In production environments there are features of Tomcat that don't pass security audit reviews&lt;/p&gt;                                                                                                  &lt;table class="storyauthor" border="0" width="468"&gt;                   &lt;tbody&gt;                   &lt;tr&gt;                     &lt;td&gt;October 3, 2007 11:45 AM EDT&lt;/td&gt;                                         &lt;td&gt;&lt;div align="right"&gt;Reads:&lt;/div&gt;&lt;/td&gt;                     &lt;td class="orange-text" width="90"&gt;30,463&lt;/td&gt;                                       &lt;/tr&gt;                 &lt;/tbody&gt;&lt;/table&gt;                   &lt;div class="actions-panel"&gt;                  &lt;br /&gt;                &lt;/div&gt;                                                  &lt;p&gt;  &lt;em&gt;Tomcat is a great reference implementation of the Java EE specification and is intended for desktop use by developers who are starting to learn about Java EE or those who work on enterprise applications and need an EE server for development. However because Tomcat is free it finds its way into production environments. In this environment there are features of Tomcat that don't pass security audit reviews. One of these features is the use of clear text passwords in the server.xml file to create data sources. The purpose of this article is to show how encryption of the username and password can be implemented thus closing a potential security vulnerability.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;img src="http://gemsres.com/story/jun07/393364/Securing-226.jpg" alt="" align="right" border="0" height="127" hspace="8" vspace="8" width="226" /&gt; Configuring a container managed data source with Tomcat is easy and well documented under the "JDBC DataSources" section of Tomcat's documentation (this article uses Tomcat 5.0.28). The data source configuration information is stored in TOMCAT/conf/server.xml. The resource is defined using the &lt;resource/&gt; tag. &lt;/p&gt;&lt;p&gt;&lt;span style="color:#800000;"&gt; &lt;Resource&lt;br /&gt;     name="jdbc/TestDB"&lt;br /&gt;     auth="Container"&lt;br /&gt;     type="javax.sql.DataSource"&lt;br /&gt;/&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt; The name attribute defines where the resource is bound in JNDI. The auth attribute will have either the value Application or Container. Container means Tomcat will provide the username and password to connect to the resource whereas Application means the application will provide them. Container is specified because the username and password will be entered in server.xml. The type attribute is the fully qualified name of the class returned when the resource is looked up using JNDI.&lt;/p&gt;&lt;p&gt; Next the resource needs to be configured. This is the purpose of the &lt;resourceparams/&gt; tag. For a JDBC resource, a basic configuration is presented in &lt;a href="http://gemsres.com/story/jun07/393364/source.html"&gt;Listing 1&lt;/a&gt;.&lt;/p&gt;&lt;p&gt; The name attribute has the value jdbc/TestDB, which must match a &lt;resource/&gt; tag. The "factory" name/value pair tells Tomcat the fully qualified name of the class that implements javax.naming.spi.ObjectFactory. This class is responsible for returning objects of the type defined by the type attribute of the &lt;resource/&gt; tag. The rest of the name/value pairs of &lt;parameter/&gt; tags are passed to the "factory" in a javax.naming.Reference object.&lt;/p&gt;&lt;p&gt; Finally, the application has to be configured to use this data source. This is done by referencing the data source in /META-INF/context.xml of the application's WAR. A &lt;resourcelink/&gt; tag is added to context.xml. &lt;/p&gt;&lt;p&gt;&lt;span style="color:#800000;"&gt; &lt;ResourceLink&lt;br /&gt;     global="jdbc/TestDB"&lt;br /&gt;     name="jdbc/SpiderMan"&lt;br /&gt;     type="javax.sql.DataSource"&lt;br /&gt;/&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt; The type attribute is the fully qualified name of the class returned when the resource is looked up using JNDI. The global attribute must match a &lt;resource/&gt; tag in server.xml. The name attribute defines where the resource is bound in JNDI. From an application's point of view, the location specified by the name attribute is relative to java:comp/env. Each application can have its own conventions for JNDI lookup names and the &lt;resourcelink/&gt; tag is the bridge between how an application does a resource lookup and where the resource is actually located. It's good practice to have the application use an atypical lookup name. This makes your application more portable to other EE servers because it's not accidentally bound to the conventions of one EE server's resource placement.&lt;/p&gt;  &lt;div class="portlet sponsored-links-inside"&gt;     &lt;div class="portlettitle"&gt;     CIO, CResources  &lt;/div&gt;       &lt;div class="portletbody"&gt;     &lt;iframe src="http://banners.sys-con.com/local/sponsored_inside_cloud.php" marginwidth="0" marginheight="0" frameborder="0" height="220" scrolling="no" width="468"&gt;&lt;/iframe&gt;    &lt;/div&gt;    &lt;/div&gt;   &lt;p&gt; For development environments or personal use this configuration is acceptable, however, in a production environment the clear text username and password in &lt;resourceparams/&gt; is a security vulnerability. If a production server is compromised, the intruder would have easy access to production data. With privacy concerns and Sarbanes-Oxley requirements the harder it is for an intruder to gain access to such data the better.&lt;/p&gt;&lt;p&gt; While Yahooing! I was surprised to discover I couldn't find any instructions addressing this issue. Most search results related to debating if securing the clear text username and password is even necessary. The general consensus seemed to be this security is not necessary for two reasons. One, if an intruder compromises a production server in a way that would allow read access to server.xml then the clear text username and password is the least security concern. Two, Tomcat is a reference implementation so it shouldn't be used in a production environment. Although these are lively debates and can spark great topics of conversation they do not address the issue. What I need is a way to get rid of the clear text username and password.&lt;/p&gt;&lt;p&gt; I will present three possible solutions to this issue. The first two are custom solutions involving application updates while the third takes advantage of Tomcat's built-in extensibility, requires no application updates and so is a much more attractive solution.&lt;/p&gt;&lt;p&gt; The first solution is to bypass Tomcat altogether and not configure a data source. With no data source there's no clear text username and password in server.xml so the problem is solved. However applications still need database connections. With no container-managed database pool each application will have to do its own pooling. This brings up all sorts of problems. Applications will need knowledge of the database and how to access it, unnecessary plumbing code is needed to manage the pool, data access objects will no longer be coded to EE specs making them less portable, no built-in or plug-in transaction management resulting in more plumbing code, an ever-growing number of connections as more applications are developed, performance degradation during high-traffic periods as connections become scarce, support overhead from managing many individual configurations, and the list goes on. It's possible each of these problems can be solved but as you solve them your code moves further and further from the EE specs. Because of all these problems, this is not an attractive solution.&lt;/p&gt;&lt;p&gt; The second solution is to move the responsibility for database authentication from Tomcat to the application. Recall the auth attribute of the &lt;resource/&gt; tag. If the value is Application, the application is responsible for providing the username and password. The Tomcat administrator can delete the username and password parameters from server.xml and the Developer would code the username and password into the application. Typically the first time JNDI is used to look up a DataSource is when the username and password are set. The code in &lt;a href="http://gemsres.com/story/jun07/393364/source.html"&gt;Listing 2 &lt;/a&gt;gives an idea of what this would look like for Tomcat. Although the example doesn't use any kind of encryption it's not difficult to plug in an encryption strategy. This solution also has problems. The application is now responsible for either knowing the username and password or knowing the encryption strategy. The application also needs to know the real class implementing DataSource (in the case of Commons DBCP) so the username and password can be provided. This could make the application not portable to another EE server. So this is not an attractive solution either.&lt;/p&gt;&lt;p&gt; The third solution is to take advantage of Tomcat's built-in extensibility. Inside the &lt;resourceparams/&gt; tag Tomcat offers the ability to specify the fully qualified name of the Java class that implements the javax.naming.spi.ObjectFactory interface. This class is responsible for returning implementations of javax.sql.DataSource. By default Tomcat uses org.apache.commons.dbcp.BasicDataSourceFactory and this class requires &lt;resourceparams/&gt; to have clear text username and password values. So why not create a class that extends BasicDataSourceFactory and is configured with an encrypted password instead? For the purposes of this article I'll use a simple Base64 encoding but the concept can be easily extended to any other method.&lt;/p&gt;&lt;p&gt;  The source code for BasicDataSourceFactory has two important methods. They are: &lt;/p&gt;&lt;p&gt;&lt;span style="color:#800000;"&gt; public Object&lt;br /&gt;     getObjectInstance(&lt;br /&gt;     Object o&lt;br /&gt;, Name n&lt;br /&gt;, Context c&lt;br /&gt;, Hashtable h)&lt;br /&gt;&lt;br /&gt; public static DataSource&lt;br /&gt;     createDataSource(&lt;br /&gt;Properties p&lt;br /&gt;)&lt;/span&gt;&lt;/p&gt;&lt;div id="main-story-content"&gt;                                  &lt;p&gt; Tomcat creates an instance of BasicDataSourceFactory by calling its no-argument constructor. When a DataSource is needed the getObjectInstance(...) method is called. The BasicDataSourceFactory class implements this method in the following way. First it typecasts the Object parameter to Reference. Then all of the name/value pairs are removed from the Reference object and set in a Properties object. Finally, the Properties object is passed to the createDataSource(...) method where it's assumed the username and password exist in the Properties object as clear text.&lt;/p&gt;&lt;p&gt; To secure Tomcat database usernames and passwords, create a new class named EncryptedDataSourceFactory that extends BasicDataSourceFactory. This new class is going to override the getObjectInstance(...) method. The new method is implemented in the following way. First it will remove the encrypted username and passwords from the Reference object. Next, it will decrypt them. Then it will put the decrypted values into the Reference object. Finally it will call the getObjectInstance(...) method of the super class so it can take care of creating the DataSource. See the source code in &lt;a href="http://gemsres.com/story/jun07/393364/source.html"&gt;Listing 3&lt;/a&gt;.&lt;/p&gt;&lt;p&gt; In the source code the "username" string of the setUsername() method and the "password" string of the setPassword() method refer to the &lt;name/&gt; value of: &lt;/p&gt;  &lt;div class="portlet sponsored-links-inside"&gt;     &lt;div class="portlettitle"&gt;     CIO, CTO &amp;amp; Developer Resources  &lt;/div&gt;       &lt;div class="portletbody"&gt;     &lt;iframe src="http://banners.sys-con.com/local/sponsored_inside_cloud.php" marginwidth="0" marginheight="0" frameborder="0" height="220" scrolling="no" width="468"&gt;&lt;/iframe&gt;    &lt;/div&gt;    &lt;/div&gt;   &lt;p&gt;&lt;span style="color:#800000;"&gt; &lt;parameter&gt;&lt;br /&gt;      &lt;name&gt;username&lt;/name&gt;&lt;br /&gt;      &lt;value&gt;postgres_user&lt;/value&gt;&lt;br /&gt;   &lt;/parameter&gt;&lt;br /&gt;   &lt;parameter&gt;&lt;br /&gt;      &lt;name&gt;password&lt;/name&gt;&lt;br /&gt;      &lt;value&gt;postgres_pass&lt;/value&gt;&lt;br /&gt;   &lt;/parameter&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt; These strings have corresponding constants in the BasicDataSourceFactory class but the constants are declared private so can't be used. The find() method throws an exception if not found because decryption will fail if there's nothing to decrypt. The decrypt() method uses a Base64 decoder that isn't secure but adequately demonstrates the concept. Finally the replace() method removes the encrypted values and puts in the decrypted values. When getObjectInstance(...) of the super class is called, it has the clear text passwords and is completely unaware that the values in server.xml are actually encrypted.&lt;/p&gt;&lt;p&gt; Using EncryptedDataSourceFactory is simple. First drop the org.moss.jdj.jdbc-yyyy.mm.dd.x.jar file into TOMCAT/server/lib. Next, get a Base64 encoding of the username and password. A simple Yahoo! search of "online base64 encoder" will find sites that will do it. Finally, edit server.xml and replace the username and password values with their corresponding Base64 equivalents and set the factory value to org.moss.jdj.dbcp.EncryptedDataSourceFactory. Start up Tomcat and see it in action.&lt;/p&gt;&lt;p&gt; Using Tomcat's built-in extensibility like this is an attractive solution. It fulfills security audit requirements by removing clear text usernames and passwords but it also lets applications be coded to EE specs. Using this solution doesn't put any unnecessary or unwanted responsibility in applications. Applications can be developed to fulfill business requirements and don't have to worry about plumbing code like initializing or shutting down a database connection pool properly, maintaining a custom transaction system to roll back on errors, or implementing an encryption strategy. Plus, when the time comes to move away from Tomcat the applications will be ready. The code in Listing 3 will be thrown away but small amounts of throwaway code is much better than the effort needed to go back and update applications.&lt;/p&gt;                &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-3130920122621527070?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/3130920122621527070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/reading-tomcat-security-for-clear.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3130920122621527070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/3130920122621527070'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/reading-tomcat-security-for-clear.html' title='Reading: Tomcat security for clear password'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7280504424649952654</id><published>2009-07-07T08:59:00.000-07:00</published><updated>2009-07-07T09:02:28.794-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><title type='text'>Reading "To ESB or not to ESB"</title><content type='html'>&lt;h2&gt;To ESB or not to ESB&lt;/h2&gt;                        &lt;p&gt; &lt;/p&gt; &lt;img alt="" src="http://www.gravatar.com/avatar/c3f5a20556094a62b3c3e98410cbf2bc?s=30&amp;amp;d=http%3A%2F%2Fwww.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D30&amp;amp;r=G" class="avatar avatar-30" height="30" width="30" /&gt; &lt;strong&gt;&lt;a href="http://blog.mulesource.org/author/rossmason/"&gt;Ross Mason&lt;/a&gt;&lt;/strong&gt;                         &lt;br /&gt;                        &lt;!-- Display the Time. --&gt;                         &lt;small&gt;July 6th, 2009&lt;/small&gt;          &lt;p&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/1.bp.blogspot.com/_-uGpx0_gPO8/RtCrI7tb_VI/AAAAAAAAAG8/D7rLdrgDmbs/s320/HamletSkullHCSealous.jpg');" href="http://1.bp.blogspot.com/_-uGpx0_gPO8/RtCrI7tb_VI/AAAAAAAAAG8/D7rLdrgDmbs/s320/HamletSkullHCSealous.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 311px;" src="http://1.bp.blogspot.com/_-uGpx0_gPO8/RtCrI7tb_VI/AAAAAAAAAG8/D7rLdrgDmbs/s320/HamletSkullHCSealous.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Many of us have had to ponder this question. Technology selection is notoriously difficult in the enterprise space since the criteria and complexity of the problem is often not fully understood until later in the development process.&lt;span id="more-819"&gt;&lt;/span&gt;&lt;br /&gt;There is an interesting post from ThoughtWorker Erik Dörnenburg with the unfortunate title “&lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/erik.doernenburg.com/2009/07/making-esb-pain-visible/');" href="http://erik.doernenburg.com/2009/07/making-esb-pain-visible/"&gt;Making the ESB pain Visible&lt;/a&gt;”. Erik provides a real-world example of when not to use an ESB citing that -&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;Based on conversations with the project sponsors I began to suspect that at least the introduction of the ESB was a case of RDD, ie. Resume-Driven Development, development in which key choices are made with only one question in mind: how good does it look on my CV? Talking to the developers I learned that the ESB had introduced “nothing but pain.” But how could something as simple as the architecture in the above diagram cause such pain to the developers? Was this really another case of architect’s dream, developer’s nightmare?&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Later, Erik quite rightly points out that an ESB should not have been used in this scenario. This is a fairly common problem for ESBs and other enterprise technology like BPM/BPEL where the technology is not chosen for the right reasons and then the technology gets blamed when the project struggles. Given that much of the enterprise software disillusionment today stems from the incorrect usage of the technology I thought I’d offer some rough guidelines for selecting an ESB.&lt;/p&gt; &lt;h3&gt;ESB selection checklist&lt;/h3&gt; &lt;p&gt;Mule and other ESBs offer real value in scenarios where there are at least a few integration points or at least 3 applications to integrate. They are also well suited to scenarios where loose coupling, scalability and robustness are required.&lt;br /&gt;Here is a quick ESB selection checklist –&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Are you integrating 3 or more applications/services? If you only need to communicate between 2 applications, using point-to-point integration is going to be easier.&lt;/li&gt;&lt;li&gt;Will you really need to plug in more applications in the future? Try and avoid YNNI in your architecture. It’s better to keep things simple re-architect later if needed.&lt;/li&gt;&lt;li&gt;Do you need to use more than one type of communication protocol? If you are just using HTTP/Web Services or just JMS, you’re not going to get any of the benefits if cross protocol messaging and transformation that Mule provides.&lt;/li&gt;&lt;li&gt;Do you need message routing capabilities such as forking and aggregating message flows, or content-based routing? Many applications do not need these capabilities.&lt;/li&gt;&lt;li&gt;Do you need to publish services for consumption by other applications? This is a good fit for Mule as it provides a robust and scalable service container, but in Erik’s use case all they needed was an HTTP client from their front-end Struts application.&lt;/li&gt;&lt;li&gt;Do you have more than 10 applications to integrate? Avoid big-bang projects and consider breaking the project down in to smaller parts. Pilot your architecture on just 3 or 4 systems first and iron out any wrinkles before impacting other systems.&lt;/li&gt;&lt;li&gt;Do you really need the scalability of an ESB? It’s very easy to over-architect scalability requirements of an application. Mule scales down as well as up making it a popular choice for ‘building in’ scalability. However, there is a price to be paid for this since you are adding a new technology to the architecture.&lt;/li&gt;&lt;li&gt;Do you understand exactly what you want to achieve with your architecture? Vendors often draw an ESB as a box in the middle with lots of applications hanging off it. In reality, it does not work like that. There is a lot details that need to be understood first around the integration points, protocols, data formats, IT infrastructure, security etc. Starting small helps to keep the scope of the problem manageable and keep the fuckupery to a minimum. Until you understand your architecture and scope it properly you can’t really make a decision as to whether an ESB is right for you.&lt;/li&gt;&lt;li&gt;Generally, always validate a product solution for your needs. Don’t choose an ESB or any other technology because – &lt;ul&gt;&lt;li&gt;It will look good on my resume&lt;/li&gt;&lt;li&gt;I don’t need the features today but there is a remote chance that I _might_ in future&lt;/li&gt;&lt;li&gt;I had a great golfing weekend with the head of sales&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;This checklist is not exhaustive, but will help clarify when not to use an ESB. Once you have decided that an ESB is a good fit for your project you’ll want to add additional selection criteria such as connectivity options, robustness, error management, service repository, performance, data support, etc. The important thing to remember is that there is no silver bullet for good architecture and you need to know your architecture before making a technology decision.&lt;/p&gt; &lt;p&gt;With this checklist in mind it’s easy to see that &lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/erik.doernenburg.com/2009/07/making-esb-pain-visible/');" href="http://erik.doernenburg.com/2009/07/making-esb-pain-visible/"&gt;Erik’s example&lt;/a&gt; never needed an ESB in the first place.&lt;/p&gt; &lt;p&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/erik.doernenburg.com/wp-content/uploads/2009/06/high-level-esb.png');" href="http://erik.doernenburg.com/wp-content/uploads/2009/06/high-level-esb.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 212px;" src="http://erik.doernenburg.com/wp-content/uploads/2009/06/high-level-esb.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;However, if the architecture looked something more like this, then an ESB would have probably been a good fit.&lt;/p&gt; &lt;p&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/1.bp.blogspot.com/_1J_NEXtTKV0/Sk4Qh1A1PfI/AAAAAAAAAK8/4nt5zhWlb7o/s1600-h/To-ESB.png');" href="http://1.bp.blogspot.com/_1J_NEXtTKV0/Sk4Qh1A1PfI/AAAAAAAAAK8/4nt5zhWlb7o/s1600-h/To-ESB.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5354235180342394354" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 303px; height: 248px;" src="http://1.bp.blogspot.com/_1J_NEXtTKV0/Sk4Qh1A1PfI/AAAAAAAAAK8/4nt5zhWlb7o/s400/To-ESB.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;Choosing Mule&lt;/h3&gt; &lt;p&gt;Obviously, as the creator of &lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/mulesource.org');" href="http://mulesource.org/"&gt;Mule&lt;/a&gt; I have some bias for wanting everyone to use Mule. However, it is critical to the continued success of the Mule project and to &lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/mulesource.com');" href="http://mulesource.com/"&gt;MuleSource&lt;/a&gt; that users understand when not to use an ESB. Open source makes a lot of sense for enterprise software because projects need time to try out the technology and refine their proposed architecture. Having access to the product and source code helps a huge amount in this discovery process and allows the customer to make an informed decision.&lt;/p&gt; &lt;p&gt;In fact the MuleSource business model hinges on the ability of the user to self-select Mule and approach us only when they need development or production support. &lt;a onclick="javascript:pageTracker._trackPageview('/outgoing/www.marketwire.com/press-release/Mulesource-1001152.html');" href="http://www.marketwire.com/press-release/Mulesource-1001152.html"&gt;This has been working very well&lt;/a&gt; for everyone involved. Customers get to do a proof of concept (PoC) with our product knowing that if they end up using it for a mission critical application that they can get professional 24×7 support. For MuleSource it means that our customers buy from us rather than us selling to them, so they always get what they want – this is a far cry from the old proprietary upfront license model that used to hold the enterprise market hostage.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7280504424649952654?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7280504424649952654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/07/reading-to-esb-or-not-to-esb.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7280504424649952654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7280504424649952654'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/07/reading-to-esb-or-not-to-esb.html' title='Reading &quot;To ESB or not to ESB&quot;'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_-uGpx0_gPO8/RtCrI7tb_VI/AAAAAAAAAG8/D7rLdrgDmbs/s72-c/HamletSkullHCSealous.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-5381055349696094832</id><published>2009-06-26T12:08:00.000-07:00</published><updated>2009-06-26T12:09:32.642-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JPA'/><title type='text'>JPA field access vs property access</title><content type='html'>For field access, you do not need have set or get method. You specify field. But for property, you use set and get to set value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-5381055349696094832?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/5381055349696094832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/06/jpa-field-access-vs-property-access.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5381055349696094832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5381055349696094832'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/06/jpa-field-access-vs-property-access.html' title='JPA field access vs property access'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-2916843173833816827</id><published>2009-06-25T10:37:00.000-07:00</published><updated>2009-06-26T12:13:52.695-07:00</updated><title type='text'>After reading "IT Managers confession"</title><content type='html'>Today I found a very interesting book about IT manager, below are the some points I got from that book:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Good team knows how to handle their manager, train the manager to do things their way.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;As a manager, if you do not like someone and you can not get rid of him/her, then it is better promote him/her to another position, so he/she can leave the group. But keep the good people with you.&lt;/li&gt;&lt;li&gt;Find a Yancey man who can speak for you. He has excellent communication skill , he can talk regular language to customers and stake holders. But you need him to follow you, speak your mind not his own mind. That is hard.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Looking Busy:&lt;/li&gt;&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;arrival early and leave late does not mean you hard, you can leave in the middle.&lt;/li&gt;&lt;li&gt;Using MS project to create a lot of report.&lt;/li&gt;&lt;li&gt;A lot of meeting and crisis management.&lt;/li&gt;&lt;li&gt;Ask your developer to send everything for you to approval.&lt;/li&gt;&lt;li&gt;visit other department regularly.&lt;/li&gt;&lt;li&gt;find any chances to complain too many emails.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-2916843173833816827?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/2916843173833816827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/06/after-reading-it-managers-confession.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2916843173833816827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/2916843173833816827'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/06/after-reading-it-managers-confession.html' title='After reading &quot;IT Managers confession&quot;'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-4420902395104918337</id><published>2009-06-23T07:01:00.000-07:00</published><updated>2009-07-07T09:03:37.380-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA'/><title type='text'>Spring JPA annotation transaction.</title><content type='html'>It has been weeks I could not figure out why I can not use annotation based transaction control, and it forced me to use programmatic transaction control.  Today I found this post from theserverside, which explains everything.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;it's caused by the use of the BeanFactory instead of an ApplicationContext, which is used inside the unit test, behind the scene when using the AbstractJpaTests base class.&lt;br /&gt;&lt;br /&gt;If you change your Main class to&lt;br /&gt;&lt;br /&gt;&lt;div style="margin: 5px 20px 20px;"&gt;  &lt;div class="smallfont" style="margin-bottom: 2px;"&gt;Code:&lt;/div&gt;  &lt;pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 800px; height: 194px; text-align: left;"&gt;public class Main {&lt;br /&gt;&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;ApplicationContext ctx = new ClassPathXmlApplicationContext("context/testContext.xml");&lt;br /&gt;PersonDAO dao=(PersonDAO)ctx.getBean("personDAO");&lt;br /&gt;&lt;br /&gt;Person p=new Person();&lt;br /&gt;p.setFirstName("testName");&lt;br /&gt;dao.save(p);&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt; &lt;/div&gt;it will work.&lt;br /&gt;&lt;br /&gt;The reason for that is a slightly different behavior between a BeanFactory and an ApplicationContext when it comes to BeanPostProcessors. From the Spring reference manual:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;It is important to know that a BeanFactory treats bean post-processors slightly differently than an ApplicationContext. An ApplicationContext will automatically detect any beans which are defined in the configuration metadata which is supplied to it that implement the BeanPostProcessor interface, and register them as post-processors, to be then called appropriately by the container on bean creation. Nothing else needs to be done other than deploying the post-processor in a similar fashion to any other bean. On the other hand,&lt;br /&gt;when using a BeanFactory implementation, bean post-processors explicitly have to be registered, with code&lt;br /&gt;like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;ConfigurableBeanFactory factory = new XmlBeanFactory(...);&lt;br /&gt;// now register any needed BeanPostProcessor instances&lt;br /&gt;MyBeanPostProcessor postProcessor = new MyBeanPostProcessor();&lt;br /&gt;factory.addBeanPostProcessor(postProcessor);&lt;br /&gt;// now start using the factory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This explicit registration step is not convenient, and this is one of the reasons why the various&lt;br /&gt;ApplicationContext implementations are preferred above plain BeanFactory implementations in the vast majority of Spring-backed applications, especially when using BeanPostProcessors&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;That's the whole reason, why your PersistenceAnnotationBeanPostProcessor never got loaded and therefore couldn't do its work!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-4420902395104918337?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/4420902395104918337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/06/spring-jpa-annotation-transaction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4420902395104918337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/4420902395104918337'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/06/spring-jpa-annotation-transaction.html' title='Spring JPA annotation transaction.'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-5247616250851134524</id><published>2009-06-16T06:35:00.001-07:00</published><updated>2009-06-16T06:38:12.710-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='my reading'/><title type='text'>From dzone.com: Three Questions About Each Bug You Find</title><content type='html'>&lt;h1&gt;&lt;templatearticletitle&gt;Three Questions About Each Bug You Find&lt;/templatearticletitle&gt;&lt;/h1&gt; &lt;h2&gt;&lt;templatesubtitle&gt;&lt;/templatesubtitle&gt;&lt;/h2&gt;    &lt;templateteaser&gt;  &lt;span style="background: black none repeat scroll 0% 50%; float: right; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="background: black none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;  &lt;/templateteaser&gt; &lt;p&gt;I really love this timeless Tom Van Vleck article from 1989. It teaches us to ask ourselves:&lt;/p&gt;  &lt;h2&gt;&lt;a href="http://www.multicians.org/thvv/threeq.html"&gt;Three Questions About Each Bug You Find&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;Those questions being:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Is this mistake somewhere else also?&lt;/li&gt;&lt;li&gt;What next bug is hidden behind this one?&lt;/li&gt;&lt;li&gt;What should I do to prevent bugs like this?&lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;When I first read these rules, I was foolish enough to think:&lt;/p&gt;  &lt;blockquote&gt;&lt;p&gt;'Cute, But Too Obvious! i do this intuitively &lt;em&gt;all the time.&lt;/em&gt;'&lt;/p&gt;&lt;/blockquote&gt;  &lt;p&gt;But &lt;a href="http://timesnapper.com/"&gt;watch yourself closely!&lt;/a&gt; I've caught myself out on occasion, and maybe you will too.&lt;/p&gt;  I'm making an effort to be more explicit about &lt;em&gt;the three questions&lt;/em&gt;. Maybe i'll end up fixing related problem&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-5247616250851134524?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/5247616250851134524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/06/three-questions-about-each-bug-you-find.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5247616250851134524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/5247616250851134524'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/06/three-questions-about-each-bug-you-find.html' title='From dzone.com: Three Questions About Each Bug You Find'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1540591164274661106.post-7793947144682380578</id><published>2009-06-11T13:06:00.000-07:00</published><updated>2009-06-11T13:09:13.709-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='first'/><title type='text'>My first blog</title><content type='html'>Today it is the first time I have a blog, I guess I will spend some of my spare time at this blog in the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1540591164274661106-7793947144682380578?l=jameslhf.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jameslhf.blogspot.com/feeds/7793947144682380578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jameslhf.blogspot.com/2009/06/my-first-blog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7793947144682380578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1540591164274661106/posts/default/7793947144682380578'/><link rel='alternate' type='text/html' href='http://jameslhf.blogspot.com/2009/06/my-first-blog.html' title='My first blog'/><author><name>James Liu</name><uri>http://www.blogger.com/profile/12065644925126284329</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
