English 中文(简体)
架设一个元数据库
原标题:Storing a Meta-Database

我在这个问题上与一位同事有某种分歧。 首先是环境(保障不会改变):

  • SQL Server 2008 R2
  • ASP.NET MVC 3
  • C#

现在的情况是: 我正在研究一项应用,使用户能够从用户那里收集信息,并为以后的报告目的储存信息。 收集投入的方法载于网页上的各种控制。 收集数据不是问题;储存数据是问题。

<>Database within A database

我遵循以下概念,即应当将其储存为关键价值乳制品的收集(例如,一个称为<编码>的表格)。 反应系统:

+----------+----------+----+-----+
|ResponseId|FormItemId|Name|Value|
+----------+----------+----+-----+

如果<代码>ResponseId和>>FormItemId构成主要关键,则ResponseId 涉及Response的表格:

+----------+------+------+-------------+
|ResponseId|FormId|UserId|SubmittedDate|
+----------+------+------+-------------+

FormId relating to a FormItem 表:

+----------+------+----+-----------------+
|FormItemId|FormId|Type|InstantiationData|
+----------+------+----+-----------------+

<代码>FormId与<编码>FormId在Response的表格中,指Form的表格,该表不作说明。

<XML Serialization

我回过头来回答说,将表格组成部分和对策的序列化越有意义,就表格而言,其数量就越少,只留下一个表格:

+------+--------+
|FormId|Elements|
+------+--------+

所有即时数据都储存在XML数据内,用于<条码>各表元素。 答复也同样记录在案:

+----------+------+-------------+----------------+
|ResponseId|UserId|SubmittedDate|ResponseElements|
+----------+------+-------------+----------------+

The Short Question After The Long Preface

我认为,第一个想法更清洁,更容易报告。 你认为什么?

As a final note, there are more tables to this, for both sides, as the forms are to be versioned for every time a user edits the form.

最佳回答

第一种办法称为实体-文书。 我认为,这是never。 a 储存关系数据的良好方式。 页: 1 在您通过这一设计之前。

我在发言Practical Object-Oriented Models in 和我的书

在这两项设计中,我倾向于采用XML方法。 它基本上使用Martin Fowler s

You might also want to read How FriendFeed Uses MySQL to Store Schema-less Data. Their approach is not specific to MySQL; it would work in SQL Server or any other RDBMS.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签