<?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-553221722267922856</id><updated>2012-02-16T00:52:21.460-08:00</updated><category term='Java'/><title type='text'>seeing is believing</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://seeingfuture.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://seeingfuture.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sergey Tyulkin</name><uri>http://www.blogger.com/profile/12913732887271390463</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/__q0vnt7ed-E/SKq0ts4VxaI/AAAAAAAAAAQ/IaYrJ7YQQ4I/S220/a_af8a23e7.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-553221722267922856.post-979130933970436503</id><published>2008-08-19T04:56:00.000-07:00</published><updated>2008-08-19T05:12:10.448-07:00</updated><title type='text'>Book Review: The Essential Guide to Flex 3 by Charles E. Brown</title><content type='html'>I am quite interested in RIA, and trying to get in touch with the latest trends in this technology. I decided to start reading something about Flex, but now I think i get a wrong book - "The essential guide to Flex 3" by Charles E. Brown.&lt;br /&gt;I am a java developer and my experience in web application development is good, but this book is aimed mostly to the juniors or below-middle level programmes, also, it's not a book for "corporate" programmers really, it's more a book for small-level sites and home applications.&lt;br /&gt;I really like books, when you develop one application through the whole book, constantly adding new features and refactoring existing code. This book is not of this style. Each chapter uses its own small application, and this application is really small - 2-3 pages (or tabs, or windows) at most.&lt;br /&gt;I also like when programming book has some academic material, such as language syntaxis, or application structure, or design patterns stuff etc. Again, it's not this kind of books. &lt;br /&gt;There good parts also about this book:&lt;br /&gt; - The code in the book is really working&lt;br /&gt; - Some sophisticated topics are discussed (like Drag'n'Drop) in good details&lt;br /&gt; - There's an expanding points, like AIR chapter&lt;br /&gt; - There are instructions about how to use Flex with different server-side technologies - PHP, J2EE, Coldfusion&lt;br /&gt;Finally, here's &lt;a href="http://www.amazon.com/Essential-Guide-Flex/dp/1590599500/ref=sr_11_1?ie=UTF8&amp;qid=1219147072&amp;sr=11-1"&gt;a link to the book on the Amazon&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/553221722267922856-979130933970436503?l=seeingfuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://seeingfuture.blogspot.com/feeds/979130933970436503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=553221722267922856&amp;postID=979130933970436503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/979130933970436503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/979130933970436503'/><link rel='alternate' type='text/html' href='http://seeingfuture.blogspot.com/2008/08/book-review-essential-guide-to-flex-3.html' title='Book Review: The Essential Guide to Flex 3 by Charles E. Brown'/><author><name>Sergey Tyulkin</name><uri>http://www.blogger.com/profile/12913732887271390463</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/__q0vnt7ed-E/SKq0ts4VxaI/AAAAAAAAAAQ/IaYrJ7YQQ4I/S220/a_af8a23e7.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-553221722267922856.post-2096092939092142709</id><published>2008-07-22T07:44:00.000-07:00</published><updated>2008-07-22T08:03:51.645-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Why Class&lt;T&gt; is parameterized?</title><content type='html'>Generics are not an easy concept in the Java language, escpecially when you are dealing with some sofisticated wildcards, but still you can grasp this concept in quite a short time. There's even a more difficult task - understand why the developers of the language choose some implementation over another, or introduced parameters in some classes.&lt;br /&gt;Let's take the Class class. It is not a container, so it is not evident from the first sight, why do we have a parameter here. You start getting "Class is a raw type. References to generic type Class&lt;T&gt; should be parameterized." warnings everywhere, and replacing those Class variable with Class&amp;lt;?&gt; looks no good. So - why did they do it?&lt;br /&gt;The best answer to such questyions is to look at the source code, and find references to the parameter. Almost instantly you'll see, that the newInstance() method returns now T, which gives us a very powerful premise to create object factories with strong typing. Like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public static &amp;lt;T&gt; Collection&lt;T&gt; select(Class&amp;lt;T&gt; c, int times) { &lt;br /&gt;  Collection&amp;lt;T&gt; result = new ArrayList&amp;lt;T&gt;();&lt;br /&gt;  for (int i=0; i&amp;lt;times; i++) { &lt;br /&gt;    T item = c.newInstance(); &lt;br /&gt;    result.add(item);&lt;br /&gt;  } &lt;br /&gt;  return result; &lt;br /&gt;} &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This example is oversimplified, but you should already see, what a gift we've got here!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/553221722267922856-2096092939092142709?l=seeingfuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://seeingfuture.blogspot.com/feeds/2096092939092142709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=553221722267922856&amp;postID=2096092939092142709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/2096092939092142709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/2096092939092142709'/><link rel='alternate' type='text/html' href='http://seeingfuture.blogspot.com/2008/07/why-class-is-parameterized.html' title='Why Class&amp;lt;T&gt; is parameterized?'/><author><name>Sergey Tyulkin</name><uri>http://www.blogger.com/profile/12913732887271390463</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/__q0vnt7ed-E/SKq0ts4VxaI/AAAAAAAAAAQ/IaYrJ7YQQ4I/S220/a_af8a23e7.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-553221722267922856.post-7120053304427810737</id><published>2008-06-09T11:58:00.000-07:00</published><updated>2008-06-09T12:38:01.093-07:00</updated><title type='text'>Struts 2 Zero Configuration issues</title><content type='html'>I've been working with a Struts 2 application recently. It's a great framework, escpecially compared to the Struts 1. Some of its features are really catching eye, and on of the is Zero Configuration. You simply add such snippet in you web.xml&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;filter&gt;&lt;br /&gt;  &amp;lt;filter-name&gt;&lt;br /&gt;    struts2&lt;br /&gt;  &amp;lt;/filter-name&gt;&lt;br /&gt;  &amp;lt;filter-class&gt;&lt;br /&gt;    org.apache.struts2.dispatcher.FilterDispatcher&lt;br /&gt;  &amp;lt;/filter-class&gt;&lt;br /&gt;  &amp;lt;init-param&gt;&lt;br /&gt;   &amp;lt;param-name&gt;actionPackages&amp;lt;/param-name&gt;&lt;br /&gt;   &amp;lt;param-value&gt;&lt;br /&gt;     com.my.acme.application.action&lt;br /&gt;   &amp;lt;/param-value&gt;&lt;br /&gt;  &amp;lt;/init-param&gt;&lt;br /&gt;&amp;lt;/filter&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and voila - all actions (if they end with Action or implement/extend some Struts 2 classes/interfaces) inside this package are parsed and added to the Struts configuration.&lt;br /&gt;There was one particular action, which I preferred to define in the struts.xml. Sometimes it worked, sometimes didn't. The action class name ended with Action, and this was the source of my problems - sometimes it was recognized by the Zero Configuration, and sometimes - by the Struts 2 XML configuration. The behaviour was not consistent, and I couldn't find exact steps to reproduce the problem, but once I moved the Action to another package it started working properly all the time.&lt;br /&gt;&lt;br /&gt;I hope they will fix it sometime in future, and overall, they warn the developers with "Zeror Configuration is an experimantal feature" message, so I will definetely continue keep an eye on this framework&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/553221722267922856-7120053304427810737?l=seeingfuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://seeingfuture.blogspot.com/feeds/7120053304427810737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=553221722267922856&amp;postID=7120053304427810737' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/7120053304427810737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/7120053304427810737'/><link rel='alternate' type='text/html' href='http://seeingfuture.blogspot.com/2008/06/struts-2-zero-configuration-issues.html' title='Struts 2 Zero Configuration issues'/><author><name>Sergey Tyulkin</name><uri>http://www.blogger.com/profile/12913732887271390463</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/__q0vnt7ed-E/SKq0ts4VxaI/AAAAAAAAAAQ/IaYrJ7YQQ4I/S220/a_af8a23e7.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-553221722267922856.post-2639356593185025844</id><published>2008-05-30T03:41:00.000-07:00</published><updated>2008-05-30T03:54:50.487-07:00</updated><title type='text'>Programming to Interfaces Buy me Something. For sure</title><content type='html'>Today I've read a post from Ben Northrop - &lt;a href="http://www.bennorthrop.com/Essays/2008/program-to-interface-not-implementation.php"&gt;Does Programming to Interfaces Buy Us Anything?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I really understand, that interfaces hurt sometime. And many of us use because of these "reduced coupling, maintainability and testability" features. But there are numerous examples of interfaces usage, which you can dind useful every day:&lt;br /&gt;1) It is very common to switch from JDBC DAO to a Hibernate DAO and conversely, for performance gains, or ad-hoc SQL. Or, from Hibernate to iBATIS, for reporting methods.&lt;br /&gt;2) Though you can generate proxies for classes, they are not easy to test and debug. Let's take a simple ubiquitous example - transactional facade, defined via Spring's interceptor. When you proxy with CGLIB you can end up with stacktrace without source code line information. And you couldn't step through the code, because "source is not found". This can be an IDE limitation, but with interfaces thing are much better.&lt;br /&gt;3) Mock frameworks are not a panacea. Sometimes you need to create mock yourself.&lt;br /&gt;4) Miss F3 in Eclipse for interfaces? Use Ctrl+T!&lt;br /&gt;&lt;br /&gt;I can found more practical examples of interface benefits, but they already buy me a lot during my daily work as a developer&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/553221722267922856-2639356593185025844?l=seeingfuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://seeingfuture.blogspot.com/feeds/2639356593185025844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=553221722267922856&amp;postID=2639356593185025844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/2639356593185025844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/2639356593185025844'/><link rel='alternate' type='text/html' href='http://seeingfuture.blogspot.com/2008/05/programming-to-interfaces-buy-me.html' title='Programming to Interfaces Buy me Something. For sure'/><author><name>Sergey Tyulkin</name><uri>http://www.blogger.com/profile/12913732887271390463</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/__q0vnt7ed-E/SKq0ts4VxaI/AAAAAAAAAAQ/IaYrJ7YQQ4I/S220/a_af8a23e7.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-553221722267922856.post-8332417271145098597</id><published>2008-05-28T04:37:00.000-07:00</published><updated>2008-05-28T04:56:58.122-07:00</updated><title type='text'>Beware of hidden autoboxing features</title><content type='html'>Not so long ago I was asked on some interview - "Can you provide an example of an assignment operation, which causes a Runtime Exception". I started thinking about different casts, but couldn't find such example (though I passed the interview).&lt;br /&gt;I haven't been working closely with Java 5 at those days. I heard and tried all those enums, generics, extended for and so on, but I haven't used this features in a real project.&lt;br /&gt;Now I am involved in such Java 5 project, and recently I was fighting with some obscure exception, which unidentifiable cause and null stacktrace. It looked like this:&lt;br /&gt;InvocationTargetException caused by NullPointerException: null. As all projects now, we are using all those proxies, CGLIB, interceptors etc, but anyway why no stacktrace??&lt;br /&gt;Finally I found the reason. It was an autoboxing usage. The simplest possible example will look like this:&lt;br /&gt;&lt;br /&gt;Boolean b = null;&lt;br /&gt;//do something&lt;br /&gt;boolean a = b;&lt;br /&gt;&lt;br /&gt;The comparison operator will throw a NullPointerException. Looks very simple, if you already knew this; and if you run a search query "NullPointerException autoboxing" yuo find numerous results. But if you cannot link this NPE with that autoboxing usage, you can spend a day fighting with it, like I did.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/553221722267922856-8332417271145098597?l=seeingfuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://seeingfuture.blogspot.com/feeds/8332417271145098597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=553221722267922856&amp;postID=8332417271145098597' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/8332417271145098597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/553221722267922856/posts/default/8332417271145098597'/><link rel='alternate' type='text/html' href='http://seeingfuture.blogspot.com/2008/05/beware-of-hidden-autoboxing-features.html' title='Beware of hidden autoboxing features'/><author><name>Sergey Tyulkin</name><uri>http://www.blogger.com/profile/12913732887271390463</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://4.bp.blogspot.com/__q0vnt7ed-E/SKq0ts4VxaI/AAAAAAAAAAQ/IaYrJ7YQQ4I/S220/a_af8a23e7.jpg'/></author><thr:total>0</thr:total></entry></feed>
