12 application blocks?

The April edition of vsj magazine (www.vsj.co.uk) claims that there are 12 available blocks available at www.microsoft.com/resources/practices/code.mspx

The first 7 are part of the Enterprise Library:
Enterprise Library

These are the Microsoft Patterns and Practice best practices (I can only find 11 distinct items)

  1. Caching Application Block
  2. Configuration Application Block
  3. Cryptography Application Block
  4. Data Access Application Block
  5. Exception Handling Application Block
  6. Logging & Instrumentation Application Block
  7. Security Application Block
  8. Smart Client Offline Application Block
  9. Updater Application Block V2
  10. User Interface Process Application Block – Version 2.0
  11. Web Service Façade for Legacy Applications

Note that microsoft do not support these so as soon as you take them you own the code.
It would make a great open source project to take these on and centralise extensions to them.

Inheritance of constructors in C#

This is a serious problem with the C# langauage.

Given the following two classes:

class First
{
    First(string message)
    {
       System.Console.WriteLn(message);
    }
}

class Second
{

}

The following will not compile:

Second = new Second(“Test”);

Now I know if I add the following to Second

    Second(string message)  : base(message)
    {
    }

This is not much code for a simple constructor, but what about classes with multiple constructors like exceptions? That makes them more difficult to define than necessary.
   

System.Net

System.Net contains the ever useful WebClient class.

This allows code such as:

System.Net.WebClient wc = new System.Net.WebClient();
byte[] myDataBuffer = wc.DownloadData(url);
string download = System.Text.Encoding.ASCII.GetString(myDataBuffer);

This allows the text at a given url to be extracted.
Welcome to your own web spider.

API going AWOL

Microsoft in their infinate wisdom have decided to break the Mailslot API in the XP line and above. Mailslots were a great means of communicating between processes running under differing user accounts. Under XP these were made unreliable which renders them unusable.

In addition I have found that certain security API’s are missing on Windows Server 2003 custom builds. What is the point of developing against a fixed plaform if a custom build take away API calls?

Small Languages

Given that in .NET it is easy to write your own language these could be used to plug obvious holes in the mainstream languages. For example C# makes a pigs ear of it’s constructors.
The minimal syntax is

C () : base () { }

It is possible to have more code in the base () parameters than in the implementation itself.

You need to redefine any constructors that are required in a descendant class.
This makes the definition of mostly empty classes such as exception hireachies far more work than is actually needed.

Delphi has trivial to implement Exceptions :

type
   EBaseException = class(Exception);

  EMyException = class(EBaseException);

This makes their definition and use so useful.

I am wondering if it is possible to create an Exception Definition Language to ease this issue?
I will Blog about this experiment later.

Missing featues : array over enum

This is the first article in the blog comparing Delphi features to C#.
C# is a great language but is missing some incedibly useful features from Delphi.

In Delphi you can declare an enumeration as

TEnumColour = (Red, Green, Blue);

You can then declare an array over that enumeration:

TWaveLength : array[TEnumColour] of integer  = (100,200,300);

This is a very powerful technique for ensuring that an enumeration always has valid data.

I have yet to work out how to do this in C#

Localization and Databases

I got caught by another localizaion feature of SQL Server today.
SQL Server is not aware of regional settings.

This can be a real pain. If your machine uses say German regional settings and your database returns 1.01  if you use variant conversion routines (hey I am still using ado – we all can’t be on the bleeding edge) this can arrive as 101

This is not what is wanted. This has brought me to question where in a data access layer should the localization go?

CodeGen

Code Generation In .NET

This is an important site for an important topic.

Years ago I was involved on a project that was seriously delayed due to the failure of a CASE tool. The project had all of the design completely modelled – it was just that the CASE tool that was suposed to split out the code did not work and the company making it went under.

Code Generation seems to fulfill the promise that CASE tools had been making at the end of the 80’s. Kathleen Dollards approach is entirely feasable. She uses XSLT to generate code from metadata that is either manually created or extracted from for example a database. This is ideal for the middle tier and data access layers which are typically mechanical.

Monoppix 1.0 Released

Monoppix 1.0 has been released.

Monoppix is a linux live CD version of Knoppix that includes a working version of Mono.

Knoppix is the major Live CD for Linux. It allows you to experiment with Linux applications without risk to your current operaing system installation. All you have to do is put the Live CD into the CD drive, set the PC to boot from the CD and reboot.

Knoppix is a must have for any PC user. I have managed to get Knoppix to boot and get online even when my PC’s hard drive had failed.

Mono is an open-source implementation of the .NET Framework. There have been complaints that it is hard to configure Linux to get mono to work. A live CD is the best way to demonstrate a working system (so you can easily find what is missing).

Kylix is dead

A couple of weeks ago I attended an introduction to Delphi 2005 seminar.

During the Q & A session questions were asked about the future of Kylix.
A quick summary of the answer is that Kylix is dead.
They have no plans to update the product as yet.