﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on The required infrastructure frees you from infrastructure decisions</title><description>Matthew,
I don't have hard &amp; fast rules. </description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment17</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment17</guid><pubDate>Thu, 17 Nov 2011 14:45:49 GMT</pubDate></item><item><title>Matthew Shapiro commented on The required infrastructure frees you from infrastructure decisions</title><description>@Ayende: Out of curiosity do you tend to use properties for all dependency injected objects or just for deep infrastructure objects (such as sessions or db contexts)?</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment16</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment16</guid><pubDate>Thu, 17 Nov 2011 14:42:05 GMT</pubDate></item><item><title>Ayende Rahien commented on The required infrastructure frees you from infrastructure decisions</title><description>Marcus,
It isn't _your_ controller. It is in the base class infrastructure.
I made it the OnActionExecuted and OnActionExecuting for simplicity sake, but it could be a separate action filter just as easily</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment15</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment15</guid><pubDate>Thu, 17 Nov 2011 14:41:02 GMT</pubDate></item><item><title>Ayende Rahien commented on The required infrastructure frees you from infrastructure decisions</title><description>Matthew,
I tend to use a publicly settable property, who ever is executing the task can provide the session then</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment14</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment14</guid><pubDate>Thu, 17 Nov 2011 14:39:58 GMT</pubDate></item><item><title>Ayende Rahien commented on The required infrastructure frees you from infrastructure decisions</title><description>Tyrone,
Known issue, was fixed today, you can download build 531 to get it.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment13</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment13</guid><pubDate>Thu, 17 Nov 2011 14:39:15 GMT</pubDate></item><item><title>Ayende Rahien commented on The required infrastructure frees you from infrastructure decisions</title><description>Marco,
That really depend on how you are implementing your transactions. In that case, we hooked into the post tx event</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment12</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment12</guid><pubDate>Thu, 17 Nov 2011 14:37:34 GMT</pubDate></item><item><title>Nigel A commented on The required infrastructure frees you from infrastructure decisions</title><description>@JustinA - No it's one of Rob's already existing productions: http://tekpub.com/productions/ft_triage_oren - and very good it is too.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment11</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment11</guid><pubDate>Thu, 17 Nov 2011 06:16:27 GMT</pubDate></item><item><title>Justin A commented on The required infrastructure frees you from infrastructure decisions</title><description>People .. .people!!! None of you guys are asking the right question(s).

=&gt; What is Ayende doing with RobCon + Tekpub + Code !! :)
https://github.com/ayende/TekPub.Profiler.BackOffice/tree/master/TekPub.Profiler.BackOffice/Tasks

My spidersense is tingling and it's felling good .. like when i spread awesomesauce over my latest RavenDB project.

Is this one of Rob's secret new series, to be coming out in the future?

May world-domination finally begin.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment10</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment10</guid><pubDate>Thu, 17 Nov 2011 02:47:49 GMT</pubDate></item><item><title>Harry Steinhilber commented on The required infrastructure frees you from infrastructure decisions</title><description>@Marcus,
That is the whole point though. You *could* be using the base class to create the session. Or it could be done through IoC property injection. Or it could be a global action filter. Or it might be an action filter on the class. Or it might be something else entirely. Any of these is valid. _And we don't care which one is used._ It is an infrastructure concern and our business code shouldn't be worried about it.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment9</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment9</guid><pubDate>Wed, 16 Nov 2011 20:17:10 GMT</pubDate></item><item><title>Matthew Shapiro commented on The required infrastructure frees you from infrastructure decisions</title><description>@Kiliman: Ah I hadn't thought about using property injection rather than constructor injection.
</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment8</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment8</guid><pubDate>Wed, 16 Nov 2011 14:44:23 GMT</pubDate></item><item><title>Daniel Lidström commented on The required infrastructure frees you from infrastructure decisions</title><description>@Matthew: It seems handling the session for tasks is done by the TaskExecuter: https://github.com/ayende/TekPub.Profiler.BackOffice/blob/master/TekPub.Profiler.BackOffice/Tasks/TaskExecuter.cs So that class would be part of the infrastructure. As far as I can see this makes it easy to test background tasks.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment7</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment7</guid><pubDate>Wed, 16 Nov 2011 14:33:31 GMT</pubDate></item><item><title>Marcus Swope commented on The required infrastructure frees you from infrastructure decisions</title><description>I'm confused by this comment:

"What is important about that is that it isn’t actively doing something, it just assumes that it is there."

Correct me if I'm wrong, but the Controller _is_ creating the session, right? Just because it's in the base class doesn't mean that it's not there.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment6</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment6</guid><pubDate>Wed, 16 Nov 2011 14:21:49 GMT</pubDate></item><item><title>Kiliman commented on The required infrastructure frees you from infrastructure decisions</title><description>@Matthew, if you look at his RacoonBlog project, he uses property injection to set IDocumentSession. He has an action filter that sets it.

So I imagine he's doing something similar here. His main point is that our code shouldn't care. We should just assume it'll be set somewhere along the way.

If we're unit testing, then new up the controller, set document session and call our code. In a unit test, we can control the context.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment5</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment5</guid><pubDate>Wed, 16 Nov 2011 14:13:48 GMT</pubDate></item><item><title>Matthew Shapiro commented on The required infrastructure frees you from infrastructure decisions</title><description>While I agree with this, and use it myself, I am confused on how the BackgroundTask actually creates a document session in a way that supports dependency injection with coded unit/integration testing.  

Usually I would pass a document session into the constructor, which (unfortunately) then requires me to also pass it into the constructor for all sub-classes as well.  I assume that since your ProcessOrderMessageTask  does not contain an explicit constructor that the BackgroundTask talks to the IoC engine directly to retrieve the document session?  If so that seems like a lot of work required to set up coded unit and integration tests.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment4</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment4</guid><pubDate>Wed, 16 Nov 2011 13:26:52 GMT</pubDate></item><item><title>Tyrone commented on The required infrastructure frees you from infrastructure decisions</title><description>Loving your posts.

I dont think this is the right place to post this, but keep getting the below silverlight error when creating and editing a document in ravendb management studio. Any ideas? Can see and create sample data, just cant edit the actual document. Just upgraded silverlight.

[Arg_TargetInvocationException]
Arguments: 
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&amp;Version=4.0.60831.0&amp;File=mscorlib.dll&amp;Key=Arg_TargetInvocationException.... more info available upon request

Thanks and apologize for posting here, but I always see how you reply to commenters.

Tyrone</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment3</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment3</guid><pubDate>Wed, 16 Nov 2011 12:07:56 GMT</pubDate></item><item><title>Marco commented on The required infrastructure frees you from infrastructure decisions</title><description>Nice! the question is of course ;-). How did you implement the transaction support in the ExecuteLater method?</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment2</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment2</guid><pubDate>Wed, 16 Nov 2011 10:34:30 GMT</pubDate></item><item><title>Scooletz commented on The required infrastructure frees you from infrastructure decisions</title><description>Separation of concerns - that's how I'd call it. Speaking about unit tests of 'derived' classes, I do prefer testing code based on composition rather than derivation and in the Validate method test, I'd simply take the session as parameter (custom binder for document session will take care of binding it to the param), of course if the session is not used 'much' in the other methods.</description><link>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment1</link><guid>http://ayende.com/136193/the-required-infrastructure-frees-you-from-infrastructure-decisions#comment1</guid><pubDate>Wed, 16 Nov 2011 10:33:27 GMT</pubDate></item></channel></rss>