人们在持久的.NET字典中想要什么?

6 .net c# database persistence dictionary

我正在基于ESENT数据库引擎(使用ManagedEsent互操作层)实现通用的,持久的.NET集合.到目前为止,我一直专注于完全模仿他们的System.Collections.Generic对应的类,除了他们在构造函数中采用指示数据库应该去的位置的路径.像这样的代码工作:

using Microsoft.Isam.Esent.Collections.Generic;

static void Main(string[] args)
{
    var dictionary = new PersistentDictionary<string, string>("Names");
    Console.WriteLine("What is your first name?");
    string firstName = Console.ReadLine();
    if (dictionary.ContainsKey(firstName))
    {
        Console.WriteLine("Welcome back {0} {1}", firstName, dictionary[firstName]);
    }
    else
    {
        Console.WriteLine("I don't know you, {0}. What is your last name?", firstName);
        dictionary[firstName] = Console.ReadLine();
    }
}
Run Code Online (Sandbox Code Playgroud)

我的问题是:

  • 除了与Stack,Queue和Dictionary的兼容性之外,人们在持久化集合中需要/需要哪些功能?
  • 我是否需要.NET框架的2.0版或3.5版?
  • 键和值类型都限于基本的.NET类型(bool,byte,[all allgers],float,double,Guid,DateTime和string).我可能会添加对可序列化结构的值的支持.这种类型的限制是否太痛苦了?
  • 人们希望看到什么样的性能基准?
  • 人们想要使用PersistedDictionary的应用程序是什么类型的?

我将在下周准备第一个版本,但我想确保我正在构建正确的东西.

小智 5

我已经在 Codeplex 上发布了 PersistentDictionary。这仅支持序列化结构,但我将研究支持存储和检索任意对象的不同数据结构。

https://github.com/microsoft/managedesent