Work Late with Workstate - Joe's WeblogMarch 05, 2005
System.Transactions in .NET 2.0In .NET 2.0 Microsoft is adding support for the explicit creation and management of distributed database transactions in a new super-easy-to-use API (Application Programming Interface) called System.Transactions. As a bit of background, here's a grossly oversimplified history of distributed transaction APIs and frameworks:
Not that this is a bad thing... quite the opposite in fact. The MTS / COM+ style and the explicit transaction style have distinct feature sets and even in the cases where those feature sets overlap, both models have their pros and cons. Regardless, it's still pretty interesting to observe the full circle that Microsoft has completed here. Although System.Transactions is, in some ways, a step backward in time, it is also an interesting and significant step forward in terms of developer productivity. Part of the original motivation for MTS / COM+ was the fact that explicit transaction code that included proper connection management and full error handling / rollback code, was quite tedious and verbose to create and maintain in the VB / C++ world of the mid 90s. Where MTS / COM+ was revolutionary, System.Transactions is evolutionary. Highly evolutionary... so much so that System.Transactions looks almost nothing like its primitive ancestors. By relying on modern data access layers, a garbage collection runtime and even some of the post-Java features of .NET, new code written to System.Transactions is some of the cleanest and most readable distributed transaction code that I've ever seen: public class AccountTransactions { public static void Transfer(int IN_Amount) { using (TransactionScope scope = new TransactionScope()) { using (SqlConnection connection1 = new SqlConnection(DemoData.Bank1Database)) { connection1.Open(); using (SqlConnection connection2 = new SqlConnection(DemoData.Bank2Database)) { connection2.Open(); DoWithdrawal(connection1, IN_Amount); DoDeposit(connection2, IN_Amount); scope.Complete(); } } } } } This code is based on example code from Mike Clark's recent and highly recommended MSDN Video 'Introducing System.Transactions in .NET 2.0'. Now before anyone jumps up and screams "That doesn't look any cleaner than the JDBC / ADO.NET / etc. code that I'm already using today" please note that this code implements a full distributed transaction across two distinct database servers. The databases in question could be on different machines or be of completely different platform / resource manager type (two Oracle servers, or one SQL Server and one Oracle Server, or a message queue and a database server, etc.) The level of effort necessary to explicitly orchestrate these types of distributed transactions has never been lower. And if that wasn't enough... the new framework also automatically supports promotable enlistment (when supported by the underlying resource manager) which significant improves performance in situations where only a single database is being accessed. System.Transactions looks like it's going to be a great new addition to the .NET data access story. December 14, 2004
Google LibrariesPlease excuse the mindless link propagation but Google is the gift that keeps on giving. June 30, 2004
Apple Rendezvous SDK for WindowsApple has released a tech preview of their new Rendezvous SDK for Windows. Rendezvous is Apple's implementation of the Zeroconf protocol which enables auto-discovery of local network services without requiring any manual configuration by the user. This is an extremely useful feature for roaming users and allows them to, for example, start their laptop in a new or unknown office and instantly see any local web sites and printers that are availble to them. Zeroconf can also help to simplify, or even eliminate altogether, the need for the networking configuration interfaces currently required by collaborative and/or ad-hoc networking applications such as realtime document sharing software and multiplayer games. I've been watching the Zeroconf space in the hope that more Windows support for the protocol would materialize. Porchdog Software has had a Zeroconf stack called Howl available for quite some time now. Hopefully, based on Apple's recent commitment, we'll be seeing more Zerconf enabled Windows apps in the future. June 23, 2004
No Comdex in 2004Wow. April 24, 2004
Word and Excel Data IslandsTwo recent posts from Paul Cornell and Eric Carter show off the extremely impressive looking data island features of the upcoming Visual Studio Tools for Office 2.0. Microsoft has taken what is probably the most common automation scenario for Word and Excel documents and crafted a nearly perfect solution. Behold:
Although it's technically possible to implement some of these features today by autogenerating and/or manipulating the new Word and Excel XML formats directly from server-side code, these new VSTO features will enable developers to create much more robust solutions with only a fraction of the effort required today. This is super-impressive looking stuff... read on for the full details: Offline and server-based Office document scenarios
April 19, 2004
PINVOKE.NETPINVOKE.NET is a Wiki site dedicated to P/Invoke signatures. The fact that the site is a Wiki makes it simple for anyone to add new signatures or update existing ones... all without requiring a login. If enough developers play along then this site could quickly become an indispensable .NET resource. April 06, 2004
New DynamicMethod Class in the CLRJoel Pobar has recently posted some great introductory material regarding the new DynamicMethod class being added to the CLR: Hello World, LCG Style! DynamicMethod will allow runtime code generation to occur at a finer level of granularity, with better performance, and presumably without the resource hogging issues that exist with dynamic assemblies today. This is going to be a great addition to the CLR and we certainly would have made extensive use of this functionality had it been available to us during the implementation of Codify. Beta documentation for DynamicMethod is available on MSDN: April 02, 2004
Software Cold War EndsWow... Sun gets $1.6 billion to kiss and make up. This has all the makings of a watershed moment for the tech industry. Over time, even previously bizarre phrases like "Microsoft Certified Sun Xeon Server" will begin to sound normal. It's a strange world. It's also pretty entertaining to consider the fact that the PR handlers at both companies probably had to avoid announcing this yesterday for fear of the the April Fools factor. October 16, 2003
The most powerful key on the keyboard...One of the amazing things about software is that it's possible to use it for years and years and years without discovering major features that have been hiding in there all along:
I've written and tested more than my fair share of tree view code over the years. (In fact, Codify uses more tree views than should be legally allowed in a single application.) In all this time I had no idea that these little gizmos were sitting there on my keyboard waiting to save me hundreds and thousands of mouse clicks. Maybe some of these other keys are useful too... September 03, 2003
Codify 1.3 and our New SiteThe past week has been pretty hectic. We released Codify 1.3 and launched an entirely new version of our website. Codify has several new features that we're pretty excited about. We're hoping to put up some new tutorials soon that show these features in action. As for the new site.. it was a tough decision to make. We liked our previous site design visually but were looking for a way to reduce our update friction. So... we decided to go with a less structured and more text centric site. And being the programmers that we are... we locked on to the idea of a text-centric site and took it pretty far towards the to the furthest possible extreme. There are still a few things that we don't like so you can expect to see it evolve over time. Hope you like it! If you run into any problems or have any feedback then please don't hesitate to let us know at team.website@workstate.com. Subscribe: RSS 2.0 |