Going Native

There has been a recent push for a return to native coding on the Windows platform. You can see it from the resurgence of the C++ programming language. Part of this might be due to the latest update to the C++ language specification. Long live C++11. The language was last updated 10 years ago.

Not sure if the new excitement is going to stick. However it seems like more frequent C++ language updates are planned for the future. I am hearing more and more about the upcoming C++14 changes. And there is even remote noise regarding C++17.

This is only natural. Java always seems to be having updates to the language. But one thing I don't seem to hear much about is advances in the C# programming language. Yeah there might be some new ideas for .NET technologies. But the C# bandwagon may be abandoned.

The TestApi

TestApi is a library of tools to assist with testing software. One of the tools that comes with it are Fault Injection routines. Fault injection is the process of deliberately putting errors in an app to see if they are handled gracefully.

You can use fault injection to test those hard to reproduce situation. You know the kind. They are the exceptions that only happen once your app has shipped to production.

The two key pieces to TestApi are the "TestApiCore.dll" file, and the FaultInjectionEngine folder. One last note is that fault injection is different than mutation testing. In mutation testing you put an error in you app to see if your unit tests pick it up.

Good luck with your testing. I am currently in the design phase of the software development life cycle. So I don't have a lot of hands on testing just yet.

Entity Framework Tricks

The Entity Framework allows the developer to create a model against which the programmers do queries. The Entity Framework then translates these model queries to SQL against the actual data store.

In the end, the Entity Framework is generating your typical database commands such as insert, update, and delete. But hey. You want to lock down such real database objects to ensure they remain consistent.

The tried and true method to lock down your database is to require all access to go through stored procedures and views. The good news is that you can train the Entity Framework to do just that.

The Entity Framework does not need to go against base tables. It can run against views. In fact, you could even create some views that are identical to the base tables. Good stuff.

Running Zork on .NET

Remember the Infocom games from the good old days? I am talking about games like Zork. Well there is an Infocom game interpreter called Frotz out there. It allows you to play Infocom games on modern day PCs. Frotz is written in the C programming language.

Well guess what? Frotz has been ported to C#. It now has a WPF front end as well. This thing needs the .NET 4.0 runtime to work. I just read a blog post that some guy tried this newly ported interpreter, and had Zork I up and running fine. This sounds like good stuff.

Silverlight Media Framework

Microsoft has an open source framework called the Silverlight Media Framework, or SMF for short. It is a framework for video. This allows you to create your own media player. Cool stuff.

SMF makes use of the Smooth Streaming Player Development Kit. This additional kit is not open source. You create your own Silverlight project. Then you use SMF and this kit within it.

The technique is to inherit from the SMF player. Then you extend the capabilities as you see fit. Settings are downloaded from a server via an XML file. Check it out.

Complaints Against Microsoft

Let us all admit Microsoft’s goals for the .NET framework. They want to go for the enterprise market. They target high end systems. This is the same market that Java is going after. Some people are not happy with how Microsoft has been proceeding with expanding the .NET framework.

On a positive note, .NET provides you with great plumbing. But it seems as if Microsoft is not collecting feedback from users and developers when deciding the new things they are adding to the framework. There are also complaints that .NET is becoming very bloated.

Take the ADO.NET Entity Framework for example. This is an object relational mapping. It is now Microsoft’s recommended data access solution. People think the database layer is big, maybe too big. What happened to support for LINQ to SQL? Developers want to spend time learning and using technologies that will stick around. Microsoft needs to keep an ear on the developer community.


I want to talk about this new Managed Extensibility Framework (MEF) idea. It is a library that ships with the .NET Framework 4, as well as Silverlight 4. It allows third parties to extend systems after they are deployed.

There are other technologies which implement the same thing. These include Enterprise Java Beans, Corba, Spring, and the Component Object Model. However some of these competing or legacy technologies are heavyweight. The competitors may also require a lot of developer work.

Let us discuss some of the MEF terminology. A part provides services to other parts. An export is another name for a service. An import is the service that you part uses. And a contract is an identifier.

MEF comes with an attribute programming model. You can achieve the import using constructors. That is called constructor injection. All part instances are currently implemented as singletons. Finally there is a “lazy” framework where instantiation is delayed until the value of the object Is accessed.