<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8733111205723785067</id><updated>2011-07-09T00:06:15.817+05:00</updated><category term='Regex'/><category term='Project Management'/><category term='Internet'/><category term='Architecture'/><category term='Karachi'/><category term='Javascript'/><category term='Business Object Model'/><category term='SQL Server'/><category term='Reference'/><category term='COM Interop'/><category term='AJAX'/><category term='Process'/><category term='ASP'/><category term='Object Oriented Programming'/><category term='Paypal'/><category term='Google'/><category term='.NET'/><category term='ASP.NET'/><title type='text'>Dimagh Ki Dahi</title><subtitle type='html'>Discussion of  everyday software development issues, Software design and application architecture, as well as dimagh ki dahi discussions and some mindless ranting and experimentation</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-5761704992977625802</id><published>2009-10-28T12:41:00.001+06:00</published><updated>2009-10-28T12:42:49.762+06:00</updated><title type='text'>Too Long!</title><content type='html'>Cant believe I hav'nt posted anything for 2 years! I think I'll stop wasting my time now :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-5761704992977625802?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/5761704992977625802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=5761704992977625802' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/5761704992977625802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/5761704992977625802'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2009/10/too-long.html' title='Too Long!'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-3634531497276978157</id><published>2007-08-25T22:01:00.000+05:00</published><updated>2007-08-25T23:16:36.425+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Project Management'/><category scheme='http://www.blogger.com/atom/ns#' term='Process'/><title type='text'>To be or not to be (Agile)</title><content type='html'>Sorry , I haven't been posting a lot of stuff as much as I wanted to, I have recently been assigned the responsibility of managing a small project team. The last month or so has mostly been spent in a lot of meetings and team coordination.&lt;br /&gt;&lt;br /&gt;So far from what Ive experienced, project management is all about making plans, updating them and meetings, and some more meetings. I'm not really sure at the moment if I want to continue this path fo project management or stay towards more on the architecture side.&lt;br /&gt;&lt;br /&gt;I'm currently leading an internal project, so there is no requirement for costing or client meetings etc. I can classify project management practices for software in two major categories&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Plan Driven Management&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Agile Development Methods&lt;/li&gt;&lt;/ol&gt;I have been doing a bit of reading on the internet on different forums and article based sites for better management practices and which yields more productivity. One of the sites is &lt;a href="http://techrepublic.com.com/"&gt;techrepublic&lt;/a&gt;, a great site on general IT related articles and whitepapers&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Plan Driven Management:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Plan driven management is the classic form of project management, in which you have one project manager who usually creates an upper level plan within the first 1-2 weeks of the start of the project, allocates resources and maintains the cost of the project.&lt;br /&gt;&lt;br /&gt;The project manager is responsible for defining timeliness of the project from top to bottom to the very detailed pieces required&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Agile Development Methods:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;There are a number of methodologies available for agile development, Agile methodologies welcome change and focus more on the people and team effort rather than processes or plan management&lt;br /&gt;&lt;br /&gt;I am most familiar with the SCRUM, Ive take two presentations on it, one during my MS and one during the PDC&lt;br /&gt;&lt;br /&gt;In Agile development methodologies there is no single person responsible for complete planning, usually the complete plan is broken down into iterations and the team itself is responsible for further deciding who will do which task in order to complete the iteration.&lt;br /&gt;&lt;br /&gt;Agile management requires that the initial level plan only define the upper level requirements, the detailed planning is done just in time.  All agile methods focus on customer satisfaction, there also exists an &lt;a href="http://agilemanifesto.org/"&gt;agile manifesto&lt;/a&gt;, which consists of the underlying principles for all agile methods&lt;br /&gt;&lt;br /&gt;more information can be found in these links:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Project_management"&gt;Traditional Plan Driven Project Management&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Agile_management"&gt;Agile Project Management&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Agile_software_development"&gt;Agile Software Development&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-3634531497276978157?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/3634531497276978157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=3634531497276978157' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/3634531497276978157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/3634531497276978157'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/08/to-be-or-not-to-be-agile.html' title='To be or not to be (Agile)'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-2928947054370186197</id><published>2007-07-25T08:24:00.000+05:00</published><updated>2007-08-25T19:51:55.213+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Karachi'/><category scheme='http://www.blogger.com/atom/ns#' term='Internet'/><title type='text'>DSL experience in Karachi</title><content type='html'>For those of you reading this post from within Pakistan know the problems associated with getting a broadband connection. A lot of services do not provide QoS (Quality of service) or any affordable package. Recently I got a shared DSL home 256k unlimited download package from &lt;a href="http://www.max.com.pk"&gt;maxcom&lt;/a&gt;. So far I have been using it for almost 2 months without any issues, check out the &lt;a href="http://speedtest.net/"&gt;speedtest&lt;/a&gt; result for my connection:&lt;br /&gt;&lt;a href="http://www.speedtest.net/result/159845329.png"&gt;speedtest result&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The experience so far with maxcom has been really great, the installation was free and service downtime is virtually zero.&lt;br /&gt;&lt;br /&gt;Some providers are providing download speeds upto 2 Mbps via ADSL connection, but almost all of them are volume based. Unlimited packages cross the affordibility line for the average Pakistani.&lt;br /&gt;&lt;br /&gt;But the prospects are good, like the launch of country wide Wimax solution by wateen telecom, the prices should come within affordable reach even for 2Mbps connections&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-2928947054370186197?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/2928947054370186197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=2928947054370186197' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/2928947054370186197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/2928947054370186197'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/07/dsl-experience-in-karachi.html' title='DSL experience in Karachi'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-7944561848799693602</id><published>2007-06-25T09:41:00.000+05:00</published><updated>2007-06-25T10:02:13.734+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Karachi'/><title type='text'>2nd Day at PDC 07 , Stephen Forte to the rescue!</title><content type='html'>Thanks to &lt;a href="http://www.stephenforte.net/owdasblog/"&gt;stephen forte&lt;/a&gt; for putting some life back into PDC 07!, I feel the problem here is maturity of professionals. Our industry is still young and people are still new to concepts like application architecture and management processes required to deliver a successful solution. As such, the local presenters either dont have the presentation skills or the required experience to engage the audience in an interesting case study.&lt;br /&gt;&lt;br /&gt;Otherwise the mismanagement from the PC Hotel management was slightly better than the first day, you can download all the slides for topics presented by stephen from &lt;a href="http://www.stephenforte.net/owdasblog/default.aspx?date=2007-06-22"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My personal favorites were database design patterns and Scalable applications. I really wish &lt;a href="http://vasters.com/clemensv/"&gt;Clement Vasters&lt;/a&gt; would come and visit sometime. I took some of his sessions at PDC 05',  they were a real mind opener.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-7944561848799693602?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/7944561848799693602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=7944561848799693602' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/7944561848799693602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/7944561848799693602'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/06/2nd-day-at-pdc-07-stephen-forte-to.html' title='2nd Day at PDC 07 , Stephen Forte to the rescue!'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-9218463720346776364</id><published>2007-06-19T23:57:00.001+05:00</published><updated>2007-06-20T00:34:10.052+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reference'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Regex'/><title type='text'>Regex Fundamentals</title><content type='html'>&lt;span style="font-family: verdana;"&gt;I went over this site over the weekend to brush up my skills on regular expressions, this is probably the one of the best and only site you'll need, it has basics, quick starts and detailed internal working of the regex engines&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;For people new to Regular Expressions or regex, it provides a powerful functionality to match patterns in text, it might seem confusing at first but once you get the hang of it its not that hard (but I think the testing data would take some thought!)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;as I work on .NET, the framework provides you classes in the namespace System.Text.RegularExpressions&lt;/span&gt;&lt;br /&gt;&lt;a style="font-family: verdana;" href="http://www.regular-expressions.info/"&gt;&lt;br /&gt;http://www.regular-expressions.info/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;I'll try to post some examples later&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-9218463720346776364?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/9218463720346776364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=9218463720346776364' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/9218463720346776364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/9218463720346776364'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/06/regex-fundamentals.html' title='Regex Fundamentals'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-4504817112334397073</id><published>2007-06-19T22:37:00.000+05:00</published><updated>2007-06-25T10:02:41.127+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Karachi'/><title type='text'>First day at pakistan developers conference 2007</title><content type='html'>&lt;span style="font-family:arial;"&gt;As some of you might know, PDC 2007 is happening in karachi on 19th and 20th June, today happens to be the first day of the event. Frankly, i was looking forward to some of the topics mentioned in the agenda &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.microsoft.com/middleeast/pakistan/conference/"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;My first was PDC 2005, which was really quite good with speakers like&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt; &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://www.google.com.pk/search?hl=en&amp;rlz=1B3GGGL_enPK226PK227&amp;amp;sa=X&amp;oi=spell&amp;amp;resnum=0&amp;ct=result&amp;amp;amp;cd=1&amp;q=Rafal+Lukawiecki+&amp;amp;spell=1"&gt;Rafal Lucaweicki &lt;/a&gt;and &lt;a href="http://vasters.com/clemensv/"&gt;Clemens Vasters&lt;/a&gt;, at that time VS 2005 and SQL Server 2005 was to be released, so there was tons to learn from it. The list of speakers was amazing none the less and there were topics on domain specific modeling, sql server reporting services and even Avalon. It was truly inspiring, after that I kept following blogs of some of the technical leaders in the market.&lt;br /&gt;&lt;br /&gt;Unfortunately, that was probably the last good PDC there ever was, I get the feeling that PDC has been going downhill ever since, the number of professional speakers are minimized and so is the list of topics.&lt;br /&gt;&lt;br /&gt;Today I attended the first day at PDC 07 arranged at PC hotel, It started off by waiting for the chief guest IT Minister Leghari to arrive, which in keeping with tradations here at pakistan arrived a full hour late. eventually he arrived and the ceremony was kicked off with a speech from the minister and plaque award ceremony.&lt;br /&gt;&lt;br /&gt;Plaques were given to all sorts of people, including a guy who wrote the new urdu dictionary and a bunch of other people who's achievements were not explained and other irrelevants from the developers conference. Probably IT minister thought it would be a good idea to get rid of all pending plaque presentations at the PDC 07 event, may it be relevant to the developer conference or not&lt;br /&gt;&lt;br /&gt;Finally we got to the tea break an hour late, on our way back we were handed an updated schedule. On close examination of the schedule, the session on Architecture "decoupling business logic from services" which I was planning to take was removed from schedule without any explanation!&lt;br /&gt;&lt;br /&gt;we decided to take &lt;a href="http://www.google.com.pk/search?hl=en&amp;rlz=1B3GGGL_enPK226PK227&amp;amp;sa=X&amp;oi=spell&amp;amp;resnum=0&amp;ct=result&amp;amp;cd=1&amp;q=goksin+bakir&amp;amp;spell=1"&gt;Goksin Bakirs&lt;/a&gt; presentation on developing with windows Vista enchancements, the presentation was nice but it was an overview level, pretty much of which I already knew&lt;br /&gt;&lt;br /&gt;then we had the (mis)managed lunch. One of my friends had to go on a hunger strike lol!, cuz he had'nt filled his plate enough the first time, after the food as gone the waiters refused to fill it up. By the time people moved to desert, all the spoons had disappeared&lt;br /&gt;&lt;br /&gt;after that we took the second session on "using LINQ to retrieve business data" by Zia khan. Zia khan is more of a business entrepreneur than a  tech guy, but he gave enough of an overview to get started. Again there wernt any live sessions or demo's , just some architecture slides and some code in slides. You would be better off by downloading a &lt;a href="http://davidhayden.com/blog/dave/archive/2007/01/29/LINQVideoAndersHejlsbergLINQTutorials.aspx"&gt;quickstart tutorial&lt;/a&gt; on LINQ&lt;br /&gt;&lt;br /&gt;the last session we took was "using the right technology : Bizztalk, SQL Server, Sharepoint etc" by &lt;a href="http://bajoo.blogspot.com/"&gt;Naveed bajwa&lt;/a&gt;, the guy was a pretty horizontal tech guy, but the presentation could use some work. He explained some basics and discussed certain scenarios and asked the audience what technology can be used under the scenarios. Unfortunately, the scenarios were bland 2 liner requirements statement and without depth except the last one. It was hardly a topic for PDC, he could have been better off by writing a 2 page article on it&lt;/span&gt;&lt;b style="font-family: arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;span style="font-family:arial;"&gt;I really hope that tomorrows sessions are better, otherwise if we keep getting useless topics and inexperienced MVP speakers, PDC 07 would be loosing the last of its professional audience. Ever wonder why we have a Professional Developers Conference in the world all over and here its called Pakistan Developer Conference ??&lt;/span&gt;&lt;b style="font-family: arial;"&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-4504817112334397073?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/4504817112334397073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=4504817112334397073' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/4504817112334397073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/4504817112334397073'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/06/first-day-at-pakistan-developers.html' title='First day at pakistan developers conference 2007'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-1549658210520804697</id><published>2007-06-13T18:54:00.000+05:00</published><updated>2007-06-19T23:56:35.356+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reference'/><category scheme='http://www.blogger.com/atom/ns#' term='Regex'/><title type='text'>The cheat sheet page</title><content type='html'>&lt;a href="http://www.ilovejackdaniels.com/"&gt;Jack daniel's&lt;/a&gt; website has a cheat sheet section, consisting of printable summarized commonly used methods for  a number of tools and technologies including html, MySql, regular expressions and more.&lt;br /&gt;&lt;br /&gt;I was looking for something on regular expressions when I came across this&lt;br /&gt;&lt;br /&gt;click &lt;a href="http://www.ilovejackdaniels.com/cheat-sheets/"&gt;here&lt;/a&gt; to access his cheat sheet section&lt;br /&gt;&lt;br /&gt;These are handy printouts that would help in any situation, I usually use one for javascript reference which can be found &lt;a href="http://www.dannyg.com/ref/jsquickref.html"&gt;here&lt;/a&gt; its from the book Javascript Bible, it has save me many hours of unproductive searching&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-1549658210520804697?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/1549658210520804697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=1549658210520804697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/1549658210520804697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/1549658210520804697'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/06/cheat-sheet-page.html' title='The cheat sheet page'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-9100723828830569615</id><published>2007-06-07T10:16:00.000+05:00</published><updated>2007-06-07T10:23:35.232+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Karachi'/><title type='text'>Karachi load shading reaches new heights</title><content type='html'>Karachi load shading has reached new heights, KESC is proabably in Guinness Book of world records by now for the  longest load shading hours, yesterday we had load shading for about 7 hours. This is really bringing things to halt.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://karachi.metblogs.com/archives/images/2007/06/KESC.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://karachi.metblogs.com/archives/images/2007/06/KESC.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Checkout this image posted on &lt;a href="http://karachi.metblogs.com/"&gt;karachi metblog&lt;/a&gt;&lt;br /&gt;Good thing our office has its own power supply&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-9100723828830569615?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/9100723828830569615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=9100723828830569615' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/9100723828830569615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/9100723828830569615'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/06/karachi-load-shading-reaches-new.html' title='Karachi load shading reaches new heights'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-4113675439567107276</id><published>2007-06-05T13:36:00.000+05:00</published><updated>2007-06-05T16:00:14.256+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><title type='text'>Reverse Ajax</title><content type='html'>A couple of months back, i had posted simple AJAX tutorials on how to initiate simple AJAX calls and get the response from the server. Today I stumbled upon an article on reverse AJAX, click &lt;a href="http://prokata.com/reverseajax"&gt;here&lt;/a&gt; to view the original post.&lt;br /&gt;&lt;br /&gt;Reverse AJAX is actually an implementation (seems more of a marketing buzz word to me) rather than a technology. In case of AJAX it is the browser that initiates the request, but what if the server needs to inform the browser of something ?&lt;br /&gt;&lt;br /&gt;Suppose there are 6 clients (browsers) connected to a server viewing the same financial record, if one of the clients updates the record then how do the other connected clients get informed that the record has been updated ? this is a typical problem that a reverse AJAX solution can be used to target.&lt;br /&gt;&lt;br /&gt;There are generally 3 methods that can be used for implementation of Reverse AJAX, the details can be read on the original link that I posted earlier&lt;br /&gt;&lt;br /&gt;1) COMET or SLOW LOAD&lt;ul&gt;&lt;li&gt;COMET was coined by &lt;a href="http://alex.dojotoolkit.org/?p=545"&gt;&lt;span style="font-family:arial;"&gt;Alex Russell&lt;/span&gt;&lt;/a&gt; , its a technique to keep keep alive HTTP connections&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.obviously.com/tech_tips/slow_load_technique"&gt;Bryce Nesbitt's&lt;/a&gt; example on slow loading, it uses an frames to keep the connection open&lt;/li&gt;&lt;/ul&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;2) Polling&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the browser polls the server after some specified intervals to check if something new has happened&lt;/li&gt;&lt;/ul&gt;3) PiggyBack&lt;br /&gt;&lt;ul&gt;&lt;li&gt;piggy backing means that whenever a browser requests an operation, you send back the notification with the result of that request, hence piggy backing on the response&lt;/li&gt;&lt;/ul&gt;I have not used any of the above mentioned techniques but in my opinion a small framework can be built that sends an asynchronous call to the server and listens for the response, the server would only resonse if some event has occured. This would be similar to slow load technique but at least  you wont have to use frames with it&lt;br /&gt;&lt;br /&gt;I'll try it out if I can get the time, I'm currently preparing for an MCTS exam due in July... so lets see&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-4113675439567107276?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/4113675439567107276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=4113675439567107276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/4113675439567107276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/4113675439567107276'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/06/reverse-ajax.html' title='Reverse Ajax'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-5198938856713300614</id><published>2007-06-04T13:04:00.000+05:00</published><updated>2007-06-04T13:47:18.225+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Indexes in SQL Server</title><content type='html'>Here's a great article on the ins and outs and do's and dont's of indexing in SQL Server, its a beginner level article but explains pretty much there is to know about indexing.&lt;br /&gt;&lt;a href="http://www.odetocode.com/Articles/70.aspx"&gt;&lt;br /&gt;http://www.odetocode.com/Articles/70.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The above mentioned article focuses on SQL Server 2000, for a comparison with SQL Sever 2005 indexes, click &lt;a href="http://searchsqlserver.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid87_gci1128437,00.html"&gt;here&lt;/a&gt; , on the whole it adds a new type of index for xml datatype that it supports and enhances on previous things, nothing dramatically new.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-5198938856713300614?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/5198938856713300614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=5198938856713300614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/5198938856713300614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/5198938856713300614'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/06/indexs-in-sql-server.html' title='Indexes in SQL Server'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-6490433602714120115</id><published>2007-06-04T11:34:00.000+05:00</published><updated>2007-06-04T11:44:30.574+05:00</updated><title type='text'>Links section added</title><content type='html'>Ive added a new links section to my blog,  Most them are those which I visit regularly for updates and news (there are others concerning posts :) ).&lt;br /&gt;&lt;br /&gt;My favorites have to be the Architecture resource and patterns and practices links, a really good resource if you are a Microsoft developer, but still good enough on general principles of modeling applications etc. I would really recommend the architecture journal which is available form the architecture resource link, it provides a good insight into whats happening in the architecture world, do's and dont's and opinions of many valued professionals in the field&lt;br /&gt;&lt;br /&gt;I'm currently involved with e-commerce development, I came across a really good blog for a company which does research and analysis in e-commerce technology. Its a good blog, providing updates on other news and updates in the development frameworks for e-commerce...&lt;br /&gt;&lt;br /&gt;Ive added this to the links section as well, by name of next generation shopping...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-6490433602714120115?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/6490433602714120115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=6490433602714120115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/6490433602714120115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/6490433602714120115'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/06/links-section-added.html' title='Links section added'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-1992984367950492325</id><published>2007-05-28T14:11:00.000+05:00</published><updated>2007-06-04T11:47:16.870+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>compilation model differences in .net 1.1 and 2.0</title><content type='html'>here's a good article on the differences of the compilation models in ASP.NET 1.1 and 2.0,  for those wishing to get the debugging database in 2.0 this article also explores that and tells how it can be achieved, debugging database (.PDB) are useful for getting information like like numbers and other information in a stack dump whenever the code breaks&lt;br /&gt;&lt;br /&gt;&lt;a href="http://odetocode.com/Blogs/scott/archive/2005/11/15/2464.aspx"&gt;http://odetocode.com/Blogs/scott/archive/2005/11/15/2464.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-1992984367950492325?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/1992984367950492325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=1992984367950492325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/1992984367950492325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/1992984367950492325'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/05/compilationmodel-differences-in-net-11.html' title='compilation model differences in .net 1.1 and 2.0'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-5650750058675705447</id><published>2007-05-24T15:33:00.000+05:00</published><updated>2007-05-28T14:07:40.246+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Object Oriented Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Object orientation in javascript</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=";font-family:Arial;" &gt;In almost ever project I have been involved this is the case with javascript, its only used for validation checks and small time jobs etc by making a js library and writing procedural code.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=";font-family:Arial;" &gt;in most large forms, java script methods keep growing and eventually you cant figure out if they are being actually used somewhere for what purpose or just junk code.&lt;/span&gt;&lt;/span&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=";font-family:Arial;" &gt;Here’s a link to 3 articles that hope to eliminate the issue by implementing client side functionality in classes similar to object orientation in .NET, and eventually ejecting the JS client framework through ASP.NET server controls&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=";font-family:Arial;" &gt;Part 1 : &lt;a href="http://www.codeproject.com/aspnet/JsOOP1.asp"&gt;http://www.codeproject.com/aspnet/JsOOP1.asp&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=";font-family:Arial;" &gt;Part 2 : &lt;a href="http://www.codeproject.com/aspnet/JsOOP2.asp"&gt;http://www.codeproject.com/aspnet/JsOOP2.asp&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=";font-family:Arial;" &gt;Part 3 : &lt;a href="http://www.codeproject.com/aspnet/JsOOP3.asp"&gt;http://www.codeproject.com/aspnet/JsOOP3.asp&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:100%;"&gt;I'd love to get my hands practical on this one!&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:100%;"  &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-5650750058675705447?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/5650750058675705447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=5650750058675705447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/5650750058675705447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/5650750058675705447'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/05/object-orientation-in-javascript.html' title='Object orientation in javascript'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-209515013053512206</id><published>2007-05-23T12:14:00.000+05:00</published><updated>2007-06-05T13:45:06.803+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Business Object Model'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>Modelling business objects with Encapsulated saving and retreival logic</title><content type='html'>As I mentioned in the last post that I will be discussing modelling of business objects ,&lt;br /&gt;recently i had a chance to implement the idea that had been bobbing in my head for a&lt;br /&gt;while.&lt;br /&gt;&lt;br /&gt;Most of the previous projects that I have worked on had a seperate layer for business&lt;br /&gt;data containers, and another layer for converting the business data container into sql&lt;br /&gt;based information. In my opinion this is an unnesescary , it increases readibility and&lt;br /&gt;maintainance issues.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_W04WOjhbHhM/RlPrM51EPZI/AAAAAAAAABQ/amHUsTd4BQw/s1600-h/BOModelling1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_W04WOjhbHhM/RlPrM51EPZI/AAAAAAAAABQ/amHUsTd4BQw/s320/BOModelling1.jpg" alt="" id="BLOGGER_PHOTO_ID_5067652612636294546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:78%;"&gt;classic business storage model&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;I wanted to encapsulate this logic of retrieving and saving the business data within the&lt;br /&gt;business object itself. For e.g. I have a customer object name Customer, i could set all&lt;br /&gt;the information in the customer object and call the save method...  Customer.Save();&lt;br /&gt;&lt;br /&gt;In the same tradition, i also made methods for retreive by id, retrieve by condition&lt;br /&gt;methods as well, retrieve by id populates and returns an object of type customer,&lt;br /&gt;whereas by condition returns a customer collection. (I didnt use the delete operations,&lt;br /&gt;they wernt required in my case)&lt;br /&gt;&lt;br /&gt;Encapsulating the save logic within the business object makes it easier to access and use&lt;br /&gt;by developers. The Save logic consists of a single stored procedure that is used both for&lt;br /&gt;updating and inserting new records. the logic to check wehther the current record is to be&lt;br /&gt;inserted or updated if it already exists can easily be programmed in the stored procedure&lt;br /&gt;itself.&lt;br /&gt;&lt;br /&gt;Retriev by id simply constructs the object based on getting the record and populating the&lt;br /&gt;business data by primary key&lt;br /&gt;&lt;br /&gt;This type of modelling has other advantages as well, For e.g the Order object&lt;br /&gt;encapsulates a cart object and cart items object, when Object.Save() is called, the&lt;br /&gt;Cart.Save() is called which in turn calls the CartItem.Save() is called for each item in the&lt;br /&gt;cart saving them one by one.&lt;br /&gt;&lt;br /&gt;Another thing to keep in mind with a broader vision is that not all items are independant,&lt;br /&gt;and you might want to implement transactions. If the items independantly implement their&lt;br /&gt;own save methods this creates a problem.&lt;br /&gt;&lt;br /&gt;Addressing this issue requires that all the classes that need to be saved in a transaction&lt;br /&gt;should have a connection and a transaction members to assign them the connection and&lt;br /&gt;the transaction object being used externally. A boolean transactionMode attribute or&lt;br /&gt;property might be helpful as well&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_W04WOjhbHhM/RlPrnp1EPaI/AAAAAAAAABY/Q-3dO2vv_tg/s1600-h/BOModelling2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_W04WOjhbHhM/RlPrnp1EPaI/AAAAAAAAABY/Q-3dO2vv_tg/s320/BOModelling2.jpg" alt="" id="BLOGGER_PHOTO_ID_5067653072197795234" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;proposed business storage model&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;there are others who have explored this idea, here's a link to peter bells' blog&lt;br /&gt;&lt;a href="entryhttp://www.pbell.com/index.cfm/2006/10/20/Objects-or-Services--how-do-you-desi"&gt;entryhttp://www.pbell.com/index.cfm/2006/10/20/Objects-or-Services--how-do-you-desi&lt;br /&gt;gn-your-model&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;this is also the thinking behind CLSA.NET framework&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Component-based_Scalable_Logical_Architecture"&gt;http://en.wikipedia.org/wiki/Component-based_Scalable_Logical_Architecture&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;do post your comments on these thoughts&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-209515013053512206?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/209515013053512206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=209515013053512206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/209515013053512206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/209515013053512206'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/05/modelling-business-objects-with.html' title='Modelling business objects with Encapsulated saving and retreival logic'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_W04WOjhbHhM/RlPrM51EPZI/AAAAAAAAABQ/amHUsTd4BQw/s72-c/BOModelling1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-5674776286081530518</id><published>2007-05-17T14:58:00.000+05:00</published><updated>2007-06-04T11:48:30.998+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Paypal'/><category scheme='http://www.blogger.com/atom/ns#' term='Architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Finally free!</title><content type='html'>At last!, finally after missing the original deadline by quite a large margin, I have managed to complete a small independent system for receiving paypal and google notifications.&lt;br /&gt;&lt;br /&gt;currently its undergoing testing, but it has been really exciting to develop it, on recieving the information from paypal / google we can traverse the information and create user accounts and place orders for our system automaticlly, hopefully this will take quite a burden off the operations team.&lt;br /&gt;&lt;br /&gt;It was a fun challange to design a generic set of business classes that could satisfy the information needs for our system (we have an ecommerce shopping site) , information returned by google, and information returned by paypal, Although i can still think of a few improvements here and there but for the moment the model will suffice and should be expandable by implementing another checkout system with little modification.&lt;br /&gt;&lt;br /&gt;I will post the architecture that I have tried to use for comments from others. Designing a system that is generic enough to be loosely coupled and integrates with the legacy code (by legacy I mean ASP 3 and COM+) has its share of design issues. lets have a look at the model:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_W04WOjhbHhM/RkwnpZ1EPXI/AAAAAAAAABA/dv0AYCB4wL8/s1600-h/Level-1+implementation.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_W04WOjhbHhM/RkwnpZ1EPXI/AAAAAAAAABA/dv0AYCB4wL8/s320/Level-1+implementation.png" alt="" id="BLOGGER_PHOTO_ID_5065467273146547570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;Level 1 implementation&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_W04WOjhbHhM/RkwoAp1EPYI/AAAAAAAAABI/nH5W0gPM6ts/s1600-h/Level-2+implementation.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_W04WOjhbHhM/RkwoAp1EPYI/AAAAAAAAABI/nH5W0gPM6ts/s320/Level-2+implementation.png" alt="" id="BLOGGER_PHOTO_ID_5065467672578506114" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:78%;"&gt;Level 2 implementation&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;There are 2 levels of implementation, the first level implementation requires to deliver the information form our website to paypal and google checkout.&lt;br /&gt;&lt;br /&gt;As you can see, the first level implementation consists of an independant .net 2.0 assembly, registered as COM. This assembly consists of all the core business classes and supporting utility classes. This assembly has a set of core classes that accept xml (based on our own schema for information) as input and product respective html button code through a factory method. Along the way while parsing and validating the xml it also populates the business objects that can be used sometime later in the application development lifetime.&lt;br /&gt;&lt;br /&gt;The level 2 implementation is concerned with implementing a notification service, that is able to receive notifications from both paypal ipn and google notification API, although a single landing page is possible but it would create a tightly coupled integration and would be difficult to maintain and expand to another checkout provider if it came along.&lt;br /&gt;&lt;br /&gt;NotificationListener is a single web app but with 2 entry points, once for the google notification serivice and the other for paypal. These are just simple asp.net 2.0 pages that use the business classes generated earlier in CheckoutProvider.dll.&lt;br /&gt;&lt;br /&gt;NotificationListener also implement microsoft enterprise library 3.0, which again i have to say save d a lot of coding effort and debugging, I used it for logging and exception logging. It has a pretty good structure and relatively quite easy to implement&lt;br /&gt;&lt;br /&gt;the only place where i couldnt force loose coupling with the legacy application was the data layer, since all the information has to go in the same database as the actual commerce site, I believe that it can be worked out into an independent component with a little effort and its own database. but given the time constraints that wouldnt be possible anytime soon, plus if its written as an independent component there would have to be some sort of middle ware in between to connect it to existing applications.&lt;br /&gt;&lt;br /&gt;I'm focusing on designing reusable and maintainable components , I'd love to work on a truly SOA based application but not quite there yet, but this is a start anyway... would love to hear comments about it.&lt;br /&gt;&lt;br /&gt;In my next post i'll also discuss an idea that I have implemented in this implementation, about implementing the save/retrieve logic right inside the business entity object... this approach has a number of flaws which I'll comment on later...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&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/8733111205723785067-5674776286081530518?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/5674776286081530518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=5674776286081530518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/5674776286081530518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/5674776286081530518'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/05/finally-free.html' title='Finally free!'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_W04WOjhbHhM/RkwnpZ1EPXI/AAAAAAAAABA/dv0AYCB4wL8/s72-c/Level-1+implementation.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-4764945423209768653</id><published>2007-04-03T11:05:00.000+05:00</published><updated>2007-06-04T11:48:59.344+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Paypal'/><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google Checkout vs Paypal Checkout</title><content type='html'>For the past couple of weeks, I have been working on implementing the XML API for Google and HTML based API for Paypal checkout, it has been an interesting and varied experience.&lt;br /&gt;&lt;br /&gt;I personally liked working with google xml API because it seems more extensible and easy to integrate. its a well structured API building on levels of implementation rather than being completely separate implementations, as is the case with Paypal&lt;br /&gt;&lt;br /&gt;the documentation is better structured for Paypal, with easy to understand steps.&lt;br /&gt;&lt;br /&gt;I found this lacking on the google page, as you sometimes have to search through the developers forum for some specific examples that have not been published on the documentation page&lt;br /&gt;&lt;br /&gt;I'll posst some sample code and tutorials here once I'm done with it&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-4764945423209768653?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/4764945423209768653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=4764945423209768653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/4764945423209768653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/4764945423209768653'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/04/google-checkout-vs-paypal-checkout.html' title='Google Checkout vs Paypal Checkout'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-8239812753332892164</id><published>2007-03-30T09:53:00.000+05:00</published><updated>2007-06-04T11:49:31.127+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><title type='text'>Using AJAX</title><content type='html'>Continuing from the previous post, I'll first post a small tutorial on using ajax note that AJAX is a browser technology, so far I have tested in firefox and IE, ive read somewhere that SAFARI has partial implementation for it, but I didnt check which version was being discussed. first u'll need to create a factory method in your JS file, this method will , depending on the browser, call the correct library and get the ajax object.&lt;br /&gt;it should look something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;function GetXmlHttpObject()&lt;br /&gt;{&lt;br /&gt;var objXMLHttp=null&lt;br /&gt;if (window.XMLHttpRequest)&lt;br /&gt;{&lt;br /&gt;objXMLHttp=new XMLHttpRequest()&lt;br /&gt;}&lt;br /&gt;else if (window.ActiveXObject)&lt;br /&gt;{&lt;br /&gt;objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")&lt;br /&gt;}&lt;br /&gt;return objXMLHttp&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;You can call the function and get the object that will be sending the actual request&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;var url = “http://www.sample.comm/sample.asp”;&lt;br /&gt;var xmlObj = GetXmlHttpObject(); //get the object from factory method&lt;br /&gt;xmlObj.onreadystatechange = stateChanged;&lt;br /&gt;xmlObj.open("GET",url,false);&lt;br /&gt;xmlObj.send(null);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;a line by line explanation of the code&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;xmlObj.onreadystatechange = stateChanged;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;this line assigns the method to an event, whenever the state of the object changes the method you assign here will be called&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;xmlObj.open("GET",url,false);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;here you are setting the options for opening the connection&lt;br /&gt;&lt;br /&gt;arg1 = this can be either “GET” or “POST”, “POST” should be used whenever sending data more than 512kb&lt;br /&gt;arg2 = the url of the server page to hit&lt;br /&gt;arg3 = this parameter specifies whether the call should be sync or async&lt;br /&gt;&lt;br /&gt;there are two additional arguments that can be passed, I havnt used them but I think they can be used for HTTP basic authentication&lt;br /&gt;&lt;br /&gt;arg4 = username&lt;br /&gt;arg5 = password&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;xmlObj.send(null);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the actual call, note that instead of passing null, you can send xml data in the argument.&lt;br /&gt;&lt;br /&gt;Now, whenever the state of the object changes the method that you assigned will be called,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;xmlObj.onreadystatechange = stateChanged;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;lets look at how we can use this event&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;function stateChanged(){&lt;br /&gt;if (xmlObj.readyState==4 xmlObj.readyState=="complete") {&lt;br /&gt;alert("success");&lt;br /&gt;}&lt;br /&gt;else{&lt;br /&gt;alert("error");&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The readyState can be any one of the following:&lt;br /&gt;&lt;br /&gt;0 = uninitialized&lt;br /&gt;1 = loading&lt;br /&gt;2 = loaded&lt;br /&gt;3 = interactive&lt;br /&gt;4 = complete&lt;br /&gt;&lt;br /&gt;In this example I have only used the completed state, note that it might be returning its string counterparts depending on the browser&lt;br /&gt;&lt;br /&gt;There are other properties which can be used for testing the state of the xml call object&lt;br /&gt;These are:&lt;br /&gt;&lt;br /&gt;responseText : get the response as a stirng&lt;br /&gt;responseXML : get the XML DOM object which can then be parsed&lt;br /&gt;&lt;br /&gt;status : status number for http such as 200 ok status or 404 error&lt;br /&gt;statusText : get the status as string like “Not Found” or “OK”&lt;br /&gt;&lt;br /&gt;from the server side, you can write anything from the page that you have specified in the callback url in Response.Write(“”) , which will become available in the responseText property of the xml obj once the callis complete&lt;br /&gt;&lt;br /&gt;similiary , whole forms can be called and retrieved from response.Text, but its not generally a good idea as discussed in the previous post&lt;br /&gt;&lt;br /&gt;head over to w3school.com for more tutorials on calling ajax., but this is pretty much there is to it&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-8239812753332892164?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/8239812753332892164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=8239812753332892164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/8239812753332892164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/8239812753332892164'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/03/using-ajax.html' title='Using AJAX'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-2415633880632701877</id><published>2007-03-29T09:45:00.000+05:00</published><updated>2007-06-04T11:50:09.401+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><title type='text'>Parent child forms in ASP</title><content type='html'>A month ago, I had to modify an ASP form with some functionality.&lt;br /&gt;&lt;br /&gt;this functionality existed in another form, so I decided instead of developing or copy pasting the functionality , i would just call that form as a child in a DIV of the parent form using AJAX.&lt;br /&gt;&lt;br /&gt;boy was that a bad decision! believe me it works, the whole form can be called in a div using ajax response.&lt;br /&gt;&lt;br /&gt;but i ran into a weird problem that the javascript coming in the AJAX call from the child page didnt run, no matter what. even though the js was there in the AJAX response, I could see it in the debugger&lt;br /&gt;&lt;br /&gt;I had to write whole of form validation scripting on the parent page, the elements in the child form were available by using&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;document.getElementById&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;in js. I warned another of my colleague who got a similar assignment , he wanted to do it with IFRAME element, and get calls at runtime by changing the form action for the form in the IFRAME element&lt;br /&gt;&lt;br /&gt;eventually he ended with similar problems that I was having.&lt;br /&gt;&lt;br /&gt;there was another problem with browser caching when using AJAX, when the user updates some values in the child form and submits it and refreshes the parent form, although the changes were reflected in database but the browser (specifically internet explorer) kept showing old values which I believe it keeps picking up from the cache.&lt;br /&gt;&lt;br /&gt;theres a browser setting that can be set to check for the new instance of the page on every request, but that didnt seem to work either. We deployed the application with this so called "bug".&lt;br /&gt;&lt;br /&gt;I'll post some examples related to this issue later on&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-2415633880632701877?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/2415633880632701877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=2415633880632701877' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/2415633880632701877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/2415633880632701877'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/03/parent-child-forms-in-asp.html' title='Parent child forms in ASP'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8733111205723785067.post-975609205922716251</id><published>2007-03-28T11:03:00.000+05:00</published><updated>2007-06-04T11:51:05.662+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='COM Interop'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP'/><title type='text'>Using COM interop services</title><content type='html'>&lt;span style="font-size:100%;"&gt;The past few days have been quite interesting.&lt;br /&gt;&lt;br /&gt;Recently I've had a chance to work with XSL and XSLT, the experience was just amazing considering the simplicity and ease of use, i'll probably publish a post on using those later...&lt;br /&gt;&lt;br /&gt;The microsoft developers community is slowly migrating towards newer and newer development technologies, but there still a  lot of legacy applications out there which require some new development. Here is where COM interop. comes in , it provides the ease of development in .NET while still using the class library as COM in legacy enterprise services such as ASP 3.0&lt;br /&gt;&lt;br /&gt;I had a chance to work on a component which was developed in c# .net 2.0 as a class library and called in ASP 3.0&lt;br /&gt;&lt;br /&gt;using COM interop is pretty straight forward&lt;br /&gt;&lt;br /&gt;when developing a class library for COM interop in .NET its important to keep in mind that &lt;/span&gt;all classes and methods to be accessed from legacy app should be public.&lt;br /&gt;&lt;br /&gt;in .net 2.0 and VS 2005 the methods and classes are not visible to COM by default,&lt;br /&gt;&lt;br /&gt;one way is to make the whole assembly accessible to COM , goto the project properties, under the application tab click assembly information and check the make com visible checkbox near the bottom&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_W04WOjhbHhM/RgoU0XyTq4I/AAAAAAAAAAs/tkGE0Rr0bH8/s1600-h/1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_W04WOjhbHhM/RgoU0XyTq4I/AAAAAAAAAAs/tkGE0Rr0bH8/s320/1.jpg" alt="" id="BLOGGER_PHOTO_ID_5046869222392834946" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;the other method involves using System.Runtime.InteropServices library and declaring &lt;span style="font-weight: bold;"&gt;[ComVisible(true)]&lt;/span&gt; attributes at class and method level for each of the method and class&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Registering the Assembly as COM :&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;after compiling the assembly needs to be registered as COM using the command &lt;span style="font-weight: bold;"&gt;regasm.exe&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;a typical example of what I used was something like : regasm &lt;filepath filename=""&gt; /codebase / tlb&lt;br /&gt;&lt;br /&gt;the /codebase switch sets the code base in the registry and the /tlb creates a type library and registers it as well&lt;br /&gt;&lt;br /&gt;there is another option available in visual studio 2005 in project properties build tab, theres a checkbox option to register for com interoperatibility, but i havnt personally tried using that option.&lt;br /&gt;&lt;br /&gt;after registering the component it should be ready for use. I will consider usage from an ASP 3.0 application as an example&lt;br /&gt;&lt;br /&gt;from ASP 3.0, the instance can be created by using &lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Server.CreateObject("namespace.classname") &lt;span style="font-family:georgia;"&gt;command&lt;br /&gt;&lt;br /&gt;note that you have to provide the &lt;span style="font-style: italic;"&gt;namespace&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;class name&lt;/span&gt; to create the object, the namespace is not required if creating the component in VB 6, instead you can call the class using the &lt;span style="font-style: italic;"&gt;assemblyname.classname&lt;/span&gt; insted&lt;br /&gt;&lt;br /&gt;after creating the object you should be able to call any of the exposed methods for the class. As for the arguments, I passed and returned the primary data types (including string) from my methods in object&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Weird Errors :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Tracing COM errors is a difficult job, I suggest including some built in mechanism for logging events in the class library so it becomes easier to trace if the object breaks.&lt;br /&gt;&lt;br /&gt;another problem I faced during development was non-relevant error messages thrown by ASP 3.0 this really gave me a headache. I spent almost the whole day trying to figure it out when calling one of my methods i kept getting an error that the instance was not set for my object.&lt;br /&gt;&lt;br /&gt;The weird thing was that if I wrote Response.Write with the object name, it showed that the instance was created by printing the namespace and name of the class. At first I couldnt really understand that if the instance is created, but as soon as i call a method i got the error that the object wasnt set to an instance&lt;br /&gt;&lt;br /&gt;Eventually i figured out that this error was caused when my COM object was breaking when i called the method and it gave this weird error about instance not being set.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="font-weight: bold;"&gt;Permissions :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;we had to deploy on win3k server, I faced a number of issues there regarding security&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Inn my class library i had to access registry. while testing the classes in .net test application it worked fine but asp 3.0 pages failed to compile giving the error that access was denied to registry keys.&lt;br /&gt;&lt;br /&gt;this problem occurs because by default in IIS 6.0 IUSR_&lt;machinename&gt; account does not have enough rights to access the registry, &lt;/machinename&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:georgia;"&gt;IUSR_&lt;machinename&gt;is the machine account under which ASP 3.0 apps run&lt;br /&gt;&lt;br /&gt;this can be resolved by giving administrative rights to the IUSR account on the machine, but this solution is not feasible for a lot of production environments.&lt;br /&gt;&lt;br /&gt;the alternative is to register the .net COM with component services, open the run window type &lt;span style="font-weight: bold;"&gt;DCOMCNFG&lt;/span&gt; in win3k which will open the component services snap-in&lt;br /&gt;follow these steps:&lt;br /&gt;&lt;/machinename&gt;&lt;/span&gt;&lt;/span&gt;&lt;/filepath&gt;&lt;ol&gt;&lt;li&gt;add a new COM+ application&lt;/li&gt;&lt;li&gt;create a blank server application&lt;/li&gt;&lt;li&gt;provide the identity to be used by this com which has enough access rights (such as accessing the registry in my case)&lt;/li&gt;&lt;/ol&gt;the new COM+ app should have been created now add you component to this application by adding new component, and selecting from the library thats already registered you should see your &lt;span style="font-style: italic;"&gt;namespace.classname&lt;/span&gt; in the registered components list (you would have to register using regasm.exe before this activity), select the component and add.&lt;br /&gt;&lt;br /&gt;I encountered a problem here that one of the classes i created later was not appearing in the registered list. I traced the problem back to visual studio, it seems that even though make COM visible option was selected, the class still wasnt visible.&lt;br /&gt;&lt;br /&gt;I had to manually include include the attribute [ComVisible(true)] in the class, recompile it and re-register using regasm (although first you would unregister the previously registered dll using regasm /unregister)&lt;br /&gt;&lt;br /&gt;this solved my probem with having not enough access rights to the registry, becuase now i can specify the COM+ application under which identity to run&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Win3k Error : could not create object, access denied :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;you might get this error while trying to create your com object, to resolve this goto the COM+ application you created in component services, right click and go to the properties window. Under the Security tab there should be an option to enforce security checks/access, uncheck that option&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_W04WOjhbHhM/Rgo0UnyTq5I/AAAAAAAAAA0/6FD2FUam97k/s1600-h/2.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_W04WOjhbHhM/Rgo0UnyTq5I/AAAAAAAAAA0/6FD2FUam97k/s320/2.bmp" alt="" id="BLOGGER_PHOTO_ID_5046903861304077202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;it should now work.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;happy COM interoperting!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8733111205723785067-975609205922716251?l=dimaghkidahi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dimaghkidahi.blogspot.com/feeds/975609205922716251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8733111205723785067&amp;postID=975609205922716251' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/975609205922716251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8733111205723785067/posts/default/975609205922716251'/><link rel='alternate' type='text/html' href='http://dimaghkidahi.blogspot.com/2007/03/ponka-achievements-with-com-interop.html' title='Using COM interop services'/><author><name>Danish Shamim</name><uri>http://www.blogger.com/profile/18410843812383347665</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://2.bp.blogspot.com/_W04WOjhbHhM/SQqhDyHuIAI/AAAAAAAAAC0/sx-4rNOP27w/S220/DSC01624.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_W04WOjhbHhM/RgoU0XyTq4I/AAAAAAAAAAs/tkGE0Rr0bH8/s72-c/1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
