<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Techtracer &#187; Featured</title>
	<atom:link href="http://techtracer.com/category/featured/feed/" rel="self" type="application/rss+xml" />
	<link>http://techtracer.com</link>
	<description>Tracing the course of Web Technology</description>
	<lastBuildDate>Tue, 06 Jan 2009 12:14:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://techtracer.com</link>
  <url>http://techtracer.com/wp-includes/images/favicon.png</url>
  <title>Techtracer</title>
</image>
		<item>
		<title>The Great Hibernate Tutorial &#8211; a great jump start for beginners</title>
		<link>http://techtracer.com/2008/12/30/the-great-hibernate-tutorial-a-great-jump-start-for-beginners/</link>
		<comments>http://techtracer.com/2008/12/30/the-great-hibernate-tutorial-a-great-jump-start-for-beginners/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 05:42:17 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Beginner tutorial for hibernate]]></category>
		<category><![CDATA[Hibernate Tutorial]]></category>
		<category><![CDATA[steps for hibernate setup]]></category>

		<guid isPermaLink="false">http://techtracer.com/?p=278</guid>
		<description><![CDATA[Hibernate has become the de-facto ORM (Object Relational Mapping) framework for most of the organizations today. It provides a very simple framework to overcome the cumbersome techniques involved with core JDBC implementations. Whenever there is a project based on database intrinsic activities it is advisable to use Hibernate than do JDBC coding. It saves a [...]]]></description>
			<content:encoded><![CDATA[<p>Hibernate has become the de-facto <strong>ORM</strong> (<a href="http://en.wikipedia.org/wiki/Object-relational_mapping" target="_blank">Object Relational Mapping</a>) framework for most of the organizations today. It provides a very simple framework to overcome the cumbersome techniques involved with core <strong>JDBC</strong> implementations. Whenever there is a project based on database intrinsic activities it is <strong>advisable</strong> to use Hibernate than do JDBC coding. It saves a huge amount of time revolving around unnecessary chores. </p>
<p>Having said that, the major question which strikes anyone who does majorly JDBC is that how does a Hibernate DAO layer look like. Without looking at a practical implementation one cannot be easily convinced to work on it. This is the only compelling reason why I intended to write <strong>The</strong> <strong>Great Hibernate Tutorial</strong>.</p>
<p>This tutorial is aimed at those developers who want to get a<strong> </strong>quick breifing on <strong>how to implement a DAO layer using Hibernate</strong>. This tutorial does not cover the basics of ORM nor a detailed explanation of Hibernate configurations or api. It follows on the same route as the <a href="http://techtracer.com/2007/04/16/the-great-ant-tutorial-a-great-jump-start/" target="_self">Great Ant tutorial</a> which many readers liked.</p>
<p><strong>5 Steps to Designing a DAO in Hibernate:</strong></p>
<ol>
<li> Identify the tables which are required as entities in your project</li>
<li>Create the Hibernate Configuration file</li>
<li>Create the Hibernate entity mapping files (hbm) and entity classes</li>
<li>Make the DAO layer with the required functions</li>
<li>Test the DAO classes</li>
</ol>
<p><strong>Required Softwares</strong></p>
<p>The versions of the various open source software&#8217;s required for the implementation are</p>
<ul>
<li><a href="http://dev.mysql.com/downloads/mysql/5.1.html#win32" target=_blank>MySQL 5.0.5 for Windows</a></li>
<li><a href="http://dev.mysql.com/downloads/connector/j/5.0.html" target=_blank>MySQL ConnectorJ</a></li>
<li><a href="http://www.hibernate.org/6.html#A2" target=_blank>Hibernate Core 3.0</a></li>
<li><a href="http://java.sun.com/javase/downloads/index.jsp" target=_blank>JDK 1.5 or above</a></li>
<li><a href="http://www.eclipse.org/downloads/" target=_blank>Eclipse 3.3 or above</a></li>
</ul>
<p>So lets get going with<strong> the Great Hibernate Tutorial</strong>. The steps will explain you the specific details from the code while the actual code is present in the format of links at the <a href="#resources">bottom of this tutorial</a>. You can open the links in different tabs of your browser and then start reading the tutorial for getting a better understanding.</p>
<p><strong>Step 1. Identify the tables which are required as entities in your project</strong></p>
<p>For the tutorial I am designing a basic<strong> Attendance System</strong> for a company which currently has only two tables <strong>Employee</strong> and <strong>Dept</strong>. If your MySQL is not setup at the moment you may visit the tutorial on <a href="http://techtracer.com/2008/06/09/3-easy-steps-to-install-mysql-on-windows-xp/" target="_self">how to setup Mysql in windows XP</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">&nbsp;
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #008000;">`employee`</span> <span style="color: #FF00FF;">&#40;</span>                                                                                       
            <span style="color: #008000;">`psno`</span> <span style="color: #999900; font-weight: bold;">int</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">11</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #008000;">'0'</span><span style="color: #000033;">,</span>                                                                          
            <span style="color: #008000;">`name`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>                                                                              
            <span style="color: #008000;">`pass`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>                                                                              
            <span style="color: #008000;">`proj<span style="color: #008080; font-weight: bold;">_</span>cd`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">45</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>                                                                               
            <span style="color: #008000;">`dept<span style="color: #008080; font-weight: bold;">_</span>name`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">45</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>                                                                             
            <span style="color: #990099; font-weight: bold;">PRIMARY KEY</span>  <span style="color: #990099; font-weight: bold;">USING</span> <span style="color: #990099; font-weight: bold;">BTREE</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`psno`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>                                                                            
            <span style="color: #990099; font-weight: bold;">KEY</span> <span style="color: #008000;">`FK<span style="color: #008080; font-weight: bold;">_</span>employee<span style="color: #008080; font-weight: bold;">_</span>newfk`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`proj<span style="color: #008080; font-weight: bold;">_</span>cd`</span><span style="color: #000033;">,</span><span style="color: #008000;">`dept<span style="color: #008080; font-weight: bold;">_</span>name`</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>                                                              
            <span style="color: #990099; font-weight: bold;">CONSTRAINT</span> <span style="color: #008000;">`employee<span style="color: #008080; font-weight: bold;">_</span>ibfk<span style="color: #008080; font-weight: bold;">_</span>1`</span> <span style="color: #990099; font-weight: bold;">FOREIGN KEY</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`proj<span style="color: #008080; font-weight: bold;">_</span>cd`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`dept<span style="color: #008080; font-weight: bold;">_</span>name`</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">REFERENCES</span> <span style="color: #008000;">`dept`</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`PROJ<span style="color: #008080; font-weight: bold;">_</span>CD`</span><span style="color: #000033;">,</span> <span style="color: #008000;">`DEPT<span style="color: #008080; font-weight: bold;">_</span>NAME`</span><span style="color: #FF00FF;">&#41;</span>  
          <span style="color: #FF00FF;">&#41;</span> 
&nbsp;
&nbsp;
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #008000;">`dept`</span> <span style="color: #FF00FF;">&#40;</span>                   
          <span style="color: #008000;">`PROJ<span style="color: #008080; font-weight: bold;">_</span>CD`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">45</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>       
          <span style="color: #008000;">`DEPT<span style="color: #008080; font-weight: bold;">_</span>NAME`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">45</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>     
          <span style="color: #008000;">`START<span style="color: #008080; font-weight: bold;">_</span>DATE`</span> <span style="color: #999900; font-weight: bold;">date</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>       
          <span style="color: #008000;">`TYPE`</span> <span style="color: #999900; font-weight: bold;">varchar</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">45</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">default</span> <span style="color: #9900FF; font-weight: bold;">NULL</span><span style="color: #000033;">,</span>      
          <span style="color: #990099; font-weight: bold;">PRIMARY KEY</span>  <span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`PROJ<span style="color: #008080; font-weight: bold;">_</span>CD`</span><span style="color: #000033;">,</span><span style="color: #008000;">`DEPT<span style="color: #008080; font-weight: bold;">_</span>NAME`</span><span style="color: #FF00FF;">&#41;</span>  
        <span style="color: #FF00FF;">&#41;</span></pre></div></div>

<p>The Employee and Dept have a one to many relationship. From the DDL it is evident that Dept table has composite keys. Usually <a href="http://codebetter.com/blogs/jeremy.miller/archive/2007/02/01/Composite-keys-are-evil.aspx" target="_blank">composite keys are considered evil</a> , but I am using it just for the sake of presenting a use case of <strong>configuring composite keys in hibernate</strong>.</p>
<p><strong>Step 2. Create the Hibernate Configuration file </strong></p>
<p>The Hibernate configuration file is where you provide all the connection level details. It is very straightforward configuration and appears similar to your JDBC connection statements. But unlike JDBC, you can specify many more things here like <strong>caching, dialects, debug queries</strong>. One important aspect of this configuration file is providing path of <strong>hbm</strong> files. Check the following two line of XML.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mapping</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;com/abc/entities/Employee.hbm.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>     
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mapping</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;com/abc/entities/Dept.hbm.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>These lines are important. They specify the paths to your entity mapping files. Entity mapping files are those <strong>XML files</strong> which tell hibernate as to how the entity classes relate to the tables. It defines how the data should flow from class properties to the table columns. But you have to be careful in mentioning the <strong>paths</strong> to the mapping files. It is not required that the files be kept in the packages as I have done but it is considered a convention.</p>
<p><strong>Step 3. Create the Hibernate entity mapping files (hbm) and entity classes</strong></p>
<p>In this step we would be actually defining the <strong>mapping</strong>. I have kept all the entities in the package <strong>com.abc.entities</strong> along with the mapping files. The first element is obvious <em>&lt;hibernate-mapping&gt;</em>. Within this element you would most of the times define 3 elements: Class, ID and Property.</p>
<p><strong>Class</strong> &#8211; the class for which mapping to the table is being defined</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;class</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;com.abc.entities.Employee&quot;</span> <span style="color: #000066;">table</span>=<span style="color: #ff0000;">&quot;employee&quot;</span> <span style="color: #000066;">lazy</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></div></div>

<p>One extra attribute of the element you would notice is lazy=&#8221;false&#8221;. This is the lazy loading technique of ORM the details of which are beyond the scope of this tutorial. You may even not mention it.</p>
<p><strong>ID &#8211; Primary key</strong> is an absolute must in hibernate mapped tables. Primary Keys are mapped to ID as follows</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;psno&quot;</span> <span style="color: #000066;">column</span>=<span style="color: #ff0000;">&quot;psno&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;generator</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;assigned&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><strong>Generator </strong>means how the primary key is populated. If it was <strong>auto generated</strong> in the table then the value should have been &#8220;<strong>auto</strong>&#8220;. The value &#8220;<strong>assigned</strong>&#8221; means we will set it in the application itself. In case of Dept, since composite key exists we should define it as</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;composite-id</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;deptPK&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.abc.entities.DeptPK&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key-property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;projCode&quot;</span> <span style="color: #000066;">column</span>=<span style="color: #ff0000;">&quot;PROJ_CD&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key-property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;deptName&quot;</span> <span style="color: #000066;">column</span>=<span style="color: #ff0000;">&quot;DEPT_NAME&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/composite-id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><strong>Property</strong> &#8211; These are columns which would be made as properties having getters and setters in the class definition</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>this would map name property of Employee class to the name column of employee table.</p>
<p><span style="text-decoration: underline;"><strong>Associations in Hibernate</strong></span></p>
<p>The above 3 are majorly used. Apart from that you can also mention <strong>cardinality mapping</strong> if required as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;many-to-one</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dept&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.abc.entities.Dept&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;proj_cd&quot;</span> <span style="color: #000066;">not-null</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dept_name&quot;</span> <span style="color: #000066;">not-null</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/many-to-one<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Since I have a <strong>composite key</strong> in Dept table I have mentioned two columns in the above mapping. This mapping can be read as &#8220;<em>MANY Employees are related TO ONE Dept with help of COLUMNS proj_cd and dept_name</em>&#8220;. These mappings are called as <strong>Associations </strong>in hibernate.</p>
<p>In the Dept mapping file since one dept can return <strong>multiple</strong> Employees, they would be returned in the form of a<strong> set</strong>. Hence we would have to map the set of Employee as:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;set</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;employees&quot;</span> <span style="color: #000066;">inverse</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;proj_cd&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dept_name&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;one-to-many</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.abc.entities.Employee&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/set<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The<strong> inverse=&#8221;true&#8221;</strong> says that the association is <strong>bidirectional</strong> which is another important concept in hibernate. In a bidirectional relationship you can reach an associated element from within one element and same applies the other way too. On the contrary you may even have <strong>unidirectional</strong> relationship in which you don&#8217;t specify mapping in the other classes.</p>
<p><span style="text-decoration: underline;"><strong>Defining Entity classes</strong></span></p>
<p>This is straight forward. Entity classes are simple <a href="http://en.wikipedia.org/wiki/JavaBeans" target="_blank">Java Beans</a>. You can view the class definition in the links provided at the bottom of this post. A <strong>no argument public constructor </strong>is a must in case you define a custom one.</p>
<p>One special case here would be for composite keys. Composite keys are defined in a <strong>separate class</strong>. After this, In the class where composite keys are required you would have to make a property of the composite-class-type.</p>
<p><strong>Step 4. Make the DAO layer with the required functions</strong></p>
<p>Finally we are the moment of salvation. The thing which we were waiting eagerly for implementing. The DAO layer. It is always a good practice to make a separate DAO class for holding utility functions. Hibernate requires that you always open a <strong>session</strong> before accessing the database and making <strong>transactions </strong>when you update the database. This requires repeatable lines of code.</p>
<p>So in order to avoid repeating ourselves its better to keep these lines of code in a DAO class as shown in the links below. Check for <em><strong>com.abc.dao.DAO.java</strong></em>. You may use the class as it is since it is a routine code. For coding your own classes to make use of the utility functions in the DAO extend your class with this <em><strong>DAO.</strong></em></p>
<p>Lets have a look at <em><strong>AdminDAO</strong></em>. Since I belive in interface based implementations I have provided <em><strong>AdminDAO</strong></em> as an interface and <em><strong>AdminDAOHibernateImpl</strong></em> as its implementation which extends <em><strong>DAO</strong></em>. The code is kept simple for understanding purposes. The things worth pondering are:</p>
<p>In functions which do an update on the tables you have to carry the following steps:</p>
<ol>
<li>begin();</li>
<li>getSession()&#8230;.; // save or update</li>
<li>commit();</li>
<li>rollback();  //in case of HibernateException and throw any custom business exception if required</li>
</ol>
<p>For fetching data you don&#8217;t need transactions so you don&#8217;t need to do the above steps. In this case you can just execute a query via the <em>getSession() </em>as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Query</span> q = getSession<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;from Employee e inner join fetch e.dept where e.psno = :psno&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
q.<span style="color: #006633;">setString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;psno&quot;</span>, psno.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Employee emp = <span style="color: #009900;">&#40;</span>Employee<span style="color: #009900;">&#41;</span> q.<span style="color: #006633;">uniqueResult</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="text-decoration: underline;"><strong>Hibernate Query Language</strong></span></p>
<p>The above query syntax is called <strong>HQL (Hibernate Query Language)</strong>. It is syntactically very similar to JDBC with the difference that HQL queries are based on objects and not on tables so the names are <strong>case sensitive</strong> and <strong>aliases</strong> to objects are a must.</p>
<p>In HQL, you can either fetch a single result when you know that there would be exactly one row fetched. When you know that mutiple records might be returned then you can fetch the list as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Query</span> q = getSession<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;from Employee&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
List<span style="color: #339933;">&lt;</span>Employee<span style="color: #339933;">&gt;</span> list = q.<span style="color: #006633;">list</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">return</span> list<span style="color: #339933;">;</span></pre></div></div>

<p><span style="text-decoration: underline;"><strong>Paging in Hibernate</strong></span></p>
<p>You can obtain paging in Hibernate very easily without any additional efforts by applying a max results criteria</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">q.<span style="color: #006633;">setFirstResult</span><span style="color: #009900;">&#40;</span>firstResult<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
q.<span style="color: #006633;">setMaxResults</span><span style="color: #009900;">&#40;</span>maxResults<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Doesn&#8217;t it feel really good. JDBC users might feel jealous at this time1</p>
<p><strong>Step 5. Test the DAO classes</strong></p>
<p>Now, to our final strike. The testing can be done with POJO&#8217;s. For the tutorial I had created a service layer since I usally access teh DAO layer through the service layer. So the testing was done on the service layer instead of the DAO as this application was small. You can however test out directly the DAO functions.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">static</span> <span style="color: #006600; font-weight: bold;">void</span> listTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
		List<span style="color: #339933;">&lt;</span>Employee<span style="color: #339933;">&gt;</span> employees = adminService.<span style="color: #006633;">getAllEmployees</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000;  font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>Employee emp: employees<span style="color: #009900;">&#41;</span>
			<span style="color: #003399; font-weight: bold;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>emp.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>AppException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003399; font-weight: bold;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>e.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Wasn&#8217;t that a breeze? I hope that it was. Once you gain a thorough knowledge of <strong>ORM concepts </strong>then you would appreciate working with <strong>Hibernate</strong> even more. For further knowledge, I would recommend you to go through the <a href="http://en.wikipedia.org/wiki/Object-Relational_impedance_mismatch" target="_blank">impedence mismatch theory</a> to know the fundamental flaws surrounding JDBC. Working with Hibernate would then be real fun.</p>
<p>Enjoy folks!<br />
<a name="resources"></a><br />
<u><strong>Resources for the tutorial</strong></u></p>
<p>The below files are required for running the above tutorial. Copy these to your eclipse project and add the required libraries of hibernate and mysql before running the project.</p>
<p><em>Configuration</em><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/hibernatecfg.xml' target=_blank>hibernate.cfg.xml</a></p>
<p><em>Package: com.abc.entities</em><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/employeejava.txt' target=_blank>com.abc.entities.Employee.java</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/employeehbm.xml' target=_blank>Employee.hbm.xml</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/deptjava.txt' target=_blank>com.abc.entities.Dept.java</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/deptpkjava.txt' target=_blank>com.abc.entities.DeptPK.java</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/depthbm.xml' target=_blank>Dept.hbm.xml</a></p>
<p><em>Package: com.abc.dao</em><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/daojava.txt' target=_blank>com.abc.dao.DAO.java</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/admindaojava.txt' target=_blank>com.abc.dao.AdminDAO.java</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/admindaohibernateimpljava.txt' target=_blank>com.abc.dao.AdminDAOHibernateImpl.java</a></p>
<p><em>Package: com.abc.service</em><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/adminservicejava.txt' target=_blank>com.abc.service.AdminService.java</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/adminserviceimpljava.txt' target=_blank>com.abc.service.AdminServiceImpl.java</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/deptservicejava.txt' target=_blank>com.abc.service.DeptService.java</a><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/deptserviceimpljava.txt' target=_blank>com.abc.service.DeptServiceImpl.java</a></p>
<p><em>Package: com.abc.exceptions</em><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/appexceptionjava.txt' target=_blank>com.abc.exceptions.AppException.java</a></p>
<p><em>Package: com.abc.tests</em><br />
<a href='http://techtracer.com/wp-content/uploads/2008/12/depttestjava.txt' target=_blank>com.abc.tests.DeptTest.java</a></p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2008/04/26/the-technique-of-virtual-deployment-in-tomcat/" rel="bookmark" title="Permanent Link: The Technique of Virtual Deployment in Tomcat">The Technique of Virtual Deployment in Tomcat</a></li><li><a href="http://techtracer.com/2007/04/16/the-great-ant-tutorial-a-great-jump-start/" rel="bookmark" title="Permanent Link: The Great Ant Tutorial &#8211; a great jump start">The Great Ant Tutorial &#8211; a great jump start</a></li><li><a href="http://techtracer.com/2008/01/09/impressive-google-chart-generator-scripts/" rel="bookmark" title="Permanent Link: Impressive Google Chart Generator Scripts">Impressive Google Chart Generator Scripts</a></li><li><a href="http://techtracer.com/2007/03/09/hello-world/" rel="bookmark" title="Permanent Link: Tracing the route of technology">Tracing the route of technology</a></li><li><a href="http://techtracer.com/2007/10/06/mozillas-new-killer-app-the-webrunner/" rel="bookmark" title="Permanent Link: Mozilla&#8217;s New Killer App &#8211; The WebRunner">Mozilla&#8217;s New Killer App &#8211; The WebRunner</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/12/30/the-great-hibernate-tutorial-a-great-jump-start-for-beginners/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Reflection in Java &#8211; Simplified</title>
		<link>http://techtracer.com/2008/11/24/reflection-in-java-simplified/</link>
		<comments>http://techtracer.com/2008/11/24/reflection-in-java-simplified/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 04:23:37 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java Reflection]]></category>
		<category><![CDATA[Java Reflection tutorial]]></category>

		<guid isPermaLink="false">http://techtracer.com/?p=276</guid>
		<description><![CDATA[There are times when you wish you had some access to the information present in your Java classes. Information, such as which fields, methods and constructors are defined in it. This information is called as the metadata of a class and there is a way in which you can access easily without doing tedious coding [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you wish you had some access to the information present in your Java classes. Information, such as which fields, methods and constructors are defined in it. This information is called as the <strong>metadata</strong> of a class and there is a way in which you can access easily without doing tedious coding or resorting to any hacks. It is called as <strong>Reflection</strong>.</p>
<p><strong>Reflection in Java</strong> is done by using using the <strong>java.lang.Class</strong> class. This class provides access to all the information within your own applications classes or even the regular java library classes. Let’s say you have a class in a package called <em>com.tt.company.Employee </em>then if you need the metadata of the Employee class you would have to first assign it to the Class as :</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Class</span> c = <span style="color: #003399; font-weight: bold;">Class</span>.<span style="color: #006633;">forName</span><span style="color: #009900;">&#40;</span>“com.<span style="color: #006633;">tt</span>.<span style="color: #006633;">company</span>.<span style="color: #006633;">Employee</span>”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="text-decoration: underline;"><strong>Accessing Fields, Methods and Constructors with Reflection</strong></span></p>
<p>If you are not sure which fields and methods are declared in a class and you don’t have access to the source code then you can easily get this information by simple looping.</p>
<p>For example, if I wanted to access the fields and methods declared in the class <em>Employe</em>e then its as simple as the below code.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Field</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> fields = c.<span style="color: #006633;">getFields</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">Method</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> methods = c.<span style="color: #006633;">getMethods</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000;  font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Field</span> f : fields<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Field: &quot;</span> + f.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000;  font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Method</span> m : methods<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Method:&quot;</span> + m.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You might get some additional methods if you use the <strong>getMethods() </strong>method. This is because, the <strong>getMethods() </strong>definition also chooses those methods which are present in any of the super classes present. In this case, if <em>Employee</em> class does not have any super class, but still it is a subclass of <em>Objec</em>t. Hence methods defined in the <em>Object</em> class would also form a part of the output.</p>
<p>In order to avoid the methods defined in the super class you should use the <strong>getDeclaredMethods()</strong> instead.</p>
<p><strong><span style="text-decoration: underline;">Note:</span></strong> An important point worth mentioning over here is that, the loop would produce only those methods or fields which are marked public. If you don’t have a public field or method it won’t be considered. In order to loop over them, use the <strong>getDelcaredFields() </strong>or <strong>getDeclaredMethods()</strong></p>
<p><span style="text-decoration: underline;"><strong>Fun Things to do with Relection in Java</strong></span></p>
<p>You can discover new techniques of programming once you feel the power of Reflection in your hands. The new techniques would include instantiation of objects dynamically, setting of values to fields and invoking methods without calling them explicitly.</p>
<p>Let’s take the case of a <strong>Singleton </strong>class into consideration for showing the true power of Reflection. For a Java novice, a singleton class is the one which has a<strong> private constructor</strong>. It isn’t practically true, but let’s assume that it is. Using reflection, this concept of singleton can be broken.</p>
<p>Here is an example of a Singleton class:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SingleCandidate <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399; font-weight: bold;">String</span> name<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">static</span> <span style="color: #006600; font-weight: bold;">int</span> counter = <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> SingleCandidate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
counter++<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Instance #&quot;</span> + counter<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> showName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>A Singleton pattern dictates that only one instance of the object must be present at a given point of time in a JVM. So now, let’s take the above Singleton class for a ride with Reflection:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #003399; font-weight: bold;">Class</span> singleton = SingleCandidate.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">Constructor</span> privateConstructor =  singleton.<span style="color: #006633;">getDeclaredConstructors</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
privateConstructor.<span style="color: #006633;">setAccessible</span><span style="color: #009900;">&#40;</span><span style="color: #006600; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//This is scary</span>
&nbsp;
SingleCandidate obj = <span style="color: #009900;">&#40;</span>SingleCandidate<span style="color: #009900;">&#41;</span> privateConstructor.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
SingleCandidate obj2 = <span style="color: #009900;">&#40;</span>SingleCandidate<span style="color: #009900;">&#41;</span> privateConstructor.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The code is self explanatory and you will realize that in this way you can easily create many instances of the possible candidate for a singleton class in the JVM. How fool proof was that?</p>
<p><span style="text-decoration: underline;"><strong>Setting Values to Private Fields!</strong></span></p>
<p>What did you learn in encapsulation? Was it making fields private and public so that private fields could be accessed only by the class in which they are declared?  Reflection can break this too.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Even more scary</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">Field</span> privateField = singleton.<span style="color: #006633;">getDeclaredField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
privateField.<span style="color: #006633;">setAccessible</span><span style="color: #009900;">&#40;</span><span style="color: #006600; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
privateField.<span style="color: #006633;">set</span><span style="color: #009900;">&#40;</span>obj, <span style="color: #0000ff;">&quot;You are not a singleton anymore&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Access private Constructor</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Accessing private Constructor: &quot;</span> + privateConstructor.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//Get a private field value</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Accessing private Field: &quot;</span> + privateField.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//Invoke a method</span>
&nbsp;
<span style="color: #003399; font-weight: bold;">Method</span> method = singleton.<span style="color: #006633;">getDeclaredMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;showName&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
method.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="text-decoration: underline;"><strong>Reflection with Generics</strong></span></p>
<p>If you have tried out the above code in Eclipse you might see some warnings for the Class or Constructor usage. The warning message will be:</p>
<blockquote><p>Class is a raw type. References to generic type Class&lt;T&gt; should be parameterized</p>
<p>Constructor is a raw type. References to generic type Constructor&lt;T&gt; should be parameterized</p></blockquote>
<p>To suppress these warnings you will have to use the generic parameter &#8220;?&#8221; as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">Class<span style="color: #339933;">&lt;?&gt;</span> singleton = SingleCandidate.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">;</span>
&nbsp;
Constructor<span style="color: #339933;">&lt;?&gt;</span> privateConstructor =  singleton.<span style="color: #006633;">getDeclaredConstructors</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The questions mark symbol is a <a href="http://java.sun.com/docs/books/tutorial/extra/generics/wildcards.html" target="_blank">wildcard type</a> used in generics. This only applies only if you using <strong>Java 5</strong> or higher versions.</p>
<p><span style="text-decoration: underline;"><strong>Uses of reflection</strong></span></p>
<p>Reflection is <strong>powerful technique</strong> when used appropriately. The major usage of reflection comes in when you are building your own framework, compilers or development tools in which you need access to the metadata of the classes created by end users. You surely might have already used the best products of Reflection without even knowing about it.</p>
<ul>
<li>JSP gets converted to Servlets using Reflection.</li>
<li>The <strong>Spring</strong> framework uses Reflection to administer the references which you declare in your s<em>pring-config.xml</em> without you explicitly instantiating any object. The whole concept of <a href="http://techtracer.com/2007/04/26/getting-started-with-ioc-a-simplified-tutorial/" target="_self">Dependency Injection (Inversion of Control)</a> is conveniently implemented with Reflection.</li>
<li>Reflection also gave birth to the concept of <strong>aspect oriented programming</strong>.</li>
</ul>
<p>Reflection is not limited just to this post and nor Reflection is used for the purpose of breaking security. This article was aimed at showing you a direction with which you can explore Reflection more and discover new principles and techniques to build better applications.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/03/28/convert-date-to-string-and-string-to-date-in-java/" rel="bookmark" title="Permanent Link: Convert Date to String and String to Date in Java">Convert Date to String and String to Date in Java</a></li><li><a href="http://techtracer.com/2007/04/26/getting-started-with-ioc-a-simplified-tutorial/" rel="bookmark" title="Permanent Link: Getting started with IoC &#8211; A simplified tutorial">Getting started with IoC &#8211; A simplified tutorial</a></li><li><a href="http://techtracer.com/2007/04/04/java-5-generics-changing-for-good/" rel="bookmark" title="Permanent Link: Java 5 Generics &#8211; Changing for good">Java 5 Generics &#8211; Changing for good</a></li><li><a href="http://techtracer.com/2006/10/15/microsoft-internet-explorer-7-nothing-special/" rel="bookmark" title="Permanent Link: Microsoft Internet Explorer 7 &#8211; Nothing Special">Microsoft Internet Explorer 7 &#8211; Nothing Special</a></li><li><a href="http://techtracer.com/2007/08/01/j2ee-or-jee-java-5-or-java-15-is-sun-crazy/" rel="bookmark" title="Permanent Link: J2EE or JEE, Java 5 or Java 1.5 &#8211; Is SUN Crazy?">J2EE or JEE, Java 5 or Java 1.5 &#8211; Is SUN Crazy?</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/11/24/reflection-in-java-simplified/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Google Chrome &#8211; What&#8217;s in it for ya?</title>
		<link>http://techtracer.com/2008/10/06/google-chrome-whats-in-it-for-ya/</link>
		<comments>http://techtracer.com/2008/10/06/google-chrome-whats-in-it-for-ya/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 11:01:50 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://techtracer.com/?p=273</guid>
		<description><![CDATA[It was hardly a matter of a blog post on the official Google blog about the release of Google Chrome Beta to get noticed. That was it. And the rest of the work was done for free by the hoards of bloggers, internet marketing experts, forum members and mailers. The intention of Google to get [...]]]></description>
			<content:encoded><![CDATA[<p>It was hardly a matter of a <a href="http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html" target="_blank">blog post</a> on the official Google blog about the release of <strong>Google Chrome</strong> Beta to get noticed. That was it. And the rest of the work was done for free by the hoards of bloggers, internet marketing experts, forum members and mailers. The intention of Google to get its browser hooked to users got its due that easily. My post too does talk on Google Chrome but I don&#8217;t intend to rant on it or praise it or even compare it with the competitors. Is it really competing enough? That might be a question to ponder about but lets for a moment bask in the glory of the success of Chrome&#8217;s beta launch. Hey, its by Google, mate.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-274" title="google_chrome_logo" src="http://techtracer.com/wp-content/uploads/2008/10/google_chrome_logo.jpeg" alt="" width="116" height="108" /></p>
<p><strong>Future Smackdown</strong></p>
<p>I am not pretty sure behind the motive of the launch however. It might have got something to do with the browser wars in particular. You see, when the giants are busy fighting a dwarf can easily run away with the bounty. If the saying is anywhere close to truth then Google Chrome just might be the next big thing we have to wait and watch. What makes me say this you might wonder. Well, Internet Explorer is busy getting decked up for its <strong>version 8 </strong>release which Microsoft must be really pushing in with its best efforts. On the other hand Firefox has had a majestic release of its <strong>version 3.0</strong>. So where does Google Chrome fit in here? Remember, they say its in beta! Gmail was too!</p>
<p>Google Chrome has already been stated to possess best features of Firefox and other browsers. Bloggers have been ranting about this, the most. That is true since Google Chrome may not support plugins and themes feature as of now, on which Firefox has found its enormous success. But the first question to put up front is, is Google Chrome really just another browser or a <strong>desktop application</strong> which connects to the internet. Well both say the same thing but the mention of a different memory processing model for Chrome is something which you have to consider. Google won&#8217;t be silly to reinvent the wheel. It just might be a futuristic vision of Google which we are currently witnessing on a miniature scale. <strong>Google Suggest, Maps</strong> or <strong>GMail </strong>must ring the bells as I mention this.</p>
<p>People may crib and rant about Google Chrome but it hasn&#8217;t hampered the success of launch down even by a pint. In fact Google has made a smart move to get as many<strong> feedbacks</strong> as possible since it has made Chrome right from scratch. Now its motive would definitely be to do a write up once again and make a surprise launch with power packed features in the next version. I can see people waiting with baited breath keeping a hawks eye on every single move Google does.</p>
<p><strong>In For a Tough Competition?</strong></p>
<p>Google Chrome has been launched amidst <strong>Adobe Flex </strong>going mainstream with its enterprise presence and while <strong>Silverlight</strong> is being pushed into your face. You must have some or the other time come across Flex and Silverlight applications which left your mouth wide open to see the magic they do. Can a browser reduce these giant&#8217;s market share? Why do I ask?</p>
<p>If you carefully notice Chrome has heavily emphasized that it is going to <a href="http://www.google.com/chrome/intl/en/webmasters-faq.html#html5" target="_blank">support</a> the standards of web technologies like <strong>CSS, Javascript, HTML5</strong>. This means that Google Chrome would be a perfect foundation for web developers who always have been frustrated with browser dependencies when working with these web technologies. By using Chrome you might really enjoy developing a web application. This translates to more web developers being happy, more usage of standard features of Javascript, CSS and HTML, more usage of open technologies viz. <strong>Ajax, XML, JSON</strong>, leading to more usage of free tools &amp; less use of propreitary products.</p>
<p>All this means, more market share for open source and Google already has set its base up front with a plethora of tools. You name it, <strong>Google Gears, GWT, Google App Engine, Google Analytics, Google Maps</strong> etc for the web developers. More standards attribute to better web applications and all which is supported by Chrome inherently. The survival of Flex or Silverlight will be a debatable issue henceforth if Google Chrome manages to captilize on its intentions.</p>
<p>This sounds a huge success to Google Chrome. If this falls in line, then Firefox, Internet Explorer, Safari, Opera will be competing with Chrome rather than with themselves. Google will rise to the top and rule the universe. All of this is a distant dream for me and I don&#8217;t want to sound preachy now. You do the analysis as I will wait for a surprise in the next version of Google Chrome. It might just be the next big thing, you may never know!</p>
<p>The things I admire in the current release of Google Chrome :</p>
<ol>
<li>Full screen interface</li>
<li>Draggable tabs to windows and back into tabs</li>
<li>Neater display of history links and thumbnails of recent visits</li>
</ol>
<p><strong>Testing Google Chrome</strong></p>
<p>The thing you might be wondering at the moment is how to distinguish Chrome from the rest of the browsers. As Google mentions, <strong>Chrome</strong> sports a different <strong>memory management model</strong> which implements each tab as a whole <strong>new process</strong> instead of a thread. On opening a tab you would notice that the task manager would have a new process listed. In order to try out Chrome&#8217;s ability with this regards you should try opening a Javascript heavy page first in browsers such as Firefox and Internet Explorer.</p>
<p>Heavy Javascript attributes to browser hanging which is considered often as a painful process since all the tabs hang and the browser itself has to be killed to stop the loading. As far as Chrome goes, this nature would be handled in a completely different manner since you can now directly kill a tab process from the task manager without affecting the other open tabs.</p>
<p>While the above concept is not much useful for the casual surfer, it will be a must for web application users in times to come, since the advent of Web 2.0 has in fact spruced up the usage of Ajax which in turn has made the web application heavy for processing. Such a model would have been required any time in near future, but with Chrome stepping the right foot at the right time you can relax down a bit now. If you are a staunch <strong>Ajax developer</strong> then Chrome surely would come to your rescue.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/google-search/" rel="bookmark" title="Permanent Link: Search Results">Search Results</a></li><li><a href="http://techtracer.com/2007/10/14/unleash-the-power-in-your-blog-with-google-custom-search/" rel="bookmark" title="Permanent Link: Unleash the Power in Your Blog with Google Custom Search">Unleash the Power in Your Blog with Google Custom Search</a></li><li><a href="http://techtracer.com/2007/12/03/google-experiments-are-brilliant/" rel="bookmark" title="Permanent Link: Google Experiments are Brilliant">Google Experiments are Brilliant</a></li><li><a href="http://techtracer.com/2007/11/28/minesweeper-back-with-a-bang/" rel="bookmark" title="Permanent Link: Minesweeper &#8211; Back with a Bang">Minesweeper &#8211; Back with a Bang</a></li><li><a href="http://techtracer.com/2007/11/27/drool-over-the-all-new-google-android-ui/" rel="bookmark" title="Permanent Link: Drool Over the all new Google Android UI">Drool Over the all new Google Android UI</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/10/06/google-chrome-whats-in-it-for-ya/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>ReadAir &#8211; Google Reader On My Desktop!</title>
		<link>http://techtracer.com/2008/07/06/readair-google-reader-on-my-desktop/</link>
		<comments>http://techtracer.com/2008/07/06/readair-google-reader-on-my-desktop/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 15:03:00 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://techtracer.com/?p=271</guid>
		<description><![CDATA[The only constant thing for me in my life is change. I like to change my lifestyle, habits, hobbies once in a while so as to keep my mind fresh and active. I get bored with routines and so is the same case in my browsing activities or tools which I use. This time around [...]]]></description>
			<content:encoded><![CDATA[<p>The only constant thing for me in my life is <strong>change</strong>. I like to change my lifestyle, habits, hobbies once in a while so as to keep my mind fresh and active. I get bored with routines and so is the same case in my browsing activities or tools which I use. This time around my axe swayed in the direction of my age old favorite feed reader, <strong>Google Reader</strong>.</p>
<p>I am thoroughly satisfied with <a href="http://techtracer.com/2007/09/06/google-reader-search-goes-live/" target="_self">Google Reader</a> for reading my RSS feeds but I felt its been a long time I have spent on it and it has now started to bore me a bit. So I started some search for good desktop applications which would give some <strong>eye candy</strong> and also improve my productivity while learning from the feeds.</p>
<p>I have found one nice solution which has relieved me to some extent and which is certainly an impressive effort in the direction of web desktop integration. Its called <a href="http://code.google.com/p/readair/" target="_blank">ReadAir</a>. It is a really nice application for feed reading and I am impressed by its potential.  The reason I liked it was because it is built on <a href="http://www.adobe.com/products/air/" target="_blank">Adobe AIR</a>. I had become a fan of <strong>Adobe AIR</strong> when I had read about it for the first time.</p>
<p>Seeing a live usable application built on it was something I had waited for and<strong> ReadAir</strong> has confirmed my belief that sometime later in the future we are going to see amazing applications built for the desktops but running on the web. <a href="http://techtracer.com/2007/10/31/mozilla-prism-a-revolution-in-web-apps/" target="_blank">Mozilla Prism</a> is a yet another effort in this field.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-272" title="readair_google_reader" src="http://techtracer.com/wp-content/uploads/2008/07/readair_google_reader.jpg" alt="Readair_Google_Reader" width="389" height="290" /></p>
<p>Okay, coming back to the <strong>ReadAir</strong>. ReadAir is a desktop feed reader for reading your Google Reader feeds. The features that I can place my votes on are:</p>
<ul>
<li>Easy setup and login straight into Google Reader</li>
<li><strong>Direct synchronization</strong> of read posts with Google Reader</li>
<li>You can star any post directly inside it which is also visible later in your Google Reader</li>
<li>Add/Remove tags or feeds from within it</li>
<li>It has got a very minimalistic Interface yet its pretty neat looking</li>
<li>The feed post colors and fonts are soothing to the eye</li>
<li>It is quick in loading.</li>
<li>Clicking on the post title marks the post as read (This is better than scrolling the entire length of the post as in Google Reader)</li>
</ul>
<p>I was satisfied by the above basic features and also expect them to improve them in the future. Since the application is in its early days, some features can be cranky at times. For example, I found the <strong>auto update</strong> feature somewhat unnecessary. It updated the application with some new features which later started to show some errors. Also, the search is not fully functional and currently ReadAir does not support <strong>keyboard shortcuts</strong>.</p>
<p>Leaving apart the shortcomings, the synchronization was the best part of ReadAir. At least I have got a different reader for my taste and also due to the synchronization with Google Reader, I do not have to worry about <strong>re-reading the same posts</strong> if I happen to access Google Reader from a different location. I appreciate the commendable effort put up by <strong>Adam Mcgrath</strong> for bringing this idea to life and am looking forward for addition of more features.</p>
<p><a href="http://readair.googlecode.com/files/ReadAir.0.3.air" target="_blank">Try it</a>, its nice to have a change sometimes and I would always root for <strong>web desktop applications</strong> like these. For installing ReadAir you need to have Adobe Air installed on your system. Download Adobe Air from <a href="http://labs.adobe.com/downloads/air.html" target="_blank">here</a>.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/04/09/web-and-desktop-apps-the-3rd-world-war/" rel="bookmark" title="Permanent Link: Web and Desktop Apps &#8211; the 3rd World War!">Web and Desktop Apps &#8211; the 3rd World War!</a></li><li><a href="http://techtracer.com/2007/10/06/mozillas-new-killer-app-the-webrunner/" rel="bookmark" title="Permanent Link: Mozilla&#8217;s New Killer App &#8211; The WebRunner">Mozilla&#8217;s New Killer App &#8211; The WebRunner</a></li><li><a href="http://techtracer.com/2007/10/14/unleash-the-power-in-your-blog-with-google-custom-search/" rel="bookmark" title="Permanent Link: Unleash the Power in Your Blog with Google Custom Search">Unleash the Power in Your Blog with Google Custom Search</a></li><li><a href="http://techtracer.com/2007/09/06/google-reader-search-goes-live/" rel="bookmark" title="Permanent Link: Google Reader Search Goes Live!">Google Reader Search Goes Live!</a></li><li><a href="http://techtracer.com/2007/07/25/adobe-reader-80-%e2%80%93-fully-loaded/" rel="bookmark" title="Permanent Link: Adobe Reader 8.0 &#8211; Fully Loaded">Adobe Reader 8.0 &#8211; Fully Loaded</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/07/06/readair-google-reader-on-my-desktop/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Best Tools For Editing Your Photos Online</title>
		<link>http://techtracer.com/2008/06/15/best-tools-for-editing-your-photos-online/</link>
		<comments>http://techtracer.com/2008/06/15/best-tools-for-editing-your-photos-online/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 16:29:41 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://techtracer.com/?p=252</guid>
		<description><![CDATA[A few days back my colleague asked me if I could edit one photo of his in Photoshop. I am some what good at editing photos in Photoshop but at that particular point of time I could not help him since I did not have Photoshop installed on my system. This is really common case [...]]]></description>
			<content:encoded><![CDATA[<p>A few days back my colleague asked me if I could edit one photo of his in <strong>Photoshop</strong>. I am some what good at editing photos in Photoshop but at that particular point of time I could not help him since I did not have Photoshop installed on my system. This is really common case which most of us face. We want to edit our photos and at the most needed time we do not have the appropriate tools at our disposal. What do we do in such cases?</p>
<p>Enter <a href="http://techtracer.com/category/web-20/" target="_self">Web 2.0</a>, and you do not have to ponder much over lost time for waiting to get hold of a tool. In this era, whatever you think of is already available online. So without fretting just google up your requirement and you would be amazed by what kind of power the internet can provide you. Coming back to the question, I responded him coolly, to use an <strong>online photo editor</strong>! He was totally baffled at the thought. If you are too, then I might as well introduce to you the best tools for photo editing online. <img src='http://techtracer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-decoration: underline;"><strong>Online Photo Editors</strong></p>
<p>The most important thing for a photo editor is to provide the features such as, cropping, editing brightness and contrast, sharpening and blurring, resize, effects and saving in multiple file formats. In a standalone editor you are most likely to find these features. But in an <strong>online </strong>environment the features will be severely limited with regards to <strong>flexibility</strong> of usage, since they are <strong>entirely web based</strong> which make them complicated to implement. I will suggest you some nifty tools which would actually make your work easier and lot more fun. Browsing across several editors I would recommend you 3 of the most liked online photo editors.</p>
<p><strong>1. Phixr</strong></p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-260" title="phixr_editing_tool" src="http://techtracer.com/wp-content/uploads/2008/06/phixr_editing_tool.jpg" alt="Phixtr Editor" width="354" height="363" /></p>
<p><a href="http://www.phixr.com/" target="_blank">Phixr</a> is an interesting tool which does not use Flash. It is completely <a href="http://techtracer.com/category/ajax/" target="_self">Ajax</a> based and has got the potential to give the user a complete satisfaction. The most likable feature I found in this was the ability to convert your photograph into an artistic <strong>polaroid </strong>snapshot, comment<strong> bubbles</strong> and<strong> effects.</strong> It gives you the facility of direct upload of the edited photo to numerous photo sharing sites like Facebook, Flickr, Picasaweb and so on. Moreover, its <strong>free</strong> to use.</p>
<p>Its not a compulsion for registering for using the tool. You can try out the <strong>demo</strong> from the photo shown on the front page itself and check the features for yourselfs. Look what I could come up in a few minutes of playing with this tool.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-261" title="phixr_edited_photo" src="http://techtracer.com/wp-content/uploads/2008/06/shallow-depth-of-field_phixr.jpg" alt="Phixr Effects" width="361" height="400" /></p>
<p style="text-align: left;"><strong>2. SplashUp</strong></p>
<p style="text-align: left;">If you are a Photoshop addict and cannot think of any other tool besides it, then you are in for a real surprise. <a href="http://www.splashup.com/" target="_blank">SplashUp</a>, earlier called <a href="http://www.fauxto.com/" target="_blank">Fauxto</a> is a very well designed application which closely resembles Photoshop. It has the same look and feel and is completely made in Flash. The bonus of using SplashUp is that you can actually save your work in its own file format so that you can continue working on it later. It is the <strong>first online tool</strong>, to give a <strong>layered</strong> editing environment and work on <strong>multiple images</strong> at the same time without your browser getting hanged up. Doesn&#8217;t that sound exciting enough?</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-258" title="splashup_editing_tool" src="http://techtracer.com/wp-content/uploads/2008/06/splashup_editing_tool.jpg" alt="SplashUp Editor" width="410" height="299" /></p>
<p style="text-align: left;"><strong>3. Picnik</strong></p>
<p style="text-align: left;"><a title="Picnik" href="http://www.picnik.com/" target="_blank">Picnik</a> one is one of my favorites and one of the most used tools while editing photos online. This is because, Flick has recently bought it, and it has been directly integrated into flickr. This makes editing your online flickr photos even more simpler. Just go to a flickr photo and choose the <strong>Edit</strong> <strong>Photo</strong> button, which opens up in a picnik editor mode. Check out for the humorous load messages it shows. The only thing I dislike about it is it takes a <strong>lot of time</strong> to load the photo which is not the case in <strong>SplashUp</strong>.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-259" title="picnik_editing_tool" src="http://techtracer.com/wp-content/uploads/2008/06/picnik_editing_tool.jpg" alt="Picnik Editor" width="409" height="234" /></p>
<p style="text-align: left;">Picnik has a lot of amazing features to offer but they all do not come for free. Yet you are free to use some commonly used features with ease. Check out for fancy <strong>text effects </strong>and<strong> custom shapes</strong>. They are surely fantastic. With a tool like Picnik you wouldn&#8217;t need Photoshop around for common usages.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2008/05/28/create-beautiful-collages-out-of-your-photos/" rel="bookmark" title="Permanent Link: Create Beautiful Collages Out Of Your Photos">Create Beautiful Collages Out Of Your Photos</a></li><li><a href="http://techtracer.com/2007/10/13/hp-snapfish-india-for-cost-effective-printing/" rel="bookmark" title="Permanent Link: HP Snapfish India, For Cost Effective Printing">HP Snapfish India, For Cost Effective Printing</a></li><li><a href="http://techtracer.com/2007/11/05/feast-your-eyes-with-firefox-piclens/" rel="bookmark" title="Permanent Link: Feast Your Eyes With Firefox Piclens">Feast Your Eyes With Firefox Piclens</a></li><li><a href="http://techtracer.com/2007/04/09/web-and-desktop-apps-the-3rd-world-war/" rel="bookmark" title="Permanent Link: Web and Desktop Apps &#8211; the 3rd World War!">Web and Desktop Apps &#8211; the 3rd World War!</a></li><li><a href="http://techtracer.com/2007/12/20/goa-parade/" rel="bookmark" title="Permanent Link: GOA Parade!">GOA Parade!</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/06/15/best-tools-for-editing-your-photos-online/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Create Beautiful Collages Out Of Your Photos</title>
		<link>http://techtracer.com/2008/05/28/create-beautiful-collages-out-of-your-photos/</link>
		<comments>http://techtracer.com/2008/05/28/create-beautiful-collages-out-of-your-photos/#comments</comments>
		<pubDate>Wed, 28 May 2008 17:47:28 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://techtracer.com/?p=249</guid>
		<description><![CDATA[Did you always think about what creative stuff you can do with your photos? Well, I do most of the times and end up editing some of my most favorite ones and putting in some artistic touch. I always feel that, enriching the photos gives them a whole new dimension to look from. It might [...]]]></description>
			<content:encoded><![CDATA[<p>Did you always think about what creative stuff you can do with your photos? Well, I do most of the times and end up editing some of my most favorite ones and putting in some artistic touch. I always feel that, enriching the photos gives them a whole new dimension to look from. It might be either making it more attractive, more lovable or to enliven the sentiments you attached to them from a long time.</p>
<p>Whatever the reason may be, editing a photograph is no layman&#8217;s job. Sometime people give up half way through when they do not find the required results. I recently found a something which might make your spirit rise higher when you will notice the results you get out of it. The name of the tool is <a href="http://picasa.google.com/" target="_new">Picasa</a>. Its a tool from <strong>Google</strong>. I am sure you must have used it many time to upload your photos to the online <a href="http://picasaweb.google.com/nitinclicks" target="_new">Picasaweb</a>. But did you ever try making collages from it. <strong>Picasa</strong> can generate some really amazing collages out of your precious photos and make them really gift worthy or send it amongst friends as a memoir.</p>
<p style="text-align: center;"><img src="http://picasa.google.com/assets/logo.gif" alt="Picassa_Logo" /></p>
<p>So here&#8217;s how you can make collages out of your photos:</p>
<p style="text-align: center;"><a href="http://picasaweb.google.com/nitinclicks/WaterKingdom/photo#5205463216164148834" target="_new"><img src="http://lh4.ggpht.com/nitinclicks/SD2FNyLTlmI/AAAAAAAAA9A/ivu-ddNCh6E/collage-1.jpg?imgmax=512" alt="Picture_Pile_Collage" width="512" height="384" /></a></p>
<ul style="text-align: left;">
<li>Download and install Picasa if you don&#8217;t have it already <a href="http://picasa.google.com/download/" target="_new">from here</a></li>
<li>When you open it Picasa will start indexing all your image folders</li>
<li>Choose a folder of which you want to make a collage from</li>
<li>Now carefully <strong>select</strong> the photos which are your favorite and which you want inside the collage</li>
<li>Click the <strong>Collage</strong> button in the bottom bar</li>
<li>Your collage will be loaded in the dialog mode</li>
<li>You might not be satisfied with the collage at first so you can try one of the 2 tricks</li>
<li>Press<strong> Shift and drag</strong> your mouse pointer on the collage window. You will see a change in the<strong> layout</strong></li>
<li>Keep trying till you are satisfied with a layout</li>
<li>Sometimes, you might like a layout but not how the pictures are placed</li>
<li>In this case press <strong>Ctrl and drag</strong> the mouse pointer. The layout will be same but the pictures will start to<strong> randomize </strong>in their placement.</li>
<li>Once you are done, hit the <strong>Create</strong> Button and specify <strong>location</strong> as the &#8220;current folder&#8221;</li>
<li>The collage gets created and gives you a chance to <strong>edit</strong> the collage</li>
<li>Here you can try out interesting <strong>presets</strong> which include making the collage black and white or giving it a sepia tone or soft focusing it. You can have real fun over here.</li>
<li>After finishing with the effect choose <strong>file &gt; save</strong>. A backup of the original will automatically be made</li>
<li>So here you are with a amazing memorabilia of your treasured photos. Sounds simple isn&#8217;t it?<a href="http://picasaweb.google.com/nitinclicks/WaterKingdom/photo#5205463216164148834" target="_new"><br />
</a></li>
</ul>
<p style="text-align: left;">You can do different types of collages in Picassa. The one above is called the &#8220;<strong>Picture Pile</strong>&#8220;. The other types include:</p>
<p style="text-align: left;"><strong>Picture Grid</strong></p>
<p style="text-align: center;"><a href="http://picasaweb.google.com/nitinclicks/WaterKingdom/photo#5205463628481009266" target="_new"><img src="http://lh4.ggpht.com/nitinclicks/SD2FlyLTlnI/AAAAAAAAA9g/dtVuJZAVWKE/s288/collage1.jpg" alt="Contact_Sheet_Collage" /></a></p>
<p style="text-align: left;"><strong>Contact Sheet</strong></p>
<p style="text-align: center;"><a href="http://picasaweb.google.com/nitinclicks/WaterKingdom/photo#5205462254091474514" target="_new"><img src="http://lh4.ggpht.com/nitinclicks/SD2EVyLTllI/AAAAAAAAA84/BP5ona4_P6k/s288/collage1.jpg" alt="Picture_Grid_Collage" /></a></p>
<p style="text-align: left;">You can always edit the collage features after saving it. But however there is no provision to change the photos of it later. You would have to again do the above steps for making a new collage.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/11/05/feast-your-eyes-with-firefox-piclens/" rel="bookmark" title="Permanent Link: Feast Your Eyes With Firefox Piclens">Feast Your Eyes With Firefox Piclens</a></li><li><a href="http://techtracer.com/2008/06/15/best-tools-for-editing-your-photos-online/" rel="bookmark" title="Permanent Link: Best Tools For Editing Your Photos Online">Best Tools For Editing Your Photos Online</a></li><li><a href="http://techtracer.com/2007/12/20/goa-parade/" rel="bookmark" title="Permanent Link: GOA Parade!">GOA Parade!</a></li><li><a href="http://techtracer.com/contact/" rel="bookmark" title="Permanent Link: Contact">Contact</a></li><li><a href="http://techtracer.com/2007/10/13/hp-snapfish-india-for-cost-effective-printing/" rel="bookmark" title="Permanent Link: HP Snapfish India, For Cost Effective Printing">HP Snapfish India, For Cost Effective Printing</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/05/28/create-beautiful-collages-out-of-your-photos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>BEA Dev2Dev TechDays &#8211; An Experience</title>
		<link>http://techtracer.com/2008/05/11/bea-dev2dev-techdays-an-experience/</link>
		<comments>http://techtracer.com/2008/05/11/bea-dev2dev-techdays-an-experience/#comments</comments>
		<pubDate>Sun, 11 May 2008 18:57:51 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://techtracer.com/2008/05/11/bea-dev2dev-techdays-an-experience/</guid>
		<description><![CDATA[BEA had invited people across India for attending their TechDays sessions of which Adobe was the event partner. I had  registered for it almost a month ago. It was held on May 9th Friday at The Leela, a  five star hotel in Andheri, Mumbai. The timings for the session were from 9:00 am [...]]]></description>
			<content:encoded><![CDATA[<p><strong>BEA</strong> had invited people across India for attending their <a href="http://www.shobiziems.com/BEA_Dev2Dev_days_2008/mumbai.html" target="_blank">TechDays sessions</a> of which <strong>Adobe</strong> was the event partner. I had  registered for it almost a month ago. It was held on <strong>May 9th</strong> Friday at <a href="http://www.theleela.com/hotel-mumbai.html" target="_blank">The Leela</a>, a  five star hotel in Andheri, Mumbai. The timings for the session were from <strong>9:00 am</strong> till <strong>12:00 pm </strong>and no registration nor event fees were taken. Here is my experience about the entire event.</p>
<p><strong>The Sessions</strong></p>
<p><img src="http://lh4.ggpht.com/nitinclicks/SCQhOxm8wpI/AAAAAAAAAzU/oxcSob4G_vo/s288/DSC04315.JPG" style="float: left; margin-right: 15px; margin-bottom: 5px" height="216" width="288" /></p>
<p>The session was primarily held for the developers community and less for the  corporate. This provided a relief as there weren&#8217;t much marketing gimmicks being  played and the speakers were purely techie guys which proved to be an onus. BEA  has upgraded their <strong>Weblogic Server</strong> to version <strong>10.2</strong> and their <strong>Workshop</strong> too. I had  worked on the BEA workshop studio and Aqualogic platform for ESB earlier. So my  main interests lied in what new features these upgraded products had in their  offerings. After having attending this session I am now all the more excited to  work in the BEA platform.</p>
<p>Although many people were awestruck with the features  and some felt jealous for continuing to work on the older versions at their  workplace, one thing was going through the minds of many including mine. The  question was as to what was the road map for these BEA products since now the <a href="http://techtracer.com/2008/01/23/effects-of-oracle-bea-acquisition/">acquisition  by Oracle</a> has got completed. There was a slight wave of <strong>concern</strong> over this  <strong>merger</strong> on the current developers as well as for those who wanted to adopt to the  BEA environment in future. Would Oracle continue to<strong> support</strong> active upgradation  to these wonderful products or take away the key features from them to promote  its own products? The concerns were raised higher during the session when the  BEA guys told us that were not too sure of the road map either. We will have to  keep fingers crossed for that.</p>
<p>There were <strong>3 speakers</strong> for the entire session out of which 2 were from BEA,  now christened <strong>Oracle BEA</strong> and one evangelist from <strong>Adobe</strong>. You may wonder where  does Adobe form a part of the BEA endeavor? I was curious too. The curiosity  was cleared by one of the BEA speakers on mentioning that Adobe had integrated  its Flex platform for the BEA environment. Piggybacking for publicity you may  call. But it is actually awesome.</p>
<p><strong>BEA Java2SOA Revolution</strong></p>
<p><img src="http://lh6.ggpht.com/nitinclicks/SCQh8Rm8w3I/AAAAAAAAA1M/wd7MdgDFNJU/s288/DSC04336.JPG" style="float: right; margin-left: 15px; margin-bottom: 5px" height="216" width="288" /></p>
<p>The session started with the first speaker <strong>Sandeep Sonkusale</strong> who is a  certified SOA Solution Architect for BEA speaking on the aspects of why an  organization has to choose to the SOA infrastructure and the underlying benefits  that SOA would provide. The briefing was accompanied with several high profile  diagrams of how the world would be revolutionized if SOA would be adopted. I  could see many people yawning to glory for this completely hypothetical preachy  stuff. All were waiting for the meaty part i.e how to go about doing it. After  waiting for almost 45 minutes for the briefing to get over, we felt a wave of  relief when the second speaker took over with his laptop and workshop running on  the presentation screen.</p>
<p>The second speaker was a young and smart looking<strong> Anil Sharma</strong> from the BEA  product development team. His ascent was really professional. Right from the  start to the end of a 2 hour long demo he had his cool even though people  bombarded him with several technical queries. The demo given was on the entire  new version of the <strong>BEA Workshop Studio</strong>. It is now entirely eclipse based and has  all the earlier separate workshops integrated into one. This means that having  workshop installed on your system you can build all the components of J2EE  architecture, create <strong>web services</strong>, build beehive<strong> controls</strong> for exposing the J2EE  components as <strong>services</strong>, convert these controls to web services, perform <strong>BPM  process flows</strong> and later expose them too as services, connect all controls or  services to <strong>Aqualogic Service Bus</strong>, convert the services to presentation <strong>portals  </strong>and much much more. Phew! This entire demo was a roller coaster for me but it  was real fun.</p>
<p>The key points which I found to be useful were the ones which the speaker was  emphasizing on and on. It is<strong> not necessary</strong> that you need to create web services  for making your architecture SOA enabled. You can have services like EJB  services, custom control services as well web services to make an SOA. Controls  are used to expose EJB&#8217;s or POJO&#8217;s as services and these are not Weblogic  specific. In fact they are <a href="http://beehive.apache.org/" target="_blank">Apache Beehive</a> controls which are a part of <a href="http://jcp.org/en/jsr/detail?id=175" target="_blank">JSR 175</a>, hence  vendor lock-in can be avoided. I am not too sure if any other J2EE provider has  beehive controls implementation apart from Weblogic 10.2. The interfaces and  implementations of web services are done using the <a href="http://jcp.org/en/jsr/detail?id=181" target="_blank">JSR-181</a>  constructs.</p>
<p><img src="http://techtracer.com/wp-content/uploads/2008/05/oracle_bea_logo.jpg" alt="Oracle_BEA_Logo" /> <img src="http://techtracer.com/wp-content/uploads/2008/05/dev2dev_techdays.gif" alt="Dev2Dev_TechDays_Logo" /></p>
<p>I got to understand the use of <a href="http://en.wikipedia.org/wiki/Business_Process_Management" target="_blank">BPM</a> through this session. Before this, I was really hazy as to  which use cases BPM really favors. Anil, through his demo explained this in a  peculiar scenario. When there is a need to have an entire stateful process as a  service it can be implemented as a BPM workflow through the Workshop itself.  This can be further exposed as a service. Services can be further integrated  into the <a href="http://e-docs.bea.com/alsb/docs20/index.html" target="_blank">Aqualogic Service Bus</a> (ALSB) for implementing a transactional  service workflow. It is important to note that the services integrated into the  service bus must support transaction to have transactional behavior.</p>
<p>The major surprise to me was the merger of <a href="http://dev2dev.bea.com/pub/a/2005/06/whats_new_dsp.html" target="_blank">DSP</a> into the Workshop. In between the workflow wherever you  need a transformation of data you can easily use Data Services transformation  either through <strong>XQuery</strong> or <strong>Java</strong> right within the workflow. This was something  amazing.</p>
<p>Finally shown, were the presentation services based on <strong>Weblogic Portal</strong>  platform. In order to create presentation services BEA workshop comes built in  with <a href="http://beehive.apache.org/docs/1.0/netui/overview.html" target="_blank">NetUI</a> which is the <strong>pageflow</strong> modeller for the <strong>Struts</strong> framework.  Using NetUI you can create Struts JSP views directly from exposed services which  further can be converted to <a href="http://docs.oasis-open.org/wsrp/v2/wsrp-2.0-spec-os-01.html" target="_blank">WSRP portlets</a> and integrated into the application portal. The  most surprising aspect of the WSRP portlets is that you can access the portlet  remotely too. This means that your view would be actually rendered from a remote server!</p>
<p><strong>Adobe &#8211; G</strong><strong>etting More and More Flexy</strong></p>
<p>From 9:30 am to 12:15 pm the BEA guys took the center stage. The Adobe guy  was nowhere to be seen. Right at 12:15 pm he popped from somewhere with his  laptop and took charge. His session may have been just a 45 minute one but the  impact was majestic. He transformed the crowd of almost 200 odd people to the  edge of their seats and eyes wide gaping to the screen with his magical Flex  demo. It was showtime for <a href="http://raghuonflex.wordpress.com/" target="_blank">Raghu Rao</a>, <strong>evangelist </strong>for the <strong>Flex platform</strong> for Adobe. His  charisma was attention capturing and the way he breezed through the Flex demo,  he left the geek&#8217;s including me, craving for more.</p>
<p><img src="http://lh6.ggpht.com/nitinclicks/SCQh7Rm8wzI/AAAAAAAAA0s/7pMk10oToMQ/s288/DSC04330.JPG" style="float: left; margin-right: 15px; margin-bottom: 5px" height="216" width="288" /></p>
<p>The presentation involved the showcase of Flex as a presentation level  service for the BEA platform. He presented how Flex can be used for accessing  the services exposed from the BEA environment into the presentation tier. This  included the use of the commercial <a href="http://www.adobe.com/products/livecycle/dataservices/" target="_blank">Adobe  product LCDS</a> which is an enterprise level Flex platform for services. If you  do not want to go the paid way, you can use <a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS" target="_blank">BlazeDS</a> which is a open source freeware, but with limited  capabilities, suitable for small applications. Using these you can make callouts  to the hosted services using the <a href="http://en.wikipedia.org/wiki/Action_Message_Format" target="_blank">Action  Message Format (AMF)</a> for remote calls.</p>
<p>The major source attraction proved to be the Flex demo&#8217;s, which included the  Nokia Shop and a sample consumer application. The <a href="http://demo.quietlyscheming.com/ChartSampler/app.html" target="_blank">Flex  charts</a> components and 3rd party flex UI components such as <a href="http://dougmccune.com/blog/2007/11/19/flex-coverflow-performance-improvement-flex-carousel-component-and-vertical-coverflow/" target="_blank">coverflow component</a> and the <a href="http://www.rubenswieringa.com/blog/flex-book-component-beta" target="_blank">Flex Book component</a> snatched away everyone&#8217;s breath.</p>
<p><strong>Final Notes<br />
</strong></p>
<p>Such sessions really help in accessing the direction of where technology is  heading to. I am thankful to Anil and Raghu who personally cleared my confusions  over some aspects offline. I felt bad to keep Raghu away from his food since I  kept him bugging with my questions. He had to catch a flight to Bangalore a  little while later. If you would like to evaluate the all new <a href="http://edocs.bea.com/wlw/docs102/" target="_blank">BEA Weblogic 10.2  platform</a> head straight towards their <a href="http://dev2dev.bea.com/evalguide/" target="_blank">eval guide</a> for  getting started and also win a <strong>32 GB Ipod</strong> by taking this <a href="http://www.surveymonkey.com/s.aspx?sm=HnVokokDlCgyiuwuFNhARQ_3d_3d" target="_blank">survey</a>. <img src='http://techtracer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Check out the day&#8217;s captures on my <a href="http://picasaweb.google.com/nitinclicks/TheLeela" target="_blank">picassa  web album</a>.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/05/12/developers-dilemma-pride-or-prestige/" rel="bookmark" title="Permanent Link: Developers Dilemma &#8211; pride or prestige">Developers Dilemma &#8211; pride or prestige</a></li><li><a href="http://techtracer.com/2007/10/26/what-makes-facebook-win-over-orkut/" rel="bookmark" title="Permanent Link: What Makes Facebook Win Over Orkut?">What Makes Facebook Win Over Orkut?</a></li><li><a href="http://techtracer.com/2007/10/06/mozillas-new-killer-app-the-webrunner/" rel="bookmark" title="Permanent Link: Mozilla&#8217;s New Killer App &#8211; The WebRunner">Mozilla&#8217;s New Killer App &#8211; The WebRunner</a></li><li><a href="http://techtracer.com/2006/10/16/bea-aqualogic-data-services-platform-first-glimpse/" rel="bookmark" title="Permanent Link: BEA Aqualogic Data Services Platform &#8211; First Glimpse">BEA Aqualogic Data Services Platform &#8211; First Glimpse</a></li><li><a href="http://techtracer.com/2007/10/13/hp-snapfish-india-for-cost-effective-printing/" rel="bookmark" title="Permanent Link: HP Snapfish India, For Cost Effective Printing">HP Snapfish India, For Cost Effective Printing</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/05/11/bea-dev2dev-techdays-an-experience/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Designing Enterprise Applications &#8211; Approaches and Patterns</title>
		<link>http://techtracer.com/2008/03/30/designing-enterprise-applications-approaches-and-patterns/</link>
		<comments>http://techtracer.com/2008/03/30/designing-enterprise-applications-approaches-and-patterns/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 16:07:34 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Java EE]]></category>

		<guid isPermaLink="false">http://techtracer.com/2008/03/30/designing-enterprise-applications-approaches-and-patterns/</guid>
		<description><![CDATA[JavaWorld has published a useful research paper which discusses how to discern which design patterns and frameworks would work best for your enterprise applications, written by Chris Richardson. As a developer it is very essential to know about the different strategies one would adopt in a particular business scenario. This paper helps you in making [...]]]></description>
			<content:encoded><![CDATA[<p><strong>JavaWorld</strong> has published a useful research paper which discusses how to discern <a href="http://www.javaworld.com/javaworld/jw-01-2006/jw-0130-pojo.html" target="_blank">which design patterns</a> and frameworks would work best for your enterprise applications, written by Chris Richardson<strong>.</strong> As a developer it is very essential to know about the different strategies one would adopt in a particular business scenario. This paper helps you in making important decisions about which <a href="http://techtracer.com/2007/06/10/design-patterns-building-blocks-for-your-application/">design patterns</a> would best suite a given set of requirements.</p>
<p>According to the research done by Chris for enterprise applications, here are some of the important points which the paper elaborates:</p>
<ol id="bf27">
<li id="f.vf">Make use of the POJO approach, with lightweight frameworks like <em>Hibernate</em> for <em>ORM<strong> </strong></em>and <em>Spring AOP<strong> </strong></em>for transactional activities.</li>
<li id="wu88"><em>EJB 3</em><strong> </strong>makes it possible to have your business logic sit within your POJO and also make it run outside the container which makes it really usable.</li>
<li id="n-vc">Implementing 3 tiers for an application which commonly include
<ol id="a5tp">
<li id="g.z0">Presentation tier</li>
<li id="c-e:">Business Interfaces for encapsulation + Business tier logic in classes</li>
<li id="cn3y">Persistence tier for handling transactions and concurrency</li>
</ol>
</li>
<li id="b68b">The design should involve,
<ol id="s0hb">
<li id="ywtd">Modeling your business classes appropriately</li>
<li id="q1.l">Code structuring principles for easier maintenance <br id="iuhx" /></li>
</ol>
</li>
</ol>
<p>While the above points are usually very well known amongst the developer community, it helps if you know which decisions should be taken when. Design patterns which have been established over the years play a key role in making such decisions. The white paper explains a few of the design patterns which are particularly mentioned when enterprise applications are into consideration.</p>
<p>I would like to enumerate here, some of the different design patterns which are highlighted in the paper, according to the decisions which fall into 3 main categories.</p>
<p><strong id="k87:"><span style="text-decoration: underline;">Decision #1 &#8211; Organizing Business Logic</span></strong></p>
<p>When you have to implement the business logic it is very important to identify the scope and the scale of the application to decide one or the other approaches as stated below,</p>
<p><strong id="qc0o">Transaction Script Pattern:</strong><br id="kvzb" /></p>
<ol id="v2-6">
<li id="qb0w">Does not follow the object oriented principles</li>
<li id="g:v:">Methods are mapped to application request from the presentation tier, which are called as Transaction Scripts</li>
<li id="e-6a">Follows the procedural approach which makes <em>classes</em> less important and <em>methods</em> more important</li>
<li id="jfs0">Simple to implement but difficult to understand and maintain the code</li>
<li id="jmy8">Mainly used when business application is small</li>
</ol>
<p><strong id="jq6k">Object Oriented Approach:</strong><br id="hr43" /></p>
<ol id="rth0">
<li id="x289">Maps the objects from real world to the application</li>
<li id="zz9v">Easier to understand the application logic</li>
<li id="c6vw">Behavior and state are encapsulated inside the mapped objects</li>
<li id="x3-k">Lightweight frameworks help to apply this approach to your application.</li>
</ol>
<p><strong id="wnku">Table Module Pattern:<br id="q923" /></strong></p>
<ol id="o9m8">
<li id="uyut">Involves mapping of <em>database tables</em> to <em>business classes</em></li>
<li id="u5ni">An object of a table includes all rows of the table rather than a single object mapped to one row</li>
<li id="rrpc">It suffers from the problem of maintenance.</li>
</ol>
<p><br id="kh1t" /><strong id="u5bl"><span style="text-decoration: underline;">Decision #2 &#8211; Encapsulating of Business Logic</span></strong><br id="ox2p" /><br />
Well designed Business applications always encapsulate logic from the view. This helps in application scalability and security, at the same time providing loose coupling between the different tiers. The patterns which can be adhered to encapsulate business logic are:<br />
<br id="puy-" /><strong id="kh-i">Session Facade Pattern:<br id="f5_l" /></strong></p>
<ol id="g5hb">
<li id="y0_t">Promotes proper encapsulation of business level logic</li>
<li id="i4w2">Handles transactional behavior, security and presentation tier requests</li>
<li id="ztw0">Does caching of objects to prevent memory overloading in case of many requests</li>
<li id="t_3n">Delegates requests to proper business objects</li>
<li id="v-xx">Was earlier implemented by using EJB 2 Session Objects</li>
<li id="ub:t">It is heavy on memory and time consuming for testing and development</li>
</ol>
<p><strong id="w8ez">POJO Facade Pattern:<br id="fs4_" /></strong></p>
<ol id="h_e5">
<li id="neqw">Business logic encapsulated within simple <strong>POJO&#8217;s</strong></li>
<li id="r7-b">Easier to develop and test and can run outside the container</li>
<li id="cr3b">Transactions , security and state can be maintained through <strong>AOP</strong></li>
<li id="serv"><strong>Spring framework</strong> uses this pattern</li>
<li id="mm4x">Light on memory</li>
<li id="lk7t">Makes use of <strong>Dependency Injection</strong> for wiring the <em>business classes</em> instead of using <em>JNDI</em><br id="ch4d" /></li>
</ol>
<p><strong id="zc99">Exposed Domain Model Pattern:<br id="zy0q" /></strong></p>
<ol id="tmgf">
<li id="l9v3">Used to avoid extra code for designing the facade</li>
<li id="h5-o">Presentation tier can <strong>directly</strong> access data objects <br id="schn" /></li>
<li id="ocwk">Makes use of <strong>AOP</strong> to access business objects without an intermediate facade layer</li>
<li id="i33w">Drawbacks include the requirement of transactions and data handling by presentation tier</li>
<li id="i33w">Risky since presentation tier can directly manipulate persistent data.</li>
</ol>
<p><br id="ed-o" /><strong id="i566"><span style="text-decoration: underline;">Decision #3 &#8211; Database Access</span></strong><br id="dn0:" /></p>
<p>The decision of accessing data is of strategic importance since IO has a major impact on application performance. So apart from making a decision on the databases and normalization it is crucial to have the best approach for accessing it from other tiers in the application. The paper emphasizes that,</p>
<p><strong>Direct JDBC</strong> has drawbacks such as:<br id="ucjy" /></p>
<ol id="pcb3">
<li id="q55_">Boiler plate code for handling connection and fetching of data</li>
<li id="pm-v">Database specific SQL reduces the portability of the application</li>
<li id="rlt:">Maintenance of low level SQL poses problems from schema changes</li>
<li id="z1.9">Can be of advantage when vendor specific features have to be accessed</li>
</ol>
<p>To overcome the disadvantages of JDBC, using a framework like the <strong id="i1sy">iBATIS Framework </strong>can be advantageous since:<br id="kwql" /></p>
<ol id="k_bx">
<li id="m.3_">Direct SQL queries can be used <br id="t-hn" /></li>
<li id="elp1">Provides mapping between resultsets and Java Beans through XML descriptor</li>
</ol>
<p>The Advantages that <strong id="gc:b">Persistance Frameworks</strong> offer are:<br id="vm2_" /></p>
<ol id="r.0g">
<li id="lywi">Mapping of data to domain objects</li>
<li id="b:5g"><strong>No need</strong> to write SQL code</li>
<li id="lr-n">Flexibility offered by configuring XML descriptors for domain level objects and data <br id="pk6x" /></li>
<li id="qab1">Loading &amp; updating of database as and when required</li>
<li id="zk7x">Transactions and concurrency are handled by the framework</li>
</ol>
<p>Enterprise applications should be modeled and designed properly from the early phases itself. Without following proper approaches from the ones mentioned above can be an invitation for trouble. I hope that these approaches help the developers to come up with good designs for enterprise applications.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/06/10/design-patterns-building-blocks-for-your-application/" rel="bookmark" title="Permanent Link: Design Patterns &#8211; Building blocks for your application">Design Patterns &#8211; Building blocks for your application</a></li><li><a href="http://techtracer.com/author/" rel="bookmark" title="Permanent Link: Author">Author</a></li><li><a href="http://techtracer.com/2007/04/09/web-and-desktop-apps-the-3rd-world-war/" rel="bookmark" title="Permanent Link: Web and Desktop Apps &#8211; the 3rd World War!">Web and Desktop Apps &#8211; the 3rd World War!</a></li><li><a href="http://techtracer.com/2007/07/22/soa-still-far-from-reality/" rel="bookmark" title="Permanent Link: SOA &#8211; Still Far from Reality">SOA &#8211; Still Far from Reality</a></li><li><a href="http://techtracer.com/2007/08/13/java-ee-exhaustive-yet-enchanting/" rel="bookmark" title="Permanent Link: Java EE &#8211; Exhaustive yet Enchanting">Java EE &#8211; Exhaustive yet Enchanting</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/03/30/designing-enterprise-applications-approaches-and-patterns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>5 Most Exciting Search Tricks with Google Operators</title>
		<link>http://techtracer.com/2008/03/10/5-most-exciting-search-tricks-with-google-operators/</link>
		<comments>http://techtracer.com/2008/03/10/5-most-exciting-search-tricks-with-google-operators/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 17:07:57 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://techtracer.com/2008/03/10/5-most-exciting-search-tricks-with-google-operators/</guid>
		<description><![CDATA[Knowing about different techniques of searching in Google, has the biggest  advantage in saving precious time. The more you optimize your queries, the more  faster you get what you were looking for and finally the more quicker your work gets done. Its a bit of &#8216;more&#8217; in everything when Google search tricks are [...]]]></description>
			<content:encoded><![CDATA[<p>Knowing about different techniques of searching in Google, has the biggest  advantage in saving precious time. The more you optimize your queries, the more  faster you get what you were looking for and finally the more quicker your work gets done. Its a bit of &#8216;more&#8217; in everything when Google search tricks are applied. If you liked my <a href="http://techtracer.com/2008/01/06/10-most-amazing-google-search-tricks/">earlier articles</a> <a href="http://techtracer.com/2008/02/07/5-most-fantastic-movie-search-tricks-with-google/">on how to</a> <a href="http://techtracer.com/2007/12/03/google-experiments-are-brilliant/">use various tricks</a> provided  by Google then here are some &#8216;more&#8217; for you.</p>
<p>The theme for this article is &#8220;<strong>Definitive Search</strong>&#8220;. It means  that, instead of beating around the bush for carrying out permutations and  combinations of your search queries, why not carry out the search for exactly  what we are looking for. By doing this, you would become more sure of getting  the most relevant articles to your queries. Notice the &#8216;more&#8217; here too! <img src='http://techtracer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Most of the <strong>Definitive Search tricks</strong> are obtained by using  the <strong>Google Advanced Operators</strong>. I would like to specify in this  article as to where the operators can be utilized &#8216;more&#8217; efficiently. I was myself  thrilled when I tried using these operators which lead me into writing this  article.</p>
<p style="text-align: center"><img src="http://techtracer.com/wp-content/uploads/2008/03/google-definitive-search-tricks.gif" alt="Google Definitive Search Tricks" /></p>
<p>For this article I am taking a particular case study for search query optimization. So here we go&#8230;</p>
<p>Let us take the current situation of the <a href="http://techtracer.com/2008/01/23/effects-of-oracle-bea-acquisition/">Oracle BEA acquisition</a>. One would be  interested in which stories are doing rounds of it on the web. Even if you put  the phrase <em>Oracle BEA acquisition</em> in Google you would obviously get a lot of  links. Try it:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=Oracle+BEA+acquisition&amp;btnG=Google+Search&amp;meta=" target="_blank">Oracle BEA acquisition</a></li>
</ul>
<p>But can you tell for sure which of the links are actually speaking  specifically about this story? The answer is <strong>NO</strong>. This is  because Google only searches for those articles which have these 3 words viz  <strong>Oracle</strong> or <strong>BEA</strong> or <strong>acquisition</strong>.</p>
<p><strong>1. Most common trick &#8211; Using Quotes</strong></p>
<p>To circumvent the above analogy lets try one of the most common trick, using &#8220;&#8221;  (quotes) around this phrase, since using them restricts the results to include  all the above 3 words and match the articles which have them. Try it:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=%22Oracle+BEA+acquisition%22&amp;btnG=Search&amp;meta=" target="_blank">&#8220;Oracle BEA acquisition&#8221;</a></li>
</ul>
<p>This time the results look good since all the returned results have the 3  words either in content or their titles. But you still cannot say that the links  would have some content surrounding the story. The reason is, if you consider this article itself, the 3 words are mentioned right here above. This means  that even this article might get displayed in the results simply because I have  used all the 3 words with the exact sequence. But there is no story about the  acquisition. Get it?</p>
<p><strong>2. Power of All &#8211; Using the operator <u><em>allintitle</em></u></strong></p>
<p>The time has come for using the powerful Google operator <strong>allintitle:  </strong>This operator is used in a situation as above. Now considering the  above situation, one would be urged to click on any article which has the 3  words in the title, the reason being articles with such titles are bound to be  related exactly to what  the title mentions. This is meaning of being  <strong>definitive</strong>. The operator makes it a point to help you search  the articles on the web which have the 3 words in their <strong>title</strong>.  Try it:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=allintitle%3AOracle+BEA+acquisition&amp;btnG=Search&amp;meta=" target="_blank">allintitle:Oracle BEA acquisition</a></li>
</ul>
<p><strong>3. Power of One &#8211; Using the operator <u><em>intitle</em></u></strong></p>
<p>Similar to the<strong> allintitle</strong> you also can use just <strong>intitle</strong>  which searches for articles which have either &#8220;Oracle&#8221; or &#8220;BEA&#8221; or &#8220;Acquisition&#8221;  in their content and not all the three in the title. It is good for single word  searches which come in title. Let&#8217;s say that you just wanted to find some  articles which mentioned all the acquisitions made by Oracle but you are not  sure of them. The trick would be to use:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=intitle%3AOracle+acquisition&amp;btnG=Search&amp;meta=" target="_blank">intitle:Oracle acquisition</a></li>
</ul>
<p><strong>3. Digging deeper &#8211; Using the operator <u><em>inURL</em></u></strong></p>
<p>This one is my favorite trick. I am always looking out for current topics.  The web on the other hand has got overloaded with redundant information. The  problem lies here. If I search for something I won&#8217;t be so sure whether the  links in the results are <strong>recent or old</strong>. Blogs help me the most  is using this trick to my advantage. If you are frequent visitor of blogs then  you might have noticed that they have the date of publishing right there in the  URL. If you notice this blog too then the URL will have the date. Are you  thinking what I am thinking? <img src='http://techtracer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you have not understood then lets take the same above example. If you take  the 1st example then you would notice that the search results also include old  articles. In this case it also lists out <strong>BEA&#8217;s denial of Oracle merger in 2007</strong>.  What we are interested is not this, but the news of the acquisition in <strong>2008</strong>! So  to try out a simple hack to this is to use the inURL operator. Try this:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=%22Oracle+BEA+acquisition%22+inurl%3A2008&amp;btnG=Search&amp;meta=" target="_blank">&#8220;Oracle BEA acquisition&#8221; inurl:2008</a></li>
</ul>
<p>The usage of <strong>inurl:2008</strong> lists out only those links which  have been published in 2008, thus furthering making your search definitive.</p>
<p><strong>4. The Perfect Match &#8211; Using the operator <u><em>allinurl</em></u></strong></p>
<p>This is the <strong>most definitive</strong> of all the combinations which I have mentioned  above and the most efficient too. But it may not always work because having  multiple words all together in an URL is rare. But still if we try this in our  example:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=allinurl%3AOracle+BEA+acquisition+2008&amp;btnG=Google+Search&amp;meta=" target="_blank">allinurl:Oracle BEA  acquisition 2008</a></li>
</ul>
<p>This is a huge filtering operator. You can judge it by the results  themselves. It gives only a handful of results! Isn&#8217;t that brilliant? However, with this  operator you cannot judge the<strong> quality</strong> of the returned results  since it all depends on the URL is framed and not on the content! But many a  times, I find it exact and helpful. Remember, you don&#8217;t have to put slashes (/)  in here, just the words which you think might appear in the URL.</p>
<p><strong>5. Look who is spying &#8211; Using the operator <em><u>site</u></em></strong></p>
<p>I use this operator sometimes for my amusement. With this operator you can  search for keywords only from particular sites. For example:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=Oracle+BEA+acquisition+site%3Atechtracer.com&amp;btnG=Google+Search&amp;meta=" target="_blank">Oracle BEA acquisition site:techtracer.com</a></li>
</ul>
<p>will search for the articles in this site only! It isn&#8217;t helpful much since  many sites have inbuilt search feature, including <a href="http://techtracer.com/">Techtracer</a>. But you can use it  for finding comments which you might have made in some site! Sounds like  fun!</p>
<p>I remember I had made a comment in <a href="http://www.dailyseoblog.com/" target="_blank">DailySeoBlog</a> a few days ago. But hey, I  don&#8217;t remember which article I had made the comment on. So here is my hack for  using the site operator. Just type which name you had entered while commenting.  I had used my first name <strong>&#8220;nitin&#8221;</strong>. So check this out:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=nitin+site%3Adailyseoblog.com&amp;btnG=Search&amp;meta=" target="_blank">nitin site:dailyseoblog.com</a></li>
</ul>
<p>Amazing isn&#8217;t it? Now I know which all articles I had commented upon in the  blog. So now I can easily see what people or the author has responded to my  comments.</p>
<p><strong>Gimme &#8216;more&#8217;</strong></p>
<p>Using definitive tricks you can now be sure fire way of finding out exactly what you  are looking for. But in the end knowing all the tricks will just won&#8217;t be  helpful if you don&#8217;t apply the right tricks at the right time. It comes with  habit of constantly searching for &#8216;more&#8217; information. I will be continuing writing  about how to improve your search queries. Many &#8216;more&#8217; interesting tricks are about  to come. So keep yourself <a href="http://techtracer.com/feed/" target="_blank">subscribed to Techtracer</a>. <img src='http://techtracer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2008/01/06/10-most-amazing-google-search-tricks/" rel="bookmark" title="Permanent Link: 10 Most Amazing Google Search Tricks">10 Most Amazing Google Search Tricks</a></li><li><a href="http://techtracer.com/2008/02/07/5-most-fantastic-movie-search-tricks-with-google/" rel="bookmark" title="Permanent Link: 5 Most Fantastic Movie Search Tricks With Google">5 Most Fantastic Movie Search Tricks With Google</a></li><li><a href="http://techtracer.com/google-search/" rel="bookmark" title="Permanent Link: Search Results">Search Results</a></li><li><a href="http://techtracer.com/2007/10/14/unleash-the-power-in-your-blog-with-google-custom-search/" rel="bookmark" title="Permanent Link: Unleash the Power in Your Blog with Google Custom Search">Unleash the Power in Your Blog with Google Custom Search</a></li><li><a href="http://techtracer.com/2007/09/06/google-reader-search-goes-live/" rel="bookmark" title="Permanent Link: Google Reader Search Goes Live!">Google Reader Search Goes Live!</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/03/10/5-most-exciting-search-tricks-with-google-operators/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>5 Most Fantastic Movie Search Tricks With Google</title>
		<link>http://techtracer.com/2008/02/07/5-most-fantastic-movie-search-tricks-with-google/</link>
		<comments>http://techtracer.com/2008/02/07/5-most-fantastic-movie-search-tricks-with-google/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 17:28:57 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://techtracer.com/2008/02/07/5-most-fantastic-movie-search-tricks-with-google/</guid>
		<description><![CDATA[My article on 10 Most Amazing Google Search Tricks was very well received which made me realize that people have not yet seen the powerful features provided by Google. The tricks in the article were amongst the common ones which frequent searchers know. But there are still many more which a few rare search savvy [...]]]></description>
			<content:encoded><![CDATA[<p>My article on <a href="http://techtracer.com/2008/01/06/10-most-amazing-google-search-tricks/">10 Most Amazing Google Search Tricks</a> was very well received which made me realize that people have not yet seen the powerful features provided by Google. The tricks in the article were amongst the common ones which frequent searchers know. But there are still many more which a few rare search savvy people, termed &#8220;<strong>google hackers</strong>&#8221; seem to know.</p>
<p>The fact is that, people miss out on these tricks since they are busy finding the keywords! In order to make them aware I will be trying to put up different tricks and their usage as per the requirement so that it becomes easier for you to get the required information in an instant.</p>
<p>This article is specially for the <strong>movie lovers</strong> since I am one of them. I am not &#8220;crazy&#8221; about movies but when I am keen to watch a movie I make it sure that the money is well worth spent. This is the place where Google helps me to make most of the decisions quickly. Some of these decisions include finding:</p>
<ul>
<li>Release date</li>
<li>Cast of the movie</li>
<li>Reviews of the movie</li>
<li>Theatres where the movie is being aired</li>
<li>Checking the schedule</li>
<li>Trailers</li>
</ul>
<p>So let me reveal the <strong>5 most fantastic</strong> Google Movie Search tricks that I frequently use:</p>
<p><strong>1. Movie Reviews<br />
</strong></p>
<p>Google provides a meta parameter &#8220;<strong>movie</strong>&#8221; for finding details of movies. For example, if you want to search for the details of the movie &#8220;<strong>The Matrix</strong>&#8221; then you would have to use,</p>
<ul>
<li><a href="http://www.google.com/movies/reviews?cid=b43ea16ac42b6894&amp;fq=movie:+the+matrix" target="_blank"><strong>movie:</strong> The Matrix</a></li>
</ul>
<p><img src="http://techtracer.com/wp-content/uploads/2008/02/google_movie_search_reviews.gif" alt="Google Movie reviews" /></p>
<p>This would give you the information on the release year of the movie and also would show you the <strong>ratings</strong> which the movie has got from well knowns<strong> critic web sites</strong>. The interesting part of these reviews is that it even shows the number of positive reviews, neutral reviews and negative reviews, sorting by relevance, date and rating.</p>
<p>If you want to stop your friend from pestering you to watch a movie then make sure to check out those <strong>negative</strong> reviews! If you want to find out the details of a certain character from the view, check out links of the characters in <font size="-1"><strong>&#8220;Frequently mentioned terms&#8221;</strong></font>.</p>
<p><strong>2. Discover Movies</strong></p>
<p>If you are left pale from you routine and want to catch up with the <strong>new releases</strong> then instead of reaching out for the different movie sites just go to,</p>
<ul>
<li><a href="http://www.google.com/movies" target="_blank">http://www.google.com/movies</a></li>
</ul>
<p>This will of course give out the American movies. But what if you like to watch movies from your country. Of course, Google must have done something about it!  And it does this, in the form of a simple <strong>domain change</strong> in the URL. For example if you want to find out Indian movies then change the domain in the URL to <strong>.co.in</strong> Here you go,</p>
<ul>
<li><a href="http://www.google.co.in/movies" target="_blank">http://www.google.co.in/movies</a></li>
</ul>
<p>If this page appears blank to you then it is because of the requirement of the <strong>city name</strong> you want to see the movie in. If you are from US,  just enter the <strong>zip code</strong>. This is <strong>the</strong> fantastic feature of the <strong>Google Movie search</strong>. Enter the city name in the box and watch the results. The results will show you all the theaters of the city with the list of movies which are currently being aired.</p>
<p><img src="http://techtracer.com/wp-content/uploads/2008/02/google_movie_search_by_city.gif" alt="Movie by city" /></p>
<p>Some links worth checking out of this page are the <strong>schedules</strong> and the consolidated display of movies and theatres.</p>
<p><img src="http://techtracer.com/wp-content/uploads/2008/02/google_movie_search_schedule.gif" alt="Movie Schedule" /></p>
<p><strong>3. Movie Details</strong></p>
<p>Let&#8217;s say that at this instance, you are feeling about watching any romantic movie. The first thing you would do is either ask your friend about a recommendation or walk into a shop to ask which movies are worth watching. You would not need to do this with <strong>Google Movie Search</strong> in place. All you need is to know what you are looking for. So your keywords in this case would be &#8220;<strong>romantic movies</strong>&#8221; . If you want recent ones just sort them by date.</p>
<ul>
<li><a href="http://www.google.co.in/movies/reviews?q=romantic+movies&amp;sort=1" target="_blank">romantic movies</a></li>
</ul>
<p>As with our earlier trick of changing domain, for searching movie by country, you would be short of luck over here. Because the results always would display english movies regardless of the domain of search. But hey, I have a trick for that too. Just a little change in the query,</p>
<ul>
<li><a href="http://www.google.co.in/movies?q=romantic+hindi+movies&amp;btnG=Search+Films" target="_blank">romantic hindi movies</a></li>
<li><a href="http://www.google.co.in/movies/reviews?q=romantic+indian+movies&amp;sort=1" target="_blank">romantic indian movies</a></li>
<li><a href="http://www.google.co.in/movies/reviews?q=action+hindi+movies&amp;sort=1" target="_blank">action hindi movies</a></li>
</ul>
<p><strong>4. Movie Anatomy</strong></p>
<p>Sometimes it happens so, that you remember a movie but fail to remember the cast of it, even who was the director of it. Google can help you quick fix these thoughts without much waste of time. You don&#8217;t have to open any website nor find the specific keywords if you don&#8217;t know whom you are searching for.  For instance try this,</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=director%3Athe+incredibles&amp;btnG=Google+Search&amp;meta=" target="_blank">director: The Incredibles</a></li>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=director%3AGladiator&amp;btnG=Search&amp;meta=" target="_blank">director: Gladiator</a></li>
</ul>
<p>The first line highlighted in bold spells out the directly the required answer. Fantastic, isn&#8217;t it? Similarly you can find about the entire cast of the film by just doing something similar to this,</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=cast%3A+The+Incredibles&amp;btnG=Search&amp;meta=" target="_blank">cast: The Incredibles</a></li>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=cast%3A+Gladiator&amp;btnG=Search&amp;meta=" target="_blank">cast: Gladiator</a></li>
</ul>
<p><img src="http://techtracer.com/wp-content/uploads/2008/02/google_movie_search_cast.gif" alt="Movie Cast" /></p>
<p>Remember that this <strong>might not </strong>work out in any movie. But for most of the popular movies you would be able to do the above tricks.</p>
<p><strong>5. Trailers</strong></p>
<p>Finally after you have done a hard work of finding the movie details, you would not want to suppress your excitement to go and actually watch the movie. If you cannot wait for long then why not add something more to it. And that is, watching the trailers!</p>
<p>For finding a trailer, you don&#8217;t have to visit the official movie website nor search the video sites. Just use the keywords &#8220;<strong>youtube</strong>&#8221; and &#8220;<strong>trailer</strong>&#8221; with the movie title <strong>in between</strong>. For example,</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=youtube+%22The+Matrix%22+trailer&amp;btnG=Search&amp;meta=" target="_blank">youtube  &#8220;The Matrix&#8221; trailer</a></li>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=youtube+%22Gladiator%22+trailer&amp;btnG=Search&amp;meta=" target="_blank">youtube &#8220;Gladiator&#8221; trailer</a></li>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=youtube+%22The+Incredibles%22+trailer&amp;btnG=Search&amp;meta=" target="_blank">youtube &#8220;The Incredibles&#8221; trailer</a></li>
</ul>
<p><img src="http://techtracer.com/wp-content/uploads/2008/02/google_movie_search_trailer1.gif" alt="Movie Trailer" /></p>
<p>These searches would display <strong>two videos</strong> from youtube which have been named as trailers. These <strong>won&#8217;t</strong> necessarily be official trailers but they just the right videos which you would like to watch. Even if you don&#8217;t get the video playing option in the search results page, click the <strong>first link</strong> which would open up in youtube.</p>
<p><strong>Bonus Tip:</strong>  Apart from the fantastic five searches just one more bonus tip to get to the official site of any movie. Just use the keyword <strong>site</strong> besides the movie name. Examples are:</p>
<ul>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=%22Resident+Evil%22+site&amp;btnG=Search&amp;meta=" target="_blank">&#8220;Resident Evil&#8221; site</a></li>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=%22Finding+Nemo%22+site&amp;btnG=Search&amp;meta=" target="_blank">&#8220;Finding Nemo&#8221; site</a></li>
<li><a href="http://www.google.co.in/search?hl=en&amp;q=%22The+Matrix%22+site&amp;btnG=Search&amp;meta=" target="_blank">&#8220;The Matrix&#8221; site</a></li>
</ul>
<p>You might ask, why I have chosen the same movie names in the examples. This is because these are some of my all time favorite movies <img src='http://techtracer.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . Similarly search for your favorite movie information with Google and enjoy it even more. Have fun!</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2008/03/10/5-most-exciting-search-tricks-with-google-operators/" rel="bookmark" title="Permanent Link: 5 Most Exciting Search Tricks with Google Operators">5 Most Exciting Search Tricks with Google Operators</a></li><li><a href="http://techtracer.com/2008/01/06/10-most-amazing-google-search-tricks/" rel="bookmark" title="Permanent Link: 10 Most Amazing Google Search Tricks">10 Most Amazing Google Search Tricks</a></li><li><a href="http://techtracer.com/google-search/" rel="bookmark" title="Permanent Link: Search Results">Search Results</a></li><li><a href="http://techtracer.com/2007/10/14/unleash-the-power-in-your-blog-with-google-custom-search/" rel="bookmark" title="Permanent Link: Unleash the Power in Your Blog with Google Custom Search">Unleash the Power in Your Blog with Google Custom Search</a></li><li><a href="http://techtracer.com/2007/12/03/google-experiments-are-brilliant/" rel="bookmark" title="Permanent Link: Google Experiments are Brilliant">Google Experiments are Brilliant</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/02/07/5-most-fantastic-movie-search-tricks-with-google/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>
