<?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; Concepts</title>
	<atom:link href="http://techtracer.com/category/concepts/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>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>Mystery of Accessibility in Local Inner Classes</title>
		<link>http://techtracer.com/2008/04/14/mystery-of-accessibility-in-local-inner-classes/</link>
		<comments>http://techtracer.com/2008/04/14/mystery-of-accessibility-in-local-inner-classes/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 16:33:35 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://techtracer.com/2008/04/14/mystery-of-accessibility-in-local-inner-classes/</guid>
		<description><![CDATA[Here is an interesting concept which I came across just recently and considered it worth sharing. I was reading about inner classes concepts where in, there is a type of inner class called the local inner class. Local inner classes are those classes which reside within the function of a method belonging to an outer [...]]]></description>
			<content:encoded><![CDATA[<p>Here is an interesting concept which I came across just recently and considered it worth sharing. I was reading about inner classes concepts where in, there is a type of inner class called the<strong> local inner class</strong>. Local inner classes are those classes which reside <strong>within</strong> the function of a <strong>method</strong> belonging to an outer class. The code can be something shown like this.</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> LocalInnerClassTest <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> defineInnerClass<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;">class</span> MyLocalInnerClass <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> doSomething<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>				
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now lets suppose we want to pass a variable in the <strong>defineInnerClass()</strong> and pass it to the <em><strong>doSomething()</strong></em> for some computation, then according to the specifications on local inner classes methods we must declare the variables as <strong>final</strong> or else it will result in a compile time error. So the resulting code must be something as follows:</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> LocalInnerClassTest <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> defineInnerClass<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #006600; font-weight: bold;">int</span> var<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">class</span> MyLocalInnerClass <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> doSomething<span style="color: #009900;">&#40;</span><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>var<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>where<em><strong> var </strong></em>is the variable that must be declared as <strong>final</strong> to be passed into the <em><strong>doSomething()</strong></em> method of <em><strong>MyLocalInnerClass</strong></em>. Now the mysterious question which I faced was why exactly such a specification has been outlined. Why can&#8217;t the inner class simply take the variable as it is and process further.</p>
<p>In order to understand this reason as to why local inner classes can access only final variables, we have to learn how exactly inner classes get translated to the <strong>byte code</strong>. The moment you come to know this, you can easily see the logic behind making the variables final.</p>
<p><strong>How Are Inner Classes Translated to the Byte Code</strong></p>
<p>Here is the secret. Inner classes as you must have known them from a long time are still mysterious to the  <strong>JVM</strong>. Yes its true. Inner classes have been implemented only to the <strong>compiler</strong> level. When the classes are compiled which contain inner classes, the byte code which gets generated does not actually implement inner classes as a class within a class. The book on <a href="http://www.amazon.com/Core-Java-1-1-1-Fundamentals/dp/0137669577" target="_blank">Core Java</a> from makes this statement:</p>
<blockquote><p>&#8220;Inner classes are translated into regular class files with $ (dollar signs) delimiting outer and inner class names and the virtual machine does not have any special knowledge about them&#8221;</p></blockquote>
<p>That means when the above class file from the example is compiled it will generate two class files such as:</p>
<ol>
<li>LocalInnerClassTest.class</li>
<li>LocalInnerClassTest$MyLocalInnerClass.class</li>
</ol>
<p><strong>Unfurling the mystery of final variables</strong></p>
<p>If you apply logic to the above theory of inner class at the byte code level, you have the answer to the mystery of having final variables. For explanation purpose, lets take the same example.</p>
<p>First lets say we make a call to the <em><strong>defineInnerClass()</strong></em> by creating an instance of <em><strong>LocalInnerClassTest</strong></em>. At this point, the instance of <em><strong>MyLocalInnerClass</strong></em> is still not present because the JVM treats it as a separate class at the byte code level. So when the call to <em><strong>defineInnerClass()</strong></em> is made the JVM tries to instantiate an object of <em><strong>MyLocalInnerClass</strong></em>.</p>
<p>But here we run into a problem. The function <em><strong>doSomething()</strong></em> accesses the <em><strong>var</strong></em> variable which is passed down from the outer class method. If you can simply apply logic over here, you can see the problem. How should the JVM pass the variable which has been declared in one class file to the method in another class file?</p>
<p>In order to solve this big problem, the JVM acts smart. It makes a requirement for the developer to make the variable passed from the method of an outer class to be declared as <strong>final</strong>. How would this solve the problem, you may ask? When you declare the variable <em><strong>var </strong></em>as final the compiler does a trick. The trick being, it quietly places a hidden variable with the name <em><strong>val$var</strong></em> inside the 2nd compiled class file.</p>
<p>The variable <em><strong>val$var</strong></em> is assigned the same value which has been assigned to <strong>var</strong> since now the compiler knows that the value cannot be changed as it has been declared <strong>final</strong>. This is very clever, since final variable must always be assigned before compilation.</p>
<p>So there you go. Now, when you run the program from within an application the inner class already has the value which has been assigned to <em><strong>var</strong></em> through its inner hidden variable <em><strong>val$var</strong></em> and thus the mystery gets solved. Therefore you have the concept that local inner class methods can have access to only the final variables of the outer class.</p>
<p><strong>Hey, Local Inner Classes can even access Outer Class member variables directly. How?<br />
</strong></p>
<p>Ok, now that we have tackled the above mystery, this is more simpler. The below code gets perfectly compiled</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> LocalInnerClassTest <span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #006600; font-weight: bold;">int</span> var2<span style="color: #339933;">;</span>
     <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> defineInnerClass<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #006600; font-weight: bold;">int</span> var<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 	  <span style="color: #000000; font-weight: bold;">class</span> MyLocalInnerClass<span style="color: #009900;">&#123;</span>
 		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> doSomething<span style="color: #009900;">&#40;</span><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>var+var2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 		<span style="color: #009900;">&#125;</span>
     	  <span style="color: #009900;">&#125;</span>
     <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>You can notice that the local inner class has direct access to even the private variable <em><strong>var2</strong></em> of its outer class. The reason behind the accessibility of outer member variables directly inside the local inner classes is that, once again the compiler cleverly places one more hidden variable named as <em><strong>this$0</strong></em> which is a <strong>final</strong> instance variable of the <strong>outer class type</strong>. When the inner class object is instantiated the variable <em><strong>this$0</strong></em> is given a reference to the outer variable with<strong> direct access  privileges</strong>. Hence  you can access the outer class  member variables directly from within the inner class.  Smart isn&#8217;t it?</p>
<h2>Related posts:</h2><ul><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/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/06/21/learn-the-servlet-api-a-step-by-step-approach/" rel="bookmark" title="Permanent Link: Learn the Servlet API &#8211; A step by step approach">Learn the Servlet API &#8211; A step by step approach</a></li><li><a href="http://techtracer.com/2007/04/07/annotations-in-pojo-a-boon-or-a-curse/" rel="bookmark" title="Permanent Link: Annotations in POJO &#8211; a boon or a curse?">Annotations in POJO &#8211; a boon or a curse?</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></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/04/14/mystery-of-accessibility-in-local-inner-classes/feed/</wfw:commentRss>
		<slash:comments>20</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>
		<item>
		<title>Analyzing and Improving Your Website Performance</title>
		<link>http://techtracer.com/2008/01/14/analyzing-and-improving-your-website-performance/</link>
		<comments>http://techtracer.com/2008/01/14/analyzing-and-improving-your-website-performance/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 16:52:58 +0000</pubDate>
		<dc:creator>ninadgawad</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://techtracer.com/2008/01/14/analyzing-and-improving-your-website-performance/</guid>
		<description><![CDATA[How many times have people said that your website is too slow and you found out that there is nothing you can do to improve its performance? The final option most of the times might have been either trying to change your hosting server (may be even blaming him for purposely slowing your website) or [...]]]></description>
			<content:encoded><![CDATA[<p>How many times have people said that your website is too slow and you found out that there is nothing you can do to improve its performance? The final option most of the times might have been either trying to change your hosting server (may be even blaming him for purposely slowing your website) or finding several ways to optimize your code.</p>
<p style="text-align: center"><img src="http://techtracer.com/wp-content/uploads/2008/01/website_performance.jpg" alt="Website performance" /></p>
<p>Over last few months I have been facing this same problem. I browsed the web for answers, even went ahead and bought many books on <strong>Website Optimization</strong>. All of them more or less targeted the same issue of <strong>caching static contents</strong> using additional third party tools which improvises upon browser caching thus getting better performance and all that sort of stuff.</p>
<p><strong>Analyzing the Website Performance</strong></p>
<p>There were enough options to start that made me crazy as to which one to go ahead with, I wanted things to be under my control rather than adding complexities. For this I needed information as to what actually is traveling between my web server and web browser. I added <strong>loggers</strong> in my code to note the timestamps at server, even timed by database queries.</p>
<p>All I wanted to know was what actually was being downloaded by the client. In this situation one tool finally came to my rescue. That was <a href="http://developer.yahoo.com/yslow/" target="_blank">Yahoo YSlow</a>. It helped in finding:</p>
<ul>
<li> The contents of the response object which gave a picture of images, scripts, and style sheets that were being downloaded from the server.</li>
<li>The content size and time taken to download each of them.</li>
</ul>
<p>Using this tool I came to know that the<strong> </strong><a href="http://developer.yahoo.net/blog/archives/2007/07/high_performanc_3.html" target="_blank">gzip<strong> </strong>feature</a> to compress the html pages was not working. I even found some old images hidden in Java script which where <strong>never</strong> being displayed but where getting unnecessarily downloaded.</p>
<p><strong>Improving the Website Performance</strong></p>
<p>With the above analysis, I managed to fix the performance of my web site. These are two things which I would suggest you to try out in order to improve your web site performance.</p>
<p><strong>1. Minifying JavaScript and CSS files</strong></p>
<p>An important step in improving the load speed of a website is to reduce the <strong>download time </strong>taken by JavaScript and CSS files. In my case, the attention was focused to <strong>minify</strong> these files. As a Java developer I always want properly intended code with comments to debug the script. But this actually <strong>increases</strong> the script size and <strong>degrades </strong>the website performance, hence one must make sure that <a href="http://www.maxkiesler.com/index.php/weblog/comments/how_to_minimize_your_javascript_and_css_files_for_faster_page_loads/" target="_blank">CSS &amp; JavaScript files are minified</a> before being deployed in production server. It helps to boost the website performance.</p>
<p>You can check the source code of<strong> Google homepage </strong>to see they how the JavaScript, HTML file and style sheets are being minified to the best possible way. The loading time for a Google page itself reveals the  advantage of using this technique.</p>
<p><strong>2. Combining small images into ONE image</strong></p>
<p><a href="http://www.websiteoptimization.com/speed/tweak/combine/" target="_blank">Combine small icons into a single image</a> and use <a href="http://en.wikipedia.org/wiki/Image_map" target="_blank">image map</a> to display the section of the image. This feature is being used by many websites for improving performance since a single request is much <strong>faster</strong> than making 10 individual requests.</p>
<p>Even Microsoft has followed the style of combining multiple images into one, in its search engine home page <a href="http://www.live.com" target="_blank">Live.com</a>. If you see the background image of the page then, you will notice that all small images have been combined to form a <a href="http://www.live.com/live/1.900.9.019/img/hp2.png" target="_blank">single png file</a>.</p>
<p>Fixing these simple issues improved my website performance by <strong>13-15%</strong> without actually spending money on increasing bandwidth or taking any extra efforts. However I would like to know if there are any other steps which might help further in improving a site performance.</p>
<p><em>(<strong>Ninad Gawad</strong> is a Java EE Developer who blogs at <a href="http://ninadgawad.wordpress.com/" target="_blank">Technology Discussion</a>)</em></p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2008/05/25/firefox-3-is-arriving-shortly-gear-up/" rel="bookmark" title="Permanent Link: Firefox 3 is Arriving Shortly &#8211; Gear Up!">Firefox 3 is Arriving Shortly &#8211; Gear Up!</a></li><li><a href="http://techtracer.com/2007/05/13/why-sybase-is-similar-to-microsofts-sql-server/" rel="bookmark" title="Permanent Link: Why Sybase is similar to Microsoft&#8217;s SQL Server">Why Sybase is similar to Microsoft&#8217;s SQL Server</a></li><li><a href="http://techtracer.com/2007/12/01/nasa-adopts-ajax-launches-nasa-50/" rel="bookmark" title="Permanent Link: NASA adopts Ajax, Launches NASA 5.0">NASA adopts Ajax, Launches NASA 5.0</a></li><li><a href="http://techtracer.com/2008/02/16/power-of-xray-for-web-designers/" rel="bookmark" title="Permanent Link: Power of XRAY for Web Designers">Power of XRAY for Web Designers</a></li><li><a href="http://techtracer.com/2007/09/26/seo-for-wordpress-beginners/" rel="bookmark" title="Permanent Link: SEO for Wordpress Beginners">SEO for Wordpress Beginners</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/01/14/analyzing-and-improving-your-website-performance/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>10 Most Amazing Google Search Tricks</title>
		<link>http://techtracer.com/2008/01/06/10-most-amazing-google-search-tricks/</link>
		<comments>http://techtracer.com/2008/01/06/10-most-amazing-google-search-tricks/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 17:16:53 +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/01/06/10-most-amazing-google-search-tricks/</guid>
		<description><![CDATA[Searching on Google can be a magical experience once you find out how to make your search queries efficient. By making efficient I mean using some tricks or the cheat sheet provided by Google itself to quickly find what you actually require. Having being hooked onto Google for a long time now, I have come [...]]]></description>
			<content:encoded><![CDATA[<p>Searching on <strong>Google</strong> can be a magical experience once you find out how to make your search queries efficient. By making efficient I mean using some tricks or the cheat sheet provided by Google itself to quickly find what you actually require. Having being hooked onto Google for a long time now, I have come across some amazing search tricks which can change the way you look at Google today.</p>
<p style="text-align: center"><img src="http://techtracer.com/wp-content/uploads/2008/01/google_search_tricks1.gif" alt="Google Search Tricks" /></p>
<p>In this article I will list down the search tricks which I use quite frequently. Be it finding time, meanings or watching the cricket score, searching PDF&#8217;s, with Google as the search engine life cannot be more simpler. Here are the 10 most amazing Google Search tricks:</p>
<p><strong>1. Different Types of Files at your will</strong><br />
How many times would you have asked for materials (PDF, PPT, DOC) for a particular topic from a friend? Its almost everyday that we might have the necessity to ask them either for knowledge, preparing a presentation, white-paper or for case studies. Such times it mostly difficult to look out what to exactly search for because most of the times you don&#8217;t know about the topic at hand. But this petty keyword unleashes its lethal power at such occasions.</p>
<p>Let&#8217;s say I want to implement a<strong> case study</strong> on SOA which means I have to read a lot of information for SOA. So I just have to find materials which might have already been uploaded on the web in the form of <strong>PDF&#8217;s, DOC&#8217;s or PPT&#8217;s</strong>. These materials can be easily obtained by doing a search for:</p>
<ul>
<li><strong>PDF &#8211; </strong><a href="http://www.google.co.in/search?q=service+oriented+architecture+filetype%3Apdf" target="_blank">service oriented architecture<strong> filetype:pdf</strong></a></li>
<li><strong>PPT &#8211; </strong><a href="http://www.google.co.in/search?q=service+oriented+architecture+filetype%3Appt" target="_blank">service oriented architecture <strong>filetype:ppt</strong></a></li>
<li><strong>DOC &#8211; </strong><a href="http://www.google.co.in/search?q=service+oriented+architecture+filetype%3Adoc" target="_blank">service oriented architecture <strong>filetype:doc</strong></a></li>
</ul>
<p><strong>2. Scholarly Search</strong><br />
If you want some authenticity of the materials then it would be better to find the materials from educational institutes or universities. For this use the <a href="http://scholar.google.com/" target="_blank">Google scholar search</a>. But suppose you don&#8217;t like to switch to Google scholar search you can add the same query with an <strong>additional parameter</strong> to the normal Google search box,</p>
<ul>
<li><a href="http://www.google.co.in/search?q=service+oriented+architecture+filetype%3Apdf+site%3Aedu" target="_blank">service oriented architecture <strong>filetype:pdf site:edu</strong></a></li>
</ul>
<p><strong>3. Meanings of any word in an instant<br />
</strong>Now you do not have to carry a dictionary or install a dictionary software just for the purpose of finding out a meaning of a word. With the wealth of information in Google&#8217;s hands, its a piece of cake to find out the meaning of the word. Just use the<strong> define: </strong>keyword. The meaning would of course be displayed but also a set of other links which might have an alternative definition are also given out with the link to read more about it.</p>
<ul>
<li><a href="http://www.google.co.in/search?q=define%3Abureaucracy" target="_blank">define:beureaucracy</a></li>
</ul>
<p>You would argue here that, a dicitionary gives out more information than this. But what about words that don&#8217;t actually fall within the vocabulary. Suppose you want to know what <strong>SOA (Service Oriented Architecture)</strong> is then you would have no choice. Google Search comes to your rescue in this case,</p>
<ul>
<li><strong>Abbreviations</strong> &#8211; <a href="http://www.google.co.in/search?q=define%3A+soa" target="_blank">define: SOA</a></li>
<li><strong>Jargons</strong> &#8211; <a href="http://www.google.co.in/search?q=define%3Aweb+2.0" target="_blank">define: Web 2.0</a></li>
<li><strong>SMS language</strong> &#8211; <a href="http://www.google.co.in/search?q=define%3ALOL" target="_blank">define: LOL</a></li>
</ul>
<p><strong>4. Find the time of any location</strong><br />
Many of us might be probably working for client which are based at different locations. And communication has to be carried out frequently carried out in such cases. But before a communication you have to know which time zone the location is falling into otherwise you would be causing a disturbance.</p>
<p>I have seen people installing time zone software for showing the time of the location they would be calling to. But with Google at your hands you don&#8217;t have to install any software. It would be just simple to use a query for finding the current time such as,</p>
<ul>
<li><a href="http://www.google.co.in/search?q=time+new+york" target="_blank">time new york</a></li>
</ul>
<p><strong>psst&#8230;.</strong>look closely the time on the little clock graphic. It also shows the perfect time!</p>
<p><strong>5. Weather at your fingertips</strong><br />
I had been to <a href="http://techtracer.com/2007/12/20/goa-parade/" target="_blank">GOA for a Christmas vacation</a> in the last week of December. But I made a mistake of not finding out the temperature of GOA before leaving. Had I known that it is hot even in the winter I would not have made the mistake of carrying additional luggage consisting of blankets and jackets.</p>
<p>If you are thinking to visit a place it is useful to know what the temperature of the place is before hand, it can make efficient packing. Google helps you here too. Just use this query without asking anybody or waiting for the news to make a weather report. I wish I had thought of this!</p>
<ul>
<li><a href="http://www.google.co.in/search?q=goa+weather" target="_blank">goa weather</a></li>
</ul>
<p><strong>6. Google does live commentary too!</strong><br />
Indians are cricket fanatics. But its amusing to see the organizations here trying to put together tactics to devoid cricket lovers from wasting time to watch the cricket scores instead of doing their work. What I think they fail to understand is that by blocking the live cricket scoring sites they are actually making the employees more curios and provoking them to hunt for proxy networks or listen to the radio or chat with their friends elsewhere.</p>
<p>Jokes apart, you actually don&#8217;t need proxy networks to view the <strong>live cricket scores</strong> if you at least have access to Google. If you want to find the latest info about <strong>all the cricket</strong> <strong>matches </strong>then just type,</p>
<ul>
<li><a href="http://www.google.co.in/search?q=cricket" target="_blank">cricket</a></li>
</ul>
<p>But if you want to find out only about a <strong>particular match</strong> then use only the names of the two playing nations,</p>
<ul>
<li><a href="http://www.google.co.in/search?q=india+australia" target="_blank">India Australia</a></li>
</ul>
<p>Remember that the scorecard will come <strong>only</strong> when the play is <strong>going on</strong>.</p>
<p><strong>7. Calculate with your browser</strong><br />
Every OS has a calculator inbuilt but when the browser is the thing which is constantly open whey bother to open up a calculator. Open Google and straight away type your mathematical expression. You can go all the way from <strong>basic arithmetic</strong> to <strong>trigonometrical expressions</strong>. This is simply amazing stuff accomplished by Google.</p>
<ul>
<li><a href="http://www.google.co.in/search?q=26+*+9000" target="_blank">26 * 9000</a></li>
<li><a href="http://www.google.co.in/search?q=sin(90)+%2F+cos+(90)" target="_blank">sin(90) / cos (90)</a></li>
</ul>
<p><strong>8. Compare your currency with others</strong><br />
Now that the dollar is declining, the rest of the world must be busy trying to check the impact of the dollar on their currencies. But first of all one must know how much a particular currency amounts to when cashed in another currency. Google&#8217;s <strong>inbuilt currency converter</strong> just does this.</p>
<ul>
<li><a href="http://www.google.co.in/search?q=1+USD+in+INR" target="_blank">1 USD in INR</a></li>
<li><a href="http://www.google.co.in/search?q=1+EUR+in+INR" target="_blank">1 EUR in INR</a></li>
</ul>
<p><strong>9. Keep track of the stocks</strong><br />
With the booming stock market it is very important to track the stocks on a day to day basis. Putting a stock ticker in the search box is the most obvious thing you would think of. But it is not always you would remember the stock ticker, you should add the keyword &#8220;<strong>stocks</strong>:&#8221; to the company name.</p>
<p>The<strong> best part</strong> of the obtained result is that it <strong>provides a chart</strong> which shows the trend in the company&#8217;s stock along with important statistics.</p>
<ul>
<li><a href="http://www.google.co.in/search?q=stocks%3A+INFY" target="_blank">stocks: INFY</a></li>
</ul>
<p><strong>Note: </strong>Currently the results are restricted to the companies listed in the <strong>US stock markets</strong>.</p>
<p><strong>10. Wanna find some faces?</strong><br />
This is most interesting trick. You might be needing images for various occasions and searching for images is the most difficult thing because what we expect might not be possibly mapped to a query. But Google has a parameter in place for images in situations we need an image which describes a face.</p>
<p>Suppose I search for the term &#8220;<a href="http://images.google.co.in/images?q=happy" target="_blank">happy</a>&#8221; then the Google results page displays smileys. But I would like to use images of happy people. Even if I choose the term as &#8220;<a href="http://images.google.co.in/images?q=happy%20face" target="_blank">happy face</a>&#8221; the results don&#8217;t show images which contain people. For this there is a parameter &#8220;<strong>imgtype</strong>&#8221; which you can use with the URL. For this put in the URL as follows:</p>
<ul>
<li><a href="http://images.google.co.in/images?q=happy&amp;imgtype=face" target="_blank">http://images.google.co.in/images?q=happy&amp;<strong>imgtype=face</strong></a></li>
</ul>
<p>There are many more variations which can be bought about with the above tricks thus making your search experience not only enriching but also exciting. If I have missed any tricks of common usage, feel free to mention it.</p>
<p><strong>Update 1:</strong> Google keeps on experimenting new ways of searching. If you liked the above tricks then don&#8217;t miss out my article which mentions how to use the <a href="http://techtracer.com/2007/12/03/google-experiments-are-brilliant/">new search experiments introduced by Google</a>. Believe me, they are brilliant!</p>
<p><strong>Update 2</strong> : Search for your favorite movie information with Google and enjoy it even more. Have fun with the <a href="http://techtracer.com/2008/02/07/5-most-fantastic-movie-search-tricks-with-google/">5 Most Fantastic Movie Search Tricks With Google</a>.</p>
<p><strong>Update 3 : </strong>Why not carry out the search for exactly  what we are looking for? Get excited for trying out <a href="http://techtracer.com/2008/03/10/5-most-exciting-search-tricks-with-google-operators/">5 Most Exciting Search Tricks with Google Operators</a></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/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/2008/01/27/the-power-of-javascript-favelets/" rel="bookmark" title="Permanent Link: The Power of JavaScript Favelets">The Power of JavaScript Favelets</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></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2008/01/06/10-most-amazing-google-search-tricks/feed/</wfw:commentRss>
		<slash:comments>183</slash:comments>
		</item>
		<item>
		<title>Choosing Fixed Layout Over Fluid Layout</title>
		<link>http://techtracer.com/2007/12/12/choosing-fixed-layout-over-fluid-layout/</link>
		<comments>http://techtracer.com/2007/12/12/choosing-fixed-layout-over-fluid-layout/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 17:48:09 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Opinions]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/12/12/choosing-fixed-layout-over-fluid-layout/</guid>
		<description><![CDATA[I had been using fluid designs over a couple of months until the big screens came into picture. The fluid designs became so drastically different on those big screens that I found all my imagined design going down the drain. The web site rendered itself in such an ugly manner that it came down to [...]]]></description>
			<content:encoded><![CDATA[<p>I had been using <strong>fluid designs</strong> over a couple of months until the big screens came into picture. The fluid designs became so drastically different on those big screens that I found all my imagined design going down the drain. The web site rendered itself in such an ugly manner that it came down to negative remarks of the big flat screen owner. So the ultimate question to me was, why did I choose a fluid layout in the first place?</p>
<p style="text-align: center; font-size: 9px"><img src="http://techtracer.com/wp-content/uploads/2007/12/fluid_vs_fixed_layout.gif" alt="Fixed Layout vs. Fluid Layout" /><br />
Image Credit &#8211; <a href="http://www.flickr.com/photos/mountaingoat/" target="_blank">mountaingoat </a></p>
<p>If you are bewildered about the fluid and fixed terminology then their concepts are somewhat self-explanatory:</p>
<p><strong>Fixed Layout</strong> &#8211; The dimensions of blocks in your web design structure are defined by pixel length and not by percentages. The design gets defined by hard coding the pixel lengths. Such designs are displayed uniformly on screens of any resolution or size.</p>
<p><strong>Fluid Layout </strong>- The dimensions are on the contrary made in such a manner that they become fluid. Its similar to the concept of water taking the shape of its container. The fluid designs take the shape of the resolution in which the design is being viewed.</p>
<p>After trying my hands on a fixed layout for designing a theme for <a href="http://techtracer.com/">Techtracer</a>, I felt somewhat relaxed over my earlier efforts of going for a fluid scheme. I am feeling a necessity of sharing it with the readers of this blog, what pros and cons I consider for fluid and fixed layout when it comes to designing your web site from what I have gathered till now.</p>
<p><strong>Fixed Layout vs Fluid Layout</strong></p>
<p>A fixed layout as defined simply means that the length which you give for a certain area will remain the same no matter what. If that is the case, then I am happy because I know that the change in the resolution of size of the screen wont cause problems for my design.</p>
<p>But in case of a fluid layout the <strong>area widens</strong> on a big screen and if the screen is really huge then your area will be <strong>stretched</strong> like a rubber band. In short, the <strong>mood</strong> of the design is dampened. The main problematic area for a fluid layout is the<strong> rendering of text</strong>.</p>
<p><strong>An Example </strong></p>
<p>Suppose you are viewing the article <a href="/2007/12/10/5-rules-for-a-good-web-design/">5 Rules For A Good Web Design</a> in a 15&#8243; screen of resolution 1024 x 768 then you would notice 7 lines of text in the first paragraph. But this design is built on the fixed layout so even if I view the same article on a wide screen then still it remains the same. But suppose the design was made with the fluid layout then you would have seen,</p>
<ul>
<li>10 to 12 lines on a resolution of 800&#215;600 because of <strong>squeezing</strong> of content area</li>
<li>2 lines probably on a wide screen with larger resolution because of <strong>expanding</strong> of content area</li>
</ul>
<p>The large screen with less lines of text make the site look more with large spaces and less content and the <strong>reading become harder</strong>. Similarly on low resolution, the content area gets squeezed making it look ridiculous. The impression for the design falls down.</p>
<p>For that matter a fixed layout would be perfect because even if the screen comes to a lower resolution the content remains intact. In this case, a scroll bar appears on the browser to view the content placed beyond the browser area. But I would be comfortable with this because the <strong>essence</strong> of the layout remains as it was designed to be.</p>
<p>For the above reason I believe that fixed layout reigns over fluid layout and I would continue with the same thought. I think this will give a food for thought to the web designers who are in a dilemma of whether to go for a fixed layout or a fluid layout.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2007/04/22/bluewhirl-new-wordpress-theme-for-techtracer/" rel="bookmark" title="Permanent Link: BlueWhirl &#8211; new wordpress theme for TechTracer">BlueWhirl &#8211; new wordpress theme for TechTracer</a></li><li><a href="http://techtracer.com/2007/04/25/reverting-the-theme-to-bosco/" rel="bookmark" title="Permanent Link: Reverting the theme to Bosco">Reverting the theme to Bosco</a></li><li><a href="http://techtracer.com/2008/01/13/how-to-install-windows-live-writer/" rel="bookmark" title="Permanent Link: How To Install Windows Live Writer">How To Install Windows Live Writer</a></li><li><a href="http://techtracer.com/2007/12/10/5-rules-for-a-good-web-design/" rel="bookmark" title="Permanent Link: 5 Rules For A Good Web Design">5 Rules For A Good Web Design</a></li><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></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/12/12/choosing-fixed-layout-over-fluid-layout/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SEO for Wordpress Beginners</title>
		<link>http://techtracer.com/2007/09/26/seo-for-wordpress-beginners/</link>
		<comments>http://techtracer.com/2007/09/26/seo-for-wordpress-beginners/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 16:00:42 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/09/26/seo-for-wordpress-beginners/</guid>
		<description><![CDATA[What is SEO?
Search engine optimization (SEO) is a term commonly used for the techniques which ensure that your website becomes search engine friendly. This includes making you site adhere to certain rules which makes it easy for the search engine spiders to crawl effortlessly in your site pages and rank them or list them accordingly.
Why [...]]]></description>
			<content:encoded><![CDATA[<p><u><strong>What is SEO?</strong></u></p>
<p><strong>Search engine optimization</strong> (SEO) is a term commonly used for the techniques which ensure that your website becomes search engine <strong>friendly</strong>. This includes making you site adhere to certain rules which makes it easy for the search engine spiders to crawl effortlessly in your site pages and rank them or list them accordingly.</p>
<p><u><strong>Why is SEO required?</strong></u></p>
<p>SEO is must required for anyone who wants his/her website to reach to a <strong>large audience</strong>. For personal blogs, it does not matter much as the content in its sense is somewhat personal and does not cater to a large mass. But the web sites or blogs which cater to a reader&#8217;s needs should follow some SEO techniques without which the intention to get the idea across is left unintended. In other words, as you need expressions to make your thoughts move across to the people, you need SEO to make your <strong>online information</strong> accessible to the worldwide surfers. Thus, SEO is important.</p>
<p><u><strong>Can you provide any example?</strong></u></p>
<p><strong>Techtracer </strong>is a blog on technology. It includes articles, views, reviews, tutorials, news, resources which cater to a technology. Whatever I write, I make it a point that it should be <strong>well served</strong>. This means that whenever a person needs help in a particular aspect then my blog should be easily found. For this, I have to adopt SEO. Since SEO concepts are implemented in this site this is easily searchable on search engines.</p>
<p><u><strong>How to implement SEO?</strong></u></p>
<p>SEO is a very vast topic and it ranges from designing strategies of your site layout to the words you put in the site. In this particular article I would explain how to make it simple for <strong>wordpress</strong> users to implement SEO in their wordpress blogs. I will explain you <strong>5 tips</strong> by which your site will easily become search able. For the searching aspect I am targeting <strong>Google</strong> which forms a major part of the of the search queries.</p>
<p>1. Properly use that <strong>Title</strong><br />
2. Using <strong>Meta</strong> tags for targetted searches<br />
3. Making a <strong>Sitemap</strong> for your blog<br />
4. Using the <strong>robots.txt</strong> file<br />
5. Highlighting the proper <strong>keywords</strong>.</p>
<p>These are the 5 <strong>basic</strong> tips that I would like to elaborate in the forth coming posts which will be very helpful if you are using Wordpress. I am talking about <strong>Wordpress</strong> because you don&#8217;t have to do much since there are <strong>plugins </strong>which can do the majority of the things for you. So you don&#8217;t have to be a technical expert in implementing these basic yet <strong>powerful</strong> SEO tips. Bookmark this page or subscribe to this blog to get updated automatically for the <strong>upcoming</strong> posts on SEO for wordpress.</p>
<h2>Related posts:</h2><ul><li><a href="http://techtracer.com/2008/01/02/wordpress-database-error-table-wp_post2cat-doesnt-exist/" rel="bookmark" title="Permanent Link: Wordpress Database Error &#8211; Table &#8216;wp_post2cat&#8217; doesn&#8217;t exist">Wordpress Database Error &#8211; Table &#8216;wp_post2cat&#8217; doesn&#8217;t exist</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/04/22/bluewhirl-new-wordpress-theme-for-techtracer/" rel="bookmark" title="Permanent Link: BlueWhirl &#8211; new wordpress theme for TechTracer">BlueWhirl &#8211; new wordpress theme for TechTracer</a></li><li><a href="http://techtracer.com/2007/07/18/wordpress-error-allowed-memory-size-of-8388608-bytes/" rel="bookmark" title="Permanent Link: Wordpress Error &#8211; &#8220;Allowed memory size of 8388608 bytes&#8221;">Wordpress Error &#8211; &#8220;Allowed memory size of 8388608 bytes&#8221;</a></li><li><a href="http://techtracer.com/about/" rel="bookmark" title="Permanent Link: About">About</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/09/26/seo-for-wordpress-beginners/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Understanding XSD Namespaces With Concepts of Java</title>
		<link>http://techtracer.com/2007/09/19/understanding-xsd-namespaces-with-concepts-of-java/</link>
		<comments>http://techtracer.com/2007/09/19/understanding-xsd-namespaces-with-concepts-of-java/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 17:49:17 +0000</pubDate>
		<dc:creator>nitinpai</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://techtracer.com/2007/09/19/understanding-xsd-namespaces-with-concepts-of-java/</guid>
		<description><![CDATA[This article is aimed at developers who are good at programming languages like Java and want a quick jump on the XSD bandwagon by understanding some important concepts like namespaces. Hope that this article helps to make you understand namespaces quite easily.
What is a namespace?
A namespace is an identifier for elements. XML and XSD use [...]]]></description>
			<content:encoded><![CDATA[<p>This article is aimed at developers who are good at programming languages like <strong>Java</strong> and want a quick jump on the <strong>XSD</strong> bandwagon by understanding some important concepts like <strong>namespaces</strong>. Hope that this article helps to make you understand <strong>namespaces</strong> quite easily.</p>
<p><u><strong>What is a namespace?</strong></u></p>
<p>A namespace is an <strong>identifier</strong> for elements. <strong>XML</strong> and <strong>XSD</strong> use the concept of namespaces to define a<strong> relationship</strong> between the elements and their hierarchy. It means that when their are multiple elements to be defined then it might be possible that some of the elements may tend to have the same name. But having the same name often leads to collision just as the in the case of classes with same names although in different packages but referenced by name alone in a Java program. Hence the concept of <strong>namespaces</strong> is used in order to distinguish such elements.</p>
<p><u><strong>Why are namespaces used?</strong></u></p>
<p>XML and XSD are never meant for human reading. You have to remember that even though XML is a <strong>data representation</strong> markup language, it would be rare that you will actually be parsing through an XML file to use the data in your application through your own code.</p>
<p>Such parsing is often supplied through the use of API&#8217;s like <strong>SAX, DOM, JAXB</strong>, etc. You would have till now actually used these libraries while dealing with web services since it is field which uses XML, XSD to the maximum. The concept of namespace has no <strong>relevance</strong> until and unless an XML<strong> instance</strong> is associated with an <strong>XML Schema</strong> (XSD). This is because, XSD defines what do the elements in the XML instance actually mean. A standalone XML just makes the data easier to understand to you but to an XML parser it is nothing but a set of elements in some heirarchy.</p>
<p>For example if suppose you have the following XML format:</p>
<blockquote><p>&lt;employee&gt;<br />
&lt;name&gt;<strong>Alan</strong>&lt;/name&gt;<br />
&lt;/employee&gt;</p></blockquote>
<p>From this an XML parser can list out that the XML instance contains <strong>2 elements</strong> in which <em>employee</em> is the <strong>root </strong>and <em>name</em> is the <strong>child</strong> of employee. It cannot say anything more than that. For giving more meaning to the elements, XML Schema or XSD should be provided. If you want the parser to know what kind of element <em>employee</em> is then you would have to provide a namespace for the element to be in as follows:</p>
<blockquote><p>&lt;<strong>tt</strong>:employee <strong>xmlns:tt</strong>=&#8221;http://techtracer.com/schemas/employee&#8221;&gt;<br />
&lt;name&gt;Alan&lt;/name&gt;<br />
&lt;/<strong>tt</strong>:employee&gt;</p></blockquote>
<p><u><strong>How to interpret namespaces?</strong></u></p>
<p>In an object oriented language like Java, entities of the real world are mapped to <strong>Beans</strong>. Beans have <strong>properties</strong>. And in general every application uses the beans and their properties to provide values which are taken from either a system or an end user. Such values when needed to be transferred in the XML format need some kind of hierarchy to be structured with. For this API&#8217;s come to the rescue.</p>
<p>But before we can supply the API with the elements in any adhoc fashion it becomes necessary that we make the API aware of the structure by providing it with the Schema without which the API won&#8217;t be able to tell you if anything has gone wrong in the hierarchy or not. Such API are said to be <strong>namespace aware</strong> API&#8217;s.</p>
<p>For Example, if I have an bean inside a package which is to be included into any program then you would include it when required as:</p>
<blockquote><p><strong>import</strong> com.techtracer.*;</p>
<p>//and then make the bean as</p>
<p>MyBean bean = new MyBean();</p></blockquote>
<p>Now you can refer to the classes within the package successfully.</p>
<p>Comparing the above to namespaces consider the example.</p>
<blockquote><p>&lt;tt:employee xmlns:tt=&#8221;http://techtracer.com/schemas/employee&#8221;&gt;<br />
&lt;/tt:employee&gt;</p></blockquote>
<p>Here <strong>tt</strong> would be an <em>prefix</em> to the elements which has the value of the entire URL and it would correspond to the namespace just as a package in Java and <em>employee</em> would be an element just as the <em>MyBean</em> in Java. If you would not have provided the packages then the Java program would have given out an error. Similarly in a namespace aware XML parser if you don&#8217;t specify the namespace of the element then it would not run successfully.</p>
<p><u><strong>Default Namespaces</strong></u></p>
<p><strong>java.lang.*</strong> is the default package of core java. Comparing with a XSD the default namespace is:</p>
<blockquote><p>&lt;xsd <strong>xmlns</strong>=&#8221;http://www.w3c.org/2001/01/XMLSchema&#8221;&gt;<br />
&lt;/xsd&gt;</p></blockquote>
<p>Here <strong>xsd</strong> is in the default namespace i.e. the element xsd is an element of the XSD <strong>specification</strong>. So now we can say that as java.lang is the default package of java similarly the above namespace is the default namespace of XSD. And as <strong>Object</strong> is the parent of the Java classes the element xsd is the root of the XSD specification</p>
<p><u><strong>Custom and Target Namespaces</strong></u></p>
<p>There are libraries in Java, which may / may NOT be required. Library means something which you can refer to when required, else not. So including it unnecessarily as a inherent feature may be disturbing since they are present for specific reasons and not to be imposed as an implicit feature of the language. Consider this example:</p>
<blockquote><p>&lt;xsd xmlns=&#8221;http://www.w3c.org/2001/01/XMLSchema&#8221;&gt;<br />
&lt;<strong>employee</strong>&gt;Alan&lt;/<strong>employee</strong>&gt;<br />
&lt;/xsd&gt;</p></blockquote>
<p>Woops, now here is an error. The element <em>employee</em><strong> </strong>is <strong>NOT</strong> an element of the XSD specification. If you have an XSD<strong> validator</strong> it will blurt out with a big error message. This is because the XSD specification does not know a thing about your custom element <em>employee</em>. So what do you do? Somehow you should keep your<strong> </strong><em>employee</em> in a safe and secure place where it can be recognized as yours. So we can keep it under a <strong>custom namespace</strong> like &#8220;http://techtracer.com/schemas/employee&#8221;. So the change required in the above fragment would be as follows:</p>
<blockquote><p>&lt;xsd xmlns=&#8221;http://www.w3c.org/2001/01/XMLSchema&#8221; <strong>targetnamespace</strong>=&#8221;http://techtracer.com/schemas/employee&#8221;&gt;<br />
&lt;employee&gt;Alan&lt;/employee&gt;<br />
&lt;/xsd&gt;</p></blockquote>
<p>So now when the XSD validator comes across the element <strong>employee</strong>, it just checks if you have told it where it should belong (before starting the ritual of swearing at you!). Now it knows that you have mentioned a thing called <strong>targetnamespace.</strong> So it knows that your <em>employee</em> actually belongs to a separate specification which is nothing but your custom XML Schema. The new URL which is mentioned in the targetnamespace is your <strong>custom namespace</strong> itself.</p>
<p><u><strong>Conclusion</strong></u></p>
<p>Hope that this article helps to make you understand <em>namespaces</em> quite easily. Feel free to ask a question if you have any doubt about <em>namespaces</em>. Your query will be solved at the earliest.</p>
<h2>Related posts:</h2><ul><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/2007/10/10/resolving-the-unsupported-majorminor-version-490-error/" rel="bookmark" title="Permanent Link: Resolving the &#8220;Unsupported major.minor version 49.0&#8243; Error">Resolving the &#8220;Unsupported major.minor version 49.0&#8243; Error</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><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><li><a href="http://techtracer.com/2007/09/03/and-i-thought-i-knew-how-java-worked/" rel="bookmark" title="Permanent Link: And I thought I Knew How Java Worked!">And I thought I Knew How Java Worked!</a></li></ul><br /><a href="http://techtracer.com/">Techtracer.com</a> Copyright &copy; 2008<br /> ]]></content:encoded>
			<wfw:commentRss>http://techtracer.com/2007/09/19/understanding-xsd-namespaces-with-concepts-of-java/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
