<?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'><id>tag:blogger.com,1999:blog-3333902368700703970</id><updated>2010-03-12T00:07:43.399-08:00</updated><title type='text'>Java around me</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.javapuru.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-4875698875996419859</id><published>2009-11-10T18:56:00.000-08:00</published><updated>2009-11-10T19:03:38.414-08:00</updated><title type='text'>Exception Handling - Do's and Don’ts -Code for failures -Part-3</title><content type='html'>&lt;a href="http://www.ssqq.com/newsletter/images/exceptions.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5290664737124865378" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 116px; CURSOR: hand; HEIGHT: 116px" alt="" src="http://2.bp.blogspot.com/_IWeXLRjP_H8/SWw3jBoDVWI/AAAAAAAAAAs/1pYRBQFIOdM/s200/exception.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.javapuru.com/2009/01/exception-handling-code-for-failures.html"&gt;Part-1 is here...&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.javapuru.com/2009/07/exception-handling-code-for-failures.html"&gt;Part-2 is here...&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;Do's and Don'ts in Exception Handling&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;1. Do not suppress the exception&lt;br /&gt;2. Do catch the specific exception than the toplevel or generic exceptions&lt;br /&gt;3. Do handle the thrown exception.&lt;br /&gt;4. Do not throw the irrelevant exceptions to the caller&lt;br /&gt;5. Do not handle the irrelevant exception by own.&lt;br /&gt;6. Do Wrap-up the exception&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Do not suppress the exception&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;try{&lt;br /&gt;&lt;br /&gt;// File reading code here&lt;br /&gt;&lt;br /&gt;}catch(IOException ioEx){&lt;br /&gt;&lt;br /&gt;// do Nothing&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Often we use try catch block in our code when compiler/IDE force as to handle the checked exceptions, we do write try catch block and just leave the catch block as&lt;br /&gt;Empty, first of all we must handle these checked exceptions, that's the reason it has been forced by compilers, by leaving empty catch block, we defeat the purpose of these checked exceptions.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Do catch the specific exception than the top-level or generic exceptions&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Catch the specific exceptions as much as possible; do not just catch the generic exceptions.&lt;br /&gt;&lt;br /&gt;try{&lt;br /&gt;&lt;br /&gt;// File reading code here&lt;br /&gt;&lt;br /&gt;}catch(FileNotFoundException fnfEx){&lt;br /&gt;&lt;br /&gt;// do something&lt;br /&gt;&lt;br /&gt;}catch(IOException ioEx){&lt;br /&gt;&lt;br /&gt;// do something&lt;br /&gt;&lt;br /&gt;}catch(Exception ex){&lt;br /&gt;&lt;br /&gt;// do something&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3. Do handle the thrown exception.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Compiler won't force us to handle the unchecked exceptions, it doesn't mean we no need to handle, for the good exceptiona handling must handle all the exceptions as much as possible.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4. Do not throw the irrelevant / unknown exceptions to the caller&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This is one of the important point in exception handling, code shouldn't throw all the exceptions to the caller, if any exception which can be handled by own, that exceptions must be handled then and there, for example, a method is trying to connect to Database and it throws Connection Could not established exception, then code should not throw this to handler, the method must handle and do some recoveries like re try or try to connect to the alternate Database. the caller may not know what to do with this exception, so this must be handled then and there.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5. Do not handle the irrelevant exception by own.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Like the above point, the code must not handle the exceptions which are not relevant to that piece, it should throw the exception to the caller.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;6. Do Wrap-up the exception&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;From the bottom to top, if the code throws all the exceptions as it is, the top level must handle or know about too many exceptions, so must wrapper the exceptions, log down it and pass to the above layer.&lt;br /&gt;&lt;br /&gt;For example, if DAO layer got some exception like SQLExcpetion, the end user or UI not necessarily say what is the error, instead this code wrap up as SystemException and pass it to the above layer, even though wrap that to system exception it should be logged down properly in the log files as SQLException, otherwise developer or operation people get confused about the exceptions.&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/3333902368700703970-4875698875996419859?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/4875698875996419859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=4875698875996419859' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/4875698875996419859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/4875698875996419859'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2009/11/exception-handling-do-and-donts-code.html' title='Exception Handling - Do&apos;s and Don’ts -Code for failures -Part-3'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IWeXLRjP_H8/SWw3jBoDVWI/AAAAAAAAAAs/1pYRBQFIOdM/s72-c/exception.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-128037054766192179</id><published>2009-07-23T00:50:00.000-07:00</published><updated>2009-07-23T01:42:41.698-07:00</updated><title type='text'>Exception Handling - Code for failures - Part-2</title><content type='html'>&lt;a href="http://www.ssqq.com/newsletter/images/exceptions.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5290664737124865378" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 116px; CURSOR: hand; HEIGHT: 116px" alt="" src="http://2.bp.blogspot.com/_IWeXLRjP_H8/SWw3jBoDVWI/AAAAAAAAAAs/1pYRBQFIOdM/s200/exception.jpg" border="0" /&gt;&lt;/a&gt; &lt;a href="http://www.javapuru.com/2009/01/exception-handling-code-for-failures.html"&gt;Part-1 is here...&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;Exception can be thrown for two reasons&lt;/strong&gt;&lt;br /&gt;1. Application failure, which includes operational failures, code issues and all other technical issues. (mostly non recoverable by end user)&lt;br /&gt;&lt;br /&gt;2. Business validations. (mostly recoverable by end user by changing the input data)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If any failure happened,&lt;br /&gt;&lt;strong&gt;we required below information to fix the issue&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. What was the failure?&lt;br /&gt;2. Where it happened?&lt;br /&gt;3. Which circumstance or state or environment?&lt;br /&gt;4. What are the input data?&lt;br /&gt;5. Is this recoverable?&lt;br /&gt;6. Is it necessary to Alert / Escalate to the support people?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Our Exception handling must provide all these details whenever the failure happened.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do we provide these information?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. What was the failure?&lt;/strong&gt;&lt;br /&gt;Do not throw a generic high level exception, provide a more specific Exception class.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Where it happened?&lt;/strong&gt;&lt;br /&gt;Do not throw a generic high level exception, provide a more specific Exception class, if we use the Same exception class in many places differentiates with the Id or message. so we know exactly where the failure happened.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Which circumstance or state or environment?&lt;/strong&gt;&lt;br /&gt;This is very important, many time we programmers do not mind that our program work only in a Conditional state(or environment), so we need to provide this information while throwing exception by id orMessage.&lt;br /&gt;&lt;br /&gt;The exception handler (typically a catch block or caller method) would change the state or look foralternate and re-try before throw the exception.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. What are the input data?&lt;/strong&gt;&lt;br /&gt;This information is important for Exception handling, most of the time exception could happened by theinput data, throw proper data exception when the failure happened like NullArgumentException&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Is this recoverable?&lt;/strong&gt;&lt;br /&gt;Most of the time, we throw Validation Exceptions, these validation exceptions would be recoverable by the end user, so the handling code must know that these exceptions are recoverable exceptions, so we Provide more meaningful information to recover this to the end user.&lt;br /&gt;&lt;br /&gt;Secondly this would use to hold the same state or environment for the end user to continue working with the application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Is it necessary to Alert / Escalate to the support people?&lt;/strong&gt;&lt;br /&gt;Not all the exceptions required admin or support people to be informed, so providing this information to the handler code will alert the admin or support team accordingly.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;If we get all the mentioned information without seeing the log, code and trace is consider the better Exception handling.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The Exception handling tips Will be continued…&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-128037054766192179?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/128037054766192179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=128037054766192179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/128037054766192179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/128037054766192179'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2009/07/exception-handling-code-for-failures.html' title='Exception Handling - Code for failures - Part-2'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IWeXLRjP_H8/SWw3jBoDVWI/AAAAAAAAAAs/1pYRBQFIOdM/s72-c/exception.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-3505716724399946204</id><published>2009-07-14T01:36:00.000-07:00</published><updated>2009-07-14T02:05:50.102-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fast Lane Reader Pattern'/><title type='text'>Fast Lane Reader Pattern -  When to use this?</title><content type='html'>&lt;a href="http://www.ihamad.com/images/20071214213306_fast%20lane.jpg"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 169px; CURSOR: hand; HEIGHT: 127px" alt="" src="http://www.ihamad.com/images/20071214213306_fast%20lane.jpg" border="0" /&gt;&lt;/a&gt; For our last few developments, we follow the Service --&gt; Business --&gt; DAO layer architecture.&lt;br /&gt;&lt;br /&gt;We strictly follow that the Service layer can call only Business layer and not DAO, the same way Business layer can call only the DAO layer and not the Service layer, this is approach is very much OK for all the CRUD operations&lt;br /&gt;&lt;br /&gt;But this approach is tedious, unnecessary and overhead for some straight forward operations like just to display large data without many validations, manipulations, business logic and so on… in this scenario we use Fast Lane Reader pattern. By this pattern we can call DAO layer directly from Service layer. So we avoid the complexity.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Conditions to use this&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. The data must be sued for Read only purpose and the data access also read only&lt;br /&gt;2. It must be as a tabular form instead of Object form&lt;br /&gt;3. Use only when the Data accuracy is not a crucial factor, means efficiency is more important than the current data.&lt;br /&gt;&lt;br /&gt;We could achieve &lt;strong&gt;fast retrieval of large data… &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We could avoid complexity in code, another way this will increase the design and code complexity by providing another passage to access the data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-3505716724399946204?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/3505716724399946204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=3505716724399946204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/3505716724399946204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/3505716724399946204'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2009/07/fast-lane-reader-pattern-when-to-use.html' title='Fast Lane Reader Pattern -  When to use this?'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-3906278551895884783</id><published>2009-02-12T01:46:00.001-08:00</published><updated>2009-02-12T01:46:36.568-08:00</updated><title type='text'>NUS Career Fair, SIngapore, Today and Tomorrow</title><content type='html'>NUS Career fair is held on to-day and to-morrow(12 and 13th Feb,2009) at Multi Purpose Sports Hall 1 &amp;amp; 2 .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Credit Suisse, AXA Life Insurance, JobStreet.com, JobsCentral, goverment agencies and many more companies participated in that... get the full list of the companies &lt;a href="http://www.nus.edu.sg/osa/career/downloads/students/Event%20Website%2009.pdf"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;in many counters they are giving some free gifts like pen, note books and some more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-3906278551895884783?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/3906278551895884783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=3906278551895884783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/3906278551895884783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/3906278551895884783'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2009/02/nus-career-fair-singapore-today-and.html' title='NUS Career Fair, SIngapore, Today and Tomorrow'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-6165434555456806680</id><published>2009-01-12T22:34:00.000-08:00</published><updated>2009-07-23T00:58:04.939-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exception Handling'/><title type='text'>Exception Handling - Code for failures - Part-1</title><content type='html'>&lt;a href="http://www.ssqq.com/newsletter/images/exceptions.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5290664737124865378" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 116px; CURSOR: hand; HEIGHT: 116px" alt="" src="http://2.bp.blogspot.com/_IWeXLRjP_H8/SWw3jBoDVWI/AAAAAAAAAAs/1pYRBQFIOdM/s200/exception.jpg" border="0" /&gt;&lt;/a&gt; &lt;strong&gt;Exception Handling - Code for failures&lt;/strong&gt; &lt;strong&gt;(Part-1)&lt;/strong&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;This article is not about what is Exception Handling, this article is just providing some tips, do's , don'ts and sharing the knowledge about Exception Handling and designing of Exception Handling...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Exception Handling is nothing but &lt;strong&gt;preparation for failures&lt;/strong&gt;, if we &lt;strong&gt;do not prepare for failures, then expect the more system failures&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;Normally we the programmers do not bother much about failure cases while coding, programmers concentrate more on to code the funcationality, yes it is important to complete the optimistic path of the program but the world is not so perfect.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;We write a program to run successfully in a conditionl environment, that means we define a program run successfully in this environemnt for this inputs and in this state, so we must concentrate on the Exception Handling to face when the program runs in improper environemt or inputs or states &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;strong&gt;Improper or poor exception handling will lead for the following things&lt;br /&gt;&lt;/strong&gt;1. Maitenance will be very difficult&lt;br /&gt;2. Difficult to debug.&lt;br /&gt;3. More turn around time.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Do we have any gauge for perfect Exception handling? &lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Never mind, as long as we are able to identify the reason for failures without looking the Stacktrace then the Exception Handling is done in good manner.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;I will write more in the next part...&lt;/div&gt;&lt;br /&gt;&lt;a href="http://www.javapuru.com/2009/07/exception-handling-code-for-failures.html"&gt;Part 2 is here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-6165434555456806680?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/6165434555456806680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=6165434555456806680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/6165434555456806680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/6165434555456806680'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2009/01/exception-handling-code-for-failures.html' title='Exception Handling - Code for failures - Part-1'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IWeXLRjP_H8/SWw3jBoDVWI/AAAAAAAAAAs/1pYRBQFIOdM/s72-c/exception.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-6679118275125205554</id><published>2009-01-07T17:53:00.000-08:00</published><updated>2009-01-07T18:59:00.268-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE Design Patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='e-book'/><title type='text'>Core J2EE Patterns best practices and design strtegies e-book</title><content type='html'>Definition for Design Patterns in Wikipedia is&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)"&gt;&lt;em&gt;In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Most of the time you are not the first person to face some problem in the world, some one might face this issue earlier, the solutions or method they find solution would be useful to resolve your problem. this is where patterns are important.&lt;br /&gt;&lt;br /&gt;Design Patterns are not difficult to understand, I found the website &lt;a href="http://www.javacamp.org/designPattern/"&gt;javacomp.org&lt;/a&gt; explains the basics of Design pattern in a simple and easy to understand manner.&lt;br /&gt;&lt;br /&gt;The above design pattern is common for OOAD, most of the time we look solutions on platform oriented, the sameway we need patterns for J2EE...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.patterndepot.com/put/8/JavaPatterns.htm"&gt;The Design Patterns Java Companion by James W. Cooper&lt;/a&gt; also simple to understand&lt;br /&gt;&lt;br /&gt;I found that the book "&lt;strong&gt;Core J2EE Patterns best practices and design startegies&lt;/strong&gt;" by Deepak Alur, John Crupi, Dan Malks is veryuseful.&lt;br /&gt;&lt;br /&gt;you can download the softcopy of the book by clicking &lt;a href="http://www.tamilveli.com/javapuru/ebooks/Core%20J2EE%20Patterns.pdf"&gt;this link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In the book they mentioned abouot what this book is about and what this book is not about&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What This Book is About?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;This book is about: &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;• Using patterns for the J2EE Platform. &lt;/strong&gt;&lt;br /&gt;Based on our collective J2EE platform experience, we have assembled the&lt;br /&gt;pattern catalog in this book. The J2EE Pattern Catalog describes various best&lt;br /&gt;practices related to architecting and designing applications for the J2EE&lt;br /&gt;platform. This book focuses on the following four J2EE technologies: Servlets,&lt;br /&gt;JSP, EJB components, and JMS.&lt;br /&gt;&lt;br /&gt;• Using best practices to design applications that use JSP, Servlet, EJB&lt;br /&gt;components, and JMS technologies.&lt;br /&gt;&lt;br /&gt;It is not sufficient to merely learn the technology and the APIs. It is equally&lt;br /&gt;important to learn to design with the technology. We have documented what&lt;br /&gt;we have experienced to be the best practices for these technologies.&lt;br /&gt;&lt;br /&gt;• Preventing re-inventing-the-wheel when it comes to design and architecture&lt;br /&gt;for the J2EE platform.&lt;br /&gt;Patterns promote design reuse. Reusing known solutions reduces the cycle&lt;br /&gt;time for designing and developing applications, including J2EE applications.&lt;br /&gt;&lt;br /&gt;• Identifying bad practices in existing designs and refactoring these designs to&lt;br /&gt;move to a better solution using the J2EE patterns.&lt;br /&gt;Knowing what works well is good. Knowing what does not work is equally&lt;br /&gt;important. We have documented some of the bad practices we have&lt;br /&gt;experienced when designing applications for the J2EE platform.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What This Book Is Not? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;This book is not about:&lt;br /&gt;&lt;/strong&gt;• How to program with Java or J2EE technologies&lt;br /&gt;This book is not about programming. While this book is heavily based on the&lt;br /&gt;J2EE technologies, we do not describe the specific APIs. If you wish to learn&lt;br /&gt;about programming using Java or using any of the J2EE technologies, there&lt;br /&gt;are a number of excellent books and online resources from which to learn.&lt;br /&gt;The online tutorials on the official Java home page at http://java.sun.com&lt;br /&gt;are highly recommended if you wish to learn about individual technologies.&lt;br /&gt;The official specifications for J2EE technologies are also available from the&lt;br /&gt;Java home page.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;• What process and methodology to use&lt;br /&gt;&lt;/strong&gt;We do not suggest any type of process or methodology to use since the&lt;br /&gt;material presented in this book is not related to either. Hence, this book does&lt;br /&gt;not teach you about a process or methodology to follow in your projects. If&lt;br /&gt;you would like to learn more about processes and methodologies, there are&lt;br /&gt;a good number of books that deal with various object-oriented&lt;br /&gt;methodologies and new books on lightweight processes, such as Extreme&lt;br /&gt;Programming.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;• How to use Unified Modeling Language (UML) &lt;/strong&gt;&lt;br /&gt;This book is not going to teach you about UML. We use UML extensively&lt;br /&gt;(specifically class and sequence diagrams) to document the patterns and&lt;br /&gt;describe the static and dynamic interactions. If you want to learn more about&lt;br /&gt;UML, please refer to the UML User Guide [Booch] and the UML Reference&lt;br /&gt;Manual [Rumbaugh] by Grady Booch, Ivar Jacobson and James Rumbaugh.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-6679118275125205554?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/6679118275125205554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=6679118275125205554' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/6679118275125205554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/6679118275125205554'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2009/01/core-j2ee-patterns-best-practices-and.html' title='Core J2EE Patterns best practices and design strtegies e-book'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-8200128977224264</id><published>2008-12-28T19:54:00.000-08:00</published><updated>2008-12-28T19:56:07.172-08:00</updated><title type='text'>Boost Performance with 5.1 and Query Analyzer</title><content type='html'>MySQL Live Webinar News&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MySQL invites you to join our very exciting Live Webinar in January for Asia South. Space is limited, so register now!!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Title:&lt;/strong&gt;Boost Performance with 5.1 and Query Analyzer (Asia South)&lt;br /&gt;&lt;br /&gt;MySQL Live Webinar News&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;MySQL invites you to join our very exciting Live Webinar in January for Asia South.  Space is limited, so register now!!&lt;br /&gt;&lt;br /&gt;- Title: &lt;br /&gt;    Boost Performance with 5.1 and Query Analyzer (Asia South)&lt;br /&gt;- Date: &lt;br /&gt;    Thursday, January 8, 2009 &lt;br /&gt;    11:00 am in Singapore/Malaysia/Philippines&lt;br /&gt;    10:00 am in Bangkok/Indonesia/Vietnam&lt;br /&gt;    12:00 pm in Japan&lt;br /&gt;- Presenter: &lt;br /&gt;    Robin Schumacher, Director of Product Management, Sun MySQL&lt;br /&gt;    Rob Young, Senior Manager of Product Management, Sun MySQL&lt;br /&gt;- Register:&lt;br /&gt;    http://www.mysql.com/news-and-events/web-seminars/display-258.html&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Join this webinar to learn how MySQL Enterprise now delivers higher performance for large-scale enterprise applications through Partitioning and Row-Based Replication - as well as the ability to further optimize database performance and manage scale with Query Analyzer; a must-have tool for DBAs and developers to identify and analyze problem SQL code causing performance issues and slow downs.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;For recorded replays of our most popular live web seminars that cover a wide range of topics, please go to http://www.mysql.com/news-and-events/on-demand-webinars/.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Sincerely, &lt;br /&gt; &lt;br /&gt;Sun Microsystems / MySQL&lt;br /&gt;www.mysql.com&lt;br /&gt;Thursday, January 8, 2009&lt;br /&gt;11:00 am in Singapore/Malaysia/Philippines&lt;br /&gt;10:00 am in Bangkok/Indonesia/Vietnam&lt;br /&gt;12:00 pm in Japan&lt;br /&gt;- Presenter:&lt;br /&gt;Robin Schumacher, Director of Product Management, Sun MySQL&lt;br /&gt;Rob Young, Senior Manager of Product Management, Sun MySQL&lt;br /&gt;- Register:&lt;br /&gt;http://www.mysql.com/news-and-events/web-seminars/display-258.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Join this webinar to learn how MySQL Enterprise now delivers higher performance for large-scale enterprise applications through Partitioning and Row-Based Replication - as well as the ability to further optimize database performance and manage scale with Query Analyzer; a must-have tool for DBAs and developers to identify and analyze problem SQL code causing performance issues and slow downs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For recorded replays of our most popular live web seminars that cover a wide range of topics, please go to http://www.mysql.com/news-and-events/on-demand-webinars/.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-8200128977224264?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/8200128977224264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=8200128977224264' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/8200128977224264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/8200128977224264'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2008/12/boost-performance-with-51-and-query.html' title='Boost Performance with 5.1 and Query Analyzer'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-8923445347938707741</id><published>2008-12-15T03:23:00.000-08:00</published><updated>2008-12-15T03:49:54.116-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox issues'/><category scheme='http://www.blogger.com/atom/ns#' term='Works in IE'/><category scheme='http://www.blogger.com/atom/ns#' term='not wokring in Firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='IE issues'/><title type='text'>Firefox shows html not web page but IE Internet Explorer is fine</title><content type='html'>one of the simple portal page what we developed was rendering as HTML in IE browser, but mozilla firefox shows the HTML tags a text instead of rendering...&lt;br /&gt;&lt;br /&gt;interesting and irritating, as we know that firefox is strictly checking HTML, we were looking DOCTYPE and every html tag in the page is well formed, tired... it is all well formed.... but still it works in IE and not in Firefox, we have gone through line by line the HTML source, yes yes content type is missing, then we added&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But still not working in firefox, but IE it works fine…&lt;br /&gt;&lt;br /&gt;Then we look our JSP’s again we added &lt;strong&gt;&lt;span style="color:#3333ff;"&gt;contentType="text/html; charset= utf-8 " &lt;/span&gt;&lt;/strong&gt;in the jsp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But still not working in firefox, but IE it works fine…&lt;br /&gt;&lt;br /&gt;I started scolding about firefox, just add a simple hellow world jsp and access that, it is working…….in IE and Firefox, but the real page is not working…&lt;br /&gt;&lt;br /&gt;Then I access the page by calling jsp directly instead of calling from Servlet…. This is working…….in IE and Firefox also…&lt;br /&gt;&lt;br /&gt;Then suddenly strikes out, is that the response content type issue which is not set in Servlet? this is a very basic thing, how do we miss it? Without much hope I look the servlet, oh ya… it is missing….&lt;br /&gt;&lt;br /&gt;Just added &lt;strong&gt;&lt;span style="color:#3333ff;"&gt;response.setContentType("text/html")&lt;/span&gt;&lt;/strong&gt;; in servlet, yehhhhh it works in firefox and IE, actually the cultprit is IE and not firefox,&lt;br /&gt;&lt;br /&gt;Firefox display the out put as per the default “text/plain” , but the IE is ignoring the default “text/plain” and shows in HTML…&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-8923445347938707741?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/8923445347938707741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=8923445347938707741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/8923445347938707741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/8923445347938707741'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2008/12/firefox-shows-html-not-web-page-but-ie.html' title='Firefox shows html not web page but IE Internet Explorer is fine'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-8647999263154160850</id><published>2008-12-15T00:49:00.000-08:00</published><updated>2008-12-15T00:54:34.094-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sun tech days singapore'/><title type='text'>Sun tech days 2009 in Singapore</title><content type='html'>&lt;a href="http://a676.g.akamaitech.net/f/676/773/60m/images.delivery.net/cm50content/18570/33990/masthead_v02_600w.gif"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 600px; CURSOR: hand; HEIGHT: 241px; TEXT-ALIGN: center" alt="" src="http://a676.g.akamaitech.net/f/676/773/60m/images.delivery.net/cm50content/18570/33990/masthead_v02_600w.gif" border="0" /&gt;&lt;/a&gt; Early birds enjoy great discounts and stand to win iPOD Nanos and more! &lt;a title="http://communications1.sun.com/r/c/r?2.1.3J1.2U2.145t6O.CD2lZE..N.Fj%5fi.2DZm.DPOKEXV0" href="http://communications1.sun.com/r/c/r?2.1.3J1.2U2.145t6O.CD2lZE..N.Fj%5fi.2DZm.DPOKEXV0"&gt;Register Now&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Date/Venue:&lt;br /&gt;&lt;br /&gt;&lt;a title="http://communications1.sun.com/r/c/r?2.1.3J1.2U2.145t6O.CD2lZE..N.Fj%2a4.2DZm.DGAcEUL0" href="http://communications1.sun.com/r/c/r?2.1.3J1.2U2.145t6O.CD2lZE..N.Fj%2a4.2DZm.DGAcEUL0"&gt;Sun Tech Days 2009&lt;/a&gt;, 20 - 21 Jan 2009 (Tue &amp;amp; Wed) Raffles Ballroom, Level 4 Raffles City&lt;br /&gt;&lt;br /&gt;Convention Centre&lt;br /&gt;Contact: June&lt;br /&gt;Tel: 6273 9956&lt;br /&gt;Fax: 6273 8277&lt;br /&gt;Email:&lt;a title="mailto:techdays_sg@sun.com" href="mailto:techdays_sg@sun.com"&gt;techdays_sg@sun.com &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-8647999263154160850?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/8647999263154160850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=8647999263154160850' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/8647999263154160850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/8647999263154160850'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2008/12/sun-tech-days-2009m-in-singapore.html' title='Sun tech days 2009 in Singapore'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-1748027379711930504</id><published>2008-11-02T19:41:00.000-08:00</published><updated>2008-11-06T21:20:23.937-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='When to leave a company'/><title type='text'>When to leave a company?</title><content type='html'>1. Do you have some respect on your immediate boss?&lt;br /&gt;2. Do you have some respect on your organisation?&lt;br /&gt;3. Do you have some respect on the work you are doing?&lt;br /&gt;&lt;br /&gt;If you say NO for all of the above three... right time to leave the organisation, do not think about anything else....do not try to resolve the problems... just leave it...&lt;br /&gt;&lt;br /&gt;If you say NO for two of the above three... Be Ready to leave... but think twice before take any decision to leave... calculate the risk and benifits... Look for change within organisation&lt;br /&gt;&lt;br /&gt;If you say NO only for one of the above three... Donot leave.... try to resolve the problems, talk to your bosses&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-1748027379711930504?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/1748027379711930504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=1748027379711930504' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/1748027379711930504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/1748027379711930504'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2008/11/when-to-leave-company.html' title='When to leave a company?'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-1370759620383359249</id><published>2008-09-18T03:06:00.000-07:00</published><updated>2008-09-18T03:16:11.604-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Shenton way'/><category scheme='http://www.blogger.com/atom/ns#' term='Bernard'/><category scheme='http://www.blogger.com/atom/ns#' term='volatile'/><category scheme='http://www.blogger.com/atom/ns#' term='transient'/><title type='text'>Bernard, Shenton waycoffeebean shop, java volatile</title><content type='html'>Some time back  I suppose to meet “java troopers” &lt;a href="http://www.javatroopers.com/about.html"&gt;Bernard Ng&lt;/a&gt; in the early morning eight O’ clock at Shenton way coffeebean shop, I am a night owl, early wake up is one of the tougher job for me.&lt;br /&gt;&lt;br /&gt;I can say that the Java trooper Bernard is one of the geniuses in Java.&lt;br /&gt;&lt;br /&gt;In that discussion, Bernard wants to test my coding ability to that before he gives green signal for a company who are interested to recruit me, so he asked me to write java code using threads. The question is very simple; Write a program to invoke one java method after completes all the threads finish it’s execution.&lt;br /&gt;&lt;br /&gt;It’s a straight forward question right?  declare a count variable common for these threads, in the last line of the the thread execution, just increase the count of a common variable in a synchronize block, there could be a 4th thread will check the value of that variable, if it is not 3 then this thread will go to sleep for some time and again will check the value of that variable.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.linkedin.com/profile?viewProfile=&amp;amp;key=3835302"&gt;Bernard Ng&lt;/a&gt; has great knowledge in java and programming languages, I have to impress him to get the job, so I have written this program in bit different way, I plan to use “volatile” even though the use of “volatile” is not the 100% perfect for this problem. “volatile” is not frequently used by programmers, so many of us ignore about volatile, so I just want to use “volatile” to impress him.&lt;br /&gt;&lt;br /&gt;We assume something and keep in our mind for years and years without knowing the real fact, the same way I assume that “volatile” is something opposite to “transient” and it was in my mind for many years. I never try to read or learn about “volatile”&lt;br /&gt;&lt;br /&gt;Some time back when I was searching job, I refresh my java knowledge again, first few days I skip reading about “volatile” but at last I read about volatile…. A big shock, reasons are&lt;br /&gt;&lt;br /&gt;1. “volatile” is not opposite to “transient” or something like “transient” in java&lt;br /&gt;2. “volatile” is related to thread and not related to serialization…&lt;br /&gt;&lt;br /&gt;I was really ashamed on me then I started looking for “volatile”&lt;br /&gt;&lt;br /&gt;In a mutli-thread environment, a variable can be accessed by many threads and asynchronously change the values of that variable, so when a thread access that variable, it does not guarantee that the value is the latest one, once a variable is marked as “volatile”&lt;strong&gt;, who ever access this variable, gets the latest value of the variable&lt;/strong&gt;, so it’s some way equals to synchronized without overhead of the synchronized keyword.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Marking local variable is “volatile” is not appropriate&lt;/strong&gt;, since other threads cannot see local variables, there is never any need to mark local variables volatile.&lt;br /&gt;&lt;br /&gt;I declare a variable as “volatile” and I haven’t use synchronize block for thread safety, except this, I use the same approach mentioned above, but in this approach also there is a very less possibility for the code might not work.&lt;br /&gt;&lt;br /&gt;Increasing the volatile variable count++ might not work as expected, even though count++ looks single operation, it comprise three operations.&lt;br /&gt;&lt;br /&gt;Read the value of the variable, increase one for the value of the variable, assign back to the increased value to the variable, if a thread modify the value of that variable After read the value of the variable and before assign the increased value back to the variable, then it might not work as expected, even though this unlikely happened, still there are chances, that’s why I said this is not the 100% perfect solution for &lt;a href="http://www.linkedin.com/profile?viewProfile=&amp;amp;key=3835302"&gt;Bernard’s &lt;/a&gt; question.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-1370759620383359249?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/1370759620383359249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=1370759620383359249' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/1370759620383359249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/1370759620383359249'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2008/09/bernard-shenton-waycoffeebean-shop-java.html' title='Bernard, Shenton waycoffeebean shop, java volatile'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3333902368700703970.post-6687270266284802344</id><published>2008-09-01T00:33:00.000-07:00</published><updated>2008-12-23T21:16:01.797-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='puru'/><category scheme='http://www.blogger.com/atom/ns#' term='purushothaman'/><title type='text'>How do I introduce myself?</title><content type='html'>I am Purushothaman (many call me as "Puru"), I am just working in Java/J2EE since 1999 and mostly I have worked for developing web based systems and have worked on some Perl, PHP projects earlier time in my carrier.&lt;br /&gt;&lt;br /&gt;I know something in java, and I am sharing this with my friends, colleagues, with my wife and now I am sharing in the web. I have done the Sun java2 vertification for programmer in the year 2002&lt;br /&gt;&lt;br /&gt;OK what I am going to write in this? Technical articles? Nope... I just share my experience, thoughts, effects cause by java, It might contain technical information, management related items and experience with people but all these linked with me by Java...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Likes:&lt;br /&gt;&lt;/strong&gt;Books, surf in net, family, java, people&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Dislikes: &lt;/strong&gt;&lt;br /&gt;Boot Licking, Back stabbing&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Political View:&lt;br /&gt;&lt;/strong&gt;Leftist (but definitely not like a pseudo communists, I believe the better system falls in between capitalism and communism)&lt;br /&gt;&lt;br /&gt;Believe in Human Rights&lt;br /&gt;&lt;br /&gt;You can reach me on &lt;a href="mailto:javapuru@gmail.com"&gt;javapuru@gmail.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;&lt;br /&gt;The information and this blog conents are my own views, this should not relate this with any other organisations and especially should not relate with my current organisation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3333902368700703970-6687270266284802344?l=www.javapuru.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.javapuru.com/feeds/6687270266284802344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3333902368700703970&amp;postID=6687270266284802344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/6687270266284802344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3333902368700703970/posts/default/6687270266284802344'/><link rel='alternate' type='text/html' href='http://www.javapuru.com/2008/09/how-do-i-introduce-myself.html' title='How do I introduce myself?'/><author><name>javaPuru</name><uri>http://www.blogger.com/profile/03536412546659994475</uri><email>javapuru@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='12671289431620586489'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>