Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
From the author of

.NET Options

You can choose among many options in .NET:

  • DataReader. This isn't really a container, but just a way (and one that performs well) to stream data out from the database, as a firehose.

  • Untyped DataSet. The untyped DataSet (or just DataSet) is an in-memory database in which you hold disconnected data in tabular format as DataTables. There's a lot of built-in functionality, such as sorting and filtering.

  • Typed DataSet. In this case, the schema of the DataSet is created at design time. Therefore, the code that you write against the typed DataSet will be typesafe. (A typed DataSet inherits from an untyped DataSet, so I won't address that as yet another option.)

  • Wrapped container datatype. By wrapping a DataSet, you can get all the nice functionality while exposing only a minimal interface so that the DataSet is encapsulated. You could just as well wrap an XML DOM, a Hashtable, or something else that fits your needs, but I chose a DataSet for this article.

  • Generic container datatype. The Framework Class Library (FCL) has a wealth of generic container classes, such as Array, Hashtable, XML DOM, and so on. When I discuss this further, I will use Hashtable as an example.

  • Custom classes and collections. In this case, you build up a custom object model that maps as closely as possible to your problem domain. You get a lot of flexibility, but it also means a lot of work.

Of course, this list is not exhaustive, but it represents a broad range of possible solutions. It also represents solutions that I will discuss in this series of articles.

Another option that probably will be interesting in the future is ObjectSpaces from Microsoft. An alpha version was out, but Microsoft decided to withdraw it several months ago and has published no new version yet. The last thing I heard about this is that we will have to wait until V2 of the .NET Framework.

Other options are to have a look at third-party solutions such as PragmaTier and EntityBroker. ObjectSpaces (at least the withdrawn alpha) and the types of third-party solutions I'm mentioning here have custom classes at the heart of the programming model.

  • + Share This
  • 🔖 Save To Your Account