<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-954885857108135149</atom:id><lastBuildDate>Thu, 07 Jan 2010 18:17:23 +0000</lastBuildDate><title>Technology =&gt; Technical babbling</title><description>Took a long time for me to find something in life that I really enjoy and to do it everyday is a Gods Gift....</description><link>http://dotnetdevblog.blogspot.com/</link><managingEditor>noreply@blogger.com (Yash)</managingEditor><generator>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-7614481168691422581</guid><pubDate>Sat, 02 Jan 2010 04:10:00 +0000</pubDate><atom:updated>2010-01-01T20:14:45.335-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Javascript</category><category domain='http://www.blogger.com/atom/ns#'>Ajax</category><title>Ajaxify your web application...</title><description>Happy New Year!!! This year I have made a resolution that I will blog more about the things I learn :)&lt;br /&gt;&lt;br /&gt;Today I am going to blog about how to implement Ajax functionality without using the Asp.Net Ajax.What AJAX functionality means is -- you can make a request to the server from the client without the page being refreshed.It gives a better user experience.&lt;br /&gt;&lt;br /&gt;The main object behind Ajax functionality is the &lt;b&gt;&lt;i&gt;XmlHttpRequest&lt;/i&gt;&lt;/b&gt; Object. This object has a method called send which can make request to the server.&lt;br /&gt;&lt;br /&gt;In this application, I will show how to populate a dropdownlist based on user selection without doing a complete postback. &lt;br /&gt;&lt;br /&gt;The way I have designed this application is:&lt;br /&gt;1)I have added a HttpHandler which executes functions based on the querystring input.&lt;br /&gt;2)Ajax Request is made to this handler from javascript with appropriate parameters i.e&lt;br /&gt;a)BusinessFunction Name, which should be executed&lt;br /&gt;b)Parameters which the businessfunction needs.&lt;br /&gt;&lt;br /&gt;I have created custom attributes which keep track of which classes and functions are business functions, i.e the functions that can be executed from the Ajax Handler. &lt;b&gt;&lt;i&gt;FrameworkHelper&lt;/i&gt;&lt;/b&gt; is implemented as &lt;i&gt;&lt;b&gt;singleton&lt;/b&gt;&lt;/i&gt; which will keep all these functions in the dictionary and will execute these functions on the fly using reflection.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/Sz7B3vhETKI/AAAAAAAAAKI/hjbJZflwQo0/s1600-h/AjaxApplication.JPG" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" ps="true" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/Sz7B3vhETKI/AAAAAAAAAKI/hjbJZflwQo0/s400/AjaxApplication.JPG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can download this application&amp;nbsp; &lt;a href="http://cid-928a438e82450145.skydrive.live.com/self.aspx/.Public/AjaxAppBlogExample.zip"&gt;&lt;strong&gt;&lt;span style="color: red;"&gt;here&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;&lt;br /&gt;-Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7614481168691422581?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2010/01/ajaxify-your-web-application.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iUI-C9OjkTY/Sz7B3vhETKI/AAAAAAAAAKI/hjbJZflwQo0/s72-c/AjaxApplication.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-6893760642504880552</guid><pubDate>Sun, 04 Oct 2009 18:09:00 +0000</pubDate><atom:updated>2009-11-01T13:27:22.211-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Javascript</category><title>Javascipt Basics - Part 2</title><description>I did one blogpost couple of months back regarding Javascript Basics. This is continuation of that post.&lt;br /&gt;&lt;br /&gt;A)&lt;strong&gt;EncodeUri and EncodeUriComponent&lt;/strong&gt; -&lt;br /&gt;These are builtin function which are used to encode the parameters.&lt;br /&gt;&lt;br /&gt;EncodeUri(uri)-- will encode the part of the Url after the "http://somehostName/{This part will be encoded}&lt;br /&gt;&lt;br /&gt;EncodeUrlComponent(url) -- it assumes that you will passing only the parameter that you want to encode. It will encode whatever you pass to the function.&lt;br /&gt;&lt;br /&gt;For eg: if you pass&lt;br /&gt;&lt;br /&gt;var url = 'http://yashwant.dns.mycompany.com/H ome&lt;/DEFAU lt.aspx&gt;';&lt;br /&gt;alert(encodeURI(url));&lt;br /&gt;Output:&lt;a href="http://yashwant.dns.mycompany.com/H%20ome%3C/defau%20lt.aspx%3E"&gt;http://yashwant.dns.mycompany.com/H%20ome%3C/defau%20lt.aspx%3E&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;alert(encodeURIComponent(url));&lt;br /&gt;Output:http%3A%2F%2Fyashwant.dns.mycompany.com%2FH%20ome%3C%2Fdefau%20lt.aspx%3E&lt;br /&gt;&lt;br /&gt;B)&lt;strong&gt; Functions as Data&lt;/strong&gt;&lt;br /&gt;Javascripts treats functions as Data. So a function can be assigned to a varaible.&lt;br /&gt;for eg:&lt;br /&gt;var x = function()&lt;br /&gt;{&lt;br /&gt;alert('this is a function');&lt;br /&gt;}&lt;br /&gt;This notation is called as &lt;strong&gt;&lt;em&gt;function literal notation&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;C) &lt;strong&gt;Anonymous Functions&lt;/strong&gt;&lt;br /&gt;Anonymous function are declared in place and dont have a name. Main use of Anonymous functions are it makes the code more elegant. They are used a lot as callback functions. As we know that Functions can be treated as data, so we can pass a function to another function as a parameter in javascript.&lt;br /&gt;For eg:&lt;br /&gt;&lt;br /&gt;var y = function (functionParameter)&lt;br /&gt;{&lt;br /&gt;alert('I am in functionA');&lt;br /&gt;&lt;strong&gt;//CallBack the anonymous function that you passedin&lt;/strong&gt;&lt;br /&gt;functionParameter();&lt;br /&gt;}&lt;br /&gt;y(function() { alert('I am the callback function')});&lt;br /&gt;&lt;br /&gt;D) &lt;strong&gt;Global Objects&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;When we declare a varaible using the &lt;strong&gt;object literal notation&lt;/strong&gt; i.e&lt;br /&gt;&lt;br /&gt;var Person = {&lt;br /&gt;firstName: 'Yashwant',&lt;br /&gt;middleName: 'Jaywant',&lt;br /&gt;lastName: 'Patil',&lt;br /&gt;print: function() //This is a method&lt;br /&gt;{&lt;br /&gt;alert(this.firstName + " " + this.middleName + " " + this.lastName);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Person property gets attached to the global javascript variable. In this case, since the code is running in a browser "person" property gets attached to the WINDOW object. So you can call the print method on the Person object like this&lt;br /&gt;&lt;br /&gt;//Person Varaible gets attached as a property of the Global Object i.e Window object&lt;br /&gt;window['Person'].print();&lt;br /&gt;&lt;br /&gt;E)&lt;strong&gt;Configuration Objects&lt;/strong&gt;&lt;br /&gt;The rule I follow while writing javascript functions is :If there are more than 3 parameters that need to be passed to a javascript function, it is better to pass it as a JSON configuration object.&lt;br /&gt;&lt;br /&gt;for eg:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;//Cofiguration Objects...&lt;/strong&gt;&lt;br /&gt;var func = function Print(configurationObj)&lt;br /&gt;{&lt;br /&gt;for (var j in configurationObj)&lt;br /&gt;{&lt;br /&gt;alert(configurationObj[j]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;var obj = {"firstName":"Yashwant",&lt;br /&gt;"middleName":"Jaywant",&lt;br /&gt;"lastName": "Patil"&lt;br /&gt;};&lt;br /&gt;Print(obj);&lt;br /&gt;&lt;br /&gt;It makes the code easire to read and understand.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6893760642504880552?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2009/10/javascipt-basics-part-2.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-2301685234962787162</guid><pubDate>Sun, 16 Aug 2009 19:48:00 +0000</pubDate><atom:updated>2009-08-16T13:07:43.568-07:00</atom:updated><title>Facade Pattern</title><description>Facade pattern is a very simple but useful pattern.When I think of Facade pattern.. what comes to my mind is composition.&lt;br /&gt;&lt;br /&gt;Complex System ----&gt; Sub System 1&lt;br /&gt;----&gt; Sub System 2&lt;br /&gt;----&gt; Sub System 3&lt;br /&gt;----&gt; Sub System 4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For an external system we can create a wrapper which hides all the subsystems and provides an unified interface. Internall this wrapper will dispatch the call to the correct subsystems.&lt;br /&gt;&lt;br /&gt;For eg:&lt;br /&gt;public Class ComplexSystem&lt;br /&gt;{&lt;br /&gt;private SubSystem _subSystem1;&lt;br /&gt;private SubSystem _subSystem2;&lt;br /&gt;private SubSystem _subSystem3;&lt;br /&gt;&lt;br /&gt;public void SubSystem1Method1()&lt;br /&gt;{&lt;br /&gt;_subSystem.Method1();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void SubSystem2Method1()&lt;br /&gt;{&lt;br /&gt;_subSystem2.Method1();&lt;br /&gt;}&lt;br /&gt;public void SubSystem3Method1()&lt;br /&gt;{&lt;br /&gt;_subSystem3.Method1();&lt;br /&gt;}&lt;br /&gt;public void SubSystem4Method1()&lt;br /&gt;{&lt;br /&gt;_subSystem4.Method1();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I hope this explanation helps.  You can donwload a real world example here: &lt;a href="http://dotnetdevblog.googlepages.com/FacadePatters.zip"&gt;http://dotnetdevblog.googlepages.com/FacadePatters.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2301685234962787162?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2009/08/facade-pattern.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-7030330467881042412</guid><pubDate>Sun, 14 Jun 2009 23:15:00 +0000</pubDate><atom:updated>2009-11-01T13:27:22.211-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Javascript</category><title>Javascript Basics......</title><description>&lt;div&gt;Its been long time since I wrote a post. Was busy with lot of things.&lt;br /&gt;Lately I have been working a lot with Javascript. This is the first time I am using Javascript heavily in a project.&lt;br /&gt;&lt;br /&gt;Today I want to demonstrate some of the basic javascript concept.&lt;br /&gt;1)Static Methods&lt;br /&gt;2)Public Methods/Variables&lt;br /&gt;3)Private Methods/Varables&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this project.. I created a simple server control which renders a link. Href of this link is a javascript function.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/SjfETi2R_NI/AAAAAAAAAHc/Gszfi4EQypA/s1600-h/CropperCapture%5B1%5D.Bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5347958922576788690" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 306px" alt="" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/SjfETi2R_NI/AAAAAAAAAHc/Gszfi4EQypA/s400/CropperCapture%5B1%5D.Bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Javascript method CreateArt(...) creats an instance of a Window Object.&lt;br /&gt;var win = new Window();&lt;br /&gt;&lt;br /&gt;Window object'ss prototype property has two methods&lt;br /&gt;1)Initialize(..) -- Sets the local variable firstName,middleName,lastName&lt;br /&gt;2)Display(..) -- Displays the names in a table which is attached to the body of the document.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/Slq1JZ87nHI/AAAAAAAAAHs/_dr5iENgAag/s1600-h/Set+the+Prototype+Object.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5357793879900527730" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 150px" alt="" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/Slq1JZ87nHI/AAAAAAAAAHs/_dr5iENgAag/s400/Set+the+Prototype+Object.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another way to set the prototype is to add each function individually.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/Slq2spyTAKI/AAAAAAAAAH0/5Blr3tB8Msk/s1600-h/CropperCapture%5B2%5D.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5357795584957939874" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 127px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/Slq2spyTAKI/AAAAAAAAAH0/5Blr3tB8Msk/s400/CropperCapture%5B2%5D.jpg" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;adding public variable/function and a private variable/function to the Window Object.&lt;/p&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/Slq3u0jj-7I/AAAAAAAAAH8/i5SQAoqms7I/s1600-h/Public+and+Private+Variable+in+js.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5357796721720294322" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 129px" alt="" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/Slq3u0jj-7I/AAAAAAAAAH8/i5SQAoqms7I/s400/Public+and+Private+Variable+in+js.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;Declaring a public method is done using the this keyword.&lt;br /&gt;&lt;br /&gt;Private methods are declared using a private Variable and then adding a method to that variable. The advantage of this is we dont expose this method from the class.&lt;br /&gt;&lt;br /&gt;Static Method can be easily declared by adding that method to the class. for eg:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/Slq5LrT8ixI/AAAAAAAAAIE/eHW7UHlrOSY/s1600-h/Static+and+Main+Method.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5357798316966710034" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 129px" alt="" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/Slq5LrT8ixI/AAAAAAAAAIE/eHW7UHlrOSY/s400/Static+and+Main+Method.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;If you want to download the source code please click here --&gt; &lt;a href="http://dotnetdevblog.googlepages.com/JavascriptBlogApp.zip"&gt;http://dotnetdevblog.googlepages.com/JavascriptBlogApp.zip&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;I started loving javascript as a language after working on this project. I used to think javascript  was not for real programmer but now I believe it has lot of goodness in it. &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Embrace It :)&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Thanks,&lt;/div&gt;&lt;div&gt;Yash&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7030330467881042412?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2009/06/javascript-basics.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/SjfETi2R_NI/AAAAAAAAAHc/Gszfi4EQypA/s72-c/CropperCapture%5B1%5D.Bmp' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-3784595060292286051</guid><pubDate>Mon, 16 Feb 2009 01:21:00 +0000</pubDate><atom:updated>2009-02-15T20:08:38.582-08:00</atom:updated><title>Implementing Strategy Design Pattern...</title><description>Implementing the strategy pattern helps in decoupling the application.The main idea behind you can interchange the different implementation of your algorithm without breaking the code.&lt;br /&gt;&lt;br /&gt;What I mean by that is .. I have an interface, IGetData which defines a single method which returns a Customer object.&lt;br /&gt;&lt;br /&gt;public interface IGetData&lt;br /&gt;{&lt;br /&gt;Customer GetData();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This interface is implemented by two different classes...SqlDataSource which gets the customer object from the SqlServer Database, while XmlDataSource gets the Customer object from the XmlDatasource.&lt;br /&gt;The data class encapsulates the interface[IGetData]... in the Constructor of the Data class. you can pass in different implementations of IGetData. i.e you can pass any class which implements the IGetData interface.&lt;br /&gt;By doing this .. you can have some factory method which will return the appropriate class which implements the IGetData interface.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SZjkqatupTI/AAAAAAAAAHE/vVxnIfH61d0/s1600-h/Strategy.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5303239978605520178" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SZjkqatupTI/AAAAAAAAAHE/vVxnIfH61d0/s400/Strategy.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Click on the image to enlarge.&lt;br /&gt;&lt;br /&gt;You can decouple more by using either factory or abstract factory pattern.&lt;br /&gt;SourceCode download ---&gt; &lt;a href="http://dotnetdevblog.googlepages.com/StrategyPattern.zip"&gt;http://dotnetdevblog.googlepages.com/StrategyPattern.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-3784595060292286051?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2009/02/implementing-strategy-design-pattern.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/SZjkqatupTI/AAAAAAAAAHE/vVxnIfH61d0/s72-c/Strategy.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-5038575345504461851</guid><pubDate>Sun, 15 Feb 2009 18:11:00 +0000</pubDate><atom:updated>2009-02-16T09:56:01.829-08:00</atom:updated><title>Accessing Embedded Resources in an assembly....</title><description>Recently I was working on a project where..I had to embed some Config.Xml files in an assembly. That assembly was later on added to the main project.&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Accessing the resource:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Step1: Add the resource and make the "BUILD Action" as embedded resource in Visual Studio.&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SZhdAS2CSsI/AAAAAAAAAGk/GWswK1FiCMg/s1600-h/EmbedResourc.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5303090820868623042" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SZhdAS2CSsI/AAAAAAAAAGk/GWswK1FiCMg/s400/EmbedResourc.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;PS: Click on the image, to View the Code..&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Step2: Use Reflector to get the resource Name.&lt;/div&gt;&lt;div&gt;Step3: Load the assembly .. and use the method "GetManifestResouceStream" to access the resource..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Assembly assembly = Assembly.Load("MyLib");&lt;br /&gt;Stream st = assembly.GetManifestResourceStream("MyLib.Config.Config.xml");&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Its a nice way to access embedded resources from the build..&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Happy Programming!!!&lt;/div&gt;&lt;div&gt;Yash&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-5038575345504461851?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2009/02/accessing-embedded-resources-in.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/SZhdAS2CSsI/AAAAAAAAAGk/GWswK1FiCMg/s72-c/EmbedResourc.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-2860353371790237123</guid><pubDate>Wed, 28 Jan 2009 23:28:00 +0000</pubDate><atom:updated>2009-01-28T15:31:51.851-08:00</atom:updated><title></title><description>Hello... today I found an interesting class ...PostBackOption class from the&lt;br /&gt;System.Web.UI namespace.  PostBackOption's is interesting becuase it lets you create controls like&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2860353371790237123?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2009/01/hello.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-7688040039054240056</guid><pubDate>Sun, 18 Jan 2009 23:01:00 +0000</pubDate><atom:updated>2009-01-18T16:10:57.709-08:00</atom:updated><title>Different implementation of StateBag</title><description>I am going to show some different implementations of StateBag... many times while developing .Net Application, you need to pass some data from one function to another for eg:&lt;br /&gt;&lt;br /&gt;A() -&gt; B() --&gt; C()&lt;br /&gt;OR&lt;br /&gt;&lt;br /&gt;you want to keep data in some collection and spit it out during page rendering.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Instead of moving the data domain data from function to function, it is a good idea to put the data in the Application Context or in the StateBag.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;StateBag -- This is implentation is not a session implentation but its global becuase I am making the stateBag a static variable.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/SXO6pj4TfII/AAAAAAAAAFc/AEGNeMmWhNE/s1600-h/StateBag.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5292779210259266690" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/SXO6pj4TfII/AAAAAAAAAFc/AEGNeMmWhNE/s400/StateBag.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;PS:Click on the image to enlarge&lt;br /&gt;&lt;br /&gt;StateBag1 implementation:&lt;br /&gt;&lt;p&gt;StateBag1 is a good implementation which exposes a property which will return the StateBag.. The StateBag is stored in the HttpContext. HttpContext provides a items collection where you can dump all your StateBag.This implementation will only work in web centric senario as HttpContext is not available in non web centric application.&lt;br /&gt;&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SXO7tvoiagI/AAAAAAAAAFk/j85GUe31wlY/s1600-h/StateBag1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5292780381645466114" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SXO7tvoiagI/AAAAAAAAAFk/j85GUe31wlY/s400/StateBag1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;StateBag2 implementation:&lt;br /&gt;&lt;br /&gt;This implementation is similar to StateBag1 but can be used in non web-centric as it uses the CallContext object if HttpContext is not available.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SXO8jyg743I/AAAAAAAAAFs/6975I8mEok4/s1600-h/StateBag2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5292781310131823474" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 243px" alt="" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SXO8jyg743I/AAAAAAAAAFs/6975I8mEok4/s400/StateBag2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Creating your ApplicationContext:&lt;/p&gt;&lt;p&gt;This is bascially a wrapper class around the HttpContext. You can store this AppContext object in the CallContext, this way only one instance is created per thread.I like this implementation a lot.&lt;/p&gt;&lt;a href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SXO9TEcOhHI/AAAAAAAAAF0/L9EQwCeV9XY/s1600-h/MyAppContext.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5292782122397762674" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 250px" alt="" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SXO9TEcOhHI/AAAAAAAAAF0/L9EQwCeV9XY/s400/MyAppContext.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;You need to searlize this StateBag before the page renders as a hidden string. When postBack happens that time you need to desearlize the StateBag to get the parameters back.&lt;br /&gt;&lt;br /&gt;If you want to download the SourceCode ---&gt; &lt;a class="tr_pseudo-link" id="tr_site-url" onclick="TR_execViewLive('');" href="http://dotnetdevblog.googlepages.com/WebApplication1.Zip"&gt;http://DotNetDevBlog.googlepages.com/WebApplication1.Zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I hope you like the implentations :)&lt;br /&gt;&lt;br /&gt;Happy Coding!!&lt;br /&gt;Yash&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7688040039054240056?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2009/01/different-implementation-of-statebag.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_iUI-C9OjkTY/SXO6pj4TfII/AAAAAAAAAFc/AEGNeMmWhNE/s72-c/StateBag.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>7</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-3629348292654538086</guid><pubDate>Sat, 17 Jan 2009 21:27:00 +0000</pubDate><atom:updated>2009-01-29T14:24:08.003-08:00</atom:updated><title>Adding Reflector as External Tool in Visual Studio</title><description>I spend most of my dev time in Visual Studio. I hate to go out of VS and open some other programs like fiddler or reflector. In Visual studio you can easily add the tools that you use a lot by adding these tools as external tools.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All you have to do is go to Tools-&gt;External Tools, configure your tool over there ... Heres a screen shot of to configure Reflector in Visual Studio..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SYIr6WqEuUI/AAAAAAAAAGc/UO84uokAr64/s1600-h/CropperCapture%5B1%5D.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5296844393255582018" style="WIDTH: 400px; CURSOR: hand; HEIGHT: 388px" alt="" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SYIr6WqEuUI/AAAAAAAAAGc/UO84uokAr64/s400/CropperCapture%5B1%5D.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thats it.... next time you want to use the reflector... all you have to do is go to tools and select Reflector.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-3629348292654538086?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2009/01/i-spend-most-of-my-dev-time-in-visual.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_iUI-C9OjkTY/SYIr6WqEuUI/AAAAAAAAAGc/UO84uokAr64/s72-c/CropperCapture%5B1%5D.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-1189464186454048821</guid><pubDate>Sun, 28 Dec 2008 00:36:00 +0000</pubDate><atom:updated>2010-01-01T21:07:20.012-08:00</atom:updated><title>Tools I use....</title><description>Today, I am going to list the tools that I use often in my day to day development activities.&lt;br /&gt;&lt;br /&gt;1)Reflector&lt;br /&gt;2)Notepad++&lt;br /&gt;3)Fiddler2&lt;br /&gt;4)LinqPad&lt;br /&gt;5)SOAP UI&lt;br /&gt;6)WCF Trace Viewer&lt;br /&gt;7)Firebug&lt;br /&gt;8)IE development toolbar&lt;br /&gt;9)SlickRun&lt;br /&gt;10) Live Headers (FireFox plugin)&lt;br /&gt;11) Thunderbird &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy holidays!!!&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1189464186454048821?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/12/tools-i-use.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-3552991010166116747</guid><pubDate>Mon, 08 Dec 2008 00:34:00 +0000</pubDate><atom:updated>2008-12-07T19:25:55.811-08:00</atom:updated><title>Fiddler with ASP.Net Development Server...</title><description>Fiddler is one a tool that I use very often while debugging,to see what paramaters are going in the request etc....&lt;br /&gt;&lt;br /&gt;Today I was doing some Custom Server Control development, where I was passing some paramaters using Http POST.I thought that Fiddler will automatically capture the request to the dev server, but it doesnt.&lt;br /&gt;&lt;br /&gt;If you are doing any dev work on the ASP.Net Development and want to use fiddler -- try this.&lt;br /&gt;&lt;br /&gt;Suppose the url is: &lt;a href="http://localhost:1203/MyApp/Default.aspx"&gt;http://localhost:1203/MyApp/Default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;if you just try to capture the request using Fiddler it wont work, you need to change the&lt;br /&gt;url to: &lt;a href="http://localhost.:1203/MyApp/Default.aspx"&gt;http://localhost.:1203/MyApp/Default.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Just append "." after localhost&lt;br /&gt;&lt;br /&gt;Nice little info....&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-3552991010166116747?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/12/fiddler-with-aspnet-development-server.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-567505862141296543</guid><pubDate>Sat, 11 Oct 2008 20:29:00 +0000</pubDate><atom:updated>2009-07-13T09:49:16.585-07:00</atom:updated><title>Commands that I use Everyday</title><description>Today I am going to list some of the commands that I use all the time while coding... You can type these commands in the Run Prompt.&lt;br /&gt;&lt;br /&gt;1) For Windows Server 2003:&lt;br /&gt;&lt;br /&gt;a) tsadmin (Terminal Services Manager) ---&gt; Used to connect to a computer and see who has logged in, to logoff the users.. etc.&lt;br /&gt;b) qwinsta /server:servername ---&gt; to query windows station.&lt;br /&gt;This is a command line tool that I use to see who has logged into a particular machine...&lt;br /&gt;c) rwinsta ID /server:servername ---&gt; Used to logoff an user from a particular server based on the ID.&lt;br /&gt;First get the ID of a particular user using qwinsta and then logoff the user using rqinsta.&lt;br /&gt;d) mstsc -- to launch the remote desktop connection.&lt;br /&gt;e)inetmgr -- to launch IIS&lt;br /&gt;f)devenv -- to lauch visual stuido 2005 and 2008.&lt;br /&gt;g)lusrmgr.msc -- Used for adding a New User or adding a existing user to a group.&lt;br /&gt;h)query --- to query a session etc..&lt;br /&gt;&lt;br /&gt;2)Windows Server 2008&lt;br /&gt;The only command that has changed from the windows server 2003 is&lt;br /&gt;a) tsadmin.msc .... now you have to add the .msc extension to launch the Terminal Services Manager..&lt;br /&gt;&lt;br /&gt;3)Visual Studio Commands&lt;br /&gt;a) Control + "." to add the usings&lt;br /&gt;b)Control + Alt + "D" --- to view all the breakPoints set in the application&lt;br /&gt;c)Alt + Enter -- to view the properties window&lt;br /&gt;d) Ctrl + Alt + "F" -- to search for some string in the entire solution&lt;br /&gt;e)Ctrl + "F" -- to search for some string in the current file&lt;br /&gt;f) shift + F12 -- to find all the references for a function.&lt;br /&gt;g) Getting VisualStudio CommandPrompt -- Control + W + A&lt;br /&gt;h)Go to LineNumber in code-- &gt; Control + G&lt;br /&gt;i) Open folder in VisualStudio -- &gt; Control + O&lt;br /&gt;j)Go to defition of a fucntion etc - F12&lt;br /&gt;k)Formating Code - Control + K + D&lt;br /&gt;&lt;br /&gt;4) windows general shortCuts I use&lt;br /&gt;a) wins..Key + "R" to get the Run prompt.. very use full for me&lt;br /&gt;b) wins..Key + "D" to get to the Desktop&lt;br /&gt;c) Control Panel -- at the Run prompt type .. control&lt;br /&gt;d) Add remove features -- at the Run prompt type control appwiz.cpl&lt;br /&gt;&lt;br /&gt;5)VisualStudio Command Prompt --&lt;br /&gt;a)np -- add a new project&lt;br /&gt;b)props - open Properties Window&lt;br /&gt;c)View.SolutionExplorer -- for viewing solution explorer&lt;br /&gt;d) open filename -- to open a file from command prompt&lt;br /&gt;&lt;br /&gt;Happy Coding!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-567505862141296543?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/10/commands-that-i-use-everyday.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-8346385169311295054</guid><pubDate>Tue, 07 Oct 2008 21:37:00 +0000</pubDate><atom:updated>2008-10-07T18:37:21.683-07:00</atom:updated><title>Implementing Factory Pattern using  Reflection and Singleton Pattern</title><description>Today I want to demonstrate how to implement Factory pattern using Reflection...&lt;br /&gt;&lt;br /&gt;Important point that should be considered whenever you write code&lt;br /&gt;1) Keep the  coupling between components  as low as possible --&lt;br /&gt;&lt;br /&gt;what this means is when you write components, you should always try to keep the code independent of the other components. It should be testable by itself. It should be reusable without the need of other components.&lt;br /&gt;&lt;br /&gt;One of the standard technique that lot of people use to reduce the coupling is by using the Factory Pattern.&lt;br /&gt;&lt;br /&gt;Generally use the "new" keyword to instantiate a class, but my doing so we make our code dependent on that object.&lt;br /&gt;Factory pattern separates the creation and initialization of object.&lt;br /&gt;&lt;br /&gt;To demonstrate this,&lt;br /&gt;Lets see the class diagram&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iUI-C9OjkTY/SOv9oNC_m9I/AAAAAAAAAE0/7RXtS8gB8tI/s1600-h/FactoryClassDiagram.jpg.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/SOv9oNC_m9I/AAAAAAAAAE0/7RXtS8gB8tI/s400/FactoryClassDiagram.jpg.jpg" alt="" id="BLOGGER_PHOTO_ID_5254572257396628434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to see the image contents.&lt;br /&gt;&lt;br /&gt;Computer is an abstract base class and  different computers like (BrandXComputer or ConcreteComputer) inherit from this interface. Computer as an abstract property called Mhz. Different derived classed will override this property.&lt;br /&gt;&lt;br /&gt;Similarly, there is an Abstract class called ComputerFactory, it has an abstract method called "GetFactory". Every class you create will have a corresponding concretefactory class which will return an instance of the corresponding Concrete Computer class. Each concrete factory has a Singleton implementation i.e only one instance of these classes are created. This make sense here as we dont want to instantiate the Factory class everyone.. which will be a wastage of memory.&lt;br /&gt;&lt;br /&gt;Alright, till now what we have done is standard factory implementation. It gets interesting when you actually get an instance of the factory. The way this is implemented is through Reflection.&lt;br /&gt;&lt;br /&gt;All the concrete factories that you need are kept in the App.Config Files...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOv_5tjgxwI/AAAAAAAAAE8/zmcu-2OP6UM/s1600-h/AppConfigFactorySettings.jpg.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOv_5tjgxwI/AAAAAAAAAE8/zmcu-2OP6UM/s400/AppConfigFactorySettings.jpg.jpg" alt="" id="BLOGGER_PHOTO_ID_5254574757203986178" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to see the image contents.&lt;br /&gt;&lt;br /&gt;In the config file bascially we keep all the entries of the concrete factory along with their types i.e class names.&lt;br /&gt;&lt;br /&gt;There is one more class which is very important in this whole setup and that class is -- ComputerFactories.&lt;br /&gt;&lt;br /&gt;Computer factories has one Static method GetFactory which will take the factoryname (i.e key from the app.config file) , from that it will get the type of the factory and using FieldInfo class it will get that singleton instance we created. Reflection is a very powerful and it has been extensively used in the .Net Base Class Library.&lt;br /&gt;&lt;br /&gt;As you can see we, the client code doesnt need to know anything about the Computer Object instantiation or initialization. The code is not tightly coupled.&lt;br /&gt;&lt;br /&gt;To download the SourceCode -- &lt;a href="http://dotnetdevblog.googlepages.com/FactoryPatternImplementation.rar"&gt;Click Here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-8346385169311295054?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/10/implementing-factory-and-singleton.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/SOv9oNC_m9I/AAAAAAAAAE0/7RXtS8gB8tI/s72-c/FactoryClassDiagram.jpg.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-1233236222299555087</guid><pubDate>Sat, 04 Oct 2008 22:43:00 +0000</pubDate><atom:updated>2008-10-05T17:10:26.193-07:00</atom:updated><title>Great Plugin for Xml Debugging... Xml Visualizer v.2</title><description>While going through the CodePlex website (one of my fvt website) I found this new Visualizer for Xml.&lt;br /&gt;&lt;br /&gt;Its a great plugin that you have to copy paste  in the "MyDocument\Visual Studio(2005/2008)\Visualizers" directory.&lt;br /&gt;&lt;br /&gt;I really wanted a tool where I can just load the Xml into memory and play with the XPath Queries.This visualizer lets me do that and more.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_iUI-C9OjkTY/SOf2ghcdnPI/AAAAAAAAAEU/vsdj6sY4Ag8/s1600-h/XmlVisualizer2+ScreenShot1.Bmp"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/SOf2ghcdnPI/AAAAAAAAAEU/vsdj6sY4Ag8/s400/XmlVisualizer2+ScreenShot1.Bmp" alt="" id="BLOGGER_PHOTO_ID_5253438528944970994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to view the contents of the image.&lt;br /&gt;&lt;br /&gt;1) I can easily add  a XPath Query and check the results.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_iUI-C9OjkTY/SOf30C9IaYI/AAAAAAAAAEc/sZLukSt_bbA/s1600-h/XpathQuery.bmp.Bmp"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_iUI-C9OjkTY/SOf30C9IaYI/AAAAAAAAAEc/sZLukSt_bbA/s400/XpathQuery.bmp.Bmp" alt="" id="BLOGGER_PHOTO_ID_5253439963869505922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to view the contents of the image.&lt;br /&gt;&lt;br /&gt;As you can see in this screenshot I have added a XPathQuery  and you can see the results in the output. Very nice feature while debugging.... or if you are doing some xml parsing.&lt;br /&gt;&lt;br /&gt;2) I can see the xml output in a browser.&lt;br /&gt;&lt;br /&gt;3) I can create StyleSheets and use them to style my Xml file contents.&lt;br /&gt;&lt;br /&gt;You can download the XmlVisualizer 2.0 from CodePlex.&lt;br /&gt;&lt;br /&gt;Link --&gt; &lt;a href="http://www.codeplex.com/XmlVisualizer"&gt;Download Location&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I think developers can be definitely more productive if they use this tool.&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1233236222299555087?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/10/great-plugin-for-xml-debugging-xml.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/SOf2ghcdnPI/AAAAAAAAAEU/vsdj6sY4Ag8/s72-c/XmlVisualizer2+ScreenShot1.Bmp' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-4108125159889212662</guid><pubDate>Fri, 19 Sep 2008 18:09:00 +0000</pubDate><atom:updated>2008-11-27T16:19:41.764-08:00</atom:updated><title>How to Query Active Directory for Users and Groups..</title><description>Last couple of months I was really busy working on a small ASP.Net project from scratch....&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Alright... enough of that.Lets get to the Code....&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;First of all I want to show you guys how I divided the whole application into small components... here's is a screen shot of the app...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_iUI-C9OjkTY/SNPunk_xPfI/AAAAAAAAADw/gFUxVSr166Y/s1600-h/Components.Bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5247800354530213362" alt="" src="http://1.bp.blogspot.com/_iUI-C9OjkTY/SNPunk_xPfI/AAAAAAAAADw/gFUxVSr166Y/s400/Components.Bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;PS: Please click on the image to view the contents.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Each component is a stand alone component for a specific purpose....&lt;br /&gt;So.. lets get into the Auth component...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;We had a requirement where we wanted to Authenticate a user against the Active Directory...basically certain pages were not visible to certain groups...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Querying Active Directory in c# is very easy task.. but before that if you are not familiar with the structure of your active directory you can install a great utility from Microsoft called ldp.exe.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;I tried it to see what is the structure of our Active Directory.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;So basically to query an Active Directory you need a ldappath... like&lt;/div&gt;&lt;div&gt;&lt;a href="ldap://NXdfsdfqwM03.ABC150.org/DC=ABC150,DC=org"&gt;LDAP://NXdfsdfqwM03.ABC150.org/DC=ABC150,DC=org&lt;/a&gt; , A username and password who has access to this Active Directory.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now to get All the Users in a particular Group this is the code...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This function bascially calls the GetUserByGroup which in turn calls the GetUserDetails function where I am querying the active directory for a particular user.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_iUI-C9OjkTY/SNPxmI3NgUI/AAAAAAAAAD4/kiLpy-eR39M/s1600-h/GetAllUsers.Bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5247803628333138242" alt="" src="http://3.bp.blogspot.com/_iUI-C9OjkTY/SNPxmI3NgUI/AAAAAAAAAD4/kiLpy-eR39M/s400/GetAllUsers.Bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;PS: Please click on the image to view contents...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOf8ovG89yI/AAAAAAAAAEk/6p9ztg5kf84/s1600-h/GetApplicationUsersByGroup.jpg.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5253445267121567522" style="CURSOR: pointer" alt="" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOf8ovG89yI/AAAAAAAAAEk/6p9ztg5kf84/s400/GetApplicationUsersByGroup.jpg.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS: Please click on the image to view contents...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOf97V-JEEI/AAAAAAAAAEs/mTHRwP7Syxw/s1600-h/GetUserDetails.jpg.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5253446686302867522" style="CURSOR: pointer" alt="" src="http://4.bp.blogspot.com/_iUI-C9OjkTY/SOf97V-JEEI/AAAAAAAAAEs/mTHRwP7Syxw/s400/GetUserDetails.jpg.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;PS:Please click on the image to view contents...&lt;br /&gt;&lt;br /&gt;Important classes are DirectoryEntry, DirectorySearcher, DirectoryEntires.. etc.&lt;br /&gt;&lt;br /&gt;I hope this gives a basic idea about how to query an Active Directory.&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;Yash&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-4108125159889212662?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/09/how-to-query-active-directory-for-users.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_iUI-C9OjkTY/SNPunk_xPfI/AAAAAAAAADw/gFUxVSr166Y/s72-c/Components.Bmp' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-1142559938577269907</guid><pubDate>Thu, 11 Sep 2008 22:38:00 +0000</pubDate><atom:updated>2008-09-22T18:35:11.247-07:00</atom:updated><title>Pics from the Trip to Philadelphia,PA</title><description>Check out the pics at ... &lt;a href="http://picasaweb.google.com/DotNetDevBlog/PATrip"&gt;http://picasaweb.google.com/DotNetDevBlog/PATrip&lt;/a&gt;#&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1142559938577269907?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/09/pics-from-trip-to-philadelphiapa.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-2366427409072611188</guid><pubDate>Sun, 06 Jul 2008 04:42:00 +0000</pubDate><atom:updated>2008-07-05T21:47:51.632-07:00</atom:updated><title>Foundation of Programming free e-book</title><description>Last week while watching Channel 9 video, I came across this  good free e-book (Foundation of Programming) from  Karl &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Seguin&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Download it and read it, really good book. I have not covered even 50 % of it, but I love the things that he has explained like ... mock objects,TDD, Dependency injection  etc.&lt;br /&gt;&lt;br /&gt;Initially its bit tough but very useful in long run.&lt;br /&gt;&lt;br /&gt;Grab it!!!!&lt;br /&gt;&lt;br /&gt;http://codebetter.com/files/folders/codebetter_downloads/entry179694.aspx&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Yash&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2366427409072611188?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/07/foundation-of-programming-free-e-book.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>22</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-6241275689909088620</guid><pubDate>Tue, 01 Jul 2008 05:05:00 +0000</pubDate><atom:updated>2008-06-30T23:10:49.569-07:00</atom:updated><title>Lambda Expression</title><description>Lambda Expression -- introduced by Microsoft in C# 3.0 is a very fascinating topic. It has been extensively used in LINQ(Language Intergrated Query).&lt;br /&gt;&lt;br /&gt;So, what is Lambda Expression?&lt;br /&gt;&lt;br /&gt;Lambda Expression is basically nothing but an anonymous function.&lt;br /&gt;&lt;br /&gt;In .Net 1.1 we used to create delegates using delegate type. Delegate is a type safe datatype which contains a  reference to a function.&lt;br /&gt;Eg:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_iUI-C9OjkTY/SGm-un1engI/AAAAAAAAABQ/mSkb8qzJFpM/s1600-h/CropperCapture%5B1%5D.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp3.blogger.com/_iUI-C9OjkTY/SGm-un1engI/AAAAAAAAABQ/mSkb8qzJFpM/s400/CropperCapture%5B1%5D.jpg" alt="" id="BLOGGER_PHOTO_ID_5217911351461977602" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;.Net 2.0 introduced the concept of Anonymous delegates. what is means is you can write the whole function inline. This  makes the code more readable  and you don't have to define  instance or static methods.&lt;br /&gt;Eg:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_iUI-C9OjkTY/SGnA2mnO_EI/AAAAAAAAABg/8RmwmimsI5E/s1600-h/CropperCapture%5B4%5D.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp3.blogger.com/_iUI-C9OjkTY/SGnA2mnO_EI/AAAAAAAAABg/8RmwmimsI5E/s400/CropperCapture%5B4%5D.jpg" alt="" id="BLOGGER_PHOTO_ID_5217913687596006466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see the code is readable and concise.&lt;br /&gt;&lt;br /&gt;In C# 3.0 the concept of anonymous delegates  has been taken to the next level by  adding lambda expression.&lt;br /&gt;&lt;br /&gt;Lambda expression uses an operator  ( =&gt;) which should be read as "goes to".&lt;br /&gt;Eg:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_iUI-C9OjkTY/SGnCTSI8mUI/AAAAAAAAABo/t3KWEtllSbo/s1600-h/CropperCapture%5B5%5D.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp0.blogger.com/_iUI-C9OjkTY/SGnCTSI8mUI/AAAAAAAAABo/t3KWEtllSbo/s400/CropperCapture%5B5%5D.jpg" alt="" id="BLOGGER_PHOTO_ID_5217915279828097346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see the code is very elegant and the IL(intermediate language) generated by all the 3 ways of using delegates is the same. So the point to understand here is that the complier will generate exactly the same IL for all the 3 implementations so we don't need a new runtime for executing this code. .Net 2.0 runtime will be able to execute this code for us.&lt;br /&gt;&lt;br /&gt;Lambda's can be expression or statements. Lambda statement are nothing but a group of c# statements clubbed together.&lt;br /&gt;&lt;br /&gt;IL generate by instance methods:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_iUI-C9OjkTY/SGnEZL4qMfI/AAAAAAAAABw/5oDsQeEJIco/s1600-h/CropperCapture%5B6%5D.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp1.blogger.com/_iUI-C9OjkTY/SGnEZL4qMfI/AAAAAAAAABw/5oDsQeEJIco/s400/CropperCapture%5B6%5D.jpg" alt="" id="BLOGGER_PHOTO_ID_5217917580251640306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;IL generated by anonymous delegates (.Net 2.0)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_iUI-C9OjkTY/SGnEe6g33OI/AAAAAAAAAB4/DKkiD_EMeWI/s1600-h/CropperCapture%5B7%5D.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp1.blogger.com/_iUI-C9OjkTY/SGnEe6g33OI/AAAAAAAAAB4/DKkiD_EMeWI/s400/CropperCapture%5B7%5D.jpg" alt="" id="BLOGGER_PHOTO_ID_5217917678667685090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;IL generated by Lambda Expression&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_iUI-C9OjkTY/SGnF88uV3TI/AAAAAAAAACI/Dg65Fjt-_dE/s1600-h/CropperCapture%5B8%5D.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp3.blogger.com/_iUI-C9OjkTY/SGnF88uV3TI/AAAAAAAAACI/Dg65Fjt-_dE/s400/CropperCapture%5B8%5D.jpg" alt="" id="BLOGGER_PHOTO_ID_5217919294168751410" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetdevblog.googlepages.com/LambdaExpressionExplained.zip"&gt;&lt;span style="text-decoration: underline;"&gt;Click here to download the SourceCode:&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope this will help you understand what Lambda expressions are.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6241275689909088620?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/06/lambda-expression.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_iUI-C9OjkTY/SGm-un1engI/AAAAAAAAABQ/mSkb8qzJFpM/s72-c/CropperCapture%5B1%5D.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-7768825142502007110</guid><pubDate>Sun, 29 Jun 2008 21:13:00 +0000</pubDate><atom:updated>2008-06-29T16:31:05.890-07:00</atom:updated><title>How to Read custom entries from the Web.Config/App.Config file</title><description>Today I am going to blog about "How to read custom entries from the Web.Config/App.Config file."&lt;br /&gt;&lt;br /&gt;Working as a .Net Developer, there will be many occasions when we want to store some data (Maybe Key/Value Pair) in the configuration file but we dont want to add to the AppSettings. In such situations, I have always found is very easy to store my Config entires in the Custom Config sections in Web.Config files.&lt;br /&gt;&lt;br /&gt;I want to read the custom section shown below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp2.blogger.com/_iUI-C9OjkTY/SGgT1OGIi7I/AAAAAAAAAA4/6m9BqXKYDKM/s1600-h/CustomSection.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5217441973346536370" style="CURSOR: hand" alt="" src="http://bp2.blogger.com/_iUI-C9OjkTY/SGgT1OGIi7I/AAAAAAAAAA4/6m9BqXKYDKM/s400/CustomSection.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The idea behind reading or writing to the config files is that -- "You should tell the framework how you want your data to be Serialized/Deserialized.&lt;br /&gt;&lt;br /&gt;In .Net 2.0 made it very easy to Read/Write config data into the configuration file by providing the functionality in System.Configuration.dll.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp0.blogger.com/_iUI-C9OjkTY/SGgWH7Q34RI/AAAAAAAAABI/EXBzBY2loUc/s1600-h/ConfigSection1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5217444493732077842" style="CURSOR: hand" alt="" src="http://bp0.blogger.com/_iUI-C9OjkTY/SGgWH7Q34RI/AAAAAAAAABI/EXBzBY2loUc/s400/ConfigSection1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Add the entry shown above, in the ConfigSection so that framework can create an instance of the class at runtime using reflection.&lt;br /&gt;&lt;br /&gt;I have attached the SourceCode for this application.&lt;br /&gt;&lt;br /&gt;Source Code Loc:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://dotnetdevblog.googlepages.com/ReadCustomConfigSections.zip"&gt;http://dotnetdevblog.googlepages.com/ReadCustomConfigSections.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you like/dislike something, feel free to leave comments.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-7768825142502007110?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/06/how-to-read-custom-entries-from.html</link><author>noreply@blogger.com (Yash)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_iUI-C9OjkTY/SGgT1OGIi7I/AAAAAAAAAA4/6m9BqXKYDKM/s72-c/CustomSection.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-1809796361051511451</guid><pubDate>Sun, 01 Jun 2008 01:28:00 +0000</pubDate><atom:updated>2008-06-18T15:26:15.016-07:00</atom:updated><title>Tools to Write Solid code!!!</title><description>Today I am going to blog about two important tools most of the developers should have to write solid code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1)FxCop&lt;br /&gt;&lt;br /&gt;This is a free tool from Microsoft which will run through your .dll files and will point out where yo have made design mistakes or where you have violated coding standards.&lt;br /&gt;&lt;br /&gt;I started to use this tool sometime back and its really neat.&lt;br /&gt;&lt;br /&gt;I would recommend other software developer to use this tool.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2)Stylecop or Source Analysis.&lt;br /&gt;&lt;br /&gt;Very nice tool from Microsoft which is free now. Get a copy. It is integrated with visual studio .&lt;br /&gt;&lt;br /&gt;Just run it and make your code more readable and pretty.&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;Happy Programming!!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;Yash&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-1809796361051511451?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/05/tools-to-write-solid-code.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-2369746926494453105</guid><pubDate>Sat, 31 May 2008 22:35:00 +0000</pubDate><atom:updated>2008-06-18T15:28:33.094-07:00</atom:updated><title>How to Write Solid Piece of Code</title><description>The most important point to consider while designing and writing code&lt;br /&gt;&lt;br /&gt;1) Always design code in such a way that it is Open for extension but Closed for modification.&lt;br /&gt;&lt;br /&gt;i.e when a new requirement comes don't add new code to the classes that work but create new classes to fulfill those requirement . i.e the previous code is locked.&lt;br /&gt;&lt;br /&gt;The more code code you add to the existing working code the more possibility of introducing new bugs and ofcourse you have to change the UnitTest Code too.&lt;br /&gt;&lt;br /&gt;ALWAYS TRY TO USE DESIGN PATTERN LIKE FACTORY,SINGLETON ETC.&lt;br /&gt;&lt;br /&gt;USE OOP CONCEPTS TO KEEP THE DEPENDENCY TO MINIMUM.&lt;br /&gt;&lt;br /&gt;I will give you an example here...&lt;br /&gt;&lt;br /&gt;Create a Abstract base class... and derive your classes from that i.e different version of classes.&lt;br /&gt;&lt;br /&gt;This way you can use the factory pattern and create the appropriate version of the classes depending upon the requirement.&lt;br /&gt;&lt;br /&gt;This way you keep the dependency to minimum.&lt;br /&gt;&lt;br /&gt;VERY USEFUL TECHNIQUE----&lt;br /&gt;&lt;br /&gt;2) ALWAYS GO BACK AND REFACTOR YOUR CODE (Very Important)&lt;br /&gt;&lt;br /&gt;As new requirement come always go back and try to refactor you code, create new classes, delegate functionality to different classes, this makes the individual code more testable.&lt;br /&gt;&lt;br /&gt;Very important while writing code.&lt;br /&gt;&lt;br /&gt;When you have implement something..&lt;br /&gt;&lt;br /&gt;a)Start with simple things... make then work as desired.&lt;br /&gt;b) Then go back and add new functionality to it.&lt;br /&gt;c) Side by Side your integration code should go on, i.e think about how you will integrate with you add i.e creating MSI, installers etc...&lt;br /&gt;&lt;br /&gt;If you write code this way, there are more chances of finding the edge cases and your code will be more solid. Always implement small components i.e small projects and then integrate with the main application.&lt;br /&gt;&lt;br /&gt;Don't code the whole thing in one shot, Very important concept to remember.&lt;br /&gt;&lt;br /&gt;When designing api's, try to separate out the common things from the things that differ. Designing good api is a very important thing in software developers life (atleast for me it is the single most important thing) .&lt;br /&gt;&lt;br /&gt;If you follow this, your code will definitely be more solid and testable.&lt;br /&gt;&lt;br /&gt;These are some of the points I learned from my Manager here in Redmond, WA.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Update:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before writing code two things to remember&lt;br /&gt;&lt;br /&gt;1) Code should be as testable as possible.&lt;br /&gt;2) Code should be reusable.&lt;br /&gt;&lt;br /&gt;Consider each functionality as a seperate set of class.-- Always think how I can refactor this functionality into different set of classes. (Very important for good design.)&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-2369746926494453105?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/05/how-to-write-solid-piece-of-code.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-5312474989482001822</guid><pubDate>Wed, 28 May 2008 22:11:00 +0000</pubDate><atom:updated>2008-05-28T15:24:24.795-07:00</atom:updated><title>Hello There!!!</title><description>Hello Friends,&lt;br /&gt;&lt;br /&gt;Its been a long time, I have not blogged. Lot of things happened during the last couple of months.&lt;br /&gt;&lt;br /&gt;Most important was I left my Job at Telecom Industry to join one of the biggest companies in software development.&lt;br /&gt;&lt;br /&gt;I loved my job back in Oklahoma but I had to make the tough decision as I am still learning lot of new things in software development and coming here in Seattle,WA was a very important decision in my life.&lt;br /&gt;&lt;br /&gt;I believe that no decision is right or wrong. Everything depends on the how we look at it.&lt;br /&gt;&lt;br /&gt;I struggled a lot here in Seattle initially, but now I have feel like I have come to terms with the new job.&lt;br /&gt;&lt;br /&gt;Learning curve is huge. Lot of new ways of builing apps, writing apps among other things.&lt;br /&gt;&lt;br /&gt;I miss my freinds in tulsa,OK but life goes on ...&lt;br /&gt;&lt;br /&gt;Will be writing some new blogs about the things I learnt here in Seattle, WA.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-5312474989482001822?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2008/05/hello-from-software-developer.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-943553316025301740</guid><pubDate>Wed, 26 Dec 2007 02:20:00 +0000</pubDate><atom:updated>2007-12-25T18:21:20.397-08:00</atom:updated><title>Happy Xmas and Have a Great New Year....</title><description>Thank you for reading my post.. I wish you and your family a Happy Xmas and a prosperous New Year(2008!!!!!!)&lt;br /&gt;&lt;br /&gt;Happy Programming!!!&lt;br /&gt;&lt;br /&gt;Yash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-943553316025301740?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2007/12/happy-xmas-and-have-great-new-year.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-6392433589275691863</guid><pubDate>Thu, 08 Nov 2007 19:51:00 +0000</pubDate><atom:updated>2007-12-26T12:50:38.917-08:00</atom:updated><title>How to Design UserInterface.... AND Custom Validation</title><description>1) While Designing the User Interface (Presentation Layer) always put all your controls in a Table.&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;br /&gt; &lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;      &lt;td&gt; Place Control 1 Here ... &lt;/td&gt;&lt;br /&gt;      &lt;td&gt; Place Control 2 Here...  &lt;/td&gt;&lt;br /&gt; &lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;2) While designing the Web-Page make use of PlaceHolder Control. The advantage of this technique is that&lt;br /&gt;&lt;br /&gt;   a) You can Dynamically Load and Place the control at runtime... i.e Suppose you have a app- Setting Key/Value pair  in your web.config file --- which you can read in from the web.config file and depending upon what you get from the WeB.Config file you can select which control to  Load in the Palce Holder.&lt;br /&gt;&lt;br /&gt;  b) This gives a uniformity and Flexibility to get User-Interface Design.....&lt;br /&gt;&lt;br /&gt;  c) This way you can totally concentrate on creating the UserControl and not worry about the    Presentation Layer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------CUSTOM Validator-------------------------------------------------&lt;br /&gt;&lt;br /&gt;With Custom Validator you get to validate the Control at the&lt;br /&gt;&lt;br /&gt;ServerSide -- By Creating a function OnServerValidate()&lt;br /&gt;ClientSide --  By writing a function in the ClientSideValidation()&lt;br /&gt;&lt;br /&gt;That all that it is...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Thanks,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Happy Programming!!!!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6392433589275691863?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2007/11/how-to-design-userinterface-and-custom.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-954885857108135149.post-6131700561367873078</guid><pubDate>Wed, 31 Oct 2007 19:03:00 +0000</pubDate><atom:updated>2008-05-28T15:28:02.632-07:00</atom:updated><title>Asp.Net -- Informative URL's</title><description>--- This is a good informative Url for CrossPagePosting ---&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/05/09/CuttingEdge/"&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;http://msdn.microsoft.com/msdnmag/issues/05/09/CuttingEdge/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(51,255,51)"&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;--- This is a good Informative Url for Asp.Net Page Life Cycle ---&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms178472.aspx"&gt;&lt;span style="COLOR: rgb(255,0,0)"&gt;http://msdn2.microsoft.com/en-us/library/ms178472.aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(204,0,0)"&gt;Thanks,&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(204,0,0)"&gt;Happy Programming!!!&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/954885857108135149-6131700561367873078?l=dotnetdevblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetdevblog.blogspot.com/2007/10/cross-page-posting.html</link><author>noreply@blogger.com (Yash)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item></channel></rss>