<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ÎÜñ&#124;‹ø\/\/ñ [ÐëÞrëçã†ëð]&#039;s Blog &#187; .architecture</title>
	<atom:link href="http://desigeek.com/blog/amit/category/architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://desigeek.com/blog/amit</link>
	<description>Amit Bahree&#039;s insight into stuff…</description>
	<lastBuildDate>Sat, 19 May 2012 07:35:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Concurrency and CEP</title>
		<link>http://desigeek.com/blog/amit/2012/04/18/concurrency-and-cep/</link>
		<comments>http://desigeek.com/blog/amit/2012/04/18/concurrency-and-cep/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 18:36:07 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false">http://desigeek.com/blog/amit/?p=3718</guid>
		<description><![CDATA[The sooner we all understand the Concurrency ≠ CEP (Complex Event Processing), the better the world will be! CEP is generally used when we implement real-time systems (of course that is not the only area where CEP is used). Real-time does not mean concurrent or for that matter high-performing system. Of course there are correlations, [...]]]></description>
			<content:encoded><![CDATA[<p>The sooner we all understand the Concurrency ≠ CEP (Complex Event Processing), the better the world will be! </p>
<p>CEP is generally used when we implement real-time systems (of course that is not the only area where CEP is used). Real-time does not mean concurrent or for that matter high-performing system.</p>
<p>Of course there are correlations, but at the same time they are fundamentally different paradigms.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2012%2F04%2F18%2Fconcurrency-and-cep%2F&amp;title=Concurrency%20and%20CEP" id="wpa2a_2"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2012/04/18/concurrency-and-cep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I am working on today? Optimisation Algorithms</title>
		<link>http://desigeek.com/blog/amit/2012/03/17/what-i-am-working-on-today-optimisation-algorithms/</link>
		<comments>http://desigeek.com/blog/amit/2012/03/17/what-i-am-working-on-today-optimisation-algorithms/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 09:34:32 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false">http://desigeek.com/blog/amit/?p=3704</guid>
		<description><![CDATA[I often get the question – a what am I working on today? Some of the things I can’t discuss in an open forum, but some I can. Those that I can, I thought it was best to share via my blog and do quick small posts on it. Will this become a new series? [...]]]></description>
			<content:encoded><![CDATA[<p>I often get the question – a what am I working on today? Some of the things I can’t discuss in an open forum, but some I can. Those that I can, I thought it was best to share via my blog and do quick small posts on it. Will this become a new series? Well time will tell – depends on how much bandwidth I will have.</p>
<p>This weekend, I am researching <a href="http://en.wikipedia.org/wiki/Optimization_(mathematics)" target="_blank">Optimisation Algorithms</a> – both Deterministic and Probabilistic. Specifically interested in <a href="http://en.wikipedia.org/wiki/Swarm_intelligence" target="_blank">Swarm Intelligence</a> (which are a type of Monte Carlo algorithm) and in that in <a href="http://en.wikipedia.org/wiki/Swarm_intelligence#Ant-based_routing" target="_blank">Ant Colony</a> and <a href="http://en.wikipedia.org/wiki/Swarm_intelligence#Crowd_simulation" target="_blank">Particle Swarm</a> routing are the main ones I am researching.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2012%2F03%2F17%2Fwhat-i-am-working-on-today-optimisation-algorithms%2F&amp;title=What%20I%20am%20working%20on%20today%3F%20Optimisation%20Algorithms" id="wpa2a_4"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2012/03/17/what-i-am-working-on-today-optimisation-algorithms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Occasionally Connected Architecture</title>
		<link>http://desigeek.com/blog/amit/2011/06/16/occasionally-connected-architecture/</link>
		<comments>http://desigeek.com/blog/amit/2011/06/16/occasionally-connected-architecture/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 04:56:20 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false">http://desigeek.com/blog/amit/2011/06/16/occasionally-connected-architecture/</guid>
		<description><![CDATA[When implementing an occasionally connected architecture for a solution, there are three fundamental requirements: Part of the overall solution, some smart client is deployed and installed on the desktop and a web only approach is not possible. The main rational being that a smart client can work in a disconnected mode which of course with [...]]]></description>
			<content:encoded><![CDATA[<p>When implementing an occasionally connected architecture for a solution, there are three fundamental requirements:</p>
<ol>
<li>Part of the overall solution, some smart client is deployed and installed on the desktop and a web only approach is not possible. The main rational being that a smart client can work in a disconnected mode which of course with a web application is not possible. </li>
<li>Underlying infrastructure needs to be in place to support this. Infrastructure is not specifically networks and servers, but also both the operational environment and the user’s environment and machine. The operational environments need to allow things such as: data caching, local storage of user data, user profile details, etc. </li>
<li>More robust exception management process – this is not only about handling errors but also understanding the fact that the application is in a disconnected state and needs to do things differently.</li>
</ol>
<p>When designing an occasionally connected application, there are two design approaches that one can take &#8211; data centric or service oriented.</p>
<p><strong></strong></p>
<ol>
<li><strong><span style="font-weight: normal"><strong>Data Centric</strong> – Applications had a RDBMS of some sort installed locally and use the built-in capabilities of that RDBMS to propagate and sync data including resolving any conflicts.</span></strong>
<ol>
<li>Server publishes data, which a client subscribes to and is copied locally. The conflict resolution (as changes can be both on the server or client) needs to be agreed upfront. </li>
<li>Generally the database’s built-in conflict resolution is used – this makes it simpler for the application as one does not need to build this in the application. </li>
<li>As there is only one data repository, the data convergence is guaranteed between the client and the server. </li>
<li>Both the client and the server are tightly coupled. </li>
<li>As a database needs to run locally, machines with small footprints or devices such as mobile phones will not be able to run this. </li>
<li>If deployment is an issue then there is more work required here. </li>
</ol>
</li>
<li><strong>Service-Oriented</strong> – Applications use the SOA paradigm and store information in messages which are queued (when disconnected) and send to the server when connected for processing.
<ol>
<li>The client can interact with any service required and focuses on the service requests instead of the local data i.e. are loosely coupled. </li>
<li>No local RDBMS required; of course some state information would still need to be saved. </li>
<li>Better when needs to interact outside of the firewall (e.g. Internet or Intranet) </li>
<li>Deployment is still required, but is simpler. </li>
</ol>
</li>
</ol>
<p>For Data centric application, from a design perspective the following aspects should be factored in:</p>
<ol>
<li>Application needs to be aware of the merge-replication schemes that are implemented as the application needs to optimise for data updates and conflicts. </li>
<li>As a result, ACID properties are not used for transactions; instead a pub-sub model is implemented. </li>
</ol>
<p>On the other hand, for Service-oriented apps, the application design should address the following:</p>
<ul>
<li>Application has to implement asynchronous communication. </li>
<li>Overall solution needs to keep all the network interactions simple and cannot be complex. </li>
<li>Application needs to add data caching capabilities </li>
<li>Application needs to implement robust connection management (e.g. Manual vs. Automatic) </li>
<li>Implement a store-and-forward mechanism such as using MSMQ. </li>
<li>Application needs to implement a robust data and business rule conflict manager. </li>
<li>Interacting with CRUD like Web services. </li>
<li>The application and the work can be logically broken into “chunks” to allow one using a task-based approach. </li>
<li>The application should be able to handle both forward and reverse dependencies which in turn could be complex business logic. </li>
</ul>
<p>As a high level guide, a data centric approach should be used when:</p>
<ul>
<li>One can deploy a database instance on the client. </li>
<li>The application can function in a two-tier environment. </li>
<li>One can tightly couple the client to the server through data schema definitions and communication protocol. </li>
<li>There is a need for built-in change tracking and synchronization. </li>
<li>One wants to rely on the database to handle data reconciliation conflicts and minimize the amount of custom reconciliation code that needs to be written. </li>
<li>There is no need to interact with multiple disparate services. </li>
<li>Users are able to connect to a database directly through a LAN/VPN/IPsec. </li>
</ul>
<p>And, a service oriented approach should be taken when:</p>
<ul>
<li>One wants to decouple the client and server to allow independent versioning and deployment. </li>
<li>There is a need for more control and flexibility over data reconciliation issues. </li>
<li>The delivery team has expertise to write more advanced application infrastructure code. </li>
<li>There is a need for a lightweight client footprint. </li>
<li>The applications can be structured into a service-oriented architecture. </li>
<li>There is a need for specific business functionality (for example, custom business rules and processing, flexible reconciliation, and so on).
<ul>
<li>Note: One might also need to look at a few good rules engine if this is the case. </li>
</ul>
</li>
<li>One needs control over the schema of data stored on the client and flexibility that might be different from the server. </li>
<li>The application needs to interact with multiple services using different communication technologies (Web services, Message Queuing, RPC, etc.). </li>
<li>There is a need for a custom security scheme. </li>
<li>The application needs to operate outside of the firewall. </li>
</ul>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2011%2F06%2F16%2Foccasionally-connected-architecture%2F&amp;title=Occasionally%20Connected%20Architecture" id="wpa2a_6"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2011/06/16/occasionally-connected-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ Message queuing options?</title>
		<link>http://desigeek.com/blog/amit/2010/12/29/c-message-queuing-options/</link>
		<comments>http://desigeek.com/blog/amit/2010/12/29/c-message-queuing-options/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 00:04:31 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>
		<category><![CDATA[.code]]></category>
		<category><![CDATA[.opensource]]></category>

		<guid isPermaLink="false">http://desigeek.com/blog/amit/?p=3439</guid>
		<description><![CDATA[I am thinking of implementing a queue in one of the projects I am working on right now (sorry cannot go into more details until it gets published &#8211; hopefully in a few months). Anywyas, this is in C++ which needs to run on Ubuntu and my queueing experience (with C++ or otherwise) is only [...]]]></description>
			<content:encoded><![CDATA[<p>I am thinking of implementing a queue in one of the projects I am working on right now (sorry cannot go into more details until it gets published &#8211; hopefully in a few months). Anywyas, this is in C++ which needs to run on Ubuntu and my queueing experience (with C++ or otherwise) is only with <a href="http://msdn.microsoft.com/en-us/library/ms711472(VS.85).aspx">MSMQ</a> which is brilliant, but does not help me here as that run only on Windows. I also cannot use something like <a href="http://www.cplusplus.com/reference/stl/queue/" target="_blank">STL Queue</a> as this will need to run across a number of machines and trying to sync between them would a royal pain. In other words, this needs to be distributed and async &#8220;loose&#8221; messaging.  <img src='http://desigeek.com/blog/amit/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I am already using <a href="http://desigeek.com/blog/amit/2010/11/06/moos/">MOOS</a>, so one option is for me to continue to use that &#8211; however this is for another part of the application and it <em>might</em> be easier for me to use something else (still need to think it through a little more).</p>
<p>These are the requirements (these are must haves!). Also if it makes a difference I am using <a href="http://eclipse.org/cdt/" target="_blank">CDT</a> for this project.</p>
<ul>
<li>Needs to be able to run on Ubuntu 9.04 (and higher)</li>
<li>Needs to be Open Source (cannot be commercial)</li>
<li>Needs to be able to store messages &#8220;offline&#8221;</li>
<li>Needs to be able to run on TCP with minimal dependencies. It would be nice not to have a whole bunch of underlying dependencies.</li>
<li>Preferably be easy to use (as a consumer) &#8211; I don&#8217;t have much time to read through loads of documentation just to get my head around the underlying object model and how to use it.</li>
<li>C++ support (if it was not obvious until now)</li>
</ul>
<p>I did a little research online and came across the following, and wanted to get some feedback:</p>
<ul>
<li><a href="http://activemq.apache.org/" target="_blank">ActiveMQ</a> &#8211; seems like it has good C++ support via <a href="http://activemq.apache.org/cms/" target="_blank">CMS</a> (C++ Messaging Service).</li>
<li><a href="http://aws.amazon.com/sqs/" target="_blank">Amazon SQS</a> &#8211;  not sure how good the C++ support is. If there is no library per se that I can use, then writing things around REST APIs might be more painful. Also I suddenly have a dependency to be able to go to the public internet. Also it is not free (though there is a free 100K messages / month).</li>
<li><a href="Amateurish" target="_blank">MQ4CPP</a> &#8211; seems quite amateurish (kudos to the guy writing it though &#8211; seems like an interesting project to pick up when once has time).</li>
<li><a href="http://www.rabbitmq.com/" target="_blank">RabbitMQ</a> &#8211; I know some guys used this at work (though that was using it in .NET); nothing for C++, but there <a href="http://www.rabbitmq.com/download-ex.html#rabbitmq-c" target="_blank">some C experimental code</a>; overall does not inspire confidence (in the context of C++).</li>
<li>OpenAMQ &#8211; seems quite interesting and also has a <a href="http://www.openamq.org/doc:prog-wireapi" target="_blank">C++ API</a> based on its WireAPI.</li>
<li>Anything else??</li>
</ul>
<p>At face value it seems like this is down to ActiveMQ and OpenAMQ. Just looking at the quick samples between the two ActiveMQ seems like more<a href="http://activemq.apache.org/cms/example.html" target="_blank"> C++ friendly</a> and easier to use <a href="http://www.openamq.org/doc:prog-wireapi" target="_blank">compared to OpenAMQ</a>. Of course this is just the first impression and I could be completely wrong &#8211; it is not like I have had a chance to play with this (yet anyways).</p>
<p>Does anyone have any experience and feedback on this matter? Feel free to comment on this post, or tweet me.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2010%2F12%2F29%2Fc-message-queuing-options%2F&amp;title=C%2B%2B%20Message%20queuing%20options%3F" id="wpa2a_8"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2010/12/29/c-message-queuing-options/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MOOS</title>
		<link>http://desigeek.com/blog/amit/2010/11/06/moos/</link>
		<comments>http://desigeek.com/blog/amit/2010/11/06/moos/#comments</comments>
		<pubDate>Sat, 06 Nov 2010 21:17:03 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>
		<category><![CDATA[.opensource]]></category>

		<guid isPermaLink="false">http://desigeek.com/blog/amit/?p=3397</guid>
		<description><![CDATA[I don&#8217;t think many people have heard of MOOS (which stands of Mission Oriented Operating Suite); I have been working with it for the past few months as part of my dissertation. And I must admit, the more I play with it, the more impressed I am. It is quite simple and yet powerful. Whilst [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t think many people have heard of <a href="http://www.robots.ox.ac.uk/~mobile/MOOS/wiki/pmwiki.php/Main/Introduction" target="_blank">MOOS</a> (which stands of Mission Oriented Operating Suite); I have been working with it for the past few months as part of my dissertation. And I must admit, the more I play with it, the more impressed I am. It is quite simple and yet powerful.</p>
<p>Whilst MOOS&#8217;s roots are in robotics (<a href="http://www.robots.ox.ac.uk/~mobile/wikisite/pmwiki/pmwiki.php" target="_blank">MRG</a>) and embedded systems, I wonder if I can extend it to use it some of the grid computing scenarios. Maybe implement a pMapReduce or pHadoop? Or perhaps a .NET implementation. Hmm, just need some time. If you need a robust, cross platform communication layer then check out <a href="http://www.robots.ox.ac.uk/~mobile/MOOS/wiki/pmwiki.php/Main/Introduction" target="_blank">MOOS</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2010%2F11%2F06%2Fmoos%2F&amp;title=MOOS" id="wpa2a_10"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2010/11/06/moos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analysis of Algorithms</title>
		<link>http://desigeek.com/blog/amit/2010/03/26/analysis-of-algorithms/</link>
		<comments>http://desigeek.com/blog/amit/2010/03/26/analysis-of-algorithms/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 18:50:40 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>
		<category><![CDATA[.geek]]></category>

		<guid isPermaLink="false">http://desigeek.com/blog/amit/2010/03/26/analysis-of-algorithms/</guid>
		<description><![CDATA[If you were interested in algorithms and interested in some mathematical foundations for algorithm analysis? For example if you are interested in proof techniques, probability, Amortization analysis techniques, Case studies and Asymptotic notions (such as Big-Oh, Big-Omega, Little-oh, little-omega, Big-Theta) then check out these lecture notes (in ppt, 224kb) from California State University.]]></description>
			<content:encoded><![CDATA[<p>If you were interested in algorithms and interested in some mathematical foundations for algorithm analysis? For example if you are interested in proof techniques, probability, Amortization analysis techniques, Case studies and Asymptotic notions (such as Big-Oh, Big-Omega, Little-oh, little-omega, Big-Theta) then check out <a href="http://csc.csudh.edu/jhan/Spring2005/csc401/LectureNotes/LectureNotes02.ppt" target="_blank">these lecture notes</a> (in ppt, 224kb) from California State University.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2010%2F03%2F26%2Fanalysis-of-algorithms%2F&amp;title=Analysis%20of%20Algorithms" id="wpa2a_12"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2010/03/26/analysis-of-algorithms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good UML Tool (and free too)</title>
		<link>http://desigeek.com/blog/amit/2007/12/03/good-uml-tool-and-free-too/</link>
		<comments>http://desigeek.com/blog/amit/2007/12/03/good-uml-tool-and-free-too/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 23:40:38 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Love it or hate it UML is important for anyone involved (Architect/Developer/Whoever) &#8211; either you need to create designs based on UML and you need to understand that someone else has. Sure it has its challenges and for some specific things there are better solutions (DSL&#39;s &#8211; more on that some other day). I am [...]]]></description>
			<content:encoded><![CDATA[<p>Love it or hate it UML is important for anyone involved (Architect/Developer/Whoever) &#8211; either you need to create designs based on UML and you need to understand that someone else has. Sure it has its challenges and for some specific things there are better solutions (DSL&#39;s &#8211; more on that some other day). I am &quot;old school&quot; and over the years have used <a href="http://www-306.ibm.com/software/awdtools/developer/rose/index.html" target="_blank">Rational Rose</a> (or whatever IBM has renamed it to since buying Rational out).</p>
<p>But as are aware Rational tools are very pricey and I was on the look out for something reasonable. Most people have heard of <a href="http://www.sparxsystems.com.au/products/ea.html" target="_blank">EA</a> (no, not the game company) which is a decent tool and not too expensive (at least the Desktop edition). </p>
<p>Of course if you are stingy like me and want something completely free then check out <a href="http://www.staruml.com/" target="_blank">StarUML</a> which is an open source UML/MDA platform and is pretty decent. When you work with it enough you will find some annoying things &#8211; most of which has workarounds. There are one or two things it just cannot do, but I only have been using it for a few months now and am quite impressed. Is it better than the likes of <a href="http://www.sparxsystems.com.au/products/ea.html" target="_blank">EA</a> or Rose, nope but it is pretty damn good for the price.</p>
<p><a href="http://www.bahree.com/amit/blog_images/GoodUMLTool_D0E7/image.png" rel="lightbox[981]"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="146" alt="image" src="http://www.bahree.com/amit/blog_images/GoodUMLTool_D0E7/image_thumb.png" width="240" border="0" /></a> <img src="http://staruml.sourceforge.net/image/staruml-screenshot.jpg" alt="" /></p>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=5141" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2007%2F12%2F03%2Fgood-uml-tool-and-free-too%2F&amp;title=Good%20UML%20Tool%20%28and%20free%20too%29" id="wpa2a_14"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2007/12/03/good-uml-tool-and-free-too/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rules of Threading</title>
		<link>http://desigeek.com/blog/amit/2007/09/20/rules-of-threading/</link>
		<comments>http://desigeek.com/blog/amit/2007/09/20/rules-of-threading/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 09:02:27 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As Mr. Kale so eloquently puts it (and of course 100% correct): If you think you need multi-threading, you&#39;re wrong If your specification says &#34;you need threading&#34;, see Rule 1 (For advanced users only) If you think you need multi-threading, you&#39;re probably wrong.]]></description>
			<content:encoded><![CDATA[<p>As Mr. Kale so eloquently puts it (and of course 100% correct):
<ol>
<li>If you think you need multi-threading, you&#39;re wrong </li>
<li>If your specification says &quot;you need threading&quot;, see Rule 1 </li>
<li>(For advanced users only) If you think you need multi-threading, you&#39;re <em>probably</em> wrong.</li>
</ol>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=4662" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2007%2F09%2F20%2Frules-of-threading%2F&amp;title=Rules%20of%20Threading" id="wpa2a_16"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2007/09/20/rules-of-threading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Architect Insight presentations available</title>
		<link>http://desigeek.com/blog/amit/2007/03/16/architect-insight-presentations-available/</link>
		<comments>http://desigeek.com/blog/amit/2007/03/16/architect-insight-presentations-available/#comments</comments>
		<pubDate>Fri, 16 Mar 2007 07:40:45 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I had the opportunity to present on .NET 3.0 in the Enterprise at the Architect Insight Conference hosted by Microsoft earlier this month. All the presentations from the conference are available for download&#160;and of course including my presentation&#160;(13.6 mb).]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://desigeek.com/weblog/amit/archive/2007/02/15/microsoft-architect-insight-conference.aspx">had the opportunity to present</a> on .NET 3.0 in the Enterprise at the Architect Insight Conference hosted by Microsoft earlier this month. All the presentations from the conference are <a href="http://www.microsoft.com/uk/msdn/architecture/architectinsight/2007download.mspx" target="_blank">available for download</a>&nbsp;and of course <a href="http://download.microsoft.com/documents/uk/msdn/architecture/architectinsight/2007/Collaboration/COL05-NET-3.0-in-the-Enterprise.ppt">including my presentation</a>&nbsp;(13.6 mb).</p>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=3643" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2007%2F03%2F16%2Farchitect-insight-presentations-available%2F&amp;title=Architect%20Insight%20presentations%20available" id="wpa2a_18"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2007/03/16/architect-insight-presentations-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Architect Insight Conference</title>
		<link>http://desigeek.com/blog/amit/2007/02/15/microsoft-architect-insight-conference/</link>
		<comments>http://desigeek.com/blog/amit/2007/02/15/microsoft-architect-insight-conference/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 20:38:15 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Microsoft hosts an annual event in the UK called the Architect Insight Conference. I am one of the speakers this year and will be presenting on &#8220;.NET 3.0 in the Enterprise&#8221;. This is a pretty good event and I would recommend it&#160;if you have not been to one of these. You can check out the [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft hosts an annual event in the UK called the <a href="http://www.microsoft.com/uk/msdn/architecture/architectinsight/default.mspx" target="_blank">Architect Insight Conference</a>. I am one of the speakers this year and will be presenting on &#8220;.NET 3.0 in the Enterprise&#8221;. This is a pretty good event and I would recommend it&nbsp;if you have not been to one of these. You can check out the <a href="http://www.microsoft.co.uk/Events/registermulti.aspx?event=ArchitectInsight2007" target="_blank">Agenda here</a> and if you want, <a href="http://www.microsoft.co.uk/Events/registermulti.aspx?event=ArchitectInsight2007" target="_blank">register here</a>&nbsp;and you can find out more information on <a href="http://microsoft.com/uk/msdn/architecture/architectinsight/2007speakers.mspx" target="_blank">the Speakers here</a>. Here is a blurb from Microsoft on what can you expect to hear:</p>
<blockquote><p>You’ll be able to engage in the technology debate with thought-provoking in-depth sessions from customer and partner architects along with members of the UK Microsoft Architect Council such as Avanade, Capgemini, Conchango and Solidsoft. </p>
<p>The agenda is split into seven tracks covering Enterprise, Real World, Identity, Lifecycle, SaaS, Collaboration and Dynamic Systems; the main content sessions will be 75 or 150 minutes in length to accommodate the different formats and levels of interaction that may be required.
<p>There will be an emphasis on architectural ‘investigation’ through the use of small focus groups, as well as a structured networking clinic where individuals from similar vertical business backgrounds can discuss and work through a particular problem domain. </p>
</blockquote>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=3632" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2007%2F02%2F15%2Fmicrosoft-architect-insight-conference%2F&amp;title=Microsoft%20Architect%20Insight%20Conference" id="wpa2a_20"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2007/02/15/microsoft-architect-insight-conference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One man&#039;s feature is another man&#039;s bloat &#8211; The Java Performance Debate</title>
		<link>http://desigeek.com/blog/amit/2005/06/14/one-mans-feature-is-another-mans-bloat-the-java-performance-debate/</link>
		<comments>http://desigeek.com/blog/amit/2005/06/14/one-mans-feature-is-another-mans-bloat-the-java-performance-debate/#comments</comments>
		<pubDate>Tue, 14 Jun 2005 16:48:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Firstly this is not a Java bashing and I don&#8217;t preach to say .NET/C++, etc is faster. However, based on what I have seen it sure is slow &#8211; slow like a snail. Maybe its the time that takes to load the VM or maybe it Swing &#8211; gurk! I like how Andy puts it [...]]]></description>
			<content:encoded><![CDATA[<p>Firstly this is not a Java bashing and I don&#8217;t preach to say .NET/C++, etc is faster. However, based on what I have seen it sure is slow &#8211; slow like a snail. Maybe its the time that takes to load the VM or maybe it Swing &#8211; gurk! I like how Andy puts it &#8211; &#8220;One man&#8217;s feature is another man&#8217;s bloat&#8221;. He has a <a href="http://www.osnews.com/story.php?news_id=10729">very objective article</a> on the area which are slow, what Sun is doing to address it and what the main issues (with the developers) are &#8211; who don&#8217;t know how to use it. He talks about the Memory, JVM, Desktop and Java2D<img src="http://desigeek.com/weblog/aggbug.aspx?PostID=1143" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2005%2F06%2F14%2Fone-mans-feature-is-another-mans-bloat-the-java-performance-debate%2F&amp;title=One%20man%27s%20feature%20is%20another%20man%27s%20bloat%20%E2%80%93%20The%20Java%20Performance%20Debate" id="wpa2a_22"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2005/06/14/one-mans-feature-is-another-mans-bloat-the-java-performance-debate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CLR: Under the Hood</title>
		<link>http://desigeek.com/blog/amit/2005/06/02/clr-under-the-hood/</link>
		<comments>http://desigeek.com/blog/amit/2005/06/02/clr-under-the-hood/#comments</comments>
		<pubDate>Thu, 02 Jun 2005 17:13:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The CLR team has a couple of slides from their roadshow where they talk about two tracks, one discusses what happens insight the CLR, if you have some of the books recommended in the presentation, none of this would be new to you. It covers things like the IL which is the abstract representation of [...]]]></description>
			<content:encoded><![CDATA[<p>The CLR team has a <a href="http://www.microsoft.com/downloads/details.aspx?familyid=12f73ce1-7144-4077-b88d-976d82d64c6d&amp;displaylang=en">couple of slides from their roadshow</a> where they talk about two tracks, one discusses what happens insight the CLR, if you have some of the books recommended in the presentation, none of this would be new to you. It covers things like the IL which is the abstract representation of an execution semantic and how that is represented using an abstract stack machine, where we consecutively execute each instruction, using the stack as the evaluation of that execution and how this stack abstraction works. And two, there is a discussion on perf engineering including the GC, costs and pitfalls, etc.</p>
<p>On a different note, been out and about on a few days of holiday with family visiting, but its good to be back now. <img src='http://desigeek.com/blog/amit/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=764" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2005%2F06%2F02%2Fclr-under-the-hood%2F&amp;title=CLR%3A%20Under%20the%20Hood" id="wpa2a_24"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2005/06/02/clr-under-the-hood/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which encoding is better for webservices?</title>
		<link>http://desigeek.com/blog/amit/2005/04/12/which-encoding-is-better-for-webservices/</link>
		<comments>http://desigeek.com/blog/amit/2005/04/12/which-encoding-is-better-for-webservices/#comments</comments>
		<pubDate>Tue, 12 Apr 2005 18:25:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[There are two options when it comes to encoding in the context of webservices, e.g. .NET and Weblogic use document literal encoding while IBM and other vendors (Java) use RPC encoding. What is the difference and which one is better for which scenarios? Also, how easy is it to switch between the two? Well for [...]]]></description>
			<content:encoded><![CDATA[<p>There are two options when it comes to encoding in the context of webservices, e.g. .NET and Weblogic use document literal encoding while IBM and other vendors (Java) use RPC encoding. What is the difference and which one is better for which scenarios? Also, how easy is it to switch between the two?</p>
<p>Well for those new to webservices, there are two options that you can choose when encoding your wsdl messages.</p>
<p>So, how do they look like. If I &#8220;borrow&#8221; and example from <a href="http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns/">Sun</a>, if below was your original class in Java:<!--StartFragment --></p>
<p><code><br />
package com.examples.xmlstring;<br />
import java.rmi.Remote;<br />
<br />
import java.rmi.RemoteException;<br />
<br />
public interface IStringService extends Remote {<br />
    <br />
&nbsp;&nbsp;&nbsp; public String sayXMLHello(String xml) <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throws RemoteException;<br />
&nbsp;&nbsp;&nbsp; }</code>
<p>The rpc encoding for that looks like this:</p>
<p><code>&lt;binding name="IStringServiceBinding" type="tns:IStringService"&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http"<br />
<b>style="rpc"</b>/&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;operation name="sayXMLHello"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;soap:operation soapaction=""/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&lt;soap:body encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" <b>use="encoded"</b> namespace="http://www.examples.com/wsdl/StringService"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/input&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;output&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&lt;soap:body encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" <b>use="encoded"</b> namespace="http://www.examples.com/wsdl/StringService"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/output&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;/operation&gt;<br />
&lt;/binding&gt;</p>
<p></code></p>
<p>And the document encoding looks like:</p>
<p><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;env:envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"<br />
xmlns:xsd="http://www.w3.org/2001/XMLSchema"<br />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"<br />
    xmlns:ns0="http://www.examples.com/types"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;env:body&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ns0:sayxmlhello&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string_1&gt;Hello World&lt;/string_1&gt;<br />
  <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ns0:sayxmlhello&gt;<br />
 <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/env:body&gt;<br />
&lt;/env:envelope&gt;</code></p>
<p>I think in the end the real thing to keep in perspective is who and what will be consuming this? If your clients are primarily MS-based (COM/.NET) then you are better off with literal encoding, on the other hand if its primarily J2EE client then you are better off with the other one. But, more interestingly if you don&#8217;t know (or in other words can be both), then which road to take?</p>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=672" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2005%2F04%2F12%2Fwhich-encoding-is-better-for-webservices%2F&amp;title=Which%20encoding%20is%20better%20for%20webservices%3F" id="wpa2a_26"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2005/04/12/which-encoding-is-better-for-webservices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Services are not distributed objects</title>
		<link>http://desigeek.com/blog/amit/2005/03/24/web-services-are-not-distributed-objects/</link>
		<comments>http://desigeek.com/blog/amit/2005/03/24/web-services-are-not-distributed-objects/#comments</comments>
		<pubDate>Thu, 24 Mar 2005 04:20:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Werner Vogel, CTO of Amazon.com has an article which was published a few months ago where we talks about the misconception of how most people think that web services are distributed objects. Here is an excerpt from the article. The hype surrounding Web services has generated many common misconceptions about the fundamentals of this emerging [...]]]></description>
			<content:encoded><![CDATA[<p>Werner Vogel, CTO of Amazon.com <a href="http://weblogs.cs.cornell.edu/AllThingsDistributed/archives/000343.html">has an article</a> which was published a few months ago where we talks about the misconception of how most people think that web services are distributed objects. Here is an excerpt from the article.
</p>
<blockquote><p>The hype surrounding Web services has generated many common misconceptions about the fundamentals of this emerging technology.
</p>
<p>Web services are frequently described as the latest incarnation of distributed object technology. This misconception, perpetuated by people from both industry and academia, seriously limits broader acceptance of the true Web services architecture. Although the architects of many distributed and Internet systems have been vocal about the differences between Web services and distributed objects, dispelling the myth that they are closely related appears difficult.
</p>
<p>Many believe that Web services is a distributed systems technology that relies on some form of distributed object technology. Unfortunately, this is not the only common misconception about Web services. In this article, I seek to clarify several widely held beliefs about the technology that are partially or completely wrong.
</p>
<p><b>Fundamental Errors</b>: At the International World Wide Web Conference in May 2003, a smart and gifted Internet architect I will call Peter asked me, &#8220;Don&rsquo;t you think Web services will fail like all the other wide-area distributed object technologies that people have tried to build?&#8221; I was baffled. How could someone like Peter still view Web services as distributed object technology? Yet, he is not alone in his stubbornness: many developers, architects, managers, and academics still see Web services as the next episode in a saga that includes Corba, DCOM, and remote method invocation (RMI). Web services are distributed systems technologies, but that is where the common ground ends. The only possible relation is that Web services are now sometimes deployed in areas where distributed object applications have failed in the past. Within the distributed technology world, it is probably more appropriate to associate Web services with messaging technologies because they share a common architectural view, although they address different application types.
</p>
<p>Given that Web services are based on XML documents and document exchange, we could say their technological underpinning is document-oriented computing. However, exchanging documents is very different from requesting an object&rsquo;s instantiation, requesting a method&rsquo;s invocation on the basis of the specific object instance, receiving that invocation&rsquo;s result in a response, and releasing the object instance after several such exchanges.
</p>
<p>I frequently encounter about a dozen other statements that fall into the same basic category. I hear people say, for example, that &#8220;Web services are just remote procedure calls for the Internet,&#8221; or &#8220;You need HTTP to make Web services work.&#8221; Before addressing several of the more common misconceptions, we should define a Web service in its purest form in order to begin with a clear model.</p>
</blockquote>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=644" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2005%2F03%2F24%2Fweb-services-are-not-distributed-objects%2F&amp;title=Web%20Services%20are%20not%20distributed%20objects" id="wpa2a_28"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2005/03/24/web-services-are-not-distributed-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Examination of Data Structures in .NET 2.0</title>
		<link>http://desigeek.com/blog/amit/2005/03/01/examination-of-data-structures-in-net-2-0/</link>
		<comments>http://desigeek.com/blog/amit/2005/03/01/examination-of-data-structures-in-net-2-0/#comments</comments>
		<pubDate>Tue, 01 Mar 2005 17:01:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[You might have seen this already, if not, MSDN has a six-part article extensively examining the data structures in .NET 2.0 covering the usual suspects and then some not-so-usual unless you have written some compilers such as BST’s, graphs, red-back trees, etc. Quite an interesting read when you have some time.]]></description>
			<content:encoded><![CDATA[<p>You might have seen this already, if not, MSDN has a <a href="http://msdn.microsoft.com/vcsharp/using/understanding/netfundamentals/datastructures/">six-part article extensively examining</a> the data structures in .NET 2.0 covering the usual suspects and then some not-so-usual unless you have written some compilers such as BST’s, graphs, red-back trees, etc. Quite an interesting read when you have some time.</p>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=615" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2005%2F03%2F01%2Fexamination-of-data-structures-in-net-2-0%2F&amp;title=Examination%20of%20Data%20Structures%20in%20.NET%202.0" id="wpa2a_30"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2005/03/01/examination-of-data-structures-in-net-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enterprise Library</title>
		<link>http://desigeek.com/blog/amit/2005/01/29/enterprise-library/</link>
		<comments>http://desigeek.com/blog/amit/2005/01/29/enterprise-library/#comments</comments>
		<pubDate>Sat, 29 Jan 2005 14:39:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Microsoft released the Enterprise Library based on ACA.NET which our engineering guys here at Avanade, work their butts off! Enterprise Library features new and updated versions of application blocks that were previously available as stand-alone application blocks. All Enterprise Library application blocks have been updated with a particular focus on consistency, extensibility, ease of use, [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft released the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/entlib.asp">Enterprise Library</a> based on <a href="http://www.avanade.com/_uploaded/pdf/solution/acanet.pdf">ACA.NET</a> which our engineering guys here at Avanade, work their butts off! Enterprise Library features new and updated versions of application blocks that were previously available as stand-alone application blocks. All Enterprise Library application blocks have been updated with a particular focus on consistency, extensibility, ease of use, and integration. </p>
<p>The application blocks that comprise the Enterprise Library are the following: </p>
<ul>
<li>Caching Application Block. This application block allows developers to incorporate a local cache in their applications.
<li>Configuration Application Block. This application block allows applications to read and write configuration information.
<li>Data Access Application Block. This application block allows developers to incorporate standard database functionality in their applications.
<li>Cryptography Application Block. This application block allows developers to include encryption and hashing functionality in their applications.
<li>Exception Handling Application Block. This application block allows developers and policy makers to create a consistent strategy for processing exceptions that occur throughout the architectural layers of enterprise applications.
<li>Logging and Instrumentation Application Block. This application block allows developers to incorporate standard logging and instrumentation functionality in their applications.
<li>Security Application Block. This application block allows developers to incorporate security functionality in their applications. Applications can use the application block in a variety of situations, such as authenticating and authorising users against a database, retrieving role and profile information, and caching user profile information.</li>
</ul>
<p>Different applications have different requirements and you will not find that every application block is useful in every application that you build. Before using an application block, you should have a good understanding of your application requirements and of the scenarios that the application block is designed to address.</p>
<p>You can also get some more information on <a href="http://weblogs.asp.net/tomholl/">Tom&#8217;s blog</a>.</p>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=578" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2005%2F01%2F29%2Fenterprise-library%2F&amp;title=Enterprise%20Library" id="wpa2a_32"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2005/01/29/enterprise-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing .NET Application Blocks (Version 1.0)</title>
		<link>http://desigeek.com/blog/amit/2005/01/18/testing-net-application-blocks-version-1-0/</link>
		<comments>http://desigeek.com/blog/amit/2005/01/18/testing-net-application-blocks-version-1-0/#comments</comments>
		<pubDate>Tue, 18 Jan 2005 17:55:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[A little while ago while I was one of the industry advisors for the PAG group at Microsoft. One of the last things I did in that capacity was provide input to the the Testing App blocks for MS. Microsoft has finally released this and can be downloaded here. Testing .NET Application Blocks covers many [...]]]></description>
			<content:encoded><![CDATA[<p>A little while ago while I was one of the industry advisors for the <a href="http://www.microsoft.com/resources/practices/">PAG group</a> at Microsoft. One of the last things I did in that capacity was provide input to the the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/mtf.asp">Testing App blocks</a> for MS. Microsoft has finally released this and can be <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=BC99325A-59AE-401D-9812-D40D10366396&#038;displaylang=en">downloaded here</a>.
</p>
<blockquote><p>Testing .NET Application Blocks covers many testing areas that were used during testing and verification of the various application blocks provided by Microsoft&#8217;s patterns &#038; practices group, such as functional, globalization, performance, integration, and security. The guide uses code examples, sample test cases, and checklists to demonstrate how to plan and implement each type of test; the guide also recommends tools to use to run the tests. It covers test considerations to be taken into account when customizing these application blocks or integrating them with your own applications.</p>
<p>Because this guide focuses on testing NET application blocks, its scope does not include user interface (UI) testing or database testing. Although the guidance is developed within the context of Microsoft patterns &#038; practices application blocks, it still applies to testing .NET code in general.</p>
</blockquote>
<div class="media">[Listening to: Nach Deutschland - The Bourne Supremacy - The Bourne Supremacy (02:40)]</div>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=563" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2005%2F01%2F18%2Ftesting-net-application-blocks-version-1-0%2F&amp;title=Testing%20.NET%20Application%20Blocks%20%28Version%201.0%29" id="wpa2a_34"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2005/01/18/testing-net-application-blocks-version-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Concurrency and Mobile Applications</title>
		<link>http://desigeek.com/blog/amit/2004/11/27/data-concurrency-and-mobile-applications/</link>
		<comments>http://desigeek.com/blog/amit/2004/11/27/data-concurrency-and-mobile-applications/#comments</comments>
		<pubDate>Sat, 27 Nov 2004 01:31:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As I start working on some stuff, I have been thinking of this. Essentially when you are dealing with mobile devices, by their very nature they are disconnected in nature, and not always on a network (such as desktop or laptop). In multi-user environments, the challenge is how to you keep the data concurrent between [...]]]></description>
			<content:encoded><![CDATA[<p>As I start working on some stuff, I have been thinking of this. Essentially when you are dealing with mobile devices, by their very nature they are disconnected in nature, and not always on a network (such as desktop or laptop). In multi-user environments, the challenge is how to you keep the data concurrent between the &#8220;online&#8221; and &#8220;offline&#8221; version? Typically there are two scenarios either you do optimistic concurrency or pessimistic concurrency. The earlier being a device (rather a client/user), submits both the currents and previous state and then the data is updated only if there have not been any changes since the device last synched. Pessimistic locking is when the application locks all the records the device intents to update &#8211; this of course is not a good idea.</p>
<p>But, in real life, neither of these issues are really ideal. How best to deal with situations where e.g. a sales person who is on the road could not (or does not) connect to the network to synch up and the person in the office updates the record? How do you deal with those situations. One solution is to update only the changes fields, and the rest are either rejected or the user needs to manually confirm each change and pick which ones take precedence. This along with the fact that in real life data can be segregated to some extent on a user level would suffice? Another thing to dwell upon, for most Mobile applications (especially disconnected), going the SOA way is what makes more sense. Since each time you sync up or submit something (if its on gprs for example), your client running on the device should just consume the service and really cannot be bothered by any more details than that (more on this on another post soon).</p>
<p>But, still seems quite fragile with lots of areas for failure. What are you thoughts? Is there a better way to do this that would make it more robust?</p>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=460" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2004%2F11%2F27%2Fdata-concurrency-and-mobile-applications%2F&amp;title=Data%20Concurrency%20and%20Mobile%20Applications" id="wpa2a_36"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2004/11/27/data-concurrency-and-mobile-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTP Modules and HTTP Handlers</title>
		<link>http://desigeek.com/blog/amit/2004/10/28/http-modules-and-http-handlers/</link>
		<comments>http://desigeek.com/blog/amit/2004/10/28/http-modules-and-http-handlers/#comments</comments>
		<pubDate>Thu, 28 Oct 2004 16:27:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[ASP.NET has a pretty interesting HTTP runtime architecture if you have ever dug into the covers. The basic run-time support has API&#8217;s as powerful as ISAPI (in IIS). ASP.NET offers IHttpHandler and IHttpModule interfaces that offer you similar functionality. I will get into each one in a little bit of detail, but at a high [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET has a pretty interesting HTTP runtime architecture if you have ever dug into the covers. The basic run-time support has API&#8217;s as powerful as ISAPI (in IIS). ASP.NET offers IHttpHandler and IHttpModule interfaces that offer you similar functionality. I will get into each one in a little bit of detail, but at a high level IHttpHandler is analogous to what would be an ISAPI extension in IIS and IHttpModule would be analogous to what a ISAPI filter in IIS. As a matter of fact, each asp.net page (.aspx) you have in your project is essentially an HTTP Handler.</p>
<p><strong><u>HTTP Handlers</u>:</strong> The &#8220;handlers&#8221; are nothing but assemblies (class libraries) that implement IHttpHandler and IHttpAsyncHandler interfaces. Essentially, ASP.NET maps each http request to a http handler. The handler in turn enables processing individual url&#8217;s or groups of url&#8217;s with similar extensions such as .aspx, .asmx, .ascx, .disco, etc. The handler can be synchronous or asynchronous, the earlier does not return until it finished processing and the latter typically launches a separate process.</p>
<p>When you inherit from IHttpHandler handler, you need to implement both the ProcessRequest method (which processes the individual http requests) and the IsReusable property (which specifies if pooling is supported or not).&nbsp;If you have a more complex set of&nbsp;logic then you&nbsp;should look at inheriting IHttpHandlerFactory, as that allows finer control&nbsp;and you can create different handler based on your need. E.g. you can create a&nbsp;separate handler for GET and PUT.</p>
<p>When you are finished building the handler (essentially compiling your assembly), you need to register it to use it. To register a handler essentially you copy the assembly in the bin folder of where you web app is running and create a <httphandlers>section in the web.config. (I&#8217;ll have a sample in a bit in this post). You might also want to ensure that the HTTP handler&#8217;s extension is registered with IIS.</p>
<p><strong>General process of Building a Handler:</strong></p>
<ol>
<li>Implement the IHttpHandler interface
<li>Handle the ProcessRequest method and IsRuseable property.
<li>Deploy the assembly
<li>Register the handler</li>
</ol>
<p>Below is an example of a handler that processes request for the files with the extension &#8220;.desigeek&#8221;. Note, that you do not need to have a physical file present with that extension.</p>
<p><font size=2></p>
<p></font><font face="Courier New"><font color=#0000ff size=2>public</font><font size=2> </font><font color=#0000ff size=2>class</font><font size=2> </font><font color=#008080 size=2>DesigeekHandler</font><font size=2> : </font></font><font face="Courier New" color=#008080 size=2>IHttpHandler<br /></font><font face="Courier New"><font size=2>{<br />&nbsp;&nbsp;&nbsp; </font><font color=#0000ff size=2>bool</font><font size=2> </font><font color=#008080 size=2>IHttpHandler</font></font><font face="Courier New" size=2>.IsReusable<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color=#0000ff size=2><font face="Courier New">get<br /><font color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></font></font><font face="Courier New"><font size=2>{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color=#0000ff size=2>return</font><font size=2> </font><font color=#0000ff size=2>false</font></font><font face="Courier New" size=2>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font face="Courier New" size=2>}<br />&nbsp;&nbsp;&nbsp; }</font></p>
<p><font face="Courier New"><font color=#0000ff size=2>void</font><font size=2> </font><font color=#008080 size=2>IHttpHandler</font><font size=2>.ProcessRequest( </font><font color=#008080 size=2>HttpContext</font></font><font face="Courier New"><font size=2> context )<br />{<br />&nbsp;&nbsp;&nbsp; </font><font color=#008080 size=2>HttpResponse</font></font><font face="Courier New"><font size=2> response = context.Response;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp; response.Write( <font color=#800000 size=2 __designer:dtid="20232186477150269">&#8220;&lt; html&gt;&#8221;</font><font face="Courier New" __designer:dtid="20232186477150268"><font size=2 __designer:dtid="20232186477150267"> );<br __designer:dtid="20232186477150266">&nbsp;&nbsp;&nbsp; response.Write( </font><font color=#800000 size=2 __designer:dtid="20232186477150265">&#8220;&lt; body&gt;&#8221;</font></font><font face="Courier New" __designer:dtid="20232186477150264"><font size=2 __designer:dtid="20232186477150263"> );<br __designer:dtid="20232186477150262">&nbsp;&nbsp;&nbsp; response.Write( </font><font color=#800000 size=2 __designer:dtid="20232186477150261">&#8220;&lt; h1&gt; Hello from Desigeek custom handler. &lt; /h1&gt;&#8221;</font></font><font face="Courier New" __designer:dtid="20232186477150260"><font size=2 __designer:dtid="20232186477150259"> );<br __designer:dtid="20232186477150258">&nbsp;&nbsp;&nbsp; response.Write( </font><font color=#800000 size=2 __designer:dtid="20232186477150257">&#8220;&lt; /body&gt;&#8221;</font></font><font face="Courier New" __designer:dtid="20232186477150256"><font size=2 __designer:dtid="20232186477150255"> );<br __designer:dtid="20232186477150254">&nbsp;&nbsp;&nbsp; response.Write( </font><font color=#800000 size=2 __designer:dtid="20232186477150253">&#8220;&lt; /html&gt;&#8221;</font></font><font face="Courier New" size=2 __designer:dtid="20232186477150252"> );<br __designer:dtid="20232186477150251"></font></font></font><font face="Courier New" size=2>}</font></p>
<p>Register the HTTP handler by creating an entry in the web.config:</p>
<p><font color=#0000ff size=2></p>
<p><font face="Courier New">&lt;</font></font><font face="Courier New" color=#800000 size=2>httpHandlers</font><font face="Courier New"><font color=#0000ff size=2>&gt;<br /></font><font color=#0000ff size=2>&nbsp;&nbsp;&nbsp; </font><font color=#0000ff size=2>&lt;</font><font color=#800000 size=2>add</font><font color=#0000ff size=2> </font><font color=#ff0000 size=2>verb</font><font color=#0000ff size=2>=</font><font size=2>&#8220;</font><font color=#0000ff size=2>*</font><font size=2>&#8220;</font><font color=#0000ff size=2> </font><font color=#ff0000 size=2>path</font><font color=#0000ff size=2>=</font><font size=2>&#8220;</font><font color=#0000ff size=2>*.desigeek</font><font size=2>&#8220;</font><font color=#0000ff size=2> </font><font color=#ff0000 size=2>type</font><font color=#0000ff size=2>=</font><font size=2>&#8220;</font><font color=#0000ff size=2>MyHTTPHandler.DesigeekHandler, MyHTTPHandler</font><font size=2>&#8220;</font></font><font face="Courier New"><font color=#0000ff size=2>/&gt;<br /></font><font color=#0000ff size=2></< FONT><font color=#800000 size=2>httpHandlers</font><font color=#0000ff size=2>&gt;</font></font></p>
<p><font face=Verdana size=2>Below is a sample of what the request would look like. Notice the URL requested is &#8220;foo.desigeek&#8221; (and there is no physical file with that name on the file system. The first screen-shot is of the web application (which basically is one label which is updated with the system time on PageLoad). The second one is where the handler kicks in.</font></p>
<p><img src="http://www.desigeek.com/weblog/images/pics/misc/httphandler1.png"></p>
<p><img src="http://www.desigeek.com/weblog/images/pics/misc/httphandler2.png"></p>
<p><font face=Verdana><font size=2><strong><u>HTTP Module</u>:</strong> HTTP modules are classes that can be configured to run in response to events that fire during the request for an ASP.NET resource (which can be serviced by any handler). An HTTP module is an assembly that implements the IHttpModule interface and handles events. ASP.NET ships with a number of modules out of the box e.g. SessionStateModule is used to supply session state services to an application.</font></font></p>
<p><font size=2><font face=Verdana>If&nbsp;you check your machine.config you will there are a number of handlers that come with ASP.NET. e.g you might look at something like:<br /></font>&lt; httpModules&gt;<br />&nbsp;&nbsp;&nbsp; &lt; add name=&#8221;OutputCache&#8221; type=&#8221;System.Web.Caching.OutputCacheModule, &#8230;/&gt;<br />&nbsp;&nbsp;&nbsp; &lt; add name=&#8221;Session&#8221; type=&#8221;System.Web.SessionState.SessionStateModule, &#8230;/&gt;<br />&nbsp;&nbsp;&nbsp; &lt; add name=&#8221;WindowsAuthentication&#8221; type=&#8221;System.Web.Security.WindowsAuthenticationModule, &#8230;/&gt;<br />&nbsp;&nbsp;&nbsp; &lt; add name=&#8221;FormsAuthentication&#8221; type=&#8221;System.Web.Security.FormsAuthenticationModule &#8230;/&gt;<br />&nbsp;&nbsp;&nbsp; &lt; add name=&#8221;PassportAuthentication&#8221; type=&#8221;System.Web.Security.PassportAuthenticationModule &#8230;/&gt;<br />&nbsp;&nbsp;&nbsp; &lt; add name=&#8221;UrlAuthorization&#8221; type=&#8221;System.Web.Security.UrlAuthorizationModule, &#8230;/&gt;<br />&nbsp;&nbsp;&nbsp; &lt; add name=&#8221;FileAuthorization&#8221; type=&#8221;System.Web.Security.FileAuthorizationModule, &#8230;/&gt;<br />&lt; /httpModules&gt;</font></p>
<p><font face=Verdana size=2>Basically you follow the similar process as HTTP handlers. Once you have created your assembly you deploy it to the bin folder and register your handler. The general process for writing an HTTP module is:</font></p>
<ul>
<li><font face=Verdana size=2>Implement the IHttpModule interface.</font>
<li><font face=Verdana size=2>Handle the Init method and register for the events you need.</font>
<li><font face=Verdana size=2>Handle the events.</font>
<li><font face=Verdana size=2>Optionally implement the Dispose method if you have to do cleanup.</font>
<li><font face=Verdana size=2>Register the module in Web.config.</font></li>
</ul>
<p><font face=Verdana size=2>Here is an example which hooks into the BeginRequest and EndRequest events of HttpApplication and adds &#8220;DesigeekModule: Begin of Request&#8220; and &#8220;DesigeekModule:&nbsp;End of Request&#8220; to the response being send out to the client. The Init() function is where your register the hooks you want.</font></p>
<p><font color=#0000ff></p>
<p><font size=2>public</font></font><font size=2> <font color=#0000ff>class</font> <font color=#008080>DesigeekModule</font> : </font><font size=2><font color=#008080>IHttpModule<br /></font>{<br />&nbsp;&nbsp;&nbsp; </font><font size=2><font color=#808080>//you register the events you are want to hook in this function<br />&nbsp;&nbsp;&nbsp; </font><font color=#0000ff>void</font> <font color=#008080>IHttpModule</font>.Init( <font color=#008080>HttpApplication</font> context )<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context.BeginRequest += ( <font color=#0000ff>new</font> <font color=#008080>EventHandler</font>( <font color=#0000ff>this</font>.App_BeginRequest ) );<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context.EndRequest += ( <font color=#0000ff>new</font> <font color=#008080>EventHandler</font>( <font color=#0000ff>this</font>.App_EndRequest ) );<br />&nbsp;&nbsp;&nbsp; }</font></p>
<p><font size=2><font color=#0000ff><font color=#000000>&nbsp;&nbsp;&nbsp; </font>private</font> <font color=#0000ff>void</font> App_EndRequest( <font color=#0000ff>object</font> source, <font color=#008080>EventArgs</font> e )<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=#008080>HttpApplication</font> app = (<font color=#008080>HttpApplication</font>)source;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=#008080>HttpContext</font> context = app.Context;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context.Response.Write( <font color=#800000>&#8220;DesigeekModule: END of Request&#8221;</font> );<br />&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; <font color=#0000ff>private</font> <font color=#0000ff>void</font> App_BeginRequest( <font color=#0000ff>object</font> source, <font color=#008080>EventArgs</font> e )<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=#008080>HttpApplication</font> app = (<font color=#008080>HttpApplication</font>)source;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=#008080>HttpContext</font> context = app.Context;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; context.Response.Write( <font color=#800000>&#8220;DesigeekModule: BEGIN of Request&#8221;</font> );<br />&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; <font color=#0000ff>public</font> <font color=#0000ff>string</font> ModuleName {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=#0000ff>get </font>{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color=#0000ff>return</font> <font color=#800000>&#8220;DesigeekModule&#8221;</font>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}</font></p>
<p><font face=Verdana size=2>You register the HTTP Module by adding the following section in your web.config.</font></p>
<p><font color=#0000ff size=2></p>
<p>&lt; </font><font color=#800000 size=2>httpModules</font><font color=#0000ff size=2>&gt;<br />&nbsp;&nbsp;&nbsp; </font><font color=#0000ff size=2>&lt; </font><font color=#800000 size=2>add</font><font color=#0000ff size=2> </font><font color=#ff0000 size=2>name</font><font color=#0000ff size=2>=</font><font size=2>&#8220;</font><font color=#0000ff size=2>DesigeekModule</font><font size=2>&#8220;</font><font color=#0000ff size=2> </font><font color=#ff0000 size=2>type</font><font color=#0000ff size=2>=</font><font size=2>&#8220;</font><font color=#0000ff size=2>MyHTTPModule.DesigeekModule, MyHTTPHandler</font><font size=2>&#8220;</font><font color=#0000ff size=2>/&gt;<br /></font><font color=#0000ff size=2>&lt; /</font><font color=#800000 size=2>httpModules</font><font color=#0000ff size=2>&gt;</font></p>
<p><font face=Verdana size=2>When you run this (see the screen shots below), you will notice that when I goto the default.aspx I see the label with the date-time and the BEGIN and END strings. Another interesting point, if I get to one of my custom handler (e.g. foo.desigeek) then as shown below I get output from both the HTTP Module and HTTP Handler, which means there are many powerful things you can get by combining these.</font></p>
<p><font face=Verdana size=2><img src="http://www.desigeek.com/weblog/images/pics/misc/httpmodule1.png"></font></p>
<p><font face=Verdana size=2><img src="http://www.desigeek.com/weblog/images/pics/misc/httpmodule2.png"></font></p>
<p><font face=Verdana size=2>Overall, the image below shows graphical representation of the process of a ASP.NET HTTP pipeline. The process starts with a request arriving at IIS. If the requested resource is configured to be handled by the ASP.NET ISAPI Extension, IIS dispatches the request to the unmanaged aspnet_isapi.dll ISAPI Extension. This ISAPI Extension passes off the request to the managed ASP.NET engine. It is important to note that during the request life cycle, one or more HTTP modules may execute, depending on what modules have been registered and what events they have subscribed to. Finally, the ASP.NET engine determines the HTTP handler that is responsible for rendering the content, invoking the handler and returning the generated content back to IIS, which returns it back to the requesting client. If you want to get creative and do some more processing, you can use the HTTP Factory. Remember, an HTTP handler factory is a class that is not directly responsible for rendering the content, but instead is responsible for selecting and returning an HTTP handler instance. This returned HTTP handler instance is then the one that is tasked with rendering the requested resource.</font></p>
<p><font face=Verdana size=2><img src="http://msdn.microsoft.com/library/en-us/dnaspp/html/elmah_fig04.gif"></font></p>
<p><font face=Verdana size=2>More Information:</font></p>
<ul>
<li><font face=Verdana size=2><a href="http://tinyurl.com/6qb4r">http://tinyurl.com/6qb4r</a></font></li>
<li><font face=Verdana size=2><a href="http://tinyurl.com/4x8yt">http://tinyurl.com/4x8yt</a></font></li>
<li><font face=Verdana size=2><a href="http://tinyurl.com/5wthn">http://tinyurl.com/5wthn</a></font></li>
<li><font face=Verdana size=2><a href="http://tinyurl.com/47cp2">http://tinyurl.com/47cp2</a></font></li>
</ul>
<p></font><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=449" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2004%2F10%2F28%2Fhttp-modules-and-http-handlers%2F&amp;title=HTTP%20Modules%20and%20HTTP%20Handlers" id="wpa2a_38"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2004/10/28/http-modules-and-http-handlers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yes, the GC *can* leak memory &#8211; there I said it!</title>
		<link>http://desigeek.com/blog/amit/2004/09/21/yes-the-gc-can-leak-memory-there-i-said-it/</link>
		<comments>http://desigeek.com/blog/amit/2004/09/21/yes-the-gc-can-leak-memory-there-i-said-it/#comments</comments>
		<pubDate>Tue, 21 Sep 2004 04:21:00 +0000</pubDate>
		<dc:creator>Amit Bahree</dc:creator>
				<category><![CDATA[.architecture]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Shawn Van ness has an excellent article, that spells out how event listeners can cause memory leaks, yep even when running in managed code. Steve Main sums it up pretty well: The main issue is the &#8220;lapsed listener&#8221; problem. This occurs when objects subscribe to events and subsequently get out of scope. The problem is [...]]]></description>
			<content:encoded><![CDATA[<p><font face=Verdana size=2><a href="http://weblogs.asp.net/savanness/archive/2004/04/18/115685.aspx">Shawn Van ness</a> has an excellent article, that spells out how event listeners can cause memory leaks, yep even when running in managed code. Steve Main sums it up pretty well:</font></p>
<blockquote dir=ltr style="MARGIN-RIGHT: 0px">
<p><font face=Verdana size=2>The main issue is the &#8220;lapsed listener&#8221; problem. This occurs when objects subscribe to events and subsequently get out of scope. The problem is that the event subscriber doesn&#8217;t get garbage collected because the event is still holding a reference to it inside of the event&#8217;s invocation list. The event subscriber is still considered reachable from the GC&#8217;s point of view. As such, it doesn&#8217;t get collected until the <i>event</i> goes out of scope (which is usually at application shutdown) which means that the event subscriber is effectively &#8220;leaked&#8221;.</font></p>
<p><font face=Verdana size=2>Moral of the story: when you implement an Observer pattern, it&#8217;s important to consider the relative lifetime of events and subscribers. If implemented naively, you&#8217;ll end up having objects that live a lot longer than you think they should. Unsubscribe() is your friend.</font></p>
</blockquote>
<p><font face=Verdana size=2>As Fabrice writes, .NET&#8217;s delegates and events are implementations of the <a href="http://www.dofactory.com/Patterns/PatternObserver.aspx">Observer Design Pattern</a>&nbsp;</font><font face=Verdana size=2>. But the current problem is one more&nbsp;reminder that <a href="http://weblogs.asp.net/fmarguerie/archive/2004/06/10/152535.aspx">Design Patterns should not be applied blindly</a></font><font face=Verdana size=2>.</font></p>
<p><font face=Verdana size=2>If you write the following code, you&#8217;ll see that the&nbsp;object instance gets correctly released and collected:</font></p>
<div class=code><font face="Courier New" size=2>StoopidObject&nbsp;object = new StoopidObject();<br />GC.Collect();<br />GC.WaitForPendingFinalizers();</font></div>
<div class=code>&nbsp;</div>
<div class=code><font face=Verdana size=2>If you write the following code instead, although there is no apparent reference kept to the Observer, the Observer instance will not be released:</font></div>
<div class=code><font face="Courier New" size=2></font>&nbsp;</div>
<div class=code><font face="Courier New" size=2>Observer observer = new Observer();<br />Subject subject = new Subject();<br />subject.SomethingHappened += new EventHandler(observer.subject_SomethingHappened);<br />GC.Collect();<br />GC.WaitForPendingFinalizers();</font></div>
<div class=code>
<p><font face=Verdana size=2></font>&nbsp;</p>
<p><font face=Verdana size=2>Guys from around the community came with various solutions. They call them <em>Weak Delegates</em>. Follow the links to learn more:</font></p>
<ul>
<li><font face=Verdana size=2><a href="http://blogs.msdn.com/greg_schechter/archive/2004/05/27/143605.aspx">Greg Schechter</a> (real case study; schema&#8217;s will help you to understand the problem) </font>
<li><font face=Verdana size=2><a href="http://www.interact-sw.co.uk/iangblog/2004/06/06/weakeventhandler">Ian Griffiths</a> and <a href="http://www.seedindustries.com/blog/x/2004_06_01_archive.html#108656795427367272">Xavier Musy</a>&nbsp;</font><font face=Verdana size=2>(extensions and improvements)</font></li>
</ul>
</div>
<p><font face=Verdana size=2><strong>More Information:</strong></font></p>
<ul>
<li><!--StartFragment --><a href="http://tinyurl.com/56vu4"><font face=Verdana size=2>http://tinyurl.com/56vu4</font></a>
<li><!--StartFragment --><a href="http://tinyurl.com/5ss2d"><font face=Verdana size=2>http://tinyurl.com/5ss2d</font></a>
<li><!--StartFragment --><font color=#000000><a href="http://tinyurl.com/5jo5n"><font face=Verdana size=2>http://tinyurl.com/5jo5n</font></a></font></li>
</ul>
<p><img src="http://desigeek.com/weblog/aggbug.aspx?PostID=412" width="1" height="1"></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fdesigeek.com%2Fblog%2Famit%2F2004%2F09%2F21%2Fyes-the-gc-can-leak-memory-there-i-said-it%2F&amp;title=Yes%2C%20the%20GC%20%2Acan%2A%20leak%20memory%20%E2%80%93%20there%20I%20said%20it%21" id="wpa2a_40"><img src="http://desigeek.com/blog/amit/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://desigeek.com/blog/amit/2004/09/21/yes-the-gc-can-leak-memory-there-i-said-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

