简体   繁体   English

转换用于Web的Paper / PDF表单-归一化,分区还是宽表?

[英]Converting Paper/PDF forms for web - Normalize, Partition or Wide-Table it?

We'll be converting a fairly long lease application form into a web application for submission via PHP in to a PostgreSQL database. 我们将把一个相当长的租赁申请表转换成一个Web应用程序,以便通过PHP提交到PostgreSQL数据库中。

I abide by the maxim "Normalize till it hurts, then denormalize till it works" (Attr:SQLMenace) but as I jump in I figured I'd tap the collective mind. 我遵守格言“规范化直到受伤,然后进行非规范化直到起作用”(Attr:SQLMenace),但是当我跳进去时,我发现我会挖掘集体意识。

Here is what the paper form currently looks like: http://www.borgermanagement.com/forms/commercialApplication.pdf (not the actual form but close) 这是当前纸质表格的外观: http : //www.borgermanagement.com/forms/commercialApplication.pdf (不是实际的表格,而是关闭的)

A lot of the data is mandatory and will be submitted over a couple of views with the option to save a partially completed application for completion at a later date. 许多数据是强制性的,将通过几个视图提交,并可以选择保存部分完成的申请以供日后完成。 The submitted application will be reviewed for approval (preferably in one view similar to the pdf). 提交的申请将经过审核以供批准(最好是在类似于pdf的一种视图中)。 There isn't likely to be much in-depth analysis of the data down the road. 未来可能不会对数据进行深入的分析。

How would you structure your data in this case? 在这种情况下,您将如何构造数据? To normalize or not? 规范化与否? To vertically partition or not? 要垂直分区吗?

I would go with a hybrid solution: 我会选择一个混合解决方案:

  1. Forms "in process" are XML or other "unstructured" data are messages with workflow status. “处理中”表单是XML或其他“非结构化”数据是具有工作流状态的消息。 Don't break out anything other than the fields against which you need to make decisions or find the record later. 除了您需要根据其做出决定或稍后查找记录的字段之外,请勿分解其他内容。

  2. Forms that have been fully approved, validated, what have you -- store in a fully relational model. 已被完全批准,验证的表格具有什么-存储在完全关系模型中。

I propose such a solution because you will never have the right business rules (assuming anyone does) to implement the right constraints at every stage of the game -- I've gone through that a couple of times where I work -- so don't try. 我之所以提出这样的解决方案,是因为您永远都没有正确的业务规则(假设任何人都有)来在游戏的每个阶段实施正确的约束-我已经经历了几次工作,所以不要试一试。 Don't persist a relational implementation until all the unknowns are knowns. 在所有未知数都知道之前,不要坚持执行关系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM