<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Servitium technology</title>
	<atom:link href="http://techshape.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techshape.wordpress.com</link>
	<description>Powering your business...</description>
	<lastBuildDate>Sun, 13 Jan 2008 07:30:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='techshape.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Servitium technology</title>
		<link>http://techshape.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://techshape.wordpress.com/osd.xml" title="Servitium technology" />
	<atom:link rel='hub' href='http://techshape.wordpress.com/?pushpress=hub'/>
		<item>
		<title>C# Optimizing Compiler</title>
		<link>http://techshape.wordpress.com/2008/01/13/c-optimizing-compiler/</link>
		<comments>http://techshape.wordpress.com/2008/01/13/c-optimizing-compiler/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 07:30:03 +0000</pubDate>
		<dc:creator>gauravsharma82</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2008/01/13/c-optimizing-compiler/</guid>
		<description><![CDATA[Let me share nice thing that I noticed about C# compilation model. What I did was, I created a small program to print an Int32 array to console. Then I went into IL and checked out various function calls that C# compiler has made. There was one nice thing that I noticed. C# compiler sometimes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=29&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h5 class="post-title entry-title"><span style="font-size:85%;"><span style="font-family:verdana;">Let me share nice thing that I noticed about C# compilation model. What I did was, I created a small program to print an Int32 array to console. Then I went into IL and checked out various function calls that C# compiler has made. There was one nice thing that I noticed. C# compiler sometimes optimizes your code by itself. Let me show you,</span></span><br />
<span id="more-29"></span><font face="Verdana"></font><br />
<span style="font-size:85%;color:#333399;"><span style="font-family:lucida grande;">using System;</span> <span style="font-family:lucida grande;"><br />
<span class="blsp-spelling-error">namespace</span> Optimization</span> <span style="font-family:lucida grande;"><br />
{</span> <span style="font-family:lucida grande;"><br />
 class Program</span> <span style="font-family:lucida grande;"><br />
 {<br />
</span><span style="font-family:lucida grande;">  static void Main(string[] <span class="blsp-spelling-error">args</span>)</span><br />
<span style="font-family:lucida grande;">  {<br />
</span><span style="font-family:lucida grande;">    Int32[] arr ={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,11 };<br />
</span><span style="font-family:lucida grande;">    for (Int32 i = 0; i&lt;=arr.Length-1;i++)<br />
<span style="font-family:lucida grande;">    {<br />
</span><span style="font-family:lucida grande;">       Console.<span class="blsp-spelling-error">WriteLine</span>(arr[i]);<br />
</span><span style="font-family:lucida grande;">     }</span> <span style="font-family:lucida grande;"><br />
     Console.<span class="blsp-spelling-error">ReadLine</span>();</span> <span style="font-family:lucida grande;"><br />
    }</span> <span style="font-family:lucida grande;"><br />
  } </span> <span style="font-family:lucida grande;"><br />
}</p>
<p><span style="color:#000000;font-family:verdana;">This is the code that I wrote to print a simple Int32 array. Below is the IL generated by this code snippet.</span><br />
</span></span><span style="font-size:85%;"><span style="font-family:verdana;"><a href="http://techshape.files.wordpress.com/2008/01/il.jpg" title="IL"><img width="290" src="http://techshape.files.wordpress.com/2008/01/il.jpg?w=290&#038;h=286" alt="IL" height="286" style="width:650px;height:539px;" /></a></span></span><br />
<a href="http://bp1.blogger.com/_jTQwqIkxzI4/RyiieT4aocI/AAAAAAAAAC8/BBEckNwCp9Y/s1600-h/IL.JPG"></a><br />
<span style="font-size:85%;"><span style="font-family:verdana;"><span style="color:#000000;">Compiler stores the array length in line IL_0000. &#8216;ldc.i4.s&#8217; means Load a constanst of type integer and 4 bytes in size i.e. Int32. Value that is stores is 11 i.e. length of the array. After this you can see that there is no call to Array.Length property [<span style="font-style:italic;">internally it will call the method get_Length()</span>] which I have used in For loop. Only calls that C# compiler added were to </span><span style="color:#000000;" class="blsp-spelling-error">Initialize</span> array, <span style="color:#000000;" class="blsp-spelling-error">WriteLine</span><span style="color:#000000;">() and </span><span style="color:#000000;" class="blsp-spelling-error">ReadLine</span><span style="color:#000000;">(). C# compiler have optimized our code internally so that there is no need to call Length with every loop iteration. It uses the length that is stored in the beginning to provide a performance boost. So, if you are doing such thing in your code, don&#8217;t complicate things by declaring a variable just before the for loop just to store array length and use that variable in loop condition. You will be doing that to improve your application&#8217;s performance but doing such heroics can sometime ruin your code. Knowing IL helps!</span></span></span></span></h5>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=29&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2008/01/13/c-optimizing-compiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/65dbe1b321885ea63810f07613d1f441?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gauravsharma82</media:title>
		</media:content>

		<media:content url="http://techshape.files.wordpress.com/2008/01/il.jpg" medium="image">
			<media:title type="html">IL</media:title>
		</media:content>
	</item>
		<item>
		<title>Software Requirements Analysis: Five Use Case traps to avoid</title>
		<link>http://techshape.wordpress.com/2007/12/18/software-requirements-analysis-five-use-case-traps-to-avoid/</link>
		<comments>http://techshape.wordpress.com/2007/12/18/software-requirements-analysis-five-use-case-traps-to-avoid/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 05:31:04 +0000</pubDate>
		<dc:creator>qavikasjain</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/18/software-requirements-analysis-five-use-case-traps-to-avoid/</guid>
		<description><![CDATA[Use cases have become a popular requirements development technique. Focusing on users and their goals, rather than on product features, improves the chances of developing a software package that truly meets customer needs. However, a mystique has grown up around use cases, and many organizations struggle to use them successfully. Here are several traps to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=28&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Times New Roman">Use cases have become a popular requirements development technique. Focusing on users and their goals, rather than on product features, improves the chances of developing a software package that truly meets customer needs. However, a mystique has grown up around use cases, and many organizations struggle to use them successfully. Here are several traps to avoid as your requirements analysts begin to apply the use case technique.</font></p>
<p><font face="Times New Roman"><strong>Trap #1: Use cases that users don&#8217;t understand</strong><br />
Use cases are a way to represent user requirements, which describe what the user needs to be able to do with the product. Use cases should focus on tasks a user needs to accomplish with the help of the system, so they should relate to the user&#8217;s business processes. Your users should be able to read and review use cases to find possible problems, such as missing alternative flows or incorrectly handled exceptions. If users cannot relate to use cases, there&#8217;s a problem. Perhaps they&#8217;re written too much from a technical, rather than business, perspective. </font></p>
<p><font face="Times New Roman"><strong>Trap #2: Too many use cases</strong><br />
When analysts are generating scores or hundreds of use cases, something&#8217;s wrong. This normally means that the use cases are written at too low an abstraction level. Each use case should be general enough to cover several related scenarios on a common theme. Some of these will be success scenarios, and others represent conditions in which the use case might not succeed &#8212; exceptions. If you are caught in a use case explosion, try moving up the abstraction level to group together similar use cases, treating them as alternative flows of a single, more abstract use case. </font></p>
<p><font face="Times New Roman"><strong>Trap #3: Overly complex use cases </strong><br />
The general guideline is that the number of steps in the normal flow of a use case should not exceed approximately a dozen. I once read a use case with nearly 50 steps in the normal flow. The problem was that the &#8220;normal flow&#8221; included many branching possibilities and error conditions that could arise, along with how to handle them. That is, the normal flow actually included alternative flows and exceptions. A better strategy is to pick a simple, default, well-behaved path through the use case and call that the normal flow. Then write separate alternative flows to cover variations on this and exception flows to describe the error conditions. This gives you a use case with multiple small packages of information, which is much easier to understand and manage than a huge use case that tries to handle every possibility in a single flow description. </font></p>
<p><font face="Times New Roman"><strong>Trap #4: Describing specific user interface elements and actions</strong><br />
Write &#8220;essential&#8221; use cases that describe the interactions between the user and the system at an abstract level, without incorporating user interface specifics. The use case description should not include a screen design, although simple user interface prototypes can be valuable to facilitate the use case exploration. I don&#8217;t even like to hear terminology in the use case that alludes to specific user interface controls. Saying &#8220;User clicks on OK&#8221; implies a GUI interface using a mouse and buttons. But what if it would make more sense to use a touch screen or speech recognition interface? Imposing premature design constraints in the use case can lead to a suboptimal design, unless you&#8217;re adding a new capability to an existing application where the screens already exist. </font></p>
<p><font face="Times New Roman"><strong>Trap #5: Not using other requirement models</strong><br />
Analysts who begin employing use cases sometimes seem to forget everything else they know about requirements specification. Use cases are a great aid for exploring requirements for interactive systems, kiosks and Web sites. However, they do not work as well for event-driven real-time systems, data warehouses or batch processes. </font></p>
<p><span style="font-size:12pt;font-family:'Times New Roman';">Avoid the temptation to force fit all of your functional requirements into use cases. Supplement the use case descriptions with a detailed list of functional requirements, nonfunctional requirements, graphical analysis models, prototypes, a data dictionary and other representations of requirements information. Use cases are valuable in many situations, but add them to your analyst toolkit instead of replacing your current tools with them</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=28&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/18/software-requirements-analysis-five-use-case-traps-to-avoid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c97fb61487eed14e02c36ad61d243591?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vikas</media:title>
		</media:content>
	</item>
		<item>
		<title>Object &#8211; Oriented Javascript</title>
		<link>http://techshape.wordpress.com/2007/12/17/object-oriented-javascript/</link>
		<comments>http://techshape.wordpress.com/2007/12/17/object-oriented-javascript/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 12:01:45 +0000</pubDate>
		<dc:creator>harleenkaur</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/17/object-oriented-javascript/</guid>
		<description><![CDATA[A lot of people (including myself, until recently!) think of that JavaScript is the language, they’re good at, just because they know C/C++/C# or they have some prior programming knowledge. This experience is not incorrect because it is easy to do simple things with JavaScript or to say with even little programming knowledge, we can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=27&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span><font face="Times New Roman">A lot of people (including myself, until recently!) think of that JavaScript is the language, they’re good at, <span style="color:black;">just because they know C/C++/C# or they have some prior programming knowledge. This experience is not incorrect because it is easy to do simple things with JavaScript or to say with even little programming knowledge, we can start working with JavaScript. As the complexity and interactivity of this new generation of Web applications increasing, writing JavaScript code requires an entirely different approach.</span></font></span><span style="color:black;"><font face="Times New Roman">Recently, I have come across an Article on MSDN Magazine, which discuss about Object Oriented JavaScript and how one can use this support to do object-oriented development effectively in JavaScript. I found this concept very useful and thought to discuss with all.</font></span><span style="color:black;"><font face="Times New Roman"> </font></span></p>
<p><span style="color:black;"></span><span style="color:black;"><font face="Times New Roman">Object-oriented programming (OOP) is one popular approach that is used in many JavaScript libraries to make a codebase more manageable and maintainable. JavaScript supports OOP, but it does so in a very different manner from the way popular Microsoft .NET Framework compliant languages like C++, C#, or Visual Basic do it.</font></span></p>
<p><span style="color:black;"><span id="more-27"></span></span></p>
<p><font face="Times New Roman"><span style="color:black;"><span style="color:black;"><span> </span></span><span>In C++ or C#, we use objects, we are referring to instances of classes. Objects have different properties and methods, depending on the class they are instantiated from. That is not the case with JavaScript objects. In JavaScript, objects are just collections of name/value pair, we can compare JavaScript object as a dictionary with string keys. We can get and set the properties of an object using either the familiar “.” (dot) operator, or the “[]” operator, which is typically used when dealing with a dictionary. The following snippet</span></span></font></p>
<p style="margin:0;" class="MsoNormal"><span style="color:black;"><font face="Times New Roman"></font></span></p>
<p><font face="Times New Roman"><span style="color:blue;">var UserObject = new Object();</span></font><font face="Times New Roman"><span style="color:blue;"></span><span></span></font><font face="Times New Roman"><span style="color:blue;">UserObject.lastLoginTime = new Date();</span><span></span></font><font face="Times New Roman"><span style="color:blue;"> </span></font></p>
<p><font face="Times New Roman"><span style="color:blue;">alert(UserObject.lastLoginTime);</span><span> </span></font></p>
<p><font face="Times New Roman"><span></span></font><font face="Times New Roman"><span style="color:black;">does exactly the same thing as this: </span></font></p>
<p><font face="Times New Roman"><span style="color:black;"></span><span></span></font><font face="Times New Roman"><span style="color:blue;">var UserObject = {};  // equivalent to new Object();</span></font></p>
<p><font face="Times New Roman"><span style="color:blue;"></span><span></span></font><font face="Times New Roman"><span style="color:blue;">UserObject [“lastLoginTime”] = new Date();</span></font></p>
<p><font face="Times New Roman"><span style="color:blue;"></span><span></span></font><font face="Times New Roman"><span style="color:blue;">alert(UserObject[“lastLoginTime”]); </span></font></p>
<p><font face="Times New Roman"><span style="color:blue;"></span><span></span></font><span><font face="Times New Roman">We can also define the lastLoginTime property directly within UserObject’s definition like this:</font></span><span><font face="Times New Roman"> </font></span></p>
<p><span><font face="Times New Roman"><span style="color:blue;">Var UserObject = {“lastLoginTime” : new Date() };</span></font></span></p>
<p><span><font face="Times New Roman"><span style="color:blue;">alert(UserObject.lastLoginTime); </span></font></span></p>
<p><span><font face="Times New Roman"><span style="color:blue;"></span></font></span><span><font face="Times New Roman">These examples also show how much more malleable JavaScript objects are than C++ or C# objects. Property lastLoginTime doesn’t have to be declared beforehand—if UserObject doesn’t have a property by that name, it will simply be added to UserObject. Again, I compare here a JavaScript object is a dictionary — after all, we add new keys (and their respective values) to dictionaries all the time.</font></span></p>
<p><span></span><span><font face="Times New Roman">So, there we have object properties. Likewise it has object methods too and there is also a lot many things to know about Object Oriented JavaScript. Soon I will come up with them………</font></span><span style="color:black;"><font face="Times New Roman"> </font></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=27&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/17/object-oriented-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b3593618cbd90f6668dfa34c0ed317ad?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">harleenkaur</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Linked with LINQ</title>
		<link>http://techshape.wordpress.com/2007/12/11/get-linked-with-linq/</link>
		<comments>http://techshape.wordpress.com/2007/12/11/get-linked-with-linq/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 06:58:37 +0000</pubDate>
		<dc:creator>rupalimanik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/11/get-linked-with-linq/</guid>
		<description><![CDATA[With the release of Visual Studio 2008 , its been easier for developers to build richer data driven applications. One of the most significant feature of VS2008  is the introduction of LINQ which is an exciting evolution in data programming that provides common query capabilities within the programming language.  LINQ closes the gap between the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=25&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">With the release of Visual Studio 2008 , its been easier for developers to build richer data driven applications. One of the most significant feature of VS2008 <span> </span>is the introduction of LINQ which is an exciting evolution in data programming that provides common query capabilities within the programming language.<span>  </span>LINQ closes the gap between the programming world and the data world by providing a common query facility for in-memory and external data.<span>  </span>Integrating query capabilities into the programming language provides a simple, natural way to build strongly typed queries that benefit from design-time features like IntelliSense.<span>  </span>This is an exciting leap forward to bridge the gap between Data and Programming</font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">Basically LINQ address the current database development model in the context of Object Oriented Programming Model. If some one wants to develop database application on .Net platform the very simple approach he uses ADO.Net. ADO.Net is serving as middle ware in application and provides complete object oriented wrapper around the database SQL. Developing application in C# and VB.Net so developer must have good knowledge of object oriented concept as well as SQL, so it means developer must be familiar with both technologies to develop an application. If here I can say SQL statements are become part of the C# and VB.Net code so it’s not mistaken in form of LINQ. According to Anders Hejlsberg the chief architect of C#.</font></p>
<p style="margin:0;" class="MsoNormal"><span></span></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><span>             </span>“Microsoft original motivation behind LINQ was to address the impedance mismatch between programming languages and database.”</font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">LINQ has a great power of querying on any source of data, data source could be the collections of objects, database or XML files. We can easily retrieve data from any object that implements the IEnumerable&lt;T&gt; interface. Microsoft basically divides LINQ into three areas and that are give below.</font></p>
<p style="text-indent:-0.25in;margin:0 0 0 27pt;" class="MsoNormal"><span style="font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><font face="Times New Roman"><strong>LINQ to Objects</strong> {Queries performed against the in-memory data} </font></p>
<p><span style="font-family:Symbol;"><span>  ·<span style="font:7pt 'Times New Roman';">         </span></span></span><font face="Times New Roman"><strong>LINQ to SQL</strong> (formerly DLinq) {Queries performed against the relation database only Microsoft SQL Server Supported} </font></p>
<p style="text-indent:-0.25in;margin:0 0 0 27pt;" class="MsoNormal"><span style="font-family:Symbol;"><span>·<span style="font:7pt 'Times New Roman';">         </span></span></span><font face="Times New Roman"><strong>LINQ to XML</strong> (formerly XLinq) { Queries performed against the XML source}</font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><span> </span>Here , I am putting some light over LINQ to Objects .I will surely take LINQ to SQL and LINQ to XML later in my next post.</font></p>
<p style="margin:0;" class="MsoNormal">&nbsp;</p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><strong>LINQ to Object</strong>s</font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">LINQ to Objects allows .NET developers to write “queries” over collections of objects. Traditionally, working with collections of objects meant writing a lot of looping code using for loops or foreach loops to iterate through a list carrying out filtering using if statements, and some action like keeping a running sum of a total property. LINQ frees you from having to write looping code; it allows you to write queries that filter a list or calculate aggregate functions on elements in a collection as a set.</font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">We can write queries against any collection type that implements an interface called IEnumerable. This is almost any collection type built into the .NET class libraries including simple arrays like string[], or int[], and any List&lt;T&gt; collection.</font></p>
<p style="margin:0;" class="MsoNormal">&nbsp;</p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">       <em> int[] nums = new int[] (0,4,2,6,3,8,3,1);</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>         var result = from n in nims</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>                          where n &lt; 5</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>                          orderby n</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>                          select n;</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>foreach (int i in result)</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>console.writeline(i);</em></font></p>
<p style="margin:0;" class="MsoNormal">&nbsp;</p>
<p style="margin:0;" class="MsoNormal"><em>Output:</em></p>
<p style="margin:0;" class="MsoNormal"><em>0</em></p>
<p style="margin:0;" class="MsoNormal"><em>1</em></p>
<p style="margin:0;" class="MsoNormal"><em>2</em></p>
<p style="margin:0;" class="MsoNormal"><em>3</em></p>
<p style="margin:0;" class="MsoNormal"><em>3</em></p>
<p style="margin:0;" class="MsoNormal"><em>4</em></p>
<p><font face="Times New Roman">The backbone of LINQ to Objects is the <strong>Standard Query Operators</strong> that provide query operators similar to those found in a SQL like language.For example Aggregate,Sum,Cast,GroupBy etc.</font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>  int[] nums = new int[] (0,4,2,6,3,8,3,1);</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>  int result = nums.Sum();</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>  console.writeline(result);</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>  </em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>Output:</em></font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><em>27</em></font></p>
<p style="margin:0;" class="MsoNormal"><span style="font-size:10pt;color:red;font-family:'Courier New';"></span></p>
<p><span style="font-size:10pt;color:red;font-family:'Courier New';"></span> <font face="Times New Roman">Features at a glance:</font></p>
<ul>
<li class="MsoNormal"><font face="Times New Roman">Query language over collections of objects </font></li>
<li class="MsoNormal"><font face="Times New Roman">Standard SQL like set of query operators, including joins and grouping </font></li>
<li class="MsoNormal"><font face="Times New Roman">New query operators can be added, fully extensible </font></li>
<li class="MsoNormal"><font face="Times New Roman">Intellisense and compiler syntax checking support in Visual Studio</font></li>
</ul>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">To Get Started with LINQ you can look into this video :</font></p>
<p style="margin:0;" class="MsoNormal"><span><font face="Times New Roman">            </font></span><a href="http://www.asp.net/learn/videos/video-212.aspx"><font face="Times New Roman">http://www.asp.net/learn/videos/video-212.aspx</font></a></p>
<p><font face="Times New Roman"> </font><font face="Times New Roman"> </font><font face="Times New Roman"> </font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=25&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/11/get-linked-with-linq/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0da9b8499c67336be9df0fb6c36ded95?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rupalimanik</media:title>
		</media:content>
	</item>
		<item>
		<title>How to document Use Cases</title>
		<link>http://techshape.wordpress.com/2007/12/11/how-to-document-use-cases/</link>
		<comments>http://techshape.wordpress.com/2007/12/11/how-to-document-use-cases/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 06:31:16 +0000</pubDate>
		<dc:creator>qavikasjain</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/11/how-to-document-use-cases/</guid>
		<description><![CDATA[A use case represents a case of use of a system, ideally one that captures a functional requirement in terms of an identifiable and testable goal. So, what is the best way to document a use case? Approaches to content range from diagrammatic to textual, formal to free form, expansive and detailed to brief and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=24&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Times New Roman">A use case represents a case of use of a system, ideally one that captures a functional requirement in terms of an identifiable and testable goal. So, what is the best way to document a use case? Approaches to content range from diagrammatic to textual, formal to free form, expansive and detailed to brief and abstract. The approaches to tool usage and authoring are just as varied. Here are some suggestions for a simple and streamlined, yet reasoned and thorough, approach to use case documentation.</font></p>
<p><strong><font face="Times New Roman">First things first</font></strong></p>
<p><font face="Times New Roman">In his classic paper, &#8220;Structuring Use Cases with Goals,&#8221; Alistair Cockburn made the following observation: </font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">Use cases are wonderful but confusing. People, when asked to write them, do not know what to include or how to structure them. </font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">Perhaps the first thing to clarify is what we mean by the term <em>use case</em>. A simple and literal reading is that a use case is simply a case of use: someone or something uses a system in a particular way. </font></p>
<p style="margin:0;" class="MsoNormal">&nbsp;</p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"><strong>When a user uses a system, she or he will perform a behaviorally related sequence of transactions in a dialogue with the system. We call such a special sequence a use case.</strong> </font></p>
<p><font face="Times New Roman">This description neatly captures the essence of use cases. A set of use cases can be used to capture the functional requirements of a system by slicing it up into its externally driven uses. Instead of identifying requirements as a disconnected and potentially incoherent laundry list of features, utility and usage are the principal drivers. However, framing a system&#8217;s functional requirements in terms of a sequence of actions raises a number of questions that affect how, when and by whom a use case is documented: </font></p>
<ol>
<li>
<p class="MsoNormal"><font face="Times New Roman">How should use cases be partitioned? </font></p>
</li>
<li>
<p class="MsoNormal"><font face="Times New Roman">Who should be interested in and able to read use cases? </font></p>
</li>
<li>
<p class="MsoNormal"><font face="Times New Roman">Who should write use cases? </font></p>
</li>
<li>
<p class="MsoNormal"><font face="Times New Roman">Beyond requirements, what role can use cases play?</font></p>
</li>
</ol>
<p><font face="Times New Roman">Without some answers to those questions concerning purpose and audience, we would be guilty of placing the cart before the horse if we tried to nail down how best to document a use case. Put another way, what are the requirements for this requirements approach? </font></p>
<p><font face="Times New Roman"><strong>How should use cases be partitioned? </strong><br />
In spite of the strong narrative feel of a <em>sequence of transactions</em> and a <em>dialog with a system</em>, and the implication of related concepts such as <em>scenarios</em> and <em>user stories</em>, documentation that focuses on use cases as scripts is tedious for both the reader and the use case&#8217;s author. There is more value in thinking about use cases with respect to goals rather than narratives: a use case is a usage of a system that is intended to achieve a particular outcome. The goal lends a clear focus to what is in (and not in) a given use case. </font></p>
<p><font face="Times New Roman">The emphasis on the goal begins with the name: A use case should have a definite name that clearly reflects its goal, and this should take the form of an imperative. For example, <em>Open Account</em> tells you clearly and actively what the goal is, whereas <em>Account Opening</em> is too passive and describes an ongoing state, <em>Accounts</em> describes a general heading rather than a single goal, <em>Open/Close/Suspend/Modify Account</em> describes four quite distinct goals, and <em>Manage Accounts</em> covers an indistinct number of goals, in spite of the apparent directness of its name. </font></p>
<p><font face="Times New Roman">Beyond a use case&#8217;s name, the goal can be elaborated in more detail, but this is not an excuse to break into essay-writing mode. A short paragraph is all that is needed. Beyond this, we can identify other features that add detail and precision to a use case, ideally following an inverted-pyramid style of presentation. But to better understand what we should include and exclude, we really need to know our audience. </font></p>
<p><font face="Times New Roman"><strong>Who should be interested in and able to read use cases? </strong><br />
Who cares about what a system should do? Well, put like that, it might be easier to identify who should not be interested! A use case offers common ground for technical and non-technical people to meet and agree on what a system should do. This includes developers, project managers, customers, and so on — in other words, pretty much all of the roles that have some kind of stake or direct involvement in a system&#8217;s development. What follows from this is that the documentation for a use case should be comprehensible to any of the parties involved; it should be no more technical than the domain it describes. </font></p>
<p><font face="Times New Roman">The sometime fashion for plastering use case documentation with UML diagrams &#8212; especially sequence diagrams &#8212; is deeply misguided. Such documentation has little bearing on the system&#8217;s externally visible behavior, and it alienates a significant part of the potential readership. It is a waste of everyone&#8217;s time. Use case descriptions should be concise, precise, readable and goal focused. They should not include parts that are optionally readable by different audiences &#8212; these just add clutter. </font></p>
<p><font face="Times New Roman"><strong>Who should write use cases? </strong><br />
This is an interesting question and one that ties back to the audience. In principle, anyone who can read a use case should be able to write a use case. The stakeholders who want the system developed conceptually own the requirements, and it is in their interest to be involved in formulating. On the other hand, project managers, developers, business analysts and other domain experts each hold different perspectives on a system and are likely to raise different questions and make different connections. In other words, it is not simply that anyone who cares about reading a use case should be able to write it; the combined perspectives and the mixture of skills of all these parties has the potential to offer a clearer understanding of a system&#8217;s requirements than the perspective of any one individual. </font></p>
<p><font face="Times New Roman">There is, in fact, a hidden question lurking in here: How should use cases be written? If all these different roles can contribute, then what is the most appropriate vehicle for doing so? Let&#8217;s first consider one of the least effective: The analyst writes all the use cases in a single document and emails this to the other parties for comments. This is typically an exercise in shared indifference that can stretch out over weeks and months with minimal involvement and correspondingly little feedback. </font></p>
<p><font face="Times New Roman">If you want to get people involved, then they need to be involved. If use cases offer common ground for technical and non-technical people to meet and agree on what a system should do, then they should meet and agree. A representative selection of individuals in a meeting room, armed with index cards, whiteboards and a shared goal will cover far more ground and to greater depth. How the use cases are recorded for posterity is a separate matter &#8212; a traditional document, a wiki, the index cards they were first scribbled on &#8212; but the simple act of collaborating is likely to make the single greatest difference to the quality of the resulting use cases. </font></p>
<p><font face="Times New Roman"><strong>Beyond requirements, what role can use cases play? </strong><br />
If you are thinking about use cases from the perspective of a sequential development life cycle, such as the waterfall model, you are likely to restrict their role to an early phase of development. They are likely to be treated as an output of requirements gathering and an input to a more comprehensive analysis, the output of which is fed into a design phase, and so on down the line. That approach misses one of the original goals and key strengths of a use-case-driven approach: incremental development. </font></p>
<p><font face="Times New Roman">In observing that a use case represents a slice of a system&#8217;s behavior, this is not simply a metaphor; it is a guide to how the system can be developed: a use case at a time. Use cases help to define scope and they help to define tests, especially if use cases are documented with respect to the preconditions and post-conditions that define goal fulfillment. </font></p>
<p><font face="Times New Roman">Not all requirements are created equally, which means that different use cases have different priorities, technical challenges and levels of risk. In looking to grow a system incrementally, it is those different aspects that need to be balanced over time. Incremental development by use case ensures that a system is developed in functionally complete slices, offering stability, certainty and visible signs of progress &#8212; or, to be realistic and evenhanded, early signs of trouble if there are problems. </font></p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman">Developing by use case also allows the development to respond to new needs and discoveries as the system unfolds. Importantly, trying to document all of the use cases up front is not only unnecessary, but it is likely to be harmful. Start with a kernel of key use cases and grow from there.</font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=24&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/11/how-to-document-use-cases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c97fb61487eed14e02c36ad61d243591?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vikas</media:title>
		</media:content>
	</item>
		<item>
		<title>Crazy Enums</title>
		<link>http://techshape.wordpress.com/2007/12/11/crazy-enums/</link>
		<comments>http://techshape.wordpress.com/2007/12/11/crazy-enums/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 05:19:13 +0000</pubDate>
		<dc:creator>gauravsharma82</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/11/crazy-enums/</guid>
		<description><![CDATA[There is one intresting thing that I want to share. Almost all of us have worked with .Net Enums. Let me show you something, Create a project and add one Enum to it, enum MyEnum {   Orange=0,   Red=1,   Green=2 } Now create another class where we will use this Enum, class Program { [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=18&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="post-title entry-title"><font size="2"><span style="font-size:85%;font-family:verdana;">There is one <span class="blsp-spelling-error">intresting</span> thing that I want to share. Almost all of us have worked with .Net <span class="blsp-spelling-error">Enums</span>. Let me show you something,</span><br />
<span style="font-size:85%;font-family:verdana;">Create a project and add one <span class="blsp-spelling-error">Enum</span> to it,</span><br />
</font><font size="2"><strong><span style="font-size:85%;color:#000066;font-family:verdana;"><span class="blsp-spelling-error">enum</span> <span class="blsp-spelling-error">MyEnum</span><br />
{<br />
  Orange=0,<br />
  Red=1,<br />
  Green=2<br />
}</span><br />
</strong><span style="font-size:85%;font-family:verdana;">Now create another class where we will use this <span class="blsp-spelling-error">Enum</span>,</span><br />
</font><font size="2"><strong><span style="font-size:85%;color:#000066;font-family:verdana;">class Program<br />
{<br />
  static void Main(string[] <span class="blsp-spelling-error">args</span>)<br />
  {<br />
<span class="blsp-spelling-error">     MyEnum</span> obj;<br />
     obj = (<span class="blsp-spelling-error">MyEnum</span>)5;<br />
     Console.WriteLine(obj.ToString());<br />
     Console.<span class="blsp-spelling-error">ReadLine</span>();<br />
   }<br />
}</span></strong><br />
<span style="font-size:85%;font-family:verdana;">Did you noticed something? Our <span class="blsp-spelling-error">Enum</span> only had 0,1 and 2 as valid values. I went on and assigned 5 to it. Now try compiling this code. Aha! no compilation errors. Now try running this. Everything goes well and 5 gets printed on console. Did you expected this? </span><br />
<span style="font-size:85%;font-family:verdana;">I never expected this. Did Microsoft forget about type safety and type checking issues while copying from Java <span class="blsp-spelling-error">Enums</span>? I think Java <span class="blsp-spelling-error">enums</span> works fine. </span><br />
<span style="font-size:85%;font-family:Verdana;">If you ever worked with Bit Flags you will some how realize that all of this is due to them. Bit flags can actually take up values which are a combination of values that are defined in Bit Flag <span class="blsp-spelling-error">Enum</span>. Here is an example:</span><br />
<strong><span style="font-size:85%;color:#000066;font-family:Verdana;">[Flags]</span><br />
<span style="font-size:85%;color:#000066;font-family:Verdana;">internal <span class="blsp-spelling-error">enum</span> Actions</span><br />
<span style="font-size:85%;color:#000066;font-family:Verdana;">{</span><br />
<span style="font-size:85%;color:#000066;font-family:Verdana;">  None = 0,</span><br />
<span style="font-size:85%;color:#000066;font-family:Verdana;">  Read = 0X0001,</span><br />
<span style="font-size:85%;color:#000066;font-family:Verdana;">  Write = 0X0002,</span><br />
<span style="font-size:85%;color:#000066;font-family:Verdana;"><span class="blsp-spelling-error">  ReadWrite</span> = Actions.Read Actions.Write</span><br />
<span style="font-size:85%;color:#000066;font-family:Verdana;">  &#8230;</span><br />
<span style="font-size:85%;color:#000066;font-family:Verdana;">}</span></strong><br />
<span style="font-size:85%;color:#000000;font-family:Verdana;">There are number of threads going on in forums related to this. Just keep this in mind before using <span class="blsp-spelling-error">Enums</span>.</span></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=18&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/11/crazy-enums/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/65dbe1b321885ea63810f07613d1f441?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gauravsharma82</media:title>
		</media:content>
	</item>
		<item>
		<title>YouTube API</title>
		<link>http://techshape.wordpress.com/2007/12/10/youtube-api/</link>
		<comments>http://techshape.wordpress.com/2007/12/10/youtube-api/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 08:58:05 +0000</pubDate>
		<dc:creator>guptaaman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/10/youtube-api/</guid>
		<description><![CDATA[Hi everyone, If you remember my previous post, I explained about the Mashups. What’s hot online these days? Video. What’s hot in web mashups? Video. You Tube provides an API that can be integrated into our own application. The YouTube Data API allows client applications to view YouTube content in the form of Google Data [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=17&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">Hi everyone,</p>
<p>If you remember my previous post, I explained about the Mashups. What’s hot online these days? Video. What’s hot in web mashups? Video. You Tube provides an API that can be integrated into our own application.</p>
<p class="MsoNormal">The YouTube Data API allows client applications to view YouTube content in the form of Google Data API feeds. Your client application can use the YouTube Data API feeds to fetch video feeds, comments, responses, and play lists, as well as query for videos that match particular criteria.</p>
<p class="MsoNormal"><strong><u>How to integrate YouTube API in your own Application</u></strong></p>
<p style="margin-left:27pt;text-indent:-0.25in;" class="MsoNormal"><span> 1.<font face="Times New Roman"> </font></span>For using the YouTube API, Firstly u have to register yourself on <a href="http://www.youtube.com/index">http://www.youtube.com/index</a></p>
<p style="margin-left:27pt;text-indent:-0.25in;" class="MsoNormal">2.  After getting registered click on the <strong><em>Developer Profile </em></strong><em><a href="http://www.youtube.com/my_profile_dev">http://www.youtube.com/my_profile_dev</a></em></p>
<p style="margin-left:27pt;text-indent:-0.25in;" class="MsoNormal">3.   This will generate a Developer Id.</p>
<p><span id="more-17"></span></p>
<p style="margin-left:27pt;text-indent:-0.25in;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal">Here is sample Code for using the YouTube API in ASP.NET 2.0:</p>
<p style="margin-left:9pt;" class="MsoNormal"><strong><em><u>YouTube.aspx</u></em></strong></p>
<p style="margin-left:9pt;" class="MsoNormal">On this page add a Textbox and a button. On click event of button write the following code.</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>string uri = &#8220;http://www.youtube.com/api2_rest?&#8221;;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>uri += &#8220;method=youtube.videos.list_by_tag&#8221;;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>uri += &#8220;&amp;dev_id=<strong><em>Your YouTube Id</em></strong>&#8220;;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>uri += &#8220;&amp;tag=&#8221; + Textbox1.Text;</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span><span style="font-size:12pt;font-family:'Times New Roman';">XPathDocument xpd = null;</span></p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>try</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>{</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>xpd = new XPathDocument(uri);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>}</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>catch (XmlException xe)</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>{</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;The following xml error occurred: &#8221; +<span></span>xe.Message);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.End();</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>return;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>}</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>XPathNavigator xpn = xpd.CreateNavigator();</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>XPathNodeIterator xniError = xpn.Select(@&#8221;/ut_response&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>xniError.MoveNext();</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>if (xniError.Current.GetAttribute(&#8220;status&#8221;, String.Empty) == &#8220;fail&#8221;)</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>{</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>string expression = &#8220;/ut_response/error/description&#8221;;</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>string errorText = xpn.SelectSingleNode(expression).InnerXml;<br />
<span></span></p>
<p style="margin-left:9pt;" class="MsoNormal">Response.Write(&#8220;The YouTube API reported the &#8221; +<span></span>&#8220;following error: &#8221; + errorText);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span><span></span>Response.End();</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>return;</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>}</p>
<p align="left"><span></span>try<br />
<span></span>{</p>
<p align="left"><span></span>XPathNodeIterator xni =xpn.Select(@&#8221;/ut_response/video_list/video&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;&lt;h1&gt;Videos&lt;/h1&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;&lt;ul&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>string title = &#8220;&#8221;;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>string url = &#8220;&#8221;;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>string thumbUrl = &#8220;&#8221;;</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>while (xni.MoveNext())</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>{</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>title = xni.Current.SelectSingleNode(@&#8221;title&#8221;).InnerXml;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>url = xni.Current.SelectSingleNode(@&#8221;url&#8221;).InnerXml;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span><span></span>thumbUrl =<span></span>xni.Current.SelectSingleNode(@&#8221;thumbnail_url&#8221;).InnerXml;</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;&lt;li&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;&lt;img height=&#8217;75&#8242; width=&#8217;75&#8242; src=&#8217;&#8221; +<span></span>thumbUrl + &#8220;&#8216; /&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span><span></span>Response.Write(&#8220;&lt;br /&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;&lt;a href=&#8217;&#8221; + url + &#8220;&#8216;&gt;&#8221; + title + &#8220;&lt;/a&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;&lt;p /&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;&lt;/li&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>}</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span><span></span>Response.Write(&#8220;&lt;/ul&gt;&#8221;);</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.End();</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>}</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>catch (XPathException xpe)</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>{</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.Write(&#8220;The following XPath exception occurred: &#8220;<span></span>+ xpe.Message);</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>Response.End();</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>return;</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>}</p>
<p style="margin-left:9pt;" class="MsoNormal"><span></span>}</p>
<p style="margin-left:9pt;" class="MsoNormal">&nbsp;</p>
<p style="margin-left:0.25in;" class="MsoNormal">What do you think? I am really interested to hear other opinions and thoughts around this.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=17&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/10/youtube-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/79c43ac6a926ec6f0a3f826d83302deb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">guptaaman</media:title>
		</media:content>
	</item>
		<item>
		<title>Testing for security in the age of AJAX Programming.</title>
		<link>http://techshape.wordpress.com/2007/12/05/testing-for-security-in-the-age-of-ajax-programming/</link>
		<comments>http://techshape.wordpress.com/2007/12/05/testing-for-security-in-the-age-of-ajax-programming/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 10:07:07 +0000</pubDate>
		<dc:creator>qavikasjain</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/05/testing-for-security-in-the-age-of-ajax-programming/</guid>
		<description><![CDATA[Ajax programming is one of the most exciting new technologies in recent history. Ajax (Asynchronous JavaScript and XML) allows a Web page to refresh a small portion of its data from a Web server, rather than being forced to reload and redraw the entire page as in traditional Web programming. Since they can make frequent, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=15&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Times New Roman">Ajax programming is one of the most exciting new technologies in recent history. Ajax (Asynchronous JavaScript and XML) allows a Web page to refresh a small portion of its data from a Web server, rather than being forced to reload and redraw the entire page as in traditional Web programming. Since they can make frequent, small updates, Web applications written with Ajax programming can present user interfaces that are more like desktop applications, which are more natural and intuitive interfaces for most users. Web applications have become prime targets for malicious users and hackers performing </font><font face="Times New Roman">SQL Injection</font><font face="Times New Roman"> and similar attacks. </font></p>
<p><font face="Times New Roman">The flexibility and creativity that Ajax programming affords the developer also places a corresponding burden on him to ensure that his code is secure against these new threats. Also, since delivering a secure application is part of delivering a quality application, the burden is probably felt even greater by the Quality Assurance (QA) team. The QA team will now need to develop an entirely new set of functional, performance and security testing methods in order to thoroughly test the quality of applications using Ajax programming against SQL injection attacks and other security concerns.</font></p>
<p><font face="Times New Roman"><strong>It&#8217;s in the Code</strong><br />
As an example; consider a hypothetical gourmet food e-commerce Web site. This site displays a map of the world to the user, and as the user navigates the mouse pointer over each country, the page uses Ajax programming to connect back to the Web server and retrieve a list of goods originating in that country. The following C# code snippet shows the Web method in which the database is queried:</font><font face="Times New Roman">[System.Web.Services. <span style="color:#669999;">WebMethod</span>]<span style="font-family:'Courier New';"><br />
<span style="color:#3333ff;">public</span> System.Collections.<span style="color:#669999;">IEnumerable</span> GetProducts(<span style="color:#3333ff;">string</span> country)<br />
{<br />
   <span style="color:#336600;">// update the select command to use the country parameter</span><br />
  <span style="color:#3333ff;">this</span>.SqlDataSource1.SelectCommand = <span style="color:#993300;">&#8220;SELECT * FROM [Product] WHERE Country = &#8216;&#8221;</span> + country + <span style="color:#993300;">&#8220;&#8216;&#8221;</span>;<br />
   <span style="color:#336600;">// query the database and return the results</span><br />
   <span style="color:#3333ff;">return this</span>.SqlDataSource1.Select(<span style="color:#669999;">DataSourceSelectArguments</span>.Empty);<br />
} </span></p>
<p></font><font face="Times New Roman">Some readers may notice a glaring security hole in this code. The database query is being constructed on the fly with un-validated user input being sent directly to the database. This insecure programming technique creates a vulnerability to SQL injection attacks, which are potentially devastating to the Web application and its users. SQL injection vulnerabilities allow attackers to execute their own SQL queries and commands against the database, rather than those that the developers of the Web site intended. The entire database, including customer names, addresses, and credit card numbers, could be downloaded by such a command. The prices of the products could be modified. The entire database itself could be permanently deleted. Clearly, this is a very serious issue. If the developer fails to notice the problem, the next line of defense is the QA team.</font></p>
<p><font face="Times New Roman">The average<strong> </strong>developer will probably do a quick, cursory test of the application before passing it to the QA department, without checking thoroughly for SQL injection vulnerabilities or other important problems. Instead, he will mouse over a few countries on the map, check that the displayed results match those in the database, and then pass the code off. The average QA engineer typically will be much more thorough. He will mouse over every country on the map and check that the results match. He might even set up an automated test script that will mouse over every single pixel on the screen, and he will check to see if there are any errors in the Ajax programming or underlying page code.</font></p>
<p><font face="Times New Roman">But even this extreme level of thoroughness won&#8217;t be enough to find the SQL injection vulnerability. By using a Web browser (or automated script recorded from a Web browser) as his test tool, the tester has limited his potential requests to only those which the browser can send, and the browser is itself limited by the source code of the Web page. In the example above, the browser would be limited to sending only valid country parameters to the GetProducts method, since only valid countries are present in the page code. In other words, no matter where the user (or QA engineer) navigates with the mouse, the only parameters that would be sent are &#8220;GBR&#8221;, &#8220;FRA&#8221;, &#8220;USA&#8221;, etc. Using only these valid, well-formed parameters will never reveal the SQL injection vulnerability. To do that, the QA team needs to expand their arsenal of test tools beyond browsers alone.</font></p>
<p><font face="Times New Roman">Since browsers are so limited, hackers generally don&#8217;t use them to break into Web applications or execute their SQL injection attacks and other hacks. They use tools that operate at a much lower level, tools that are capable of sending raw HTTP requests to an address and displaying the raw HTTP response. Netcat is a popular tool for this purpose, as is telnet, which has the benefit of being installed by default with virtually every modern operating system. So, instead of opening a browser, navigating to a page, and viewing the rendered HTML response, the hacker types:</font><font face="Times New Roman">nc 172.16.60.250 80 GET / HTTP/1.0</p>
<p></font><font face="Times New Roman">and then receives the response:</font><font face="Times New Roman">HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Wed, 10 May 2006 18:04:56 GMT <span style="font-family:'Courier New';"><br />
… </span></p>
<p></font><font face="Times New Roman">While interacting with Ajax programming may not seem like it would generate a round-trip request to the server since it doesn&#8217;t refresh the entire page, under the covers it&#8217;s doing exactly that. Like programming in standard hyperlink navigation or form submission, Ajax programming actions always have an HTTP request and response. So, armed with his low-level HTTP requestor tool, the hacker is now free to make attacks on the application that could never be possible with a browser alone. Instead of sending &#8220;GBR&#8221; or &#8220;FRA&#8221;, he could send &#8220;XXX&#8221;, or &#8220;!@#$%&#8221;, or &#8220;x&#8217; OR &#8217;1&#8242; = &#8217;1&#8243;, which in this case would successfully exploit the SQL injection vulnerability.</font></p>
<p><font face="Times New Roman"><strong>Thinking like a Hacker</strong><br />
In order to successfully defend against the hacker using SQL injection or some other attack, the QA engineer has to think like the hacker. Since the hacker doesn&#8217;t restrict himself to using just a browser to attack a Web application (with or without Ajax programming), neither should the QA engineer use just a browser to test it. At a minimum, the application should be tested with the same type of raw HTTP tool that the hacker uses. An even better approach is to use an automated security analysis tool that performs these tests. Automated tools can make thousands of test requests in an hour; work that would take a QA engineer a week or more to perform manually. Additionally, these tools generally have an extensive set of techniques that they use to detect security defects such as SQL injection vulnerabilities QA engineers would unlikely be aware of these techniques unless they had a background in information security. There are several excellent security analysis tools available commercially. Additional resources for learning about Web application security and security analysis tools include the Web Application Security Consortium (WASC) (www.Webappsec.org), the Open Web Application Security Project (OWASP)(www.owasp.org), and the SANS (SysAdmin, Audit, Network, Security) Institute (www.sans.org). </font></p>
<p><span style="font-size:12pt;font-family:'Times New Roman';">It seems likely that Web applications using Ajax programming are the future of Web development. The robust user interface that Web pages comprised of Ajax programming can provide represents a huge leap in usability over traditional Web pages. But, this power comes with a price: the programmers and QA engineers must move beyond browsers alone when testing the application. Security vulnerabilities can lurk in code that is accessible only by specialized low-level request tools. Hackers will be more than willing to use these tools against the Web applications, so the QA team must use the same tactics to find the vulnerabilities first.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=15&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/05/testing-for-security-in-the-age-of-ajax-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c97fb61487eed14e02c36ad61d243591?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Vikas</media:title>
		</media:content>
	</item>
		<item>
		<title>AJAX (Anatomy of its operation and the technologies used)</title>
		<link>http://techshape.wordpress.com/2007/12/03/ajax-anatomy-of-its-operation-and-the-technologies-used/</link>
		<comments>http://techshape.wordpress.com/2007/12/03/ajax-anatomy-of-its-operation-and-the-technologies-used/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 07:24:48 +0000</pubDate>
		<dc:creator>nupoorsinha</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/03/ajax-anatomy-of-its-operation-and-the-technologies-used/</guid>
		<description><![CDATA[In case one has heard about the AJAX hype, but still has missed out some technical working or concept, don’t look beyond this  This is a brief write – up on the Anatomy of the Ajax operation and the technologies used here.   What is AJAX?   Ajax is nothing more than an approach to web interaction. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=13&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:10pt;font-family:'Bookman Old Style';">In case one has heard about the AJAX hype, but still has missed out some technical working or concept, don’t look beyond this <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </span><span style="font-size:10pt;font-family:'Bookman Old Style';">This is a brief write – up on the Anatomy of the Ajax operation and the technologies used here.</span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span></p>
<p><span style="font-size:10pt;font-family:'Bookman Old Style';"></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><strong>What is AJAX?</strong><span>  </span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';">Ajax</span><span style="font-size:10pt;font-family:'Bookman Old Style';"> is nothing more than an approach to web interaction. This approach involves </span><span style="font-size:10pt;font-family:'Bookman Old Style';">transmitting only a small amount of information to and from the server in order to </span><span style="font-size:10pt;font-family:'Bookman Old Style';">give the user the most responsive experience possible.</span></span></p>
<p style="margin:0;" class="MsoNormal"><span style="font-size:10pt;font-family:'Bookman Old Style';"></span></p>
<p><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"><strong>Is AJAX New? </strong></span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"></p>
<p style="margin:0;" class="MsoNormal"><span style="font-size:10pt;font-family:'Bookman Old Style';">Not really. Remote JavaScript, of which AJAX is one example of, has garnered the most attention as of late, provides the ability to interact with a server with XML data. AJAX is possible because of the <span> </span>Internet Explorer 5 <span> </span>and later offer an XMLHTTP object while Mozilla based browsers provide an XMLHttpRequest object.<span>    </span></span></p>
<p><span style="font-size:10pt;font-family:'Bookman Old Style';"><span>                                                                                                                 </span><span>                                                                                                                                                                                                                                                                </span><span>                                                                                                                                                                                                                                                                </span><span>                                                             </span><span> </span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span>                                                                                                                                                  </span><span>                                                                                                                                                                                                                                                                </span><span>                                                                                                                                                                                                                                                                </span><span>                                                             </span><span> </span>Both Both of these objects offer essentially the same ability to request XML data from a server and process the data in a similar fashion. The server-side AJAX component can be in any technology providing XML can be delivered dynamically. </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span></p>
<p align="left"><u><span style="font-size:10pt;font-family:'Bookman Old Style';">Technologies Behind Ajax<span>  </span>are:</span></u><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';"><br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';">HTML/XHTML<span>  :</span> This is used for primary content representation.<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">CSS<span>              </span><span>     </span>:<span>  </span>It provides stylistic formatting to XHTML<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">DOM<span>                  </span>:<span>  </span>This is for dynamic updating of a loaded page<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">XML<span>                   </span>: This is for data exchange format.<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">XSLT<span>                 </span>: It transforms XML into XHTML (styled by CSS)<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">XMLHttp<span>      </span><span>      </span>: Primary Communication Broker<span> <br />
</span></span><span style="font-size:10pt;font-family:'Bookman Old Style';">JavaScript<span>        </span>: Scripting language used to program an Ajax engine</span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"> .<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';"></span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">The two core technologies that makes AJAX work are:<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';"></span><span style="font-size:10pt;font-family:Wingdings;"><span>Ø<span style="font:7pt 'Times New Roman';">       </span></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';">A JavaScript enabled browser that supports either XMLHTTP or XMLHttpRequest objects.<br />
</span><span style="font-size:10pt;font-family:Wingdings;"><span>Ø<span style="font:7pt 'Times New Roman';">       </span></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';">An HTTP Server technology that can respond in XML. </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';">An AJAX application in its simplest form is essentially a standard HTML user interface with JavaScript functions to interact with an HTTP server that can generate XML dynamically. Any dynamic Web technology ranging from CGI to servlets even including Java Server Faces, .Net Components can serve as a server-side AJAX technology. </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;color:black;font-family:'Bookman Old Style';">Suppose there is an HTML user interface with elements such as an input field .The input field “searchField” will call the Javascript function “lookup( )” on the onkeyup event.<br />
</span><span style="font-size:10pt;color:black;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;color:black;font-family:'Bookman Old Style';">&lt;input type=&#8221;text&#8221; id=&#8221;searchField&#8221; size=&#8221;20&#8243; onkeyup=&#8221;lookup (&#8216;search Field&#8217;);&#8221;&gt; </span><span style="font-size:10pt;color:#00ccff;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><strong><span style="font-size:10pt;font-family:'Bookman Old Style';">How to issue an XMLHTTP Request??</span></strong><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">The actual code in Javascript that can issue an XMLHTTP request: </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span> <br />
</span>if (window.XMLHttpRequest)<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span> </span>{</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>  <br />
</span>req = new XMLHttpRequest();<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span> </span>}<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">else if (window.ActiveXObject)<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">{</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>  <br />
</span>req = new ActiveXObject(&#8220;Microsoft.XMLHTTP&#8221;);<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">}<span> <br />
</span></span><span style="font-size:10pt;font-family:'Bookman Old Style';">This code snippet allows both major browser families (Internet Explorer and Mozilla/Safari) to make independent HTTP requests to servers. This code first checks to see if the browser supports either of the supported XMLHTTP objects and then instantiates one. </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';">Using XMLHttp</span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';">After creating the <strong>xmlHttp</strong> object, the object is initialized with the open () method;<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">It accepts three arguments:<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span>a.)<span style="font:7pt 'Times New Roman';">    </span></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';">Request Type<span>  </span>: It is the HTTP request method (GET or POST)<br />
 </span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span>b.)<span style="font:7pt 'Times New Roman';">    </span></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';">URL : It is the URL of the server where the request is send<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span> c.)<span style="font:7pt 'Times New Roman';">    </span></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';">Async : Boolean value to indicate asynchronous call             </span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span>                     <br />
</span></span><span style="font-size:10pt;font-family:'Bookman Old Style';">E.g : <span style="color:blue;">req.open (&#8220;GET&#8221;, url, true); </span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">In the above example the Async argument denotes a TRUE value which denotes asynchronous call (<strong><em>The “A” in AJAX</em></strong>). (This means that the browser can continue doing other things while the request is being fulfilled. A false value in the open method denotes a non-asynchronous or serial processing. This is not recommended, since the browser will cease operations until the response has been returned. )</span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">After initializing a connection using open, the onreadystatechange call is made (only for asynchronous calls). This registers a callback function, which will be invoked once the request is complete:<br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">req.onreadystatechange = processXMLResponse; </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">The function processXMLResponse( ), which processes the XML response, is invoked when the request is fulfilled. A callback function can also be declared inline in the onreadystatechange statement: </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">req.onreadystatechange = processXMLResponse ()</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">{ </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>  </span>// process request </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">}; </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">Any header content can also be specified using req.setRequestHeader. </span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span style="font-size:10pt;font-family:'Bookman Old Style';">Such as: </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>  </span>req.setRequestHeader(“Cookie”, “someKey=true”); </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">Once the XMLHTTP request object (req) has been fully initialized, initiating a call to the server can be done using send( ): </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">   req.send (null);<br />
</span><em><span style="font-size:10pt;font-family:'Bookman Old Style';">For GET requests, a null value or empty string “” is used. </span></em><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';">POST requests contain a string argument with form data. They also require the Content-Type to be set in the header of the request. <span style="color:teal;"></span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';">The callback function, which is called once the request has been fulfilled, usually has some code to make sure the request has no errors. This can be accomplished by checking the readyState as well as the overall status of the HTTP request. (A readystate of 4 means the XMLHTTP request is complete and 200 means it was a success (as opposed to 404 etc..) </span><span style="font-size:10pt;font-family:'Bookman Old Style';"><br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">function processXMLResponse()<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">{ </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>   <br />
       </span>if (xmlreq.readyState == 4)</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>  <br />
</span><span> </span>{ </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span> <br />
       </span>if (xmlreq.status == 200)<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>        </span>{ </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span> <br />
             </span>// Process the XML response… </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span> <br />
       </span>}<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>    </span>}<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">} </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">Processing the XML response is done using standard Javascript DOM methods.<br />
For example to extract the customer name from the incoming XML stream: </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">&lt;customer&gt; </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span>    </span>Nupoor <span> </span></span><span style="font-size:10pt;font-family:'Bookman Old Style';"> </span><span style="font-size:10pt;font-family:'Bookman Old Style';">&lt;/customer&gt; </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">The following code snippet can be used : </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">var name = req.responseXML.getElementsByTagName(&#8220;customer &#8220;)[0]; </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;font-family:'Bookman Old Style';">Parsing more complex XML involves iterating through the elements using code such as: </span><span style="font-size:10pt;font-family:'Bookman Old Style';"> <br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">for (i=0 ; i &lt; elements. Length ; i++)<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">{<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>  </span>for (j=0 ; j &lt; elements[i].childNodes.length ; j++)</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span> </span><span> <br />
</span>{<br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span>    </span>var ElementData =<span>   </span>elements[i].childNodes[j].firstChild.nodeValue; <br />
</span><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';"><span></span>}<br />
</span><strong><span style="font-size:10pt;color:blue;font-family:'Bookman Old Style';">}</span></strong> </span><span style="font-size:10pt;font-family:'Bookman Old Style';"><span id="more-13"></span></span></p>
<p></span></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=13&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/03/ajax-anatomy-of-its-operation-and-the-technologies-used/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9be3443ca1b93fbdcb8b075e6e622bf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nupoorsinha</media:title>
		</media:content>
	</item>
		<item>
		<title>MSMQ</title>
		<link>http://techshape.wordpress.com/2007/12/03/msmq/</link>
		<comments>http://techshape.wordpress.com/2007/12/03/msmq/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 07:17:15 +0000</pubDate>
		<dc:creator>gaganbatra</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techshape.wordpress.com/2007/12/03/msmq/</guid>
		<description><![CDATA[In this article I am writing about a technology that is currently being used in my project. “MSMQ (Microsoft message Queuing)”.  Suppose you are working on an application that needs to communicate to another process that is not currently running but you have to send message to that application then the solution to this problem [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=14&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="navigation">
<p class="alignleft"><span style="font-size:11pt;font-family:'Trebuchet MS';">In this article I am writing about a technology that is currently being used in my project. <strong>“MSMQ (Microsoft message Queuing)”.</strong></span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span></p>
<p class="post">
<p class="entry">
<p class="snap_preview"><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';">Suppose you are working on an application that needs to communicate to another process that is not currently running but you have to send message to that application then the solution to this problem is MSMQ.</span><span style="font-size:11pt;font-family:'Trebuchet MS';">It is a technology by Microsoft through which applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. MSMQ provides guaranteed message delivery, efficient routing, security, and priority-based messaging. It can be used to implement solutions for both asynchronous and synchronous messaging scenarios.</span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"><strong>Real life Senario:</strong> </span><span style="font-size:11pt;font-family:'Trebuchet MS';">In my current project we have a third party accounting software (i.e. Quickbooks). We are using MSMQ to post transactions to Quickbooks from a windows windows application. We have a QB manager that picksup messages from MSMQ’s message Queue. And as this is totally independent of our window application so it can be running simultaneously with the application but not always. In that case MSMQ stores all the messages in its queue and at aome later time when QB manager runs it picks up all the messages from the queue and post to QB and this is done in the same sequence as posted by window application. </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';">W</span><span style="font-size:11pt;font-family:'Trebuchet MS';">hile working on this project I was a bit excited about MSMQ, So I tried to search some details in regard of what it is and how we can use it. I found a number of articles showing what the power of MSMQ is?</span><span style="font-size:11pt;font-family:'Trebuchet MS';"><span> </span>So here in this article I tried to gether up some links about this technology so that it can be helpful to me and everyone else who is working or wants to work on this technology and have a better understanding of MSMQ.</span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';">Ill add up more details as I get into more depth of MSMQ.</span><span style="font-size:11pt;font-family:'Trebuchet MS';">Here are some useful links.</span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';">For Detailed information about what is exactly MSMQ go to:</span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';"><a href="http://msdn2.microsoft.com/en-us/library/ms711472.aspx"><font color="#800080">http://msdn2.microsoft.com/en-us/library/ms711472.aspx</font></a></span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';">MSMQ is very useful in developing Distributed Applications. There is an article on MSDN which describes how to use recoverable messages, transactions (alone or combined with database transactions), and acknowledgements with MSMQ and the Microsoft .NET Framework. This is really helpful in developing a robust distributed application. Go to </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span><span style="font-size:11pt;font-family:'Trebuchet MS';"><a href="http://msdn2.microsoft.com/en-us/library/ms978430.aspx"><font color="#800080">http://msdn2.microsoft.com/en-us/library/ms978430.aspx</font></a></span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';">There is also a very good sample application available for your reference on how to actually use it in your application. </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';"><a href="http://www.codeproject.com/dotnet/mgrmsmq.asp"><font color="#800080">http://www.codeproject.com/dotnet/mgrmsmq.asp</font></a></span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';"><strong>At Wikipedia:</strong> </span><span style="font-size:11pt;font-family:'Trebuchet MS';">MSMQ is essentially a messaging protocol that allows applications running on disparate servers to communicate in a failsafe manner. A queue is a temporary storage location from which messages can be sent when conditions permit. This enables communication across heterogeneous networks and between computers which may not always be connected. By contrast <a href="http://en.wikipedia.org/wiki/Sockets" title="Sockets"><font color="#0066cc">sockets</font></a> and other network protocols assume that direct connections always exist.</span><span style="font-size:11pt;font-family:'Trebuchet MS';">MSMQ has been available to developers on Microsoft platforms since its first version, and has commonly been used in enterprise software built with <a href="http://en.wikipedia.org/wiki/Visual_Studio" title="Visual Studio"><font color="#0066cc">Visual Studio</font></a>, both in the unmanaged pre-<a href="http://en.wikipedia.org/wiki/Microsoft_.NET" title="Microsoft .NET"><font color="#0066cc">.NET</font></a> incarnation (version 5 and 6), and in <a href="http://en.wikipedia.org/wiki/Visual_Studio_.NET" title="Visual Studio .NET"><font color="#0066cc">Visual Studio .NET</font></a>. Microsoft also has incorporated MSMQ in its messaging technology framework, <a href="http://en.wikipedia.org/wiki/Windows_Communication_Foundation" title="Windows Communication Foundation"><font color="#0066cc">Windows Communication Foundation</font></a>. Under WCF, MSMQ can be used to provide secure, reliable transport with a unified programming model compatible with other communications standards</span><span style="font-family:'Trebuchet MS';">.</span><span style="font-size:11pt;font-family:'Trebuchet MS';">For complete article go to </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span><span style="font-size:11pt;font-family:'Trebuchet MS';"><a href="http://en.wikipedia.org/wiki/Microsoft_Message_Queuing"><font color="#800080">http://en.wikipedia.org/wiki/Microsoft_Message_Queuing</font></a></span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span><span style="font-size:11pt;font-family:'Trebuchet MS';"> </span></p>
<p><span style="font-size:11pt;font-family:'Trebuchet MS';"></span><strong><span style="font-size:11pt;font-family:'Trebuchet MS';">Conclusion:</span></strong><span style="font-size:11pt;font-family:'Trebuchet MS';">Talk of enterprise applications, things that come to your mind are transactions, messaging etc. Talk of messaging, what strikes immediately is MSMQ which stands for Microsoft Message Queuing. MSMQ provides a great framework for applications that use messaging infrastructure.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/techshape.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/techshape.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techshape.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techshape.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techshape.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techshape.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techshape.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techshape.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techshape.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techshape.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techshape.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techshape.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techshape.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techshape.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techshape.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techshape.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techshape.wordpress.com&amp;blog=2170154&amp;post=14&amp;subd=techshape&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techshape.wordpress.com/2007/12/03/msmq/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/883d1f217c305bb9156305d4465d1944?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gaganbatra</media:title>
		</media:content>
	</item>
	</channel>
</rss>
