TDD and Databases

I’ve read quite a lot of bloggers (here for example) complaining about removing records from their test database.

Most of them go through some of the nifty SQL features that are VERY VERY VERY handy. How about this, you prepare your database, and save it as an mdb file… That, for example, you include as a resource in your preferred source control system.

Then, when testing your file, you copy it, and in your unit test, you use the following connection string in SqlClient:

Initial File Name=”YourPath:\YourFile.mdb”

Then you can discard your whole file after working on it. As simple as you can get.

Ads

Is a Blog SOA?

From Fabrice, Julien which is a new comer, think his blog is a SOA service. I must say I so much disagree.

  • Services share schema and contract, not class This is not entirely true, and proves to be completely wrong. RSS specs are not XSD compliant, and on the other side of the pipe, XML-RPC is not schema based. It is actually far far from it.
  • Service policy is determined based on policy Real validation of RSS feeds can’t really be expressed by XSD, and RSS is not even an infoset by it’s lack of namespaces and extensibility points (Dave Winer might say something different, but…)
  • Boundaries are explicit Which boundaries are explicit between user authentication, posting, reading, commenting, track-backing, pinging, etc?
  • Services are autonomous The only point where I do agree.

The fact is, for a blog to be considered SOA, you need a two way channel, which is autonomous, and has a clear way of communication, in a message oriented way. Atom is a good step in that direction. But no, dasBlog is not yet an SOA :)

Ads

WinFS Interop

Ken ask a question on winFS interop. From what we got from the newsgroups (you should really come and see them), WinFS has two ways of copying file and metadata.

The first way is to preserve the content by serailizing everything, the object, the relations, in a big binary blob that will be deserialized when copied over winFS again (used for contacts for example).

The second way is the Type handler fetching the metadata back into the file (less than optimal solution, but can be supported in most file formats by using extensibility headers in jpeg, tags in MP3, etc…).

To be absolutely accurate, a quote from Ward Beattie from MSFT:

There are really two kinds of copy operations out of WinFS. Toby is referring to the lossless export supported by the WinFS API. If the item is backed by a Win32 file (e.g. a jpeg file), then you can also copy the file stream only using the Win32 API. In this case, the file stream will contain the modified metadata PROVIDED that the system has a demoter which can push the metadata properties into the file (not all file formats can support this). Sanjay’s presentation for session CLI326 includes an overview of this mechanism.

Ads