11.10.2012

Webinar on Software Best Practices and ROI

I've recently seen a webinar that I would like to share with you. It concerns software best practices and their impact on companies, mainly focusing on these practices ROI. If you're trying to understand if best practices really work, or struggling to convince anyone of this, than this presentation just might be what you're looking for. I would like to highlight not only the content of the presentation, but also the Q&A session at the end of the talk.
The presenter is Steve McConnell, author for several renowned books. I've recently read his "Software Estimation: Demystifying the Black Art" and strongly recommend it!

I've asked for permission to publish the link for this webinar and Steve has given his blessing, so here's the link to a recording of Steve's talk.



8.26.2012

Customizing your application resources

Picture this: You have an asp.net application in which you support multiple languages through the use of resources (global and local resources) and depend on the .NET framework to do all the hard work of loading the correct resources depending on the current UI culture. All is well until you have a requirement of customizing a handful of resources (either per user, per customer, or any other criteria you may think of).
Anyone who has enough knowledge of the .NET framework, tells you right away that you can create your own resource provider and take control of all the aforementioned mechanism. You can find several articles online, including MSDN articles with a detailed explanation of how to provide your own resource provider (here's an interesting article about it).
There are several online resources supplying examples of resource providers that load resources from the database and other similar approaches. However in this specific situation we would like to preserve the default provider behaviour and override only when the target resource has been customized. It seems pretty easy, right? We override the default provider, find if the target resource has been customized, if so, return the new value, otherwise, call the base class implementation, right?
Wrong! You can't extend it because the GlobalResXResourceProvider class (default provider responsible for resolving global resources) is internal, the LocalResXResourceProvider class (default provider responsible for resolving local resources) is internal and the ResXResourceProviderFactory class (provider factory responsible for creating instances of the global and local resource providers) is... guess what... internal! So, it seems Microsoft did not want us to extend this classes...
Right now we could opt to rewrite this providers ourselves OR we could avoid that hard work and opt to create our resource providers as proxies/surrogates (see the design pattern here) that end up invoking the default providers. The only question is how do we initialize these default providers if they are internal... It's not pretty, but I can only think of reflection. In this case, instead of accessing both default providers through reflection I chose to minimize the points of failure by creating only the default resource provider factory through reflection and calling it's public interface to retrieve the default provider instances.
So here's the how our brand new resource provider factory looks like:

Plain simple, just create our brand new customizable resource providers and pass them a "fallback" provider, which will be used to resolve any resource that hasn't been customized. Our new resource providers just have to determine if they should resolve the resource or if they should use the "fallback" provider (which will be the default provider). Something like this:


Nice and easy! Accessing internal stuff in the framework is obviously something to be avoided, but I think we're pretty safe here. Resource providers have been around for a while and I don't expect Microsoft to remove this class sooner.

7.07.2012

Bug Hunting with NDepend


Here's another post about NDepend (one of my favorite tools of the trade)! I've recently installed the new NDepend v4 and here's how I've used it for the first time.
I was going through the logs of the asp.net application I'm developing and found reasons to believe that somewhere in the application an object was being written on the viewstate that wouldn't serialize as supposed and throw an exception.
Now, how do we find and fix this bug easily? Surely we could attempt to find in the solution for all uses of the Viewstate and reading that code, but that would be too much code to read, so I've decided to use NDepend to aid me.
So here's what I've though:
- most of the times we use the viewstate in this application is through a property on a page or user control;
- if it's a serialization error, we can ignore properties whose type is a primitive type as we're likely dealing with a class defined in our application;

Here's how I've done it:

From here I only had 3 source code locations to investigate! Much easier than going through the entire application, isn't it?

The ability to query your code (and now in a syntax much alike the linq queries I write day after day) is something very powerful, and every once in a while we might find a new way of use this power!

2.08.2012

NCrunch

I think I can say that I know most of the relevant development tools related with the .NET world, so it's obviously not every day that I stumble upon a new tool worth of notice. But today (or rather tonight) was one of those days (or nights). Even more relevant is the fact that this one is free (at least for know, while its considered a beta version).
I'm talking about NCrunch (http://www.ncrunch.net/). It's a tool targeted for developers using Visual Studio and doing TDD. It aims to decrease the amount of time we loose compiling and runing our unit tests, by not requiring us to do it at all! That is, it compiles and runs our tests in background automatically. Even before we save the file with the unit tests source code!
I'm not going to write a full review, but I dare you to use a handful of minutes looking at the video presented in the NCrunch homepage to see the awesome features available.

Happy coding and testing!

2.05.2012

Reviewing uCertify 70-515-CSharp MCTS exam prepkit (Part 2)

Hi again!

As I wrote in the last post, I'm reviewing a preparation kit for the 70-515-CSharp MCTS exam from uCertify.
Today, I'm here to write about what I've found to be the strengths and weaknesses of this product.

This is a full-featured product that pretty much covers everything this kind of tools should cover. I would highlight the following strengths of the product:
  • Easy and intuitive user-interface;
  • Rather complete explanations of why an answer is either correct or incorrect. Some other products I've seen before are only concerned about wrong questions, and dismiss explanations about the correct which may be as relevant as the explanation for wrong questions;
  • Extensive study materials covering most topics targeted by the exam. I didn't use them much myself, because I would rather take a peek at documentation supplied in msdn (links to these online resources are also supplied in a section of this product) and try the old "learn by doing" method. However there are people that would rather read the study materials and retake the tests, so I believe this is a useful feature.
  • Several kinds of test "layouts", from the traditional format, into adptative tests (which dynamically adapt the question complexity to your answers. That is, if you're getting your answers right, the complexity will gradually increase, otherwise they will decrease, thus showing you questions accordingly to your kownledge level).
and my favorite feature:
  • The hability to take quick tests.  Say that you only have a handful of minutes and you want to study a bit. Just open the application, and start a fixed time test, specifying how many minutes you wish to spend. Lacking enough free time to take complete tests, I found myself using this kind of tests a lot.

I would like to point out that despite the target of this application is to prepare yourself to take the 70-515 exam, you can also use it as a way of enriching and testing your knowledge. For instance, I find out that I have some serious gaps in ASP.NET MVC (which doesn't surprise me, knowing that I haven't developed any serious application in MVC). I just might be targeting MVC as one of the next things to investigate deeper.
Bottom line: if you've decided to take this exam, this kind of tools are definitely a good way of testing and evaluating your knowledge and I would recommend the uCertify product. But always remember that you might find different questions and topics in the real exam, so real-world experience is a must-have. Don't take your exam for granted just because you have good results in the preparation tool.

By the way, any readers of my blog are entitled to a 10% discount (in addition to any existing sale) on any test preparation software from uCertify (just use the discount code 'UCPREP' in the uCertify shopping cart).

1.02.2012

Reviewing uCertify 70-515-CSharp MCTS exam prepkit

Hi! Long time since my last post, right? Let's hope I can make a few more posts in this brand new year than I did in 2011.

I'll start the year by reviewing a preparation kit for the 70-515-CSharp MCTS exam from uCertify.
I have got a offer from them to review their PrepKit (which you can find here) and I have accepted that challenge. Initially it looks fully-featured and with a nice UI, I haven't had the time to make a few tests and that's what counts most, so I'll leave any further review opinions for later. As soon as I am done with the full review I will post it for you all.

Best regards and a Happy New Year