<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: The Ambient Context Design Pattern in .NET</title>
	<atom:link href="http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/</link>
	<description>Closed weekends and holidays.</description>
	<pubDate>Sat, 17 May 2008 14:58:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>By: Nice, Free and Reusable .Net Ambient Context Pattern Implementation &#171; .Net Braindrops</title>
		<link>http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-20596</link>
		<dc:creator>Nice, Free and Reusable .Net Ambient Context Pattern Implementation &#171; .Net Braindrops</dc:creator>
		<pubDate>Fri, 25 Apr 2008 09:06:37 +0000</pubDate>
		<guid isPermaLink="false">http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-20596</guid>
		<description>[...] Read more about the pattern here: http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Read more about the pattern here: <a href="http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/" rel="nofollow">http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Matthews</title>
		<link>http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19765</link>
		<dc:creator>Andrew Matthews</dc:creator>
		<pubDate>Wed, 02 Jan 2008 22:53:17 +0000</pubDate>
		<guid isPermaLink="false">http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19765</guid>
		<description>Hi Steve,

I can understand that developers might end up using your context as a dumping ground for all the data that they couldn't be bothered to find a better place for. But then I've seen this happen with many other kinds of design. In fact I've gone to extreme lengths in the past to prevent this kind of 'subversion' of my designs, all to no avail. What can I say - some developers are lazy, and don't take the time to appreciate the spirit of a framework, before they crap all over it.

Either the contexts were compulsory, in which case perhaps a static constructor was necessary to preinitialise the root context, or your developers should have written their code to cope with the situation where there was no context available. Perhaps the use of an ambient context creates a reponsibility on the rest of the framework to be able to cope with its absence? For instance the TransactionScope class is not compulsory in most cases, and if it's not present the database operations will still progress, just without an enclosing transaction. 

For example; having the ability to embed their code in the framework, the developers of TransactionScope were also able to define a means to declaratively mandate the use of a transaction scope. Without such access I guess you'd be forced to use something like PostSharp or some AOP framework to add wrappers around your methods to enforce mandatory context policies. That's already getting pretty complex, but if these contexts genuinely have a lot of data to carry around, and there really is a scoping concept in play, then it's probably still preferable to dumping all that luggage into &lt;i&gt;every&lt;/i&gt; method signature. 

Cheers

Andrew</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>I can understand that developers might end up using your context as a dumping ground for all the data that they couldn&#8217;t be bothered to find a better place for. But then I&#8217;ve seen this happen with many other kinds of design. In fact I&#8217;ve gone to extreme lengths in the past to prevent this kind of &#8217;subversion&#8217; of my designs, all to no avail. What can I say - some developers are lazy, and don&#8217;t take the time to appreciate the spirit of a framework, before they crap all over it.</p>
<p>Either the contexts were compulsory, in which case perhaps a static constructor was necessary to preinitialise the root context, or your developers should have written their code to cope with the situation where there was no context available. Perhaps the use of an ambient context creates a reponsibility on the rest of the framework to be able to cope with its absence? For instance the TransactionScope class is not compulsory in most cases, and if it&#8217;s not present the database operations will still progress, just without an enclosing transaction. </p>
<p>For example; having the ability to embed their code in the framework, the developers of TransactionScope were also able to define a means to declaratively mandate the use of a transaction scope. Without such access I guess you&#8217;d be forced to use something like PostSharp or some AOP framework to add wrappers around your methods to enforce mandatory context policies. That&#8217;s already getting pretty complex, but if these contexts genuinely have a lot of data to carry around, and there really is a scoping concept in play, then it&#8217;s probably still preferable to dumping all that luggage into <i>every</i> method signature. </p>
<p>Cheers</p>
<p>Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Matthews</title>
		<link>http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19763</link>
		<dc:creator>Andrew Matthews</dc:creator>
		<pubDate>Wed, 02 Jan 2008 22:37:46 +0000</pubDate>
		<guid isPermaLink="false">http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19763</guid>
		<description>Hi Howard,

Giving a design pattern a name is probably the hardest part!

I noticed when researching this pattern that the .NET framework makes heavy use of the pattern, but does not provide any &lt;i&gt;automated&lt;/i&gt; support for context flow. As a consequence I was forced to supply thread amagement functions in the ContrextManager, which I'm sure you'll agree is a Kludge. I can't recall (it's been about 6-7 years since I was a java programmer) whether there was any sort of automated hook to allow you to do thread setup. If there is, you may be able to ignore the Contextmanager.Run method in favour of something less intrusive.

Please write (or link) back with any comments you have on improvements and/or flaws in the design I've provided. It's only a first draft and surely not the perfect solution or description. If you can come up with improvements I'll happily update the page.

Cheers

Andrew</description>
		<content:encoded><![CDATA[<p>Hi Howard,</p>
<p>Giving a design pattern a name is probably the hardest part!</p>
<p>I noticed when researching this pattern that the .NET framework makes heavy use of the pattern, but does not provide any <i>automated</i> support for context flow. As a consequence I was forced to supply thread amagement functions in the ContrextManager, which I&#8217;m sure you&#8217;ll agree is a Kludge. I can&#8217;t recall (it&#8217;s been about 6-7 years since I was a java programmer) whether there was any sort of automated hook to allow you to do thread setup. If there is, you may be able to ignore the Contextmanager.Run method in favour of something less intrusive.</p>
<p>Please write (or link) back with any comments you have on improvements and/or flaws in the design I&#8217;ve provided. It&#8217;s only a first draft and surely not the perfect solution or description. If you can come up with improvements I&#8217;ll happily update the page.</p>
<p>Cheers</p>
<p>Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Campbell</title>
		<link>http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19759</link>
		<dc:creator>Steve Campbell</dc:creator>
		<pubDate>Wed, 02 Jan 2008 19:38:59 +0000</pubDate>
		<guid isPermaLink="false">http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19759</guid>
		<description>Interesting.  I found it easy enough to understand, but that may be because I have used the pattern.  

However...I am not convinced it is a good idea.  In my case, the context became a bit of a black-box.  It was difficult to know how to properly populate one, and it made writing some code more difficult, because the programmers had to construct contexts when even one part of the code they wanted to call required it.  It might have been better to pass more parameters around.</description>
		<content:encoded><![CDATA[<p>Interesting.  I found it easy enough to understand, but that may be because I have used the pattern.  </p>
<p>However&#8230;I am not convinced it is a good idea.  In my case, the context became a bit of a black-box.  It was difficult to know how to properly populate one, and it made writing some code more difficult, because the programmers had to construct contexts when even one part of the code they wanted to call required it.  It might have been better to pass more parameters around.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Howard M. Lewis Ship</title>
		<link>http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19755</link>
		<dc:creator>Howard M. Lewis Ship</dc:creator>
		<pubDate>Wed, 02 Jan 2008 16:29:33 +0000</pubDate>
		<guid isPermaLink="false">http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19755</guid>
		<description>A very cool writeup with an exteremely useful name; Tapestry 5 (Java web framework: http://tapestry.apache.org) has had these features for a long time but without a useful name (I chose Environmental).  But Ambient is a very evocative term I look forward to appropriating!</description>
		<content:encoded><![CDATA[<p>A very cool writeup with an exteremely useful name; Tapestry 5 (Java web framework: <a href="http://tapestry.apache.org" rel="nofollow">http://tapestry.apache.org</a>) has had these features for a long time but without a useful name (I chose Environmental).  But Ambient is a very evocative term I look forward to appropriating!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Matthews</title>
		<link>http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19738</link>
		<dc:creator>Andrew Matthews</dc:creator>
		<pubDate>Tue, 01 Jan 2008 21:00:37 +0000</pubDate>
		<guid isPermaLink="false">http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19738</guid>
		<description>Hi Mike,

Yes, that might help. I'll update the post soon...

Andrew</description>
		<content:encoded><![CDATA[<p>Hi Mike,</p>
<p>Yes, that might help. I&#8217;ll update the post soon&#8230;</p>
<p>Andrew</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19705</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Mon, 31 Dec 2007 10:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://aabs.wordpress.com/2007/12/31/the-ambient-context-design-pattern-in-net/#comment-19705</guid>
		<description>Thanks for the pattern. Maybe you can add an UML Diagram so people might understanding it quicker?</description>
		<content:encoded><![CDATA[<p>Thanks for the pattern. Maybe you can add an UML Diagram so people might understanding it quicker?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
