First published on MSDN on May 13, 2016
Authored by Mike Demond
Hello everyone, it’s time for another installment of Adventures in Azure. Well, it’s supposed to be another installment of Adventures in Azure, but I have not spent a single second in Azure for the past month, so I am going to do the next best thing and showcase the technologies I have been working with, instead. To catch you up, I am moving my Vote Reporter over to Azure. The Vote Reporter is based on a codebase that I have kept with me in one form or another for over a decade during my .NET development travels. Whenever I find new code I like or if there is any sort of abstracted code I design, it goes into my codebase/framework . It is through this process that I have learned the most about computer science. Starting last year, I have taken to rewrite it to make it more compatible for the new cross-platform era upon us, and I have learned A LOT – A LOT A LOT! Haha. In fact, this past month was spent really ironing out a lot of issues between all the new tech I am integrating and learning, and just learning in general. So, without further delay, here are the key technologies I am using in my framework and I highly recommend you checking them out to see how they fit into your projects/solutions.
To start with, I cannot recommend xUnit as a unit testing framework enough. It is very straight-forward in its design approach and has a very extensible model if you so wish do so. There is a lot to like about xUnit, but what I appreciate most about xUnit 2.0 in particular is that it has been built up from the ground with parallel processing in mind. That means tests run concurrently (6 by default) and allow your tests to run fast .
However, if your code is built in a not-so-concurrent-friendly way (as my codebase was, making abundant use of the Microsoft.ServiceLocation.ServiceLocator anti-pattern ), then you learn about it the hard way. In fact, most of my time has been spent within xUnit in one way or another learning this new way of thinking. Well, "new" if you are like me and have come from a WPF background where “threading” is simply about UI and background threads. My mind has totally been opened to this whole new world via xUnit and my code has benefitted from it greatly!
On the heels of xUnit is AutoFixture, which works with xUnit to easily introduce variables within your testing methods. Mark Seemann is a total hero of mine and still feel he runs the best technical blog on the web . This is one of his creations and I again can’t contain myself is saying how awesome it is, not only in function, but the code itself in its GitHub repo . I have spent some time (ok A LOT of time) exploring this codebase and learning a thing or two. After using xUnit + AutoFixture, I cannot imagine writing my tests in any other way.
ReSharper is one of those technologies where developers either love it or hate it (usually due to performance issues). For me, I buy my development machine with ReSharper in mind so it is never an issue. :) The folks at JetBrains have just released a new suite of tools along with ReSharper and have called it ReSharper Ultimate. There are a lot of products included in Ultimate, but I will outline the ones that I enjoy the most:
PostSharp is another one of those technologies that seem to have developers divided on using it or not. Some consider it " magic " while others truly appreciate its approach and power. I personally have fallen in love with the latest version, the 4.x release. If you are not aware, PostSharp enables Aspect-Oriented Programming for .NET applications. For me, PostSharp adds a lot of power to my design choices and has changed the way that I approach design decisions and consider problems. The team there has also been incredibly helpful on their support forum and have done a great job in making sure questions are answered, problems solved, and reported bugs fixed. They even go through the trouble of providing sample code to help you get started . I highly recommend this technology if you you are interested in finding a powerful new way to approach your solutions.
Finally, I have to give a shout out here to Steven Cleary , author of the Nito.ConnectedProperties project. This lightweight package has been amazing for me and again like PostSharp has changed how I go about developing solutions. If you are familiar with WPF attached properties, then you are already familiar with how ConnectedProperties work. Essentially, ConnectedProperties offer a thread-safe (important when you are now developing thread-aware/centric solutions!) data that you can attach to any object, as long as it is a reference object and not a value. The data is based on a WeakReference and gets cleaned up from memory when its host is collected. This project has started out as a cool tool in my proverbial toolbelt but has really turned into a powerhouse that has solved more than one tricky problem for me. I definitely recommend looking into this project, especially if you have experience with WPF attached properties!
Well, that concludes my tour and check-in for this month. I am hoping now that I can start moving onto Azure and get some value to report with its infrastructure for next month. Until then, keep your head in the cloud!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.