.NET 3.5 http://rickgaribay.net/category/19.aspx .NET 3.5 en-US Rick G. Garibay rickgaribay@hotmail.com Subtext Version 1.9.5.176 Is .NET a Great Disruptor of the Decade? http://rickgaribay.net/archive/2010/01/15/is-.net-a-great-disruptor-of-the-decade.aspx <p>The following article was recently brought to my attention. It asks if .NET should be considered a disruptor in the last decade: <a href="http://blogs.zdnet.com/service-oriented/?p=3921">http://blogs.zdnet.com/service-oriented/?p=3921</a></p> <p>I actually gave this a bit of thought and the best answer I was able to come up with was “Yes and No”. Here’s why…</p> <p>A technology can be "disruptive" when it gains wide spread attention but can fizzle out just as quickly or over an undetermined period of time. How deep into a revolution a technology can sink its teeth and still emerge a clear winner is a true long term measure that I believe earns the designation of "disruptor". </p> <p>A true market leader leverages (or themselves are responsible for) a revolutionary technology and both exploits it fully while surviving several aftershocks that typically follow.</p> <p>For example, I would argue that SOA was a revolutionary innovation that changed the mindset of an industry. In the process it displaced many traditional (and proprietary) approaches to distributed computing and a new market segment exploded. </p> <p>I think Microsoft capitalized on this with ASP.NET Web Services (ASMX) which at the time I would certainly consider disruptive- offering 1st generation commodity SOA to the masses- but had the innovation wave stopped there, Microsoft wouldn't have a SOA story today.</p> <p>Enter <a target="_blank" href="http://en.wikipedia.org/wiki/Windows_Communication_Foundation">WCF</a> . WCF is both an evolution over ASMX as well as a technology that has been successful in displacing many proprietary incumbents. However I think today what we have is a low-end disruption because it is evident that WCF overshot the market with performance and features. Incredibly, almost in perfect harmony with this market perception REST came into its own and disrupted our whole perspective on SOA and continues to challenge our values in the process (as all disruptive technologies do).</p> <p>WCF 3.5 and the REST Starter Kit answered this call cementing the fact that .NET (WCF) is deep enough to survive and subsume other distrubtions and at the same time, WCF 4 will attempt to democratize WCF for the masses, likely gaining both mindshare and market share in the process. </p> <p>So, while .NET has been disruptive, I don't know that we can claim it as disruptor just yet. </p> <p>One thing is for certain. <a target="_blank" href="http://en.wikipedia.org/wiki/Windows_Azure">Azure</a> has the potential to propel .NET to a more profitable market segment ushering with it new market disruption and establishing .NET in a clear lead position.</p> <p>But these are just my thoughts. What do you think?</p><img src="http://rickgaribay.net/aggbug/268.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2010/01/15/is-.net-a-great-disruptor-of-the-decade.aspx Sat, 16 Jan 2010 01:08:53 GMT http://rickgaribay.net/archive/2010/01/15/is-.net-a-great-disruptor-of-the-decade.aspx#feedback 1 http://rickgaribay.net/comments/commentRss/268.aspx http://rickgaribay.net/services/trackbacks/268.aspx The Modeling Vision Continues http://rickgaribay.net/archive/2009/08/18/the-modeling-vision-continues.aspx <p>Recently the Connected Systems Division at Microsoft, who is responsible for technologies including Windows Application Server, <a target="_blank" href="http://msdn.microsoft.com/biztalk">BizTalk</a> Server, and .NET Framework technologies including <a target="_blank" href="http://msdn.microsoft.com/en-us/netframework/aa663324.aspx">Windows Communication Foundation</a> and <a target="_blank" href="http://msdn.microsoft.com/en-us/netframework/aa663328.aspx">Windows Workflow Foundation</a>,.NET cloud services, and the "Oslo" modeling platform was reorganized into the Data and Storage Platforms Division as the Business Platform Division (BPD) which is part of the Server and Tools Group responsible for products like Windows Server, Visual Studio and SQL Server. </p> <p>This move was not a big surprise, because if you look at products like BizTalk, Dublin and Oslo, Windows Server and SQL Server are intrinsically related, delivering on the need for a comprehensive plug-and-play platform for connecting disparate systems. For example, BizTalk, Dublin and Oslo run on the Windows Server platform, and each depend on SQL Server to varying extents.</p> <p>SQL Server has proven itself as a RDBMS platform and Dog-fooding SQL Server is good for business. I’ve also <a target="_blank" href="http://rickgaribay.net/archive/2009/04/30/websphere-on-windows-outperforms-websphere-on-aix-by-37-who.aspx">talked about</a> the robustness of Windows Server, and the fact that it not only runs the .NET stack faster than Java, put runs Java faster than AIX. Needless to say, the server platform that was beat up throughout the 90's as not worthy of the enterprise has certainly come of age.</p> <p>Anyone who knows <a target="_blank" href="http://www.rickgaribay.net/contact.aspx">me</a>, has come to <a href="http://www.pcsug.org/Home/Events">PCSUG</a> meetings or reads this blog has probably heard me talk about the progression from imperative programming into declarative software development and how critical model-driven development will become in the not so distant future. As a believer, I strive to incorporate technologies like <a target="_blank" href="http://msdn.microsoft.com/wcf">WCF</a>, which is declarative, and Entity Framework which is both declarative and model-driven into my solutions. Entity Framework raises the level of abstraction beyond the logical/data layer in the database, to the conceptual layer, which is the true “stuff” of software, the model. With a model, we can have solution-oriented conversations about the problem domain without talking about tables, views, classes,  bits or bytes. In addition, developer’s benefit from significant productivity gains by avoiding boiler-plate ADO.NET code which is largely commoditized into the Entity Framework. </p> <p>Yesterday, <a target="_blank" href="http://www.douglaspurdy.com/category/microsoft/oslo/">Doug Purdy</a> <a target="_blank" href="http://www.douglaspurdy.com/category/microsoft/oslo/">announced</a> that the <a target="_blank" href="http://msdn.microsoft.com/en-us/oslo/default.aspx">Olso</a> team is joining the Data Programmability Team which is responsible for technologies like… wait for it… Entity Framework. Despite mixed messaging from Microsoft, Oslo represents the culmination of the declarative and model-driven vision within the Microsoft CSD.  As of today, Oslo will deliver languages like “M” which will at a minimum allow developers to further reduce the impedance mismatch between RDMS and application development by raising the abstraction of how developers and architects develop data models that are decompiled into TSQL. I <a target="_blank" href="http://rickgaribay.net/archive/2009/06/10/m-model-for-desert-code-camp.aspx">demonstrated</a> this in June in Phoenix at <a target="_blank" href="http://rickgaribay.net/archive/2009/06/10/m-model-for-desert-code-camp.aspx">Desert Code Camp</a>, and while it is cool, it is only the beginning. “M” will allow developers to create domain specific languages that will bring the conceptual layer closer to the design and problem solving stage. Applications built on foundational frameworks such as WCF and WF will take advantage of their declarative model to easily be serialized into the Oslo Repository for centralized management. These applications are surfaced via Quadrant, which provides a model with which to interact with the applications both individually and at the solution and enterprise scope.</p> <p>As Doug teases in his post, look for some key insights at PDC 09 this year as to the future of the modeling vision which appears to be very bright indeed.</p><img src="http://rickgaribay.net/aggbug/257.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/08/18/the-modeling-vision-continues.aspx Tue, 18 Aug 2009 20:43:16 GMT http://rickgaribay.net/archive/2009/08/18/the-modeling-vision-continues.aspx#feedback http://rickgaribay.net/comments/commentRss/257.aspx http://rickgaribay.net/services/trackbacks/257.aspx Unit Testing Microsoft Sync Framework 2.0 &amp; WCF http://rickgaribay.net/archive/2009/08/17/unit-testing-microsoft-sync-framework-amp-wcf.aspx <p>I just wrapped up some work for a client that entails exposing the Sync Framework 2.0 via WCF.</p> <p>We are using Sync Framework 2.0 CTP 2 to support occasionally connected client scenarios between applications deployed out in the edge and core services hosted in the client’s cloud. I am using WCF to wrap the Sync Fx APIs to support interoperable synchronization support via SOAP 1.1. This way, any client can on-ramp with the core services and essentially become self-provisioned by initiating and initial synchronization to download required data necessary to come on line. In addition, when events happen out on the edge, the client can synchronize each event back to the cloud using an upload semantic. </p> <p>There are many benefits to using the Sync Fx as opposed to rolling your own, and one benefit is the extremely simple provider model which makes basic synchronization scenarios a breeze, particularly between relational replicas such as SQL Server. Note however, that Sync Fx is fully extensible and capable of synchronizing any two memory streams. </p> <p>So, the basic idea is that given a SyncProvider for the local and remote replica, any two data sources/applications can be synchronized:</p> <p><a href="http://rickgaribay.net/Images/CustomContent/UnitTestingMicrosoftSyncFrameworkWCF_13226/image_5.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/UnitTestingMicrosoftSyncFrameworkWCF_13226/image_thumb_5.png" width="640" height="394" /></a> </p> <p>In my scenario, the local client out in the edge utilizes the out of the box SqlSyncProvider. The goal was to expose the cloud over HTTP using SOAP, which required some understanding of the underlying APIs. From there, it was simply a matter of wrapping the Sync Fx APIs in a service layer, so that I would arrive at something like this:</p> <p><a href="http://rickgaribay.net/Images/CustomContent/UnitTestingMicrosoftSyncFrameworkWCF_13226/image_6.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/UnitTestingMicrosoftSyncFrameworkWCF_13226/image_thumb_6.png" width="640" height="371" /></a> </p> <p>By providing a proxy to the orchestrator, I was able to implement a proxy which is polymorphic with RelationalSyncProvider. </p> <p>Immediately it should be obvious that this is not your typical integration scenario. Essentially, I am extending a framework by exposing it over WCF so that any orchestrator can leverage the WebSyncProvider. </p> <p>I started the implementation by writing some tests. It was simple enough to extract an interface for the RelationalSyncProvider type because it is abstract. I used RhinoMocks to stub it, which worked great but where I ran into problems was in recording expectations on the return types because there are not a lot of test seams in the framework. With the absence of setters on main properties that I needed to assert, I needed a way to reach into the framework types and manipulate them so that I could develop the CUT  (in this case the ServiceContract implementation) independent of the framework.<a href="http://rickgaribay.net/Images/CustomContent/UnitTestingMicrosoftSyncFrameworkWCF_13226/clip_image002.jpg"><img style="border-right-width: 0px; margin: 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" align="right" src="http://rickgaribay.net/Images/CustomContent/UnitTestingMicrosoftSyncFrameworkWCF_13226/clip_image002_thumb.jpg" width="240" height="227" /></a></p> <p><a href="http://msdn.microsoft.com/en-us/library/bb514191.aspx" target="_blank">Publicize.exe</a> works pretty nicely for what I was looking for. </p> <p>For example, let’s say I want to stub a closed/framework type so that I can actually write my test without having to resort to integrating with the framework (which wouldn’t be a unit test at all), in this case, a couple of types in the Microsoft.Syncronization.dll assembly. </p> <p>I run Publicize.exe Microsoft.Syncronization.dll and it generates a shadow assembly called Microsoft.Syncronization_Accessor.dll, which takes all types, adds _Accessor and exposes all non-public members as public as shown in Reflector on the right. </p> <p>This pretty powerful. </p> <p>I can now stub the return type of any closed/framework class and test as long as I am asserting *properties*, which is pretty common:</p> <!-- code formatted by http://manoli.net/csharpformat/ --><style type="text/css"><![CDATA[ .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }]]></style> <div class="csharpcode"> <pre class="alt"><span class="lnum"> 1: </span> </pre> <pre><span class="lnum"> 2: </span> [TestMethod]</pre> <pre class="alt"><span class="lnum"> 3: </span> <span class="kwrd">public</span> <span class="kwrd">void</span> GetChangesShouldReturnNumberOfChangesApplied()</pre> <pre><span class="lnum"> 4: </span> {</pre> <pre class="alt"><span class="lnum"> 5: </span> MockRepository mockRepository = <span class="kwrd">new</span> MockRepository();</pre> <pre><span class="lnum"> 6: </span> </pre> <pre class="alt"><span class="lnum"> 7: </span> RelationalSyncProvider provider = mockRepository.Stub&lt;RelationalSyncProvider&gt;();</pre> <pre><span class="lnum"> 8: </span> </pre> <pre class="alt"><span class="lnum"> 9: </span> </pre> <pre><span class="lnum"> 10: </span> <span class="kwrd">using</span> (mockRepository.Record())</pre> <pre class="alt"><span class="lnum"> 11: </span> {</pre> <pre><span class="lnum"> 12: </span> </pre> <pre class="alt"><span class="lnum"> 13: </span> <span class="rem">// Set up the out parameter on RelationalSyncProvider Stub</span></pre> <pre><span class="lnum"> 14: </span> DbSyncContext changeDataRetriever = <span class="kwrd">new</span> DbSyncContext();</pre> <pre class="alt"><span class="lnum"> 15: </span> </pre> <pre><span class="lnum"> 16: </span> <span class="rem">// Set up ScopeProgress property on DbySyncContext instance</span></pre> <pre class="alt"><span class="lnum"> 17: </span> <span class="rem">/*</span></pre> <pre><span class="lnum"> 18: </span><span class="rem"> * Note that in order to test for number of changes applied, we need to reach into the</span></pre> <pre class="alt"><span class="lnum"> 19: </span><span class="rem"> * DbSyncScopeProgress and access the _totalChanges private member </span></pre> <pre><span class="lnum"> 20: </span><span class="rem"> * so that public properties can be asserted. This is because the TotalChanges property only has a </span></pre> <pre class="alt"><span class="lnum"> 21: </span><span class="rem"> * getter, so the only way to influence the value is through it's backing field.</span></pre> <pre><span class="lnum"> 22: </span><span class="rem"> */</span> </pre> <pre class="alt"><span class="lnum"> 23: </span> </pre> <pre><span class="lnum"> 24: </span> DbSyncScopeProgress dbSyncScopeProgress = <span class="kwrd">new</span> DbSyncScopeProgress();</pre> <pre class="alt"><span class="lnum"> 25: </span> </pre> <pre><span class="lnum"> 26: </span> <span class="rem">// Reference the actual object which will be accessed by the generated accessor</span></pre> <pre class="alt"><span class="lnum"> 27: </span> PrivateObject obj = <span class="kwrd">new</span> PrivateObject(dbSyncScopeProgress);</pre> <pre><span class="lnum"> 28: </span> </pre> <pre class="alt"><span class="lnum"> 29: </span> <span class="rem">// Generated accessor which wraps the type to be exposed using reflection.</span></pre> <pre><span class="lnum"> 30: </span> <span class="rem">// Instead of writing the reflection code manually, Publicize.exe was run against the real assembly,</span></pre> <pre class="alt"><span class="lnum"> 31: </span> <span class="rem">// which in turn generated reflection wrappers for *all* types.</span></pre> <pre><span class="lnum"> 32: </span> </pre> <pre class="alt"><span class="lnum"> 33: </span> DbSyncScopeProgress_Accessor dbSyncScopeProgressAccessor = <span class="kwrd">new</span> DbSyncScopeProgress_Accessor(obj);</pre> <pre><span class="lnum"> 34: </span> </pre> <pre class="alt"><span class="lnum"> 35: </span> <span class="rem">// Look ma, I am accessing a private field</span></pre> <pre><span class="lnum"> 36: </span> dbSyncScopeProgressAccessor._tablesProgress = <span class="kwrd">new</span> List&lt;DbSyncTableProgress&gt;();</pre> <pre class="alt"><span class="lnum"> 37: </span> </pre> <pre><span class="lnum"> 38: </span> </pre> <pre class="alt"><span class="lnum"> 39: </span> <span class="rem">// Now we need to repeat the same process again for this type, which is at the heart of what we need to</span></pre> <pre><span class="lnum"> 40: </span> <span class="rem">// gain access to.</span></pre> <pre class="alt"><span class="lnum"> 41: </span> DbSyncTableProgress dbSyncTableProgress = <span class="kwrd">new</span> DbSyncTableProgress();</pre> <pre><span class="lnum"> 42: </span> </pre> <pre class="alt"><span class="lnum"> 43: </span> <span class="rem">// Provides the accessor with a reference to the actual object</span></pre> <pre><span class="lnum"> 44: </span> obj = <span class="kwrd">new</span> PrivateObject(dbSyncTableProgress);</pre> <pre class="alt"><span class="lnum"> 45: </span> </pre> <pre><span class="lnum"> 46: </span> <span class="rem">// Generated accessor which wraps the type to be exposed using reflection.</span></pre> <pre class="alt"><span class="lnum"> 47: </span> <span class="rem">// Instead of writing the reflection code manually, Publicize.exe was run against the real assembly,</span></pre> <pre><span class="lnum"> 48: </span> <span class="rem">// which in turn generated reflection wrappers for *all* types.</span></pre> <pre class="alt"><span class="lnum"> 49: </span> DbSyncTableProgress_Accessor dbSyncTableProgressAccessor = <span class="kwrd">new</span> DbSyncTableProgress_Accessor(obj);</pre> <pre><span class="lnum"> 50: </span> </pre> <pre class="alt"><span class="lnum"> 51: </span> <span class="rem">// Set the _rowsApplied field so that the stubbed return instance of DbSyncScopeProgress can be asserted.</span></pre> <pre><span class="lnum"> 52: </span> dbSyncTableProgressAccessor._rowsApplied = 42;</pre> <pre class="alt"><span class="lnum"> 53: </span> </pre> <pre><span class="lnum"> 54: </span> <span class="rem">// Add the dbSyncTableProgress to the private collection</span></pre> <pre class="alt"><span class="lnum"> 55: </span> dbSyncScopeProgressAccessor._tablesProgress.Add(dbSyncTableProgress);</pre> <pre><span class="lnum"> 56: </span> </pre> <pre class="alt"><span class="lnum"> 57: </span> </pre> <pre><span class="lnum"> 58: </span> <span class="rem">// Now, set the property to our used and abused instance of DbSyncScopeProgress</span></pre> <pre class="alt"><span class="lnum"> 59: </span> changeDataRetriever.ScopeProgress = dbSyncScopeProgress;</pre> <pre><span class="lnum"> 60: </span> </pre> <pre class="alt"><span class="lnum"> 61: </span> <span class="rem">// Provider is implemented in COM so out params are prevelant (yuk)</span></pre> <pre><span class="lnum"> 62: </span> <span class="kwrd">object</span> changeDataRetrieverObj = changeDataRetriever;</pre> <pre class="alt"><span class="lnum"> 63: </span> </pre> <pre><span class="lnum"> 64: </span> <span class="rem">// Set the expectation</span></pre> <pre class="alt"><span class="lnum"> 65: </span> provider.GetChangeBatch(0, <span class="kwrd">null</span>, <span class="kwrd">out</span> changeDataRetrieverObj);</pre> <pre><span class="lnum"> 66: </span> </pre> <pre class="alt"><span class="lnum"> 67: </span> <span class="rem">// Initialize params</span></pre> <pre><span class="lnum"> 68: </span> SyncIdFormatGroup idFormats = <span class="kwrd">new</span> SyncIdFormatGroup();</pre> <pre class="alt"><span class="lnum"> 69: </span> SyncKnowledge destinationKnowledge = <span class="kwrd">new</span> SyncKnowledge();</pre> <pre><span class="lnum"> 70: </span> ForgottenKnowledge sourceForgottenKnowledge = <span class="kwrd">new</span> ForgottenKnowledge();</pre> <pre class="alt"><span class="lnum"> 71: </span> </pre> <pre><span class="lnum"> 72: </span> <span class="rem">// Stub the return, including the object reference to DbSyncContext</span></pre> <pre class="alt"><span class="lnum"> 73: </span> LastCall.Return(<span class="kwrd">new</span> ChangeBatch(idFormats, destinationKnowledge, sourceForgottenKnowledge))</pre> <pre><span class="lnum"> 74: </span> .OutRef(changeDataRetrieverObj).IgnoreArguments();</pre> <pre class="alt"><span class="lnum"> 75: </span> }</pre> <pre><span class="lnum"> 76: </span> </pre> <pre class="alt"><span class="lnum"> 77: </span> IRelationalSyncManager manager = <span class="kwrd">new</span> RelationalSyncManager();</pre> <pre><span class="lnum"> 78: </span> </pre> <pre class="alt"><span class="lnum"> 79: </span> <span class="rem">// Inject the stub</span></pre> <pre><span class="lnum"> 80: </span> manager.Provider = provider;</pre> <pre class="alt"><span class="lnum"> 81: </span> </pre> <pre><span class="lnum"> 82: </span> SyncKnowledge localKnowledge = <span class="kwrd">new</span> SyncKnowledge();</pre> <pre class="alt"><span class="lnum"> 83: </span> DbSyncContext returnedContext = <span class="kwrd">new</span> DbSyncContext();</pre> <pre><span class="lnum"> 84: </span> returnedContext.ScopeProgress = <span class="kwrd">new</span> DbSyncScopeProgress();</pre> <pre class="alt"><span class="lnum"> 85: </span> </pre> <pre><span class="lnum"> 86: </span> </pre> <pre class="alt"><span class="lnum"> 87: </span> var changeBatch = manager.GetChanges(0, localKnowledge, <span class="kwrd">out</span> returnedContext);</pre> <pre><span class="lnum"> 88: </span> </pre> <pre class="alt"><span class="lnum"> 89: </span> DbSyncContext context = returnedContext;</pre> <pre><span class="lnum"> 90: </span> </pre> <pre class="alt"><span class="lnum"> 91: </span> Assert.IsTrue(context.ScopeProgress.TotalChangesApplied ==42);</pre> <pre><span class="lnum"> 92: </span> </pre> <pre class="alt"><span class="lnum"> 93: </span> }</pre> </div> <p> </p> <p>There is a bit of work here, but with a bit of elbow grease thanks to Visual Studio Test Tools, RhinoMocks, reflection and a little code generation the framework is testable.</p><img src="http://rickgaribay.net/aggbug/256.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/08/17/unit-testing-microsoft-sync-framework-amp-wcf.aspx Tue, 18 Aug 2009 04:46:33 GMT http://rickgaribay.net/archive/2009/08/17/unit-testing-microsoft-sync-framework-amp-wcf.aspx#feedback 2 http://rickgaribay.net/comments/commentRss/256.aspx http://rickgaribay.net/services/trackbacks/256.aspx Rhino Mocks Ignore Arguments http://rickgaribay.net/archive/2009/06/12/rhino-mocks-ignore-arguments.aspx <p>I am writing some tests for a project I am working on called Green Fee Broker.</p> <p>The first thing I am doing is mocking the business layer for the WCF service that I am writing so I can inject it into the service’s constructor and write the service while isolating dependencies:</p> <blockquote> <p>MockRepository mockRepository = new MockRepository(); </p> </blockquote><blockquote> <p>IBookingManager manager = mockRepository.DynamicMock&lt;IBookingManager&gt;();</p> </blockquote> <p>Next, I set an expectation that CreateTeeTime is called on the manager mock, which is injected into the service constructor:</p> <blockquote> <p>Expect.Call(manager.CreateTeeTime(course, DateTime.Now)).Return(teeTimeStub);</p> </blockquote> <p>Finally, I ReplayAll to record the mock, call the service and assert that I am getting back a TeeTime object:</p> <blockquote> <p>mockRepository.ReplayAll(); </p> <p>BookingService service = new BookingService(manager);</p> </blockquote><blockquote> <p>TeeTime teeTime = service.CreateTeeTime(course, DateTime.Now); </p> <p>Assert.IsTrue(teeTime.ConfirmationNumber == "ABC123"); </p> </blockquote> <p>Unfortunately, there is a bug in the line of code that sets up the expectation. With Rhino Mocks, for an expected behavior to be a match, the parameters must be an exact match. Notice the second parameter uses DateTime.Now. This means that the expectation will have a different parameter than the actual call, even if it is just a few milleseconds of a difference. As a result, the assertion will fail because the return is null.</p> <p>The solution is to add the IgnoreArguments method call on the expectation:</p> <blockquote> <p>Expect.Call(manager.CreateTeeTime(course, DateTime.Now)).Return(teeTimeStub).IgnoreArguments(); </p> </blockquote> <p>The IgnoreArguments() call will ensure that the parameters are discarded completely in determining a match.</p> <p>Now I am green, and good to go!</p> <p><a href="http://rickgaribay.net/Images/CustomContent/RhinoMocksIgnoreArguments_A8F/image.png"><img title="image" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="163" alt="image" width="644" border="0" src="http://rickgaribay.net/Images/CustomContent/RhinoMocksIgnoreArguments_A8F/image_thumb.png" /></a></p><img src="http://rickgaribay.net/aggbug/247.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/06/12/rhino-mocks-ignore-arguments.aspx Fri, 12 Jun 2009 07:47:26 GMT http://rickgaribay.net/archive/2009/06/12/rhino-mocks-ignore-arguments.aspx#feedback http://rickgaribay.net/comments/commentRss/247.aspx http://rickgaribay.net/services/trackbacks/247.aspx M Model for Desert Code Camp http://rickgaribay.net/archive/2009/06/10/m-model-for-desert-code-camp.aspx <p>I thought I’d post the model I created for my <a href="http://www.desertcodecamp.com/signUp.aspx?session=535">Desert Code Camp session</a> “Building a Service-Oriented Application from the Bottom Up”.</p> <p>The model is created with “M”, a new declarative language for building models in Microsoft Oslo.</p> <p>As you can see, the domain is built around golf, or more specifically, managing bookings and tee times for a sample application called “Green Fee Broker”.</p> <p><a href="http://rickgaribay.net/Images/CustomContent/MModelforDesertCodeCamp_132C0/image_3.png"><img title="image" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="772" alt="image" width="696" border="0" src="http://rickgaribay.net/Images/CustomContent/MModelforDesertCodeCamp_132C0/image_thumb_3.png" /></a> </p> <p>In this session, I will demonstrate how to compile the M model into Transact-SQL, and deploy it to the database. Next, with the logical schema out of the way, we’ll get started with the GreenFeeBroker service, a WCF 3.5 service that accepts booking requests from golfers on the internet looking for the best possible deal. Moving down the stack, we’ll use Entity Framework to model our conceptual entities and deliver at least one end-to-end slice of functionality using TDD.</p><img src="http://rickgaribay.net/aggbug/246.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/06/10/m-model-for-desert-code-camp.aspx Thu, 11 Jun 2009 04:57:46 GMT http://rickgaribay.net/archive/2009/06/10/m-model-for-desert-code-camp.aspx#feedback 1 http://rickgaribay.net/comments/commentRss/246.aspx http://rickgaribay.net/services/trackbacks/246.aspx Bite-Sized SOA: Think Big, Start Small, Rinse and Repeat http://rickgaribay.net/archive/2009/05/31/bite-sized-soa-think-big-start-small-rinse-and-repeat.aspx <p>Please join my colleague, Todd Sussman and I on Wednesday, June 3rd as we share thoughts and best practices for delivering SOA to the enterprise.</p> <p>In this 1 hour free webcast we will:</p> <ul> <li>Discuss the organizational, technical and political challenges inherent to distributing business processes across geographical business assets, vendors and business units of varying maturity. </li> </ul> <ul> <li>Provide insight and guidance directly from the field on how to bring business, technical and vendor teams together to achieve the shared vision and promise of SOA using state-of-the-art technology from Microsoft and the .NET partner ecosystem including specific discussions around WCF, Microsoft Business Rules Engine (BRE) and Neuron ESB. </li> </ul> <ul> <li>Provide real-world metrics from this success story that can be used to plan and measure success in your SOA initiatives. </li> </ul> <p>Register here: <a title="https://www.clicktoattend.com/invitation.aspx?code=137585" href="https://www.clicktoattend.com/invitation.aspx?code=137585">https://www.clicktoattend.com/invitation.aspx?code=137585</a></p><img src="http://rickgaribay.net/aggbug/245.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/05/31/bite-sized-soa-think-big-start-small-rinse-and-repeat.aspx Sun, 31 May 2009 21:00:06 GMT http://rickgaribay.net/archive/2009/05/31/bite-sized-soa-think-big-start-small-rinse-and-repeat.aspx#feedback http://rickgaribay.net/comments/commentRss/245.aspx http://rickgaribay.net/services/trackbacks/245.aspx Desert Code Camp 5 is coming on June 13, 2009 http://rickgaribay.net/archive/2009/05/16/desert-code-camp-5-is-coming-on-june-13-2009.aspx <p>I will be presenting a two-part session at Desert Code Camp 5 entitled <strong><em>"Building a Service-Oriented Application from the Bottom Up".</em></strong></p> <p>In <strong>Part 1</strong> of I will demonstrate how to build a data model with "M" (a new, simple declarative language for building domain models and working with data that is part of the Oslo vision), and use Entity Framework to generate a conceptual data model and corresponding entities to build out our domain model. Next, I'll demonstrate Test-Driven-Development to implement a data access layer using LINQ to build CRUD methods for working with our model, wrap it in a business component and expose the application as a WCF service.</p> <p>With the WCF service-oriented application completed in part 1 of this session, in <strong>Part 2</strong> I'll demonstrate the implementation of a smart client application using the Model-View-Presenter (MVP) design pattern and implement the Gateway pattern in a service agent that will provide the communication infrastructure to the service we built in part 1. I'll demonstrate both BDD and TDD in working with the model, presenter and service agents.</p> <p>Sound interesting? Then please, sign up for my talk!</p> <p><a title="http://www.desertcodecamp.com" href="http://www.desertcodecamp.com">http://www.desertcodecamp.com</a></p> <p>See you at Desert Code Camp!</p><img src="http://rickgaribay.net/aggbug/242.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/05/16/desert-code-camp-5-is-coming-on-june-13-2009.aspx Sat, 16 May 2009 17:40:05 GMT http://rickgaribay.net/archive/2009/05/16/desert-code-camp-5-is-coming-on-june-13-2009.aspx#feedback http://rickgaribay.net/comments/commentRss/242.aspx http://rickgaribay.net/services/trackbacks/242.aspx Websphere on Windows Outperforms Websphere on AIX by 37%, Who Knew? http://rickgaribay.net/archive/2009/04/30/websphere-on-windows-outperforms-websphere-on-aix-by-37-who.aspx <p>In a conference call with Steven Martin yesterday, the head of the products division that includes .NET, Azure, IIS, ASP.NET, Dublin and Oslo shared some very impressive news.</p> <p>Led by <a href="http://blogs.msdn.com/gregleak/">Greg Leake</a>, a team of researches in the Microsoft Connected Systems Division set up two rigs in the lab. One was  a 64-bit IBM WebSphere 7 Application Server running on an IBM Power 570 (IBM Power6/AIX 5.3 platform) and the other was a Hewlett Packard BladeSystem C7000 with Windows Server 2008 64-bit. Each were set up to run comparable versions of the Stock Trader reference application which has long been a reference standard for performance benchmarks. </p> <p>In his <a href="http://download.microsoft.com/download/4/8/6/486B4B4F-5A87-4B5C-BEEC-455290F83274/IBMPower570_WebSphere_7_%20NET_Benchmark_WinSrv2008.pdf">paper</a>, Greg compares the performance and price of these two IBM WebSphere platforms to the equivalent workloads developed using the Microsoft .NET Framework and deployed to the Hewlett Packard BladeSystem C7000 with Windows Server 2008 64-bit operating system.The results are astounding.</p> <p>Of course, as you would expect, the ported version of the application, for .NET outperformed the J2EE/Websphere version by 57%, because it is no surprise that .NET is leaner and meaner than the Java platform, especially when it comes to distributed communication and Service Orientation leveraging WCF. </p> <p>What is even more impressive, is that the IBM reference application, designed for Websphere runs 37% more efficiently on Websphere on Windows than Websphere on AIX! It gets better. The AIX rig, which Microsoft acquired on the regular market, retailed in at a total system cost of $215,000. This figure includes the IBM Power 570 hardware cost plus cost of <a href="http://rickgaribay.net/Images/CustomContent/WebsphereonWindowsOutperformsWebsphereon_692E/image_3.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 5px; border-right-width: 0px" height="178" alt="image" src="http://rickgaribay.net/Images/CustomContent/WebsphereonWindowsOutperformsWebsphereon_692E/image_thumb.png" width="244" align="right" border="0" /></a> Websphere middleware. </p> <p>The alternative? The platform that has long been regarded as inferior for large enterprise application scenario? The platform that has spanked the IBM equivalent by 57%? The Windows Server 2008 system, running HP BladeSystem C7000 has a total hardware cost of, wait for it… $50,161.That’s an 81% system cost savings for a configuration that outperforms the 6-figure-monster by 57%.</p> <p>Now of course, this would be news in itself. But it doesn’t stop there. Greg’s group found that the identical reference application, deployed for Websphere on Windows Sever 2008 outperforms the IBM/AIX rig by 37%, and all for a 66% cost saving. The savings of course is reduced from the 81%, because unlike the Windows Platform, Websphere, well, isn’t free. Tacking $37,000  on for Websphere middleware licensing costs brings the Websphere on Windows system cost up to $87,161. </p> <p>Now of course, the questions you have to ask, given this <a href="http://download.microsoft.com/download/4/8/6/486B4B4F-5A87-4B5C-BEEC-455290F83274/IBMPower570_WebSphere_7_%20NET_Benchmark_WinSrv2008.pdf">detailed information</a> are the following:</p> <ol> <li>Why would you choose an inferior platform to run you mission critical enterprise applications when it underperforms when compared to an equivalent hardware and middleware configuration, especially when the IBM/AIX configuration costs 81% more? </li> <li>If you are running Websphere, why would you not opt to save 66% of your total system costs by moving to the Windows platform, especially if doing so would result in over a third better total application performance? </li> </ol> <p>These are some big questions that Microsoft hopers Big Blue will attempt to answer.</p> <p>In fact, Microsoft has prepared a site dedicated to informing and educating the industry on its findings: <a title="http://www.websphereloveswindows.com/" href="http://www.websphereloveswindows.com/">http://www.websphereloveswindows.com/</a></p> <p>Now, while the performance benchmarks and cost savings speak for themselves, I have some breaking news. The report is flawed. Severely flawed. The report doesn’t speak to other costs such as administrative costs, maintenance or professional services. If you are an IBM/Websphere/AIX shop, you know too well how expensive keeping these systems running is. From tooling, to readiness, the Microsoft platform just has a far better story when it comes to administration and maintenance. And, if you’ve ever hired at Websphere consultant, you know what a bargain services from even a premier managed partner like Neudesic are.</p> <p>References:</p> <ul> <li><a title="http://blogs.msdn.com/stevemar/archive/2009/04/30/websphere-loves-windows-who-knew.aspx" href="http://blogs.msdn.com/stevemar/archive/2009/04/30/websphere-loves-windows-who-knew.aspx">http://blogs.msdn.com/stevemar/archive/2009/04/30/websphere-loves-windows-who-knew.aspx</a> </li> <li><a title="http://www.websphereloveswindows.com/" href="http://www.websphereloveswindows.com/">http://www.websphereloveswindows.com/</a> </li> <li><a title="http://www.microsoft.com/windowsserver/mainframe/whoknew/default.aspx" href="http://www.microsoft.com/windowsserver/mainframe/whoknew/default.aspx">http://www.microsoft.com/windowsserver/mainframe/whoknew/default.aspx</a> </li> <li><a title="http://msdn.microsoft.com/en-us/netframework/bb499684.aspx" href="http://msdn.microsoft.com/en-us/netframework/bb499684.aspx">http://msdn.microsoft.com/en-us/netframework/bb499684.aspx</a> </li> <li><a title="http://download.microsoft.com/download/4/8/6/486B4B4F-5A87-4B5C-BEEC-455290F83274/IBMPower570_WebSphere_7_%20NET_Benchmark_WinSrv2008.pdf" href="http://download.microsoft.com/download/4/8/6/486B4B4F-5A87-4B5C-BEEC-455290F83274/IBMPower570_WebSphere_7_%20NET_Benchmark_WinSrv2008.pdf">http://download.microsoft.com/download/4/8/6/486B4B4F-5A87-4B5C-BEEC-455290F83274/IBMPower570_WebSphere_7_%20NET_Benchmark_WinSrv2008.pdf</a> </li> </ul><img src="http://rickgaribay.net/aggbug/240.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/04/30/websphere-on-windows-outperforms-websphere-on-aix-by-37-who.aspx Thu, 30 Apr 2009 14:39:17 GMT http://rickgaribay.net/archive/2009/04/30/websphere-on-windows-outperforms-websphere-on-aix-by-37-who.aspx#feedback http://rickgaribay.net/comments/commentRss/240.aspx http://rickgaribay.net/services/trackbacks/240.aspx SSWUG Ultimate Virtual Conference April 22-24th http://rickgaribay.net/archive/2009/04/15/sql-server-world-wide-user-group-sswug-ultimate-virtual-conference.aspx <p><a href="http://www.vconferenceonline.com/shows/spring09/sql/"><img alt="" src="http://www.vconferenceonline.com/service/468.gif" /></a> </p> <p>I will be delivering two sessions at the SQL Server World Wide User Group Ultimate Virtual Conference being held worldwide online on April 22nd through April 24th, 2009.</p> <p><strong>Building, Configuring, Hosting and Deploying a Service-Oriented Application with Windows Communication Foundation 3.5</strong></p> <p><strong></strong></p> <p>Services are the next evolution in software engineering for building distributed systems. Windows Communication Foundation (WCF) is the premier framework for building service-oriented applications in .NET 3.5. </p> <p>WCF is a programming model that unifies messaging and communication concerns typical in building service-oriented applications into a single programming model that makes service-orientation tenable. In this session, we will explore the case for building service-oriented applications and demonstrate how to build, configure, host and deploy a WCF service leaving you with a fundamental foundation of the core concepts and techniques of WCF that you can put to work right away.</p> <p><strong>Building Reliable Distributed Services with Windows Communication Foundation 3.5</strong></p> <p>Services coordinate work. Often, this work may be distributed across any  number of services which work together to fulfill a business process. </p> <p>Transactional capabilities such as atomicity, consistency, isolation and durability have long been a mainstay of database development, and delivering the same level of reliability in service-oriented applications is not optional. Windows Communication Foundation (WCF) supports both local and distributed transactions in intranet and internet scenarios. In this session, we will explore why understanding transactional support in WCF is critical to providing reliability in your service-oriented applications and how you can leverage WCF’s support for local and distributed transactions with an emphasis on delivering distributed services that are reliable and transacted.</p> <p>The conference price is $125 per track, and there are 36 sessions across 4 tracks including SQL, .NET, MOSS and BI.</p> <p>Check out the registration page here, and use VIP code <strong>SPRGARN09</strong> for a discount: <a title="https://www.vconferenceonline.com/shows/spring09/sql/register/multireg.asp?newmem=1&amp;show=sql" href="https://www.vconferenceonline.com/shows/spring09/sql/register/multireg.asp?newmem=1&amp;show=sql">https://www.vconferenceonline.com/shows/spring09/sql/register/multireg.asp?newmem=1&amp;show=sql</a> </p> <p><font size="2">The .NET track schedule is available here: <span style="COLOR: #1f497d"> <a href="http://www.vconferenceonline.com/shows/spring09/dotnet/sessions.asp">http://www.vconferenceonline.com/shows/spring09/dotnet/sessions.asp</a></span></font></p><img src="http://rickgaribay.net/aggbug/236.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/04/15/sql-server-world-wide-user-group-sswug-ultimate-virtual-conference.aspx Thu, 16 Apr 2009 05:44:53 GMT http://rickgaribay.net/archive/2009/04/15/sql-server-world-wide-user-group-sswug-ultimate-virtual-conference.aspx#feedback http://rickgaribay.net/comments/commentRss/236.aspx http://rickgaribay.net/services/trackbacks/236.aspx Global MVP Summit 2009 http://rickgaribay.net/archive/2009/03/04/global-mvp-summit-2009.aspx <p>The 2009 Global MVP Summit is winding down.</p> <p>Day 1 kicked off with a welcome keynote from Toby Richards, General Manager of Microsoft Community Support Services along with Rich Kaplan, CVP Customer and Partner Advocacy. It was a very uplifting message around the impact that MVPs have, not only within the community but at Microsoft as well. It is just fantastic to be a part of a worldwide community of folks who care deeply about the technology and believe that technology can transcend all barriers. </p> <p>Day 2 included deep dives into modeling with “M”, new stuff coming out for WCF and REST and other WCF service enhancements, none of which I can talk about.</p> <p>Yesterday was all about WF 4.0 and Dublin and all I can say is the bits are getting baked.</p> <p>Today, we’ll meet with Steve Ballmer and get his perspective on the Microsoft ecosystem, as well as get an update on Windows 7 from Mike Nash and a recap of everything we’ve discussed from S. Somasegar.</p> <p>So, since there is not much I can talk about, I thought I’d share how fortunate I feel to be a part of this great group of people from all of the world. As one of 4,400 MVPs I feel privileged I feel to be an extension of an organization I am proud to represent. No, Microsoft is not perfect, and I’ve never worked for or with an organization that is, but when you get an opportunity to collaborate on a rich technical level with folks that are so passionately committed, you can’t help but be optimistic. I am not only talking about MVPs, but the product teams themselves.</p> <p>While this is now my second MVP Summit, and third time I’ve been on campus, I still marvel at how efficient things are run. From Microsoft Connect taxis that will shuttle you to any building you choose, to the extremely friendly and competent bus drivers and event coordinators that make the commute to and from Seattle run so smoothly. It was very cool to see the MVP Summit banners adorn the exterior walls of campus buildings including the Microsoft Convention Center and light posts along Microsoft Way.</p> <p>Of course, one of the biggest highlights is the opportunity to catch up with my Phoenix MVP friends like Dave Campbell, Lorin Thwaits and Scott Cate. We joked that we have to fly up to Redmond to hang out which we must definitely fix! In addition, I enjoyed catching up with fellow Connected Systems Developer MVPs  like Roman Kiss, Mick Bradan and Alan Smith and getting to know folks like Matt Milner whose work I’ve followed for quite some time- Brian Loesgen and Sam Gentile, you were definitely missed but I know someone has to work while we play :-)</p> <p>And, as with last year’s summit, the genuineness with which the product teams interact with MVPs, and the effort put forth my the MVP leads, and Customer Experience folks like Ed Hickey is just remarkable. These folks live and breath this stuff, and the chance to geek out and be speaking completely the same language on the same wave length is something that few technologists really get a chance to experience. What I mean is that so often, our dialog can easily become a victim of the impedance mismatch that is pervasive in engineering communication (for more information, please see pattern language). The opportunity to have deep, rich discussions with the very teams behind the technologies that I work with customers on every day is truly a privilege.</p> <p>So, again, while NDAs keep me from sharing any juicy details around all the tremendous vNext stuff emerging from buildings 42 and 43, I want to thank Toby and Rich for continuously building a case for the MVP program at the organizational level, Ed Hickey and Mark Clargett for making the CSD program what it is and putting forth the tremendous effort both every single day as well as in making this yearly event such a pleasure. I also want to thank members of the CSD team like Ed Pinto, Kenny Wolf, Matt Winkler, Don Box, Chris Sells, Richard Orr,  Kent Brown, Cliff Simpkins and Marjan Kantlar- to name just a few- that make it so easy for guys like me to do what I do.</p><img src="http://rickgaribay.net/aggbug/227.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2009/03/04/global-mvp-summit-2009.aspx Wed, 04 Mar 2009 20:59:39 GMT http://rickgaribay.net/archive/2009/03/04/global-mvp-summit-2009.aspx#feedback http://rickgaribay.net/comments/commentRss/227.aspx http://rickgaribay.net/services/trackbacks/227.aspx