Teun.ToString()

by Teun Duynstee [Macaw]

<September 2008>
SuMoTuWeThFrSa
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011


Navigation

Subscriptions

News

I discontinued this blog. I now post at: www.TeunToString.net



Download Finch PocketBlogger

Post Categories

Article Categories



Whatever happened to IField, IParameters, IRow, ITable?

When you want to create connectable web parts in ASP.NET 2.0, the preferred way to pass information is by specifying an interface with one or more properties. You can read up on how it works in this article by Carlos Aguilar Mares (based on beta 1). The nice thing of using interfaces is that you can have an IStringValue interface that just returns a string value and have an IZipCode interface deriving from IStringValue without adding or overriding any members. Of course, a zip code is a string, but a string is not always a zip code. This way, you can use zip code providers to feed both zip code consumers and consumers of string values.

To allow my connection providers to be connected to your connection consumers, they must be based upon the same interface for passing information. To make it easy for third party developers to connect to each others web parts, in beta 1 Microsoft included a small number of very simple interfaces. The most basic of them all was IField, which allowed you to pass an object (any object). They also included IParameters (set of name-value pairs), IRow (collecion of objects) and ITable (collection of isomorphic IRows). If your part does something very specific, you should specify your own interfaces, to make sure that only parts providing the right kind of info can connect to yours. But if you want your part to work with as many other parts as possible, you want to settle on a widely known interface, preferably from the framework.

Now in beta 2, all of these basic interfaces seem to have disappeared. Why is that? You can easily create these interface yourself, of course, but my interface would then be different from yours and parts from different vendors could never connect (well, you could start writing connection transformers for every combination, but that's another story).

posted on Tuesday, July 26, 2005 12:16 PM by TeunD





Powered by Dot Net Junkies, by Telligent Systems