Tuesday, April 29, 2008

Windows XP Service Pack 3

Has everyone had a look at the feature list in XP SP3? The service pack is primarily a rollup of patches and hot fixes that are already available from Windows Update. The list of new security features is par for the course, though I’m not surprised that at least one app has a problem with the enhancements.

Here is the product overview if you haven’t read it yet. I think it’s worth a look.

Technorati Tags:

Sunday, April 27, 2008

Interfacelift.com

One thing you must do this week is checkout the awesome desktop wallpaper available at Interfacelift.com! Goodbye boring green meadows, hello Broadway!

01481_broadway_1280x800

Technorati Tags: ,

Friday, April 25, 2008

Consolas Font Pack for Visual Studio

I'm currently trying out a new font for the text editor in Visual Studio. The font is called Consolas and it is specially designed for use in programming environments and other circumstances where a monospaced font is required. The font is optimised for ClearType with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortable reading of extended text on-screen.

Consolas is available in a special font pack for Visual Studio 2005 and 2008. You can download the font pack here.

Consolas

Tuesday, April 22, 2008

BCGSoft Controls

I blogged earlier this week about the new Visual C++ 2008 Feature Pack, which extends the base MFC library to include the Office 2007 ribbon,Visual Studio style docking toolbars and tabbed MDI groups. I've since learnt that Microsoft have simply integrated the BCGControlBar library developed by BCGSoft. BCGSoft published a press release about the move by Microsoft back in November 2007. The press release was confirmed over at the Visual C++ Team Blog in early April 2008.

BCGSoft also publish a version of the BCGControlBar Library for .NET. This version of the library is written in managed C++/CLI and is suitable for Windows Forms applications build with .NET 2.0 and later. I'm currently evaluating this version of the library and so far I'm impressed. The library contains about 25 layout controls that are simple to work with. The runtime performance is fantastic and there are very few rendering issues.

In the mean time, there were a few teething problems with the initial release of the Visual C++ Feature Pack. Microsoft has now fixed these issues and you can access the new download here.

BCGSoft_VSStyleGUI

Sunday, April 20, 2008

.NET 3.5 Training Resources

There is a useful .NET 3.5 training resource on the Microsoft Download Portal. The 35 MB download includes some great lab exercises covering:

  • ADO.NET Data Services
  • ADO.NET Entity Framework
  • ASP.NET MVC
  • ASP.NET Ajax
  • Silverlight

Unfortunately, the download doesn't contain any PowerPoint slides at the moment.

You can download the training kit here.

Visual C++ 2008 Incremental Link Hotfix

Microsoft have released a hotfix to Incremental Link bug in Visual C++ 2008. The linker would randomly crash during an incremental operation; very frustrating for large solutions!

You can download the hotfix here.

Visual C++ 2008 Feature Pack Release

Microsoft have published a final release of the Visual C++ 2008 Feature Pack. This SDK extends the base MFC libraries to support the development of applications using:

  • Office Ribbon style interface
  • Office 2007 look and feel
  • Visual Studio-style docking toolbars and panes
  • Advanced MDI tabs and groups
  • etc

The feature pack also includes an implementation of Technical Report 1 (TR1), which is an expansion of the C++ standard library to include:

  • Smart Pointers & Reference Wrappers
  • Function Objects
  • Regular expression parsing
  • New containers (tuple, array, hash table, etc)
  • Sophisticated random number generators
  • etc

You can read all about TR1 on Wikipedia.

The binary for the feature pack is just over 320 MB and you can download it here. Note that there were some issues in the initial release of the feature pack, but these have since been resolved.

Monday, April 14, 2008

Dependency Injection and Unity Container

David Hayden has published a helpful screencast on the new Unity Application Block. The screencast works through some Unity fundamentals and is a useful starting point for anyone interested in Dependency Injection. I was particularly interested to learn about container hierarchies, which reminds me of the work item hierarchy that is available in Smart Client Software Factory. I guess I need to delve some more into Prism and see whether container hierarchies are used.

You can download the screencast here.

Sunday, April 13, 2008

Dependency Inversion Principle

Dependency injection is a pretty hot topic in the .NET development community at the moment with the Patterns and Practices team moving to integrate Unity with Enterprise Library 4.0. Tom Hollander recently blogged about the future of dependency injection within Enterprise Library and raised some questions about the value of this move. He has some valid points and I agree that many of the block APIs look very similar in a dependency injection world. However, the real strength of dependency injection is that it is built on the principal of dependency inversion.

If you've never read about dependency inversion before, I can recommend this article, published in the March '08 MSDN magazine by James Kovacs. I can also suggest this whitepaper, published by the team at Object Mentor. Dependency inversion is about breaking down class dependencies to make software more maintainable, reusable and testable. Dependency inversion is the principal that enables patterns like Model View Presenter (MCP) and really opens up your software to test driven development.

I've put together a small example of how dependency inversion can be used to implement a simple payroll service using Microsoft .NET. The class diagram helps to visualise the object dependencies. The goal is to break the concrete dependency between the PayService and the EmployeeService so that the services can evolve and be tested in isolation. The class implementation is followed up with some simple unit tests that illustrate how to expand test coverage.

I believe that the introduction of dependency injection to Enterprise Library will help to promote and expand the use of dependency inversion in software and that we'll see a lot more test driven development in the community. Dependency inversion is not a difficult concept to grasp but it can really help you along the road to better quality and more maintainable software.

IoC

namespace Staff.Interface {
using System.Collections.Generic;
public class Employee {}
public interface IEmployeeService {
IList<Employee> GetEmployees();
}
}

namespace Payroll.Interface {
public interface IPayService {
void PayEmployees();
}
}

namespace Staff {
using System.Collections.Generic;
using Staff.Interface;

public class EmployeeService : IEmployeeService {
public IList<Employee> GetEmployees() {
return new List<Employee>();
}
}
}

namespace Payroll {
using Staff.Interface;
using Payroll.Interface;

public class PayService : IPayService {
private IEmployeeService service;

public PayService(IEmployeeService service) {
this.service = service;
}

public void PayEmployees() {
foreach (Employee e in service.GetEmployees()) {
}
}
}
}
namespace Payroll.Test {
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using Staff.Interface;
using Payroll;

public class MockReturnNull : IEmployeeService {
public IList<Employee> GetEmployees() {
return null;
}
}

public class MockThrowDbException : IEmployeeService {
public IList<Employee> GetEmployees() {
throw new System.InvalidOperationException();
}
}

public class MockReturn20Employees : IEmployeeService {
public IList<Employee> GetEmployees() {
return new List<Employee>();
}
}

[TestClass]
public class PayServiceTest {
[TestMethod]
public void PayEmployeesNull() {
MockReturnNull emp = new MockReturnNull();
PayService pay = new PayService(emp);
pay.PayEmployees();
}
[TestMethod]
public void PayEmployeesException() { }
}
}

Guidelines for User Interface Text

Microsoft have refreshed their user experience guidance for Windows Vista. The material on text in the user interface is particularly interesting and recommends using an "inverted pyramid" style that assists the user to scan text. There is also guidance on style and tone, which teaches developers how to construct text messages that are clear and concise. This guidance is essential reading for anyone writing desktop software.

Click here: Windows Vista User Experience Guidelines

InvertedPyramid