<?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"
	>

<channel>
	<title>Welcome to GlobalLogic Blogs</title>
	<atom:link href="http://blogs.globallogic.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blogs.globallogic.com</link>
	<description>Exponential Innovation</description>
	<pubDate>Mon, 30 Jan 2012 06:04:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>JSMS Configuration on Various Platforms</title>
		<link>http://blogs.globallogic.com/jsms-configuration-on-various-platforms</link>
		<comments>http://blogs.globallogic.com/jsms-configuration-on-various-platforms#comments</comments>
		<pubDate>Fri, 27 Jan 2012 12:13:48 +0000</pubDate>
		<dc:creator>farida.khan</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[api]]></category>

		<category><![CDATA[jsms]]></category>

		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1974</guid>
		<description><![CDATA[Introduction
Its been a tough job configuring this API on various platforms for the project. There was no striaght and simple way I could get from even the Internet.
So writing down my own experience I have followed to configure this SMS API on Windows and Linux Platforms. Hope it would be useful for others who would
need [...]]]></description>
			<content:encoded><![CDATA[<h3><span style="18pt;">Introduction</span></h3>
<p>Its been a tough job configuring this API on various platforms for the project. There was no striaght and simple way I could get from even the Internet.<br />
So writing down my own experience I have followed to configure this SMS API on Windows and Linux Platforms. Hope it would be useful for others who would<br />
need this API to be configured in their projects.</p>
<p>JSMS is a Java API for sending and receiving Short Messages (SMS) and Multimedia Messages (MMS). The API supports a wide range of communication protocols.</p>
<p><strong>1. Supported Protocols</strong></p>
<p>Receiving and Sending of messages by using any GSM Device capable of sending SMS messages and also by using the most common SMSC communication protocols:</p>
<ul>
<li>GSM (GSM devices)</li>
<li>UCP (Universal Computing Protocol)</li>
<li>CIMD2 (Computer Interface to Message Distribution)</li>
<li>SMPP (Short Message Peer-to-Peer)</li>
<li>TAP/IXO (Telocator Alphanumeric Protocol)</li>
<li>MM1 (MMS over GPRS)</li>
<li>MM7 (MMS exchange using SOAP messages over http(s))</li>
</ul>
<p><strong>2. Where to get jSMS?</strong></p>
<p>You can download a copy of the jSMS-API from http:// www.objectxp.com /. The API shipped either as a gzipped tar-archive (UTechnix users) or as ZIP-file (Windows users).</p>
<h3><span style="18pt;">Configuration on Windows Platform</span></h3>
<p><strong>Pre-assumption</strong>: Java is installed on the Windows machine and JAVA_HOME is set.</p>
<p>Follow the below steps:<br />
1.  Unzip the downloaded file to your target directory (using a tool like WinZIP)</p>
<p>2.  Copy javax.comm.properties file in the directory jSMS-&lt;ver&gt;\lib to the                        following locations on windows:<br />
JAVA_HOME\jre\lib<br />
JAVA_HOME\jdk&lt;ver&gt;\jre\lib</p>
<p>3. Make the necessary changes in the jsms.conf file which is at path jSMS-&lt;ver&gt;\bin</p>
<p>4. Copy the license properties that you received via email into the jsms.conf file</p>
<p>5. Change the property connector.serial.port to contain the port that you have the GSM device connected to (e.g. COM1).</p>
<p>6. Copy the following DLL files:</p>
<ul>
<li>win32com.dll from path jSMS-&lt;ver&gt;\lib to c:\WINDOWS\system32 folder</li>
<li>jdunxp.dll from path jSMS-&lt;ver&gt;\lib to c:\WINDOWS\system32 folder</li>
</ul>
<p>Now you are ready to send the SMS from your machine through the connected GSM device.</p>
<p><strong>Testing on Windows:</strong></p>
<p>1. Change directory to jSMS-&lt;ver&gt;\bin and double click the sms.bat file</p>
<p>2. Give the recipient’s mobile number</p>
<p>3. Specify the message to be sent</p>
<p>4. The message should be sent to the recipient</p>
<p>If received you have done it! <img src='http://blogs.globallogic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3><span style="18pt;">Configuration on Linux Platform</span></h3>
<p><strong>Pre-assumption</strong>: Java is installed on the Linux machine and JAVA_HOME is set.</p>
<p>1. Download the java communications API for linux platform from the URL:         <a title="http://www.oracle.com/technetwork/java/index-jsp-141752.html" href="http://www.oracle.com/technetwork/java/index-jsp-141752.html" target="_blank">http://www.oracle.com/technetwork/java/index-jsp-141752.html</a></p>
<p>2. unpack the download zip file using the command:</p>
<p><em><strong>unzip comm3.0_linux.zip</strong></em></p>
<p>3. Install the library using copy command:</p>
<p><strong><em> cp commapi/lib/libLinuxSerialParallel.so</em></strong></p>
<p><strong><em> JAVA_HOME/jre/lib/ext/libLinuxSerialParallel.so</em></strong></p>
<p>4. Install the comm.jar using the copy command:</p>
<p><strong><em> cp commapi/jar/comm.jar</em></strong></p>
<p><strong><em> JAVA_HOME/jre/lib/ext/comm.jar</em></strong></p>
<p>5. Install the javax.comm.properties using the copy command as below:</p>
<p><strong><em> cp commapi/docs/javax.comm.properties</em></strong></p>
<p><strong><em> JAVA_HOME/jre/lib/javax.comm.properties</em></strong></p>
<p>6. Make the necessary changes in the jsms.conf file which is at path jSMS-&lt;ver&gt;\bin</p>
<p>A. Copy the license properties that you received via email into the jsms.conf file.</p>
<p>B. Change the property connector.serial.port to contain the port that you have the GSM device connected to (e.g. dev/ttsy1).</p>
<p>Now you are ready to send the SMS from your machine through the connected GSM device.</p>
<p><strong>Testing on Linux:</strong></p>
<p>1. Open the terminal navigate to the folder <span>jSMS-&lt;ver&gt;\bin</span></p>
<p>2. Execute the sms.sh file using the below command:</p>
<p><strong><em>sh ./sms.sh</em></strong></p>
<p>3. Give the recipient’s mobile number.</p>
<p>4. Specify the message to be sent.</p>
<p>5. The message should be sent to the recipient</p>
<p>If received you have done it! <img src='http://blogs.globallogic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/jsms-configuration-on-various-platforms/feed</wfw:commentRss>
		</item>
		<item>
		<title>C# Fundamentals - Commonly compared concepts (differences)</title>
		<link>http://blogs.globallogic.com/c-fundamentals-commonly-compared-concepts-differences</link>
		<comments>http://blogs.globallogic.com/c-fundamentals-commonly-compared-concepts-differences#comments</comments>
		<pubDate>Sun, 22 Jan 2012 17:21:47 +0000</pubDate>
		<dc:creator>Bhala Ganpatye</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[C# .NET]]></category>

		<category><![CDATA[C# OOP]]></category>

		<category><![CDATA[Delegate vs. Interface]]></category>

		<category><![CDATA[Interface vs. Abstract Class]]></category>

		<category><![CDATA[Override vs. Overload]]></category>

		<category><![CDATA[Value Type vs. Reference Type]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1953</guid>
		<description><![CDATA[I have been asked many time questions like 


When should I use an abstract class and when I should use an interface?


What is difference between delegate and event?


Although people know few points of differences, it’s worth to consolidate as many as differences as we can. So I am trying to provide most of the points [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="0in 0in 10pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">I have been asked many time questions like </span></span></span></p>
<ul>
<li>
<div class="MsoListParagraphCxSpFirst" style="l0 level1 lfo1;"><span lang="EN-US"><span style="small;"><span style="Calibri;">When should I use an abstract class and when I should use an interface?</span></span></span></div>
</li>
<li>
<div class="MsoListParagraphCxSpLast" style="l0 level1 lfo1;"><span lang="EN-US"><span style="small;"><span style="Calibri;">What is difference between delegate and event?</span></span></span></div>
</li>
</ul>
<p class="MsoNormal" style="0in 0in 10pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Although people know few points of differences, it’s worth to consolidate as many as differences as we can. So I am trying to provide most of the points that can not only compares various concepts, but also helps developers understand concepts better way.</span></span></span></p>
<h2><span lang="EN-US"><span style="medium;"><span style="#17365d;"><span style="Calibri;">Override vs. Overload</span></span></span></span></h2>
<table class="MsoNormalTable" style="0in 5.4pt 0in 5.4pt;" border="1" cellspacing="0" cellpadding="0" width="600">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" width="275">
<p class="MsoNormal" style="0in 0in 0pt;"><strong><span style="Calibri;" lang="EN-US"><span style="small;"><span style="Calibri;">Overriding</span></span></span></strong></p>
</td>
<td style="solid windowtext .5pt;" width="275">
<p class="MsoNormal" style="0in 0in 0pt;"><strong><span style="Calibri;" lang="EN-US"><span style="small;"><span style="Calibri;">Overloading</span></span></span></strong></p>
</td>
</tr>
<tr style="1;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">The argument list must exactly match as that of the overridden method</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Overloaded methods must change the argument list (type and/or numbers of arguments)</span></span></span></p>
</td>
</tr>
<tr style="2;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">The return type must exactly match as that of the overridden method</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Overloaded methods can change the return type</span></span></span></p>
</td>
</tr>
<tr style="3;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">The access level can be same or less restrictive than that of the overridden method. (more restrictive not allowed)</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Overloaded methods can change the access modifier. Methods can have difference access modifiers</span></span></span></p>
</td>
</tr>
<tr style="4;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">The overriding method must not throw new or broader checked exceptions than those declared by the overridden method. But it can throw narrower or fewer exceptions. Just because an overridden method “takes risks” doesn’t mean that the overriding subclass’ exception takes the same risks. Bottom line: An overriding method doesn’t have to declare any exceptions that it will never throw, regardless of what the overridden method declares.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Overloaded methods can declare new or broader checked exceptions.</span></span></span></p>
</td>
</tr>
<tr style="5;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">You cannot override a method marked as sealed</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">You cannot overload a method just by changing only return type</span></span></span></p>
</td>
</tr>
<tr style="6;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">You can override method in derived class only</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">A method can be overloaded in the same class or in a subclass. </span></span></span></p>
</td>
</tr>
<tr style="7;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">You can override only non-static method</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">You can overload both static and non-static method</span></span></span></p>
</td>
</tr>
<tr style="8;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Runtime polymorphism</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Compile time polymorphism</span></span></span></p>
</td>
</tr>
<tr style="yes;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Overriding also applies to property and event</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Overloading also applies to operator</span></span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="0in 0in 10pt;"><span lang="EN-US"><span style="small;"> </span></span></p>
<h2><span lang="EN-US"><span style="medium;"><span style="#17365d;"><span style="Calibri;">Interface vs. Abstract Class</span></span></span></span></h2>
<table class="MsoNormalTable" style="0in 5.4pt 0in 5.4pt;" border="1" cellspacing="0" cellpadding="0" width="600">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" width="100">
<p class="MsoNormal" style="0in 0in 0pt;"><em><span style="Calibri;" lang="EN-US">Feature</span></em></p>
</td>
<td style="solid windowtext .5pt;" width="200">
<p class="MsoNormal" style="0in 0in 0pt;"><strong><span style="Calibri;" lang="EN-US">Interface</span></strong></p>
</td>
<td style="solid windowtext .5pt;" width="200">
<p class="MsoNormal" style="0in 0in 0pt;"><strong><span style="Calibri;" lang="EN-US">Abstract</span></strong><span style="Calibri;" lang="EN-US"> <strong>class</strong></span></p>
</td>
</tr>
<tr style="1;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Inheritance in class</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">A class may inherit several interfaces.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">A class may inherit only one abstract class.</span></span></span></p>
</td>
</tr>
<tr style="2;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Inheritance in structure</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An Interface can be inherited by structures.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An abstract class cannot be inherited by structures</span></span></span></p>
</td>
</tr>
<tr style="3;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Inheritance to self</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Interface can inherit only interface(s)</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An abstract class may inherit one abstract class and/or multiple interfaces</span></span></span></p>
</td>
</tr>
<tr style="4;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Default implementation</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An interface cannot provide any code, just the signature. Implicit Abstract</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An abstract class can provide complete, default code and/or just the details that have to be overridden.</span></span></span></p>
</td>
</tr>
<tr style="5;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Access Modifiers</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An interface cannot have access modifiers for members. everything is assumed as public</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An abstract class can contain access modifiers for the methods, properties</span></span></span></p>
</td>
</tr>
<tr style="6;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Adding functionality </span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Changing member or adding new member breaks the classes implementing interface. So all subclasses must change implementation </span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.</span></span></span></p>
</td>
</tr>
<tr style="7;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Allowed Members</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">properties, methods, events</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">properties, methods, events, fields, constants, delegates</span></span></span></p>
</td>
</tr>
<tr style="8;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Constructors</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An Interface cannot contain constructors or destructors. </span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">An abstract class can contain constructors or destructors. </span></span></span></p>
</td>
</tr>
<tr style="yes;">
<td style="solid windowtext .5pt;" width="100" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;"> </span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Contract</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="200" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Common behavior</span></span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="0in 0in 10pt;"><span lang="EN-US"><span style="small;"> </span></span></p>
<h2><span lang="EN-US"><span style="medium;"><span style="#17365d;"><span style="Calibri;">Value Type vs. Reference Type</span></span></span></span></h2>
<table class="MsoNormalTable" style="0in 5.4pt 0in 5.4pt;" border="1" cellspacing="0" cellpadding="0" width="600">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" width="275" valign="bottom">
<p class="MsoNormal" style="0in 0in 0pt;"><strong><span style="EN-GB;"><span style="small;"><span style="Calibri;">Value Type / Struct</span></span></span></strong></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="bottom">
<p class="MsoNormal" style="0in 0in 0pt;"><strong><span style="EN-GB;"><span style="small;"><span style="Calibri;">Reference Type</span></span></span></strong></p>
</td>
</tr>
<tr style="1;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Variables that are based on value types directly contain values. Assigning one value type variable to another copies the contained value. </span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">The assignment of reference type variables, copies a reference to the object but not the object itself.</span></span></span></p>
</td>
</tr>
<tr style="2;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Value types derive from System.ValueType, which derives from System.Object</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Reference types are derived from System.Object</span></span></span></p>
</td>
</tr>
<tr style="3;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Value types are sealed. you cannot derive a new type from a value type. However, like reference types, structs can implement interfaces.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">You can derive a new type from another reference type or class</span></span></span></p>
</td>
</tr>
<tr style="4;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">A value type cannot contain the null value. However, the nullable types feature does allow for values types to be assigned to null. </span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Reference types can be null</span></span></span></p>
</td>
</tr>
<tr style="5;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Each value type has an implicit default constructor that initializes the default value of that type.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Explicit constructor need to be called to hold data</span></span></span></p>
</td>
</tr>
<tr style="6;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">Value type variables directly contain their values which means that the memory is allocated inline in whatever context the variable is declared.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">The memory is allocated on the managed heap. the variable holds only a reference to the location of the object</span></span></span></p>
</td>
</tr>
<tr style="yes;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">There is no separate heap allocation or garbage collection overhead for value-type variables. </span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span lang="EN-US"><span style="small;"><span style="Calibri;">GC plays important role in memory clean up</span></span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="0in 0in 10pt;"><span lang="EN-US"><span style="small;"> </span></span></p>
<h2><span lang="EN-US"><span style="medium;"><span style="#17365d;"><span style="Calibri;">Delegate vs. Interface</span></span></span></span></h2>
<table class="MsoTableGrid" style="solid windowtext .5pt;" border="1" cellspacing="0" cellpadding="0" width="600">
<tbody>
<tr style="yes;">
<td style="windowtext 1pt solid;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><strong><span style="EN-GB;"><span style="small;"><span style="Calibri;">Delegate - Usage </span></span></span></strong></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><strong><span style="EN-GB;"><span style="small;"><span style="Calibri;">Interface - Usage</span></span></span></strong></p>
</td>
</tr>
<tr style="1;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">An eventing design pattern is used.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">The class using the interface will want to cast that interface to other interface or class types.</span></span></span></p>
</td>
</tr>
<tr style="2;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">It is desirable to encapsulate a static method.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">The method being implemented is linked to the type or identity of the class: for example, comparison methods.</span></span></span></p>
</td>
</tr>
<tr style="3;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">The caller has no need to access other properties, methods, or interfaces on the object implementing the method.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">There is a group of related methods that may be called.</span></span></span></p>
</td>
</tr>
<tr style="4;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">Easy composition is desired.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">The method being implemented is linked to the type or identity of the class: for example, comparison methods.</span></span></span></p>
</td>
</tr>
<tr style="yes;">
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">A class may need more than one implementation of the method.</span></span></span></p>
</td>
<td style="solid windowtext .5pt;" width="275" valign="top">
<p class="MsoNormal" style="0in 0in 0pt;"><span style="EN-GB;"><span style="small;"><span style="Calibri;">A class only needs one implementation of the method.</span></span></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="0in 0in 10pt;"><span lang="EN-US"><span style="small;"> </span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/c-fundamentals-commonly-compared-concepts-differences/feed</wfw:commentRss>
		</item>
		<item>
		<title>New Year’s Resolutions or Continuous Improvement?</title>
		<link>http://blogs.globallogic.com/new-year-resolutions-or-continuous-improvement</link>
		<comments>http://blogs.globallogic.com/new-year-resolutions-or-continuous-improvement#comments</comments>
		<pubDate>Mon, 16 Jan 2012 20:45:18 +0000</pubDate>
		<dc:creator>Peter Harrison</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Continuous Improvement]]></category>

		<category><![CDATA[New Year’s Resolution]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1945</guid>
		<description><![CDATA[Last  week, my friend confidently told me his New Year’s resolutions for  2012: eat healthier and lose 30 pounds, bring down his blood pressure  and learn a new language. I laughed because these were the exact same  resolutions he made last year &#8212; and then quickly forgot.
Sound  familiar? The beginning [...]]]></description>
			<content:encoded><![CDATA[<p><span style="baseline;">Last  week, my friend confidently told me his New Year’s resolutions for  2012: eat healthier and lose 30 pounds, bring down his blood pressure  and learn a new language. I laughed because these were the exact same  resolutions he made last year &#8212; and then quickly forgot.</span></p>
<p><span style="baseline;">Sound  familiar? The beginning of the new year is a natural opportunity to  reflect on the past and make resolutions for the future. It’s common  that such resolutions rarely survive the month of January, much less the  entire year. Is it that we’re not disciplined or motivated enough? Not  necessarily. I believe the fault lies in resolutions themselves. </span></p>
<p><span style="baseline;">Too  often on New Year’s Day, we make spur-of-the-moment promises with no  clear action plan of how to achieve them. Most of us expect to see a  drastic change in just a few weeks when, in reality, a significant and  permanent change can take months to realize.</span></p>
<p><span style="baseline;">I  have personally stopped making annual resolutions; instead, I embrace  the power of continuous improvement. Taking a note from my Agile  software teams, I’ve taken to making numerous small changes in my life  that, combined together, have a big impact. For example, I recently  decided to reduce the carbohydrates and glutens in my diet. I still eat  them, just less of them. It may not sound as impressive as completely  cutting these foods out of my diet, but it’s a change that I can  realistically sustain. Similarly, rather than committing to losing 30  pounds in a year, I have started by trying to loose 3 pounds in 30 days.  By layering such incremental improvements on top of each other, I  create goals I can achieve. Each small success builds momentum and the  confidence that I can permanently change my lifestyle for the better. </span></p>
<p><span style="baseline;">So  whether you are trying to build a great software product or just fit  back into your old jeans, take an Agile approach rather than a “big  bang” approach. Commit to one or two small goals at a time, measure  their impact, and adjust accordingly to make them permanent features in  your life. If you repeat this process over the next year, I’m very  confident you will amaze yourself. </span></p>
<p><span style="baseline;">I  look forward to hearing your stories of resolutions either made or  broken, as well as what techniques you’ve found make a lasting  difference.</span></p>
<p><span style="baseline;">Wishing you all a happy, healthy and prosperous new year!</span></p>
<p><span>This Post was an Agile collaboration between Peter Harrison &amp; Mayank Gupta of GlobalLogic</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/new-year-resolutions-or-continuous-improvement/feed</wfw:commentRss>
		</item>
		<item>
		<title>Story Sizing and Estimation ( Do&#8217;s and Dont&#8217;s)</title>
		<link>http://blogs.globallogic.com/story-sizing-and-estimation-a-few-tried-approaches</link>
		<comments>http://blogs.globallogic.com/story-sizing-and-estimation-a-few-tried-approaches#comments</comments>
		<pubDate>Fri, 13 Jan 2012 07:50:03 +0000</pubDate>
		<dc:creator>shilpi.saxena</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Story Estimation]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1930</guid>
		<description><![CDATA[Here are the user story estimation techniques that I&#8217;ve found effective.This helps escape one of the biggest risk of estimations - we get into , which says estimates are not supposed to be 100% precise.
T-Shirt sizing is vague technique - get rid of it 
Originally I estimated stories as one, two, three, four or as [...]]]></description>
			<content:encoded><![CDATA[<p>Here are the user story estimation techniques that I&#8217;ve found effective.This helps escape one of the biggest risk of estimations - we get into , which says estimates are not supposed to be 100% precise.</p>
<p><strong>T-Shirt sizing is vague technique - get rid of it </strong></p>
<p>Originally I estimated stories as one, two, three, four or as small, medium, large, extra-large. It was always meant to be understood that a medium was twice the size of a small and a large was twice the size of a medium (and so on), but that never seemed to translate well when it came to planning. Then someone recommended to me that I try powers of two. Suddenly we were speaking a language that the business could understand. They knew that an 8 was significantly bigger than a 1. I believe the sizes one, two, four, eight are also much more appropriate. As stories get larger they almost always contain more unknown and risk. A powers of two scale emphasizes the risk associated with large stories.</p>
<p><strong>Use four values - it helps streamlining </strong></p>
<p>I was once on a project that started with 1, 2, 4, 8 as their estimation values. After the first two estimation sessions less than 5% of the stories were ones and about 30% of the stories were twos. The project manager decided to get rid of the one value because it made his life easier. An interesting thing happened at each subsequent estimation meeting, suddenly only 5% of the stories were twos and many more stories had become fours. I don&#8217;t think that the developers consciously changed their scale, but developers are conditioned to be skeptical. Few developers are willing to say with certainty that any given story will be as easy as the scale allows. After witnessing this type of behavior on a few different projects, I prefer a minimum of four point values. I also prefer a maximum of 4 point values. After all, it&#8217;s nothing more than an estimate. If you try to give too much precision to an estimate you&#8217;ll end up having to account for why you missed the mark. The idea is to get a rough idea, not a rigid plan to live off of.</p>
<p><strong>No averages or numbers not on the scale</strong></p>
<p>Four values allow you to get a rough estimate without spending unnecessary time focusing on precision. Sometimes a story feels larger than a two but smaller than a four. The story should not be estimated as a three. There&#8217;s really no reason to use a three. The story carries enough risk or unknowns that it is not a two; therefore, it&#8217;s very likely that it will actually be a four. Using an average or an off scale number can briefly (and unnecessarily) confuse a team member or stakeholder. Also, in the big picture of the project, the occasional uncommon estimate isn&#8217;t likely to make much of a difference. Keep it simple, stick to the scale.</p>
<p><strong>Vote independently- no baising</strong></p>
<p>It&#8217;s human nature to be influenced by other people. If a technical leader says a story is a two, it&#8217;s likely that the rest of the team will follow his lead. For this reason I prefer an estimation process that lets each team member vote independently. This can be done by using sheets of paper that no one reveals until everyone is ready. Another option (that I prefer) is to give your estimation rock-paper-scissors (RPS) style. In our estimation meetings we talk about a story until we are ready to estimate then we all &#8220;throw&#8221; our estimations the same as you would &#8220;throw&#8221; rock, paper, or scissors. What I mean by &#8220;throw our estimation&#8221; is that if we think it&#8217;s a 1 we point 1 finger. Likewise a 2 is two fingers and 4 is four fingers. If you need to throw an 8, you can use both hands.</p>
<p><strong>Take the largest estimate - that&#8217;s the safest way</strong></p>
<p>Even when reminded, developers seem to have a hard time estimating with a team in mind. If a developer thinks they can do the story in 1 day, they throw 1 finger. Unfortunately, that developer may not be available to do the story, and then some other team member is stuck working on a story that they thought was a 2 or even a 4. I prefer to always take the largest estimate thrown by any team member. You may consider this to be sandbagging, but in reality it&#8217;s likely that each team member has identified different risks and the team member with the largest estimate has probably correctly identified that there is more risk than the other members have thought of.</p>
<p>Taking the largest estimate has additional benefits. If you must agree on a lower estimate then the team member with the larger estimate will need to discuss why they chose a larger value. This discussion can be uncomfortable for developers who are less senior on the team. They may not know how to do something as quickly, based on limited experience with the language or tools. Their concerns are often justified by their skill level, and it would be unfortunate if they felt uncomfortable giving their true estimate because they were afraid to discuss why it was higher.</p>
<p>Any discussion around taking a higher or lower value may lead to the entire team raising their value, or it may lead to that developer uncomfortably lowering their estimate. Either way, you&#8217;ll need to spend more time talking and you wont have gained&#8211;in the end it&#8217;s consistency that matters. You always know how many stories you expect to get done in an iteration by tracking velocity. Therefore, even if your estimates are &#8220;bloated&#8221; so will your velocity be, thus it has no effect on planning.</p>
<p>Finally, taking the largest estimate can help save time in an estimation meeting. If any member of the team believes the story is an 8 he can speak up at any time while discussing the story and announce that he is going to throw an eight. Unless someone else believes that there is a large estimation gap among team members, there&#8217;s no reason to continue talking about the story since it will ultimately become an eight anyway.</p>
<p><strong>Large estimate gaps - something is not right </strong></p>
<p>When estimating it&#8217;s usually the exception that the entire team agrees on the size of a story. Like I previously said, I like to handle the mismatch by always taking the larger estimate. However, sometimes a large gap represents a misunderstanding. For this reason any time there is a two value gap in estimation, additional conversation always occurs (e.g. if a team member throws a 1 and another throws a 4, some clarification needs to occur). Discussing large gaps also ensures that taking the largest estimate has less chance of being abused.</p>
<p><strong>Insufficient information - may lead to inaccurate estimates</strong></p>
<p>On occasion a story may need leave the meeting unestimated. It&#8217;s better to ask for more information than to give an estimate that you are uncomfortable with. An estimate of 8 implies that it&#8217;s a large story, but you expect it to take twice as long as a 4. Therefore, don&#8217;t simply estimate ill-defined stories as eights, because you will likely be expected to get it done in the same amount of time as it takes to get two stories estimated as fours completed. The goal of an estimation meeting isn&#8217;t to estimate all the stories, it&#8217;s to provide estimates on the stories that provide sufficient information.</p>
<p><strong>Business and Developers - the two different line of thoughts</strong></p>
<p>It&#8217;s as simple as this, the business wants to know what functionality they can get in the next iteration. To know what to expect they need estimates. Since the business will not be writing the code, they cannot contribute proper estimates. The more they are involved (in the actual estimation), the less likely it is that they will receive realistic estimates. The best domain experts answer questions in meetings, but never assert in any way the level of effort it will take to complete any given story.</p>
<p><strong>Estimation group size - the right number is the trick</strong></p>
<p>Teams come in many different sizes. On smaller teams (6 or less) I suggest the entire team attend the estimation session. The many points of view are likely to solidify vision and positively contribute to an estimate. However, I believe there is a point of diminishing returns. Not everyone on a large team needs to be part of estimating each story. Additionally, it&#8217;s an estimate, 6 people should be just as accurate as 15 people would be. If your team is larger than 6 people I suggest breaking into smaller groups for estimation. In general I like to get at least 3 people to estimate any given story, but no more than 6.</p>
<p><strong>New stories - when should they be estimated</strong></p>
<p>New stories come in two forms: new feature requests and stories that split. I generally wait to estimate new stories based on their priority. If a story needs to be done in the next iteration, it generally requires an immediate estimate. However, if the new stories aren&#8217;t going to be played for several iterations it can make sense to hold off until you have enough stories to justify an estimation meeting. I find estimates from estimation meetings to be more reliable, since they come from an environment where everyone is focused solely on estimation. Stories resulting from a split provide an additional complication: they likely already have an estimate. I strongly suggest that the new stories be estimated without taking into consideration the previous estimate. If a story carried enough risk or uncertainty that it required splitting, it&#8217;s not likely that the estimate is realistic&#8211;ignore the original estimate.</p>
<p><strong>Required participation - this is important </strong></p>
<p>This suggestion is a very important one. In theory, no developer from outside the team should be attending an estimation session. That means that every developer that attends an estimation session will potentially be tasked with working on a story that&#8217;s being estimated. If a developer is not comfortable estimating a story, then I&#8217;m not comfortable with them working on the story. Of course, there are exceptions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/story-sizing-and-estimation-a-few-tried-approaches/feed</wfw:commentRss>
		</item>
		<item>
		<title>Troubleshooting merge replication &#8212; Mismatch between the replication metadata</title>
		<link>http://blogs.globallogic.com/troubleshooting-merge-replication-mismatch-between-the-replication-metadata</link>
		<comments>http://blogs.globallogic.com/troubleshooting-merge-replication-mismatch-between-the-replication-metadata#comments</comments>
		<pubDate>Tue, 10 Jan 2012 08:21:26 +0000</pubDate>
		<dc:creator>sunil.singh</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[The merge process failed because it detected a mismatch between the replication metadata of the two replicas]]></category>

		<category><![CDATA[Troubleshooting merge replication]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1885</guid>
		<description><![CDATA[Error Message:
The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older [...]]]></description>
			<content:encoded><![CDATA[<p>Error Message:</p>
<p><span><em>The merge process failed because it detected a mismatch between the replication metadata of the two replicas, such that some changes could be lost leading to non-convergence. This could be due to the subscriber not having synchronized within the retention period, or because of one of the replicas being restored to a backup older than retention period, or because of the publisher performing more aggressive cleanup on articles of type download-only and articles with partition_options = 3. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199363)<br />
Get help: http://help/MSSQL_REPL-2147199363</em></span></p>
<p><em><span>The common generation watermark is invalid at this replica since it does not exist or metadata for changes not yet propagated may have been cleaned up. (Source: MSSQLServer, Error number: 21800)<br />
Get help:<span> </span></span><a title="http://help/21800" href="http://help/21800"><span>http://help/21800</span></a></em></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p class="MsoNormal"><span>Let us see how replication works: a subscriber connects to the publisher, submitting its knowledge about which generations have already been sent and received.  If the generations sent and received do not match, then the replication will fails by saying non-convergence can happen. </span></p>
<p class="MsoNormal"><span>If you look in the table, sysmergesubscriptions, you will see four columns: sentgen, sentguid, recgen, and recguid.  These are the columns that tell the last generations synchronized.  Depending on whether you are looking at the publisher or subscriber will determine what the columns actually mean as far as direction.  If you are looking at the publisher, then sentgen and sentguid refer to the last generation sent to the subscriber.  If you are looking at the subscriber, then sentgen and sentguid refer to the last generation sent to the publisher.  If you get the above error message, then it may be that the values do not match between the publisher and subscriber.</span></p>
<p><span>We have to trust either publisher or subscriber for accuracy, So let&#8217;s say that we trust the publisher to be accurate on the sentgen and recgen.  All you need to do is copy the values for sentgen and sentguid into the recgen and recguid columns respectively, and the recgen and recguid into the sentgen and sentguid columns respectively at the subscriber.  Your update statement will look something like:</span><br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--></p>
<p class="MsoNormal"><span>UPDATE sysmergesubscriptions </span>SET sentgen = 8664, sentguid = ‘DD172177-E223-417C-8BFF-9F72561280EA &#8216;, recgen = 13842769, recguid = 193C40B5-7A23-4A7A-B97E-885EC2A1FFD3&#8242; where subid = pubid and pubid = F6646824-BCCC-443C-875B-0D700F63D075&#8242;</p>
<p class="MsoNormal"><span><br />
<span>In the update statement we have &#8220;where subid = pubid.&#8221;  That&#8217;s because there are two records for every publication at the subscriber, and only the one where the subid equals the pubid is used to track generations.</span></span></p>
<p class="MsoNormal">If synchronization is being taken care by RMO programming then you can also take care of this issue in RMO programming as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/troubleshooting-merge-replication-mismatch-between-the-replication-metadata/feed</wfw:commentRss>
		</item>
		<item>
		<title>Reclaim Your Inbox</title>
		<link>http://blogs.globallogic.com/email</link>
		<comments>http://blogs.globallogic.com/email#comments</comments>
		<pubDate>Mon, 09 Jan 2012 19:36:04 +0000</pubDate>
		<dc:creator>Peter Harrison</dc:creator>
		
		<category><![CDATA[Marketing]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[email corporate communications etiquette business CEO correspondence]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1910</guid>
		<description><![CDATA[Manage your inbox before it manages you&#8230;
Today I had the distinct pleasure of speaking to a group of brilliant local leaders on how to Reclaim Your Inbox presented at the Young Presidents&#8217; Organization Washington DC/Baltimore Chapter Retreat in Maryland on January 9, 2012.
View the full presentation: Reclaim Your Inbox by GlobalLogic CEO Peter Harrison
- - - - -
Below [...]]]></description>
			<content:encoded><![CDATA[<h3><em>Manage your inbox before it manages you&#8230;</em></h3>
<p>Today I had the distinct pleasure of speaking to a group of brilliant local leaders on how to <strong><em><em>Reclaim Your Inbox </em></em></strong>presented at the Young Presidents&#8217; Organization Washington DC/Baltimore Chapter Retreat in Maryland on January 9, 2012.</p>
<p>View the full presentation: <a href="http://blogs.globallogic.com/wp-content/uploads/2012/01/reclaimyourinbox-globallogicceo-peter_harrison.pdf">Reclaim Your Inbox by GlobalLogic CEO Peter Harrison</a></p>
<p style="center;"><strong><a href="http://blogs.globallogic.com/wp-content/uploads/2012/01/reclaimyourinbox-globallogicceo-peter_harrison.pdf"></a>- - - - -</strong></p>
<p><em>Below is a list of GlobalLogic&#8217;s Communications Guidelines for Email. If you have a good email tip or two that&#8217;s missing from this list, I encourage you to share them here by adding your comments below.</em></p>
<p><strong>GlobalLogic&#8217;s Corporate Communications Guidelines - EMAIL:</strong></p>
<ol>
<li>Only send mail TO someone when action is requested or when responding (otherwise CC).</li>
<li>If information is simply FYI then send using CC, not TO which makes it clear no response is required</li>
<li>If you use REPLY ALL, always check that only relevant people remain in TO and CC.</li>
<li>If you send TO more than one person, make sure you clearly define who is expected to do what.</li>
<li>Consider creating a filter and applying a label to separate incoming CC mail.</li>
<li>Do not store processed mail in your Inbox - once you’ve responded/completed a mail move it to another label so you know it is complete.</li>
<li>Try to always respond to or acknowledge all TO mail within 24 hrs.</li>
<li>If you are not getting a response within the timeframe you need, pick up the phone. Not getting an email response from another person is not a reason to miss your own deadlines.</li>
<li>Do not use email for potentially emotional content; use the phone or a meeting instead.</li>
<li>If mail is confidential and not to be forwarded include CONFIDENTIAL in the subject line.</li>
<li>When you need to share attachments with a group:</li>
<li>For completed documents: upload to confluence and include the link in your mail</li>
<li>For working documents: use Google docs and share with the group</li>
<li>Always use the standard e-signature for all emails. Consider adding the PR boilerplate when sending emails for the first time to any person/prospect/partner - standard signature</li>
<li>Please use only the default background provided by Google for all emails. Backgrounds full of color and graphics can make emails difficult to read on mobile devices.</li>
<li>Please consider using HTML for emails as opposed to RTF. RTF makes it difficult to find embedded attachments.</li>
<li>As of now DELETED emails in Gmail are automatically erased from your mailbox’s memory after 3 weeks. Consider using ARCHIVE instead in order to locate your old emails.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/email/feed</wfw:commentRss>
		</item>
		<item>
		<title>Simplifying Agile - The art of writing User Stories</title>
		<link>http://blogs.globallogic.com/simplifying-agile-the-art-of-writing-user-stories</link>
		<comments>http://blogs.globallogic.com/simplifying-agile-the-art-of-writing-user-stories#comments</comments>
		<pubDate>Sun, 08 Jan 2012 13:30:13 +0000</pubDate>
		<dc:creator>Sachin Gupta</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[documentation]]></category>

		<category><![CDATA[requirements]]></category>

		<category><![CDATA[template]]></category>

		<category><![CDATA[user stories]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1890</guid>
		<description><![CDATA[When I started my current project as a Functional Analyst last year, I was advised to write user stories in the form of &#8220;As a &#60;user&#62;, I want &#60;goal&#62; so that &#60;reason&#62;”. It is a unique way to document the stories but definitely simplifies various challenges of the requirements documentation.
By learning how to gather requirements [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">When I started my current project as a Functional Analyst last year, I was advised to write user stories in the form of &#8220;As a &lt;user&gt;, I want &lt;goal&gt; so that &lt;reason&gt;”. It is a unique way to document the stories but definitely simplifies various challenges of the requirements documentation.</span></p>
<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">By learning how to gather requirements as user stories, I realized how agile plans are always kept up-to-date, contain only the latest and greatest information, and avoid one of the greatest wastes our industry has ever known—premature up-front analysis.</span></p>
<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">The key challenges that teams run into when they heavily rely on documentation for their software requirements are that:</span></p>
<ul>
<li><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">They can&#8217;t handle changes effectively</span></li>
<li><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">They build according to specs instead of what the customer wants</span></li>
<li><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">They make bad guess and false assumptions</span></li>
<li><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">They waste a lot of time</span></li>
</ul>
<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">So, Is a requirement really a requirement? If I put it in words of Kent Beck, </span><span style="&quot;Calibri&quot;,&quot;sans-serif&quot;;">one of the 17 original signatories of the Agile Manifesto</span><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">, then the term &#8216;Requirement&#8217; is just plain wrong. </span></p>
<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">“<em>Software development has been steered wrong by the term requirement, defined in the dictionary as something that is mandatory or obligatory. The word carries a connotation of absolutism and permanence, inhibitors for embracing change. And the word “requirement” is just plain wrong.</em></span></p>
<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;"><em>Out of the thousands of pages used to describe requirements, if you deliver the right 5, 10 or 20 percent, you will likely realize all of the business benefit envisioned for the whole system. So what were the other 80 percent? Not requirements—they weren’t mandatory or obligatory.</em>”</span></p>
<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">The problem with gathering requirements as documentation isn’t one of volume—it’s one of communication. </span></p>
<ul>
<li><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">First, you can’t have a conversation with a document </span></li>
<li><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">Second, it’s just really easy to misinterpret what someone wrote </span></li>
</ul>
<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">This leads us to one of the most important principles of agile: </span></p>
<p class="MsoNormal"><strong><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">The most efficient and effective method of conveying information to and within a development team is face-to-face conversation. </span></strong></p>
<p class="MsoNormal"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">So, what we need is something that enables us to have a conversation about a requirement, captures the essence of what our customer wants, and is small enough for planning yet descriptive enough to remind us what we are talking about &#8230;ENTER A USER STORY</span></p>
<p class="MsoNormal" style="normal;"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">Agile user story is a short description of a promise of a conversation. Agile encourages the user stories on index cards </span><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">to remind teams that the initial goal of the requirements-gathering exercise isn’t to get into all the details. It’s to write down a few key words to capture the spirit of the feature and file it away for a later date.</span></p>
<p class="MsoNormal" style="normal;"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">Why just few key words? </span><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">To save us the time and energy of going all in it now and having to redo it all later, we defer diving into the low-level details until later.</span></p>
<p class="MsoNormal" style="normal;"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">User stories have to make sense to business. That’s why we always try to write them in simple terms and try to stay away from any technical jargon. It is better if we put the information in terms that business understands. </span></p>
<p class="MsoNormal" style="normal;"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">A really good user story is one that goes from end to end - slicing through all the layers of the architecture and delivers something of value. The good user stories are Independent, Negotiable, Testable, and Concise that can be Estimated easily. </span></p>
<p class="MsoNormal" style="normal;"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">A few short, well-chosen words are usually enough to remind the team about what a particular user story is about: that brings up our User Story Template in existence </span></p>
<p class="MsoNormal" style="normal;"><strong><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">AS A &lt;USER&gt; I WANT &lt;GOAL&gt; SO THAT &lt;REASON&gt;</span></strong><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal" style="normal;"><span style="&quot;Verdana&quot;,&quot;sans-serif&quot;;">The nice thing about this template is it answers three important questions about the user story: <strong><em>the who, the what, and the why</em></strong>. It gives a little more context and really emphasizes and focuses on the business, which is a good thing.</span></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/simplifying-agile-the-art-of-writing-user-stories/feed</wfw:commentRss>
		</item>
		<item>
		<title>Maven Integration with PMD &#38; FindBugs</title>
		<link>http://blogs.globallogic.com/maven-integration-with-pmd-findbugs</link>
		<comments>http://blogs.globallogic.com/maven-integration-with-pmd-findbugs#comments</comments>
		<pubDate>Wed, 04 Jan 2012 14:49:19 +0000</pubDate>
		<dc:creator>Rajender Aggarwal</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[findbugs]]></category>

		<category><![CDATA[maven]]></category>

		<category><![CDATA[pmd]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1887</guid>
		<description><![CDATA[Apache Maven is a software  project management and comprehension tool. Based on the concept of a  project object model         (POM), Maven can manage a project&#8217;s build,  reporting and documentation from a central piece of information.
In  this blog, we will look at integration of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://maven.apache.org/">Apache Maven</a> is a software  project management and comprehension tool. Based on the concept of a  project object model         (POM), Maven can manage a project&#8217;s build,  reporting and documentation from a central piece of information.</p>
<p>In  this blog, we will look at integration of Maven with PMD and FindBugs.  Apart from PMS and FindBugs, there are various other tools such as  Surefire and Corbetura that can be integrated with Maven. Lets look at  them &#8230;</p>
<ul>
<li>Maven Surefire Report Plugin : Generates the test results reports (TEST-*.xml) into HTML format.</li>
<li>Maven  Corbetura Report Plugin : The Cobertura tool is a free and easy to use  source code test coverage analyser. It helps you to discover where your  source-code lacks in test coverage.</li>
<li>Maven PMD  Plugin : Runs the PMD code analysis tool on your project&#8217;s source code and generate a site report with its results.</li>
<li>Maven  FindBugs Report Plugin : FindBugs uses static analysis to inspect Java  bytecode for occurrences of bug patterns. FindBugs is better in finding  Threading issues than PMD.</li>
</ul>
<p><span style="bold;">Configuring PMD with Maven</span></p>
<p>At the PMD site there is comprehensive <a href="http://pmd.sourceforge.net/rules/index.html">documentation</a> available on what PMD will report about. In PMD there are rules and  rulesets. Rulesets are groups of rules and other rulesets. By default  PMD provides a ruleset that is packaged with the plugin. To customize  this you need to create your own ruleset like described on the PMD site.</p>
<p>&lt;plugin&gt;<br />
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br />
&lt;artifactId&gt;maven-pmd-plugin&lt;/artifactId&gt;<br />
&lt;configuration&gt;<br />
&lt;rulesets&gt;<br />
&lt;ruleset&gt;{Location of PMD Rulse Set File};/ruleset&gt;<br />
&lt;/rulesets&gt;<br />
&lt;/configuration&gt;<br />
&lt;executions&gt;<br />
&lt;execution&gt;<br />
&lt;phase&gt;package&lt;/phase&gt;<br />
&lt;goals&gt;<br />
&lt;goal&gt;pmd&lt;/goal&gt;<br />
&lt;/goals&gt;<br />
&lt;/execution&gt;<br />
&lt;/executions&gt;<br />
&lt;/plugin&gt;<br />
<span style="bold;">Configuring FindBugs with Maven</span></p>
<p>FindBugs  looks for bugs in Java programs. It is based on the concept  of bug  patterns. A bug pattern is a code idiom that is often an error.  Bug  patterns arise for a variety of reasons:</p>
<ul>
<li>Difficult language features</li>
<li>Misunderstood API methods</li>
<li>Misunderstood invariants when code is modified during maintenance</li>
<li>Garden variety mistakes: typos, use of the wrong boolean operator</li>
</ul>
<p>&lt;plugin&gt;<br />
&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;<br />
&lt;artifactId&gt;findbugs-maven-plugin&lt;/artifactId&gt;<br />
&lt;version&gt;1.2&lt;/version&gt;<br />
&lt;configuration&gt;<br />
&lt;xmlOutput&gt;true&lt;/xmlOutput&gt;<br />
&lt;!&#8211; Optional directory to put FindBugs xdoc xml report &#8211;&gt;<br />
&lt;xmlOutputDirectory&gt;target/site&lt;/xmlOutputDirectory&gt;<br />
&lt;threshold&gt;High&lt;/threshold&gt;<br />
&lt;/configuration&gt;<br />
&lt;/plugin&gt;</p>
<p>To  conclude, integrating and generating reports with Maven is a great way  to monitor the quality of the code. However, to get the real value, one  must think about which reports to choose and how to use them. Adding too  many reports will lead to information overload and may create confusion  over what to fix.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/maven-integration-with-pmd-findbugs/feed</wfw:commentRss>
		</item>
		<item>
		<title>Runtime Memory Management Basics</title>
		<link>http://blogs.globallogic.com/runtime-memory-management-basics</link>
		<comments>http://blogs.globallogic.com/runtime-memory-management-basics#comments</comments>
		<pubDate>Sat, 31 Dec 2011 16:55:25 +0000</pubDate>
		<dc:creator>Manish.Rathi1</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[Application Memory Management]]></category>

		<category><![CDATA[Memory]]></category>

		<category><![CDATA[Memory Management]]></category>

		<category><![CDATA[Runtime Memory Management]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1859</guid>
		<description><![CDATA[

Memory – One of the most valuable resources of digital world; always remains in high demand just like the Gold in real world. Every active application visible or invisible, certainly require memory for its operations. Due to its nature of limited and high demand, runtime environment has to be very cautious in allocating memory space [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><span lang="EN-IN">Memory – One of the most valuable resources of digital world; always remains in high demand just like the Gold in real world. Every active application visible or invisible, certainly require memory for its operations. Due to its nature of limited and high demand, runtime environment has to be very cautious in allocating memory space for program’s objects. Runtime employee various techniques/algorithms in order to fulfil the memory demand of various running applications, considering making all of them mutually happy.  <img src='http://blogs.globallogic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></p>
<p class="MsoNormal">It’s probably hard to imagine and directly going the way these runtime manages, better remain in real world and get conceptual understanding.</p>
<p class="MsoNormal">Let’s take a simple use case -</p>
<p class="MsoNormal">Place – Community hall</p>
<p class="MsoNormal"><span lang="EN-IN">Capacity – 1000 persons</span></p>
<p class="MsoNormal"><span lang="EN-IN">Objective – Provide the place for each person entering in hall with most convenient way. Convenience can be subjective so let be specific with following– </span></p>
<p class="MsoListParagraphCxSpFirst">
<ul>
<li><span lang="EN-IN">Minimize the allocation time</span></li>
<li><span lang="EN-IN">Minimize the disturbance for other existing</span></li>
<li><span lang="EN-IN">Smooth capture of empty seats happen due to exit of persons</span></li>
</ul>
<p><!--[if !supportLists]--></p>
<p class="MsoNormal"><span lang="EN-IN"> </span>We have to design a master idea, a virtual program as a solution to above defined use case. Let’s start with simplest one.</p>
<p class="MsoNormal"><strong><span lang="EN-IN">Idea 1</span></strong><span lang="EN-IN">: Random Allocation.</span></p>
<p class="MsoNormal"><span lang="EN-IN">Person entering can occupy any available location in the community hall. No specific seat allocation rule.</span></p>
<p class="MsoNormal">Each time a person enters, he will looks for comfortable place of his choice and occupy. Comfortable location is relative and differs for person to person. Some take front seat, some prefer back, some in center and some might look for seats close to their friends.</p>
<p class="MsoNormal">As there are no rules <strong>Think Time</strong> before occupying seat is relatively <strong>higher</strong>. Each has to think, spend some time his own way.</p>
<p class="MsoNormal"><strong><span lang="EN-IN">Idea 2</span></strong><span lang="EN-IN">: Sequencing – Force them to sit only next available seat in sequential order.</span></p>
<p class="MsoNormal">The moment we apply this rule, <strong>Think Time</strong> reduced drastically, close to zero. Now places are predetermined, person doesn’t have to spend his time in deciding the place. This idea makes things move faster but it leads into another problem.</p>
<p class="MsoNormal"><span lang="EN-IN">Problem - We only considered allocation, and completely ignored the facts of people leaving the hall from any random location. This will create random free seats available, which could be allocated to new person. Our rule does not allow person to sit in empty locations even if they are more preferable/near compare to what next available defined by our rule. Clearly this rule fails to provide the space in least possible time considering empty random locations available.</span></p>
<p class="MsoNormal"><strong><span lang="EN-IN">Idea 3</span></strong><span lang="EN-IN">:  Re-arrange</span></p>
<p class="MsoNormal">Now to address problem with idea 2 we add another rule, Every time seat freed, we move existing persons, such that vacant locations merged into free location available at the end. Of course we haven’t solved the problem of Idea 2, we just avoided the scenario where problem arising.</p>
<p class="MsoNormal">At first, things look fine. No empty location remains since every time we move that to end.</p>
<p class="MsoNormal">Few time later we found ourselves in front of Lion just to avoid barking dogs. We just fall into bigger problem. Doing re-arrangement every time whenever seat gets vacant is overkilling, creating lots of disturbance for the existing mass.</p>
<p class="MsoNormal"><span lang="EN-IN">To handle this we have added few sub-idea rules – </span></p>
<p class="MsoNormal">
<ul>
<li>Do not rearrange every time, do it in interval. Like for every 5<sup>th</sup> vacant seat.</li>
<li>Do this rearrangement in free time, break hours etc.</li>
</ul>
<p class="MsoNormal">Doing all these does not gain much advantage and we have to move away from this rule.</p>
<p class="MsoNormal">We can have hundreds of these rules defined and analysed but it will create blogs virtually impossible to read. I might discover few more rules in next blog, but bigger question to be asked why this all discussion is all about.</p>
<p class="MsoNormal">Now try to map following entities</p>
<p class="MsoNormal"><span lang="EN-IN">Community hall  = Available Memory Area</span></p>
<p class="MsoNormal"><span lang="EN-IN">Capacity 1000 persons  = 1000 memory location, allocation units</span></p>
<p class="MsoNormal">Now re-read the Idea’s with mapped memory entities. You will understand the very basics essence of memory allocation.</p>
<p class="MsoNormal"><span lang="EN-IN">All platform or programming language has their own strategy for memory management having </span><span lang="EN-IN">their own set of benefits and drawbacks. At very broader level they are built around following</span></p>
<p class="MsoNormal"><span lang="EN-IN">– Allocating memory in least possible time with most optimized way<br />
– Freeing memory (Memory Recycling / Reclaiming Free memory)<br />
– Arranging memory (Remove memory fragments)</span></p>
<p class="MsoNormal">As we go through community hall use case, though these activities might look simple but there is lot to be discussed. Hope to write more soon …</p>
<p class="MsoNormal"><span lang="EN-IN"> </span></p>
<p class="MsoNormal">
<p class="MsoNormal">
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/runtime-memory-management-basics/feed</wfw:commentRss>
		</item>
		<item>
		<title>Singleton Design Pattern using C sharp</title>
		<link>http://blogs.globallogic.com/singleton-design-pattern-using-c-sharp</link>
		<comments>http://blogs.globallogic.com/singleton-design-pattern-using-c-sharp#comments</comments>
		<pubDate>Sat, 31 Dec 2011 07:21:26 +0000</pubDate>
		<dc:creator>pradip.pathrikar</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blogs.globallogic.com/?p=1812</guid>
		<description><![CDATA[Design Patterns are recurring solutions to the software design problems you find again and again in real world application development. These patterns are about design and interaction of objects and also serves as the communication platform concerning reusable solutions to commonly faced programming challenges. This post focuses on the main categories of design patterns and [...]]]></description>
			<content:encoded><![CDATA[<p>Design Patterns are recurring solutions to the software design problems you find again and again in real world application development. These patterns are about design and interaction of objects and also serves as the communication platform concerning reusable solutions to commonly faced programming challenges. This post focuses on the main categories of design patterns and the implementation for the  Singleton design pattern using C sharp.</p>
<p>Mainly design patterns are categorized in three parts</p>
<p><strong>1) Creational Patterns</strong></p>
<p>These patterns deals with the creation mechanism of objects, trying to create objects in a manner suitable to the situation. This type of design patterns solve the complexity of creating objects by controlling its object creations.</p>
<p><strong>2) Structural Patterns</strong></p>
<p>Structural Patterns are used to identify and implement the relationships between the entities in easy way.</p>
<p><strong>3) Behavioral Patterns</strong></p>
<p>Behavioral Patterns are self explanatory, behavior means the object methods or functions. Hence these types of patterns identifies the common ways of communications between the objects and thus increase flexibility in carrying out the communication.</p>
<p><strong>Singleton Design Pattern - Creational Pattern</strong></p>
<p>Singleton : Singleton design pattern is one of the Creational Patterns which controls the object creation. The main objective of the Singleton design pattern is that it creates and ensures only ONE object will be created during the life time of the application. Ex. Singleton pattern can be used for  maintaining only one database connection object through out the application, maintaining the static information and the reference count of the object accessed or used by the application.</p>
<p><em>Structure</em></p>
<div id="attachment_1852" class="wp-caption alignnone" style="width: 178px"><a href="http://blogs.globallogic.com/wp-content/uploads/2011/12/singleton_class_diagram.png"><img class="size-full wp-image-1852" src="http://blogs.globallogic.com/wp-content/uploads/2011/12/singleton_class_diagram.png" alt="CSingleton Class Diagram" width="168" height="285" /></a><p class="wp-caption-text">CSingleton Class Diagram</p></div>
<p><em>Implementation: </em><em>Singleton class using C#</em></p>
<pre style="60px;">namespace DesignPatterns
{
    public sealed class CSingleton
    {
        private static volatile CSingleton instance;
        private static volatile int counter = 0 ;
        private static object syncRoot = new object();
        private CSingleton()
        {
        }
        public static int Counter
        {
            get
            {
                return counter;
            }
        }
        public static void Release()
        {
            counter--;
        }
        public static CSingleton Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                            instance = new CSingleton();
                    }
                }
                counter++;
                return instance;
            }
        }

    }
}</pre>
<ul>
<li>In above example the the class CSingleton is marked as sealed so as to restrict the derivation of this class which could odd instances of this class.</li>
<li>The variable &#8220;instance&#8221; will hold the object to the CSingleton class itself, volatile keyword ensures that the assignment to the instance variable completes before instance variable can be accessed.</li>
<li>Constructor is made as private to prevent creation of the object of CSingleton class by other parts of application.</li>
<li>Counter data member holds count of the references accessed by the client/other part of the application. This member is used to to know how many clients are using this object.</li>
<li>Above approach uses the thread safe implementation using the syncRoot data member, double - check locking is implemented to avoid the thread concurrency problems.</li>
<li>Release method will just decrements the counter by one. Clients should call this method once they are done using CSingleton object. Usually when they don&#8217;t require services of this class anymore.</li>
</ul>
<div><em><br />
</em></div>
]]></content:encoded>
			<wfw:commentRss>http://blogs.globallogic.com/singleton-design-pattern-using-c-sharp/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

