<?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-5982105530359725850</id><updated>2012-01-02T11:06:33.264-05:00</updated><title type='text'>Dazed &amp; Confused...</title><subtitle type='html'>Farzad Kohantorabi's Blog</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5982105530359725850.post-5724380472380614415</id><published>2008-03-20T20:39:00.001-05:00</published><updated>2008-03-20T20:39:47.776-05:00</updated><title type='text'>grepWin is free now?</title><content type='html'>&lt;p&gt;It looks like it is free now, and it is hosted on google codes web site. In any events, it is a nice tool for windows and specially for Linux addicts that need to live in da windows world.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://tools.tortoisesvn.net/grepWin"&gt;grepWin&lt;/a&gt; is a search and replace tool for windows. It has lots of useful features and unlike windows search it works! &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-5724380472380614415?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/5724380472380614415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=5724380472380614415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5724380472380614415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5724380472380614415'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2008/03/grepwin-is-free-now.html' title='grepWin is free now?'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-2668341425249708122</id><published>2008-01-23T19:48:00.001-05:00</published><updated>2008-01-23T19:48:41.278-05:00</updated><title type='text'>Thinking in Java</title><content type='html'>&lt;p&gt;Few days ago I was drown in my memories of the good old days and I remembered the first book I ever read on Java, and it was Thinking in Java. I learned a big deal from that book and that was the Java starter kit I needed. Today, I have been programming in Java for I don't know how many years and I do believe I should give some credit to that book. Recommended for all people who want to base the future job on software development in Java.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-2668341425249708122?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/2668341425249708122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=2668341425249708122' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/2668341425249708122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/2668341425249708122'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2008/01/thinking-in-java.html' title='Thinking in Java'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-4794873999228987568</id><published>2007-12-28T13:24:00.001-05:00</published><updated>2007-12-28T15:45:33.381-05:00</updated><title type='text'>Spring, Struts and Weblogic 8.1 SP6</title><content type='html'>&lt;p&gt;It's hard to get these things working together in Weblogic. You will have to think about class loading issues. The main problem is Spring support action classes reference Struts action classes and this fails to work if they are located in sibling class loaders. It's a pain to find why. Weblogic doesn't come with a nice class loader debugger (or I am blind enough not to see it) and you have to write your own debugger. The only thing so far I could do to get around this is to edit Spring manifest file and add struts.jar to class path dependency so that Weblogic makes the link. I am wondering if this should be a part of spring jar file anyways. As far as I understand it is a Java fashion to do this. On top of this, I think spring jar file should be sliced up a little bit for class loading reasons. I mean the web part of it might not need to be in the same class loader its container code is. The container code has state, it loads a network of beans and it keeps the network in memory along with static scoped beans. Therefore, it makes much sense if you want to share this container with multiple modules for performance reasons. Nonetheless, you won't need to share the web helper classes.&amp;nbsp; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-4794873999228987568?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/4794873999228987568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=4794873999228987568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4794873999228987568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4794873999228987568'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/12/spring-struts-and-weblogic-81-sp6.html' title='Spring, Struts and Weblogic 8.1 SP6'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-436644469531337758</id><published>2007-12-15T14:09:00.001-05:00</published><updated>2007-12-15T14:09:56.620-05:00</updated><title type='text'>Spring Experience 2007</title><content type='html'>&lt;p&gt;A colleague of mine sent this picture to us, right from Spring Experience 2007. I resist not to comment on it. It's cool, hey?&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.google.com/kohantorabi/R2Qmgllew5I/AAAAAAAAAC4/Bg7Xw2QL69U/bobble-head%5B3%5D"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="336" alt="bobble-head" src="http://lh3.google.com/kohantorabi/R2QmhFlew6I/AAAAAAAAADE/g2dmJVqo5ao/bobble-head_thumb%5B1%5D" width="253" border="0"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-436644469531337758?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/436644469531337758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=436644469531337758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/436644469531337758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/436644469531337758'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/12/spring-experience-2007.html' title='Spring Experience 2007'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-6767429737433274205</id><published>2007-12-13T22:18:00.001-05:00</published><updated>2007-12-13T22:18:46.268-05:00</updated><title type='text'>Flex is the future?</title><content type='html'>&lt;p&gt;The more I read about Flex the more I am convinced Flex is the way to go. For me the bigger question is how long HTML and its descendents will last. HTML was really useful but know it is just too incapable and simply it has no memory. It's intelligence is also usually supported with scripting languages such as JavaScript which is a beast of its own kind. Look at the complexity of Java front end frameworks. There is tons of them and still neither has a neat solution to the front end puzzle. The Java front end code is usually terrible. It really takes very good developers to come up with a web based GUI in Java that is well designed and it is easy to maintain. However, this is not what we want. We want stupid programmers to be able to produce. Java front end model is suffering from HTML shortcomings. Mostly from its lack of memory. That is, a request should be sent to user for every time a data is updated and server should keep this in memory for the scope of a conversation. Think of a form that adds items incrementally and as user presses save the changes are flushed to database. This will require Java code to take care of the temporary list of Items. That is why we have request scope variable, session scope variable and application scope variables. These are all a problem when it comes to scaling. In any events, Flex seems to be the answer. At least it is a great improvement. It has memory. It is richer that HTML and it can customized the same way. Even Microsoft is pushing its SilverLite.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-6767429737433274205?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/6767429737433274205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=6767429737433274205' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/6767429737433274205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/6767429737433274205'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/12/flex-is-future.html' title='Flex is the future?'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-5441728357449151204</id><published>2007-12-05T21:25:00.001-05:00</published><updated>2007-12-05T21:25:39.884-05:00</updated><title type='text'>SELECT FOR INSERT</title><content type='html'>&lt;p&gt;Wouldn't it be nice if we had some like SELECT FOR INSERT in SQL?&amp;nbsp; I am not even sure if we don't but I have not been able to find anything like that. The problem I am trying to address is the classic problem of two transactions trying to insert a data if it is missing. Lets say T1 reads for record X and if it doesn't find it, X gets inserted. T2 is doing the same. T1 and T2 happily start together so T1 reads and there is no X, same happens to T2. T1 inserts X and commits, T2 inserts and commit and boom, Duplicate data. In the same fashion we have SELECT FOR UPDATE, it would be nice to have SELECT FOR (POSSIBLE) INSERT in SQL. This would mean looks for this data and if you don't find it lock the table because I am going to insert it. It has a bad effect on performance though. That's probably why we don't have it. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-5441728357449151204?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/5441728357449151204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=5441728357449151204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5441728357449151204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5441728357449151204'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/12/select-for-insert.html' title='SELECT FOR INSERT'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-9019587527211662960</id><published>2007-12-04T21:22:00.001-05:00</published><updated>2007-12-04T21:22:23.118-05:00</updated><title type='text'>The most dreamed tool on Windows, Grep!</title><content type='html'>&lt;p&gt;Done nicely! &lt;/p&gt; &lt;p&gt;&lt;a title="http://tools.tortoisesvn.net/grepWin" href="http://tools.tortoisesvn.net/grepWin"&gt;http://tools.tortoisesvn.net/grepWin&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-9019587527211662960?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/9019587527211662960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=9019587527211662960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/9019587527211662960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/9019587527211662960'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/12/mostly-dreamed-tool-on-windows-grep.html' title='The most dreamed tool on Windows, Grep!'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-3980932925061958242</id><published>2007-12-02T23:22:00.001-05:00</published><updated>2007-12-02T23:22:00.293-05:00</updated><title type='text'>Why do they still lock game CDs?</title><content type='html'>&lt;p&gt;Game hacks and cracks are usually out within a week or two. Sometimes they are available before games are out. I am still wondering why companies are spending money on preventing copies of their CDs. I don't know how many stupid people there are and by stupid I mean the ones that can't go on internet and do a simple google search. I am talking about a 'XYZ no cd crack'. It doesn't look very hard, does it? The downside of this is legal users have to suffer. They have to push in their CDs each time they want to play a game, and of course one day their CDs are no good because all scratching and everything. &lt;/p&gt; &lt;p&gt;Once I asked my manager if we needed to obfuscate our code so that nobody can hack into it. He pointed at one our colleagues and said look at him---he was decompiling a flash code---there is billions and billions of these people. The only way we can be ahead of them is to be literally ahead of them by developing faster than they can hack.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-3980932925061958242?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/3980932925061958242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=3980932925061958242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/3980932925061958242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/3980932925061958242'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/12/why-do-they-still-lock-game-cds.html' title='Why do they still lock game CDs?'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-5234017562979876751</id><published>2007-11-29T20:52:00.001-05:00</published><updated>2007-11-29T20:59:35.510-05:00</updated><title type='text'>Eidos in Montreal</title><content type='html'>&lt;p&gt;Eidos officially &lt;a href="http://blog.canoe.ca/loadthis/loadthis/2007/11/26/deus_ex_trois_tres_bien"&gt;announced&lt;/a&gt; they will need 350 people in Montreal by 2009. This is while their competitor, Ubisoft, mass hired a lot of people in its Montreal office which at the end resulted in a sharp salary increase for most developers. The same thing is going to happen when Eidos starts sending recruiters around. I have been studying Montreal job market for a while and apparently Montreal is running out of tech work force. Hiring a developer is going to be simply impossible. Montreal has so much opportunities now that even after Motorola's close down nobody heard of excess of work force. I have seen companies putting an ad for more than 3 weeks. &lt;/p&gt; &lt;p&gt;Another side of the story is that this is happening while lots of software houses are running on a low and tight budget. Guess what? Most of these companies will not be able to keep their developers by next year and they will have to close down or find other sources of financing. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-5234017562979876751?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/5234017562979876751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=5234017562979876751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5234017562979876751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5234017562979876751'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/11/eidos-in-montreal.html' title='Eidos in Montreal'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-4478927824674660370</id><published>2007-10-24T15:02:00.001-05:00</published><updated>2007-10-24T15:02:43.612-05:00</updated><title type='text'>Less code or what?</title><content type='html'>&lt;p&gt;My philosophy of coding is less code is always better*. That is, less code needs less effort to maintain and in case of bugs you need to examine less code to spot where a bug lives. This is important when a legacy code is being maintained. It is usually acceptable to disable a legacy code to implement a new feature or fix an existing bug. During this process, some code usually becomes redundant and it should be thrown away. However, this is scary. I haven't seen a lot of developers that feel comfortable by deleting other people's code. I understand this to some extent. On the other hand, leaving a redundant code in place is scary too. Redundant codes confuse developers. Experienced developers usually come to this question of why the hell this code is there and they usually spend days to find out well sloth is a real sin. This is when people should throw code away. Throw your redundant code away, and by code I mean any form of code, either Java code or SQL statement. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;* This excludes crazy untraceable codes that break code usage searches and, therefore,&amp;nbsp;prevent refactoring tools from functioning. One example is Java Reflection API which may save few (hundred) lines of code&amp;nbsp;but it lets your code live as shadows.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-4478927824674660370?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/4478927824674660370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=4478927824674660370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4478927824674660370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4478927824674660370'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/10/less-code-or-what.html' title='Less code or what?'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-5841101467513698766</id><published>2007-10-15T19:22:00.001-05:00</published><updated>2007-10-15T19:22:40.722-05:00</updated><title type='text'>Free IntelliJ IDEA upgrade</title><content type='html'>&lt;p&gt;Today I got my free &lt;a href="http://www.jetbrains.com/idea/download/index.html?70rss"&gt;IntelliJ IDEA&lt;/a&gt; license upgrade. Yet another reason to love IntelliJ IDEA.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-5841101467513698766?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/5841101467513698766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=5841101467513698766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5841101467513698766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5841101467513698766'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/10/free-intellij-idea-upgrade.html' title='Free IntelliJ IDEA upgrade'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-723904828068169847</id><published>2007-10-04T20:38:00.001-05:00</published><updated>2007-10-04T20:38:31.600-05:00</updated><title type='text'>IntelliJ IDEA 7 - method does not exist and more</title><content type='html'>&lt;p&gt;For a while I was getting&amp;nbsp;annoying errors in IDEA early release distributions thorough their EAP, and this was becoming an issue as the errors were disabling basic functions like code highlight. I was quite concerned that IntelliJ quality is going down but at the same time I didn't think I was right to say it because those distributions are not really meant to be stable. However, after a few tinkering here and there I realized I was getting those error because I was extracting new releases on previous releases and apparently it was not the best thing to do. One still may keep the bin directory but it is not too bad of an idea to do a clean install each time.&lt;/p&gt; &lt;p&gt;In any events, IDEA 7 has a nice Spring and Hibernate support. I have been enjoying code completion for HQL queries and Spring beans. Every now and often I can see a minor false-positive error detected in my HQLs but I have a feelings these things will go away in the main release of version 7. No matter what, I still prefer to stay a customer. I can't find my way in Eclipse. Therefore, that's not really an option for me.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-723904828068169847?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/723904828068169847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=723904828068169847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/723904828068169847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/723904828068169847'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/10/intellij-idea-7-method-does-not-exist.html' title='IntelliJ IDEA 7 - method does not exist and more'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-3896855871193607793</id><published>2007-09-11T22:35:00.001-05:00</published><updated>2007-09-11T22:35:30.157-05:00</updated><title type='text'>Code Quality</title><content type='html'>&lt;p&gt;Seriously, you need to think twice if your class has 2800 lines of code! And please don't comment your code with obvious sentences. Having no comment is a lot better than having a stupid comment. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Stupid comment example 1:&lt;/p&gt; &lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Checks if total is greater than limit.&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (total &amp;gt; limit) {&lt;br /&gt; doScrewThePerson();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Stupid comment example 2:&lt;/p&gt;&lt;br /&gt;&lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;* returns the favourite person&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Person getFavouritePerson() {&lt;br /&gt;    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;.favouritePerson;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode-wrapper, .csharpcode-wrapper pre {&lt;br /&gt;  background-color: #f4f4f4;&lt;br /&gt;  border: solid 1px gray;&lt;br /&gt;  cursor: text;&lt;br /&gt;  font-family: consolas, 'Courier New', courier, monospace;&lt;br /&gt;  font-size: 8pt;&lt;br /&gt;  line-height: 12pt;&lt;br /&gt;  margin: 20px 0px 10px 0px;&lt;br /&gt;  max-height: 200px;&lt;br /&gt;  overflow: auto;&lt;br /&gt;  padding: 4px 4px 4px 4px;&lt;br /&gt;  width: 97.5%;&lt;br /&gt;}&lt;br /&gt;.csharpcode-wrapper pre {&lt;br /&gt;  border-style: none;&lt;br /&gt;  margin: 0px 0px 0px 0px;&lt;br /&gt;  overflow: visible;&lt;br /&gt;  padding: 0px 0px 0px 0px;&lt;br /&gt;}&lt;br /&gt;.csharpcode, .csharpcode pre, .csharpcode .alt {&lt;br /&gt;  background-color: #f4f4f4;&lt;br /&gt;  border-style: none;&lt;br /&gt;  color: black;&lt;br /&gt;  font-family: consolas, 'Courier New', courier, monospace;&lt;br /&gt;  font-size: 8pt;&lt;br /&gt;  line-height: 12pt;&lt;br /&gt;  overflow: visible;&lt;br /&gt;  padding: 0px 0px 0px 0px;&lt;br /&gt;  width: 100%;&lt;br /&gt;}&lt;br /&gt;.csharpcode pre {&lt;br /&gt;  margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .alt {&lt;br /&gt;  background-color: white;&lt;br /&gt;}&lt;br /&gt;.csharpcode .asp {&lt;br /&gt;  background-color: #ffff00;&lt;br /&gt;}&lt;br /&gt;.csharpcode .attr {&lt;br /&gt;  color: #ff0000;&lt;br /&gt;}&lt;br /&gt;.csharpcode .html {&lt;br /&gt;  color: #800000;&lt;br /&gt;}&lt;br /&gt;.csharpcode .kwrd {&lt;br /&gt;  color: #0000ff;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum {&lt;br /&gt;  color: #606060;&lt;br /&gt;}&lt;br /&gt;.csharpcode .op {&lt;br /&gt;  color: #0000c0;&lt;br /&gt;}&lt;br /&gt;.csharpcode .preproc {&lt;br /&gt;  color: #cc6633;&lt;br /&gt;}&lt;br /&gt;.csharpcode .rem {&lt;br /&gt;  color: #008000;&lt;br /&gt;}&lt;br /&gt;.csharpcode .str {&lt;br /&gt;  color: #006080;&lt;br /&gt;}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-3896855871193607793?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/3896855871193607793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=3896855871193607793' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/3896855871193607793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/3896855871193607793'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/09/code-quality.html' title='Code Quality'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-4516194701814275308</id><published>2007-09-11T22:28:00.001-05:00</published><updated>2007-09-11T22:28:37.540-05:00</updated><title type='text'>Business Value</title><content type='html'>&lt;p&gt;Few months ago I started working on a software that is in production now for I don't know how many years. My assignments primarily were supposed to be maintenance sort of tasks, but I somehow ran into this situation in which I didn't believe patching the code to add new features was a good idea. I skip my justification at the moment for it is not the main idea of this entry. &lt;/p&gt; &lt;p&gt;In any events, I started evaluating the existing code and no matter how I looked at the code, I didn't find a straight way to keep the existing code. My assessment was the back-end layer should be completely replaced, the front end should be modified to adhere to technology standards, build files should be revised throughout the system, and packaging needed a serious attention. My rough estimation of how much time I needed to do this was something around a year. This may sound stupid since no one is going to wait for me for a year to have a new system that does (I am crossing my fingers) exactly the same thing as&amp;nbsp; before&amp;nbsp;plus a minor new feature! On the other hand, this is not totally stupid because after the changes are done the system is better maintainable and new features will roll in as they are&amp;nbsp;needed.&lt;/p&gt; &lt;p&gt;Having considered the above criteria, I started to think what parameters help one think his/her way out of these situations. I mean one needs to plan what to do first, and he/she should find a way to keep everyone happy. After all, technical managers don't like setbacks and delays and product managers want to be able to make promises to customers (and possibly meet those promises). One possible guide to find what to tackle first is to determine&amp;nbsp;business value of each change. Most likely many changes do not have an immediate business value; therefore, they should be given a lower priority.&amp;nbsp;Changes that possibly take a long time should be broken into smaller parts that can be finished in a shorter time, even if this will make&amp;nbsp;the whole thing take longer. My point here is that business people do NOT care how perfect a code is, but they seriously appreciate seeing something that works but is a little slow or doesn't have A or B. This is something that developers don't usually understand. &lt;/p&gt; &lt;p&gt;I will try to give an example of how I think things should be in another entry. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-4516194701814275308?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/4516194701814275308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=4516194701814275308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4516194701814275308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4516194701814275308'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/09/business-value.html' title='Business Value'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-3176903132045070875</id><published>2007-08-27T21:10:00.001-05:00</published><updated>2007-08-27T21:10:48.254-05:00</updated><title type='text'>+1 for Java Closures</title><content type='html'>&lt;p&gt;After all these years of being a successful nerd I feel like I have been the wrong kind of nerd.&amp;nbsp;Read &lt;a href="http://codetojoy.blogspot.com/2007/08/closures-are-hot.html"&gt;this&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-3176903132045070875?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/3176903132045070875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=3176903132045070875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/3176903132045070875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/3176903132045070875'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/08/1-for-java-closures.html' title='+1 for Java Closures'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-8219640573469812834</id><published>2007-07-23T19:50:00.001-05:00</published><updated>2007-07-23T19:51:23.346-05:00</updated><title type='text'>EJB 3.1 - Initialize your application</title><content type='html'>&lt;p&gt;EJB 3.1's spec is out for community's review. It is primarily targeted to solve EJB 3 problems but among the new specs I personally like container initialization and shutdown callbacks, asynchronous stateless session bean calls and cron-like EJB timers. It also include other (great) features like stateful web services.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-8219640573469812834?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/8219640573469812834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=8219640573469812834' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/8219640573469812834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/8219640573469812834'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/07/ejb-31-initialize-your-application.html' title='EJB 3.1 - Initialize your application'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-3288716613696989556</id><published>2007-07-18T21:55:00.001-05:00</published><updated>2007-07-18T21:55:05.416-05:00</updated><title type='text'>Book</title><content type='html'>&lt;p&gt;A good friend of mine recommended me to read &lt;a href="http://www.amazon.ca/Getting-Yes-Negotiating-Agreement-Without/dp/0140157352/ref=sr_1_2/701-8601819-3303545?ie=UTF8&amp;amp;s=books&amp;amp;qid=1184813451&amp;amp;sr=8-2"&gt;this&lt;/a&gt;. I do recommend&amp;nbsp;reading it&amp;nbsp;for people with no so amazing negotiation skills&amp;nbsp;:) &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-3288716613696989556?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/3288716613696989556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=3288716613696989556' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/3288716613696989556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/3288716613696989556'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/07/book.html' title='Book'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-8051794155145774699</id><published>2007-07-18T21:41:00.001-05:00</published><updated>2007-07-18T21:41:35.097-05:00</updated><title type='text'>WebSphere vs JBoss</title><content type='html'>&lt;p&gt;At the moment of time I am working to improve an application that suffers high memory consumption. So, my basic choice is to profile application with WebSphere (production environment), but that sucks WebSphere is slow. After a while I change to profile the application on JBoss and my life is whole easier now. However, after profiling I started observing memory allocation behavior&amp;nbsp;when the application is running in JBoss&amp;nbsp;against WebSphere. Result is that with a couple of clicks WebSphere allocated 1G memory. The same amount of clicks on JBoss will use 600M of memory and even pounding JBoss with more clicks&amp;nbsp;does not make a huge difference.&amp;nbsp;The difference might be easily the JDKs used on JBoss and WAS; JBoss was running on Sun JDK 1.4 and WAS was running on IBM JDK. I have no clue at the moment. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I also tried to use WebSphere Application Developer Suit to profile my application. At the end of the day, it just wrecked my installation. It must be me. No seriously, I haven't been patient enough to work with WebSphere recently. Maybe because JBoss is there :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-8051794155145774699?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/8051794155145774699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=8051794155145774699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/8051794155145774699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/8051794155145774699'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/07/websphere-vs-jboss.html' title='WebSphere vs JBoss'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-6834095316286519377</id><published>2007-07-05T21:16:00.001-05:00</published><updated>2007-07-05T21:16:21.767-05:00</updated><title type='text'>JProfiler 3, WebSphere 5</title><content type='html'>&lt;p&gt;JProfiler 3 wrecked WebSphere 5's installation. I still don't know what the problem is, but WAS now only starts from JProfiler. Damn! I still don't know why one should pay for WAS while there is a JBoss. Just wondering...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-6834095316286519377?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/6834095316286519377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=6834095316286519377' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/6834095316286519377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/6834095316286519377'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/07/jprofiler-3-websphere-5.html' title='JProfiler 3, WebSphere 5'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-2058278787750517684</id><published>2007-04-09T21:54:00.001-05:00</published><updated>2007-04-09T21:54:30.354-05:00</updated><title type='text'>SQL Server 2000</title><content type='html'>&lt;p&gt;May be it is the third day.... I haven't found any jdbc driver that nicely handles distributed transactions on SQL Server 2000. One says JSQLConnect is nice and expensive. &lt;/p&gt; &lt;p&gt;In any events, one point on jTDS: they say the XA data source is not production quality so a good driver is out of question. Another point, data direct's driver does not work with hibernate and SQL Server 2000 unless you disable hibernate's fetch identity values.&amp;nbsp;On top of that our application goes crazy when I use data direct jdbc driver.&amp;nbsp; The first call to create first jms table fail because it is there and the subsequent queries fail with XAER_NOTA. jTDS does not exhibit this problem. Life sucks...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-2058278787750517684?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/2058278787750517684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=2058278787750517684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/2058278787750517684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/2058278787750517684'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/04/sql-server-2000.html' title='SQL Server 2000'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-5455903710397396321</id><published>2007-03-13T21:44:00.001-05:00</published><updated>2007-03-13T21:44:29.225-05:00</updated><title type='text'>JBossWeb, Tomcat and Apache...</title><content type='html'>&lt;p&gt;JBossWeb is &lt;a href="http://labs.jboss.com/file-access/default/members/jbossweb/freezone/index.html" target="_blank"&gt;said&lt;/a&gt; to be faster when it comes to secure connections. However, my two-days-testing didn't show any significant difference on how it handles regular http connections. &lt;/p&gt; &lt;p&gt;The first day was spend on testing Tomcat against 1500 http connections, and&amp;nbsp;Tomcat reasonably handled the connections. JBossWeb did the same job with quite less CPU usage,&amp;nbsp;which was not really impressive (around 2 percent CPU usage difference, and no significant performance gain). Both Tomcat and JBossWeb crapped out when bombarded with too many connections on the same hardware. In this test JBoss crashed with a running out of native threads errors message, and Tomcat did not throw any exception but it did not respond to any other request.&lt;/p&gt; &lt;p&gt;The second day was spend on configuring Apache to accept http requests, parse them into AJP1.3, and redirecting parsed requests to Tomcat. This test showed a better performance improvement, but still it was not impressive enough&amp;nbsp;(around&amp;nbsp;3 percent performance gain) for us. &lt;/p&gt; &lt;p&gt;These tests had been run with a test client we have for our &lt;a href="http://www.mjworldcup.com/"&gt;online&lt;/a&gt; game engine, and the results do not generally stand for a reasonable comparision of these technologies. I still need to see if I can tweak them so that I can get a better performance, in terms of CPU usage or speed, in our game engine.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-5455903710397396321?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/5455903710397396321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=5455903710397396321' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5455903710397396321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5455903710397396321'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/03/jbossweb-tomcat-and-apache.html' title='JBossWeb, Tomcat and Apache...'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-4643736734242231084</id><published>2007-03-08T21:03:00.001-05:00</published><updated>2007-03-08T21:03:37.842-05:00</updated><title type='text'>Java 7</title><content type='html'>&lt;p&gt;I am nervous to see where &lt;a href="http://blogs.sun.com/ahe/resource/java-se-7-EclipseCon-2007.pdf"&gt;this&lt;/a&gt; is going...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-4643736734242231084?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/4643736734242231084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=4643736734242231084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4643736734242231084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4643736734242231084'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/03/java-7.html' title='Java 7'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-4149457002705901234</id><published>2007-03-07T19:03:00.001-05:00</published><updated>2007-03-07T19:03:52.334-05:00</updated><title type='text'>JBoss JMX and remote monitoring</title><content type='html'>&lt;p&gt;Java 5 comes with a nice monitoring console, &lt;a href="http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html"&gt;JConsole&lt;/a&gt;, which is able to connect localy/remotely to a Java program and tell you basic stuffs about the program. This will require an application to start with&amp;nbsp;a -Dcom.sun.management.jmxremote parameter. How easy!&amp;nbsp;However, this parameter forces the JVM to start an MBeanServer. Well, so far so good, but&amp;nbsp;I tried to use this with JBoss and boom! The JBoss didn't start up successfully. Actually, It was our application that fell apart. Why?&lt;/p&gt; &lt;p&gt;Our application uses Spring to manage its in-container beans. We also use MBeanProxyFactory to get a reference to the MBeans defined within JBoss deployment descriptors. The problem here is that MBeanProxyFactory looks up in the first MBeanServer it finds and ignores the others. It's more likely that this MBeanServer is not the JBoss MBeanServer one when JBoss is started with the monitoring paramter.&amp;nbsp;&lt;/p&gt; &lt;p&gt;Today I dug up the whole internet for a solution, and&amp;nbsp;it&amp;nbsp;seriously&amp;nbsp;took me a long time to&amp;nbsp;find a solution. First, I started to define a server connection factory but I couldn't find the right service&amp;nbsp;url for the JBoss JMX. The more I tried the less I found :(&amp;nbsp;However, I happened to see a post in spring forums on a similar problem, and it turned out that JBoss has a utility class that gives you access to its MBeanServer. So, the solution for now is to use a base bean for all other proxied mbeans, and set the server:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&amp;lt;bean id=&lt;span class="str"&gt;"baseMBeanProxyFactory"&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;"org.springframework.jmx.access.MBeanProxyFactoryBean"&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt;=&lt;span class="str"&gt;"true"&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;property name=&lt;span class="str"&gt;"server"&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;bean &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;"org.jboss.mx.util.MBeanServerLocator"&lt;/span&gt; factory-method=&lt;span class="str"&gt;"locateJBoss"&lt;/span&gt;/&amp;gt;&lt;br /&gt;    &amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;  &lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This works fine, but it would be easier to specify which MBeanServer should be queried for an MBean lookup.&amp;nbsp;I have&amp;nbsp;&lt;a href="http://opensource.atlassian.com/projects/spring/browse/SPR-3240?page=all"&gt;requested&lt;/a&gt; Spring people to add a new property to the MBeanProxyFactory.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;ps. For the ones who are still wondering what the JBoss MBeanServer is called, it is 'jboss'.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-4149457002705901234?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/4149457002705901234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=4149457002705901234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4149457002705901234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/4149457002705901234'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/03/jboss-jmx-and-remote-monitoring.html' title='JBoss JMX and remote monitoring'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-53073235976992039</id><published>2007-02-26T23:20:00.001-05:00</published><updated>2007-02-26T23:20:51.944-05:00</updated><title type='text'>Java 7, a new Java?</title><content type='html'>&lt;p&gt;Apparently serious discussions are taken on the&amp;nbsp;new Java language syntaxes. To me, most changes and enhancements help with the repeating code one developes in a daily Java coding. For example, we are all used to code single-method-anonymous-classes, which in a way resemble&amp;nbsp;what&amp;nbsp;C method pointers do. However, it doesn't look great to have all that class code while you only need a method. &lt;a href="http://docs.google.com/Doc?id=ddhp95vd_0f7mcns" target="_blank"&gt;FCM&lt;/a&gt; addresses this in its entirety. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;More on this is happening at &lt;a href="http://www.javac.info"&gt;www.javac.info&lt;/a&gt;. The latest &lt;a href="http://www.javac.info/closures-v05.html"&gt;Closures for the Java Programing Language&lt;/a&gt; explains how new literals and syntaxes can be put together to eliminate huge piles of repeated Java codes. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;One good side of this is that all these new literals and syntaxes&amp;nbsp;are translated to the existing ones, which means they will be translated into the same binary code. Nonetheless, I am not sure how this will effect code maintainability. At the same time, one could expect all sort of magical refactoring tools with Extract to Code Template bla bla to come out.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;My take, we will be soon experiencing a new Java.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-53073235976992039?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/53073235976992039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=53073235976992039' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/53073235976992039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/53073235976992039'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/02/java-7-new-java.html' title='Java 7, a new Java?'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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-5982105530359725850.post-5056967849161132291</id><published>2007-02-23T01:09:00.001-05:00</published><updated>2007-02-23T01:09:41.059-05:00</updated><title type='text'>private members, are they private?</title><content type='html'>&lt;p&gt;Today I was to this Seam presentation by &lt;a href="http://www.nofluffjuststuff.com/speaker_view.jsp?speakerId=4"&gt;David Geary&lt;/a&gt;, and it was the first time I was actually seeing an EJB 3 code in which I pointed out Seam is magically (k, I mean using reflection) setting private members of a bean class. This was the first time I had to think if that is actually possible. Guess what? Yes it is possible. &lt;/p&gt; &lt;p&gt;Consider this example:&lt;/p&gt; &lt;table cellspacing="1" cellpadding="1" bgcolor="#eeeeee" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;package&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; test;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;public&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;class&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; TestClass {&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;private&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;int&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: #0000c0; font-family: 'Courier New'"&gt;a&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; = 2;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;public&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;void&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; printA()&lt;br&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;/span&gt;&lt;em&gt;&lt;span style="font-size: 10pt; color: #0000c0; font-family: 'Courier New'"&gt;out&lt;/span&gt;&lt;/em&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;.println(&lt;/span&gt;&lt;span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'"&gt;"&amp;gt;&amp;gt; a ="&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; + &lt;/span&gt;&lt;span style="font-size: 10pt; color: #0000c0; font-family: 'Courier New'"&gt;a&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;);&lt;br&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;TestClass has a private in member and a method to print the private data out. My goal is to access this private memeber's value through reflection. A quick and dirty try to do so would be a code like this: &lt;/p&gt; &lt;table cellspacing="1" cellpadding="1" bgcolor="#eeeeee" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;import&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; java.lang.reflect.Field;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;public&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;class&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; TestReflection {&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;public&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;static&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;void&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; main(String[] args) &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;throws&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TestClass t = &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;new&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; TestClass();&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.printA();&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field a = t.getClass().getDeclaredField(&lt;/span&gt;&lt;span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'"&gt;"a"&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;);&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.setInt(t, 14);&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.printA();&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;Running this will run into a &lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;java.lang.IllegalAccessException&lt;/span&gt;&lt;span style="color: black"&gt; &lt;/span&gt;exception, which is what you would expect. However, the trick to access a private member's value is to set its accessibility. The Field class has a setAccessible method by which you can tell the VM I want to set this field's value. So, adding a single line to the same code will do the job:&lt;/p&gt; &lt;table cellspacing="1" cellpadding="1" bgcolor="#eeeeee" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;import&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; java.lang.reflect.Field;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;public&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;class&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; TestReflection {&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;public&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;static&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;void&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; main(String[] args) &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;throws&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TestClass t = &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'"&gt;new&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt; TestClass();&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.printA();&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field a = t.getClass().getDeclaredField(&lt;/span&gt;&lt;span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'"&gt;"a"&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;);&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;a.setAccessible(true); &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.setInt(t, 14);&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New'"&gt; &lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.printA();&lt;/span&gt;&lt;br&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: black; font-family: 'Courier New'"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;Installing a security manager will prevent setting a field's accessiblity. However, you still have the option to let a specific code base do it. Yes, I am talking about security policy files. In other words, there is ways to get around this anyways.&lt;/p&gt; &lt;p&gt;In any events, I am not sure if this is only my illusion that private fields are not really private or there is a way to secure private values. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982105530359725850-5056967849161132291?l=kohantorabi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kohantorabi.blogspot.com/feeds/5056967849161132291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982105530359725850&amp;postID=5056967849161132291' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5056967849161132291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982105530359725850/posts/default/5056967849161132291'/><link rel='alternate' type='text/html' href='http://kohantorabi.blogspot.com/2007/02/private-members-are-they-private.html' title='private members, are they private?'/><author><name>Farzad Kohantorabi</name><uri>http://www.blogger.com/profile/08825746272666780099</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>
