0

I'm evaluating the idea of building a set of generic database tables that will persist user input. There will then be a secondary process to kick off a workflow and process the input.

The idea is that the notion of saving the initial user input is separate from processing and putting it into the structured schema for a particular application.

An example might be some sort of job application or quiz with open-ended questions. The raw answers will not be super valuable to us for aggregate reporting without some human classification. But, we do want to store the raw input as a historical record.

We may also want the user to be able to partially fill out some information and have it persisted until he returns.

Processing all the input to the point where we can put it into our application-specific data schema may not be possible until we have ALL the data.

Two initial questions:

  1. Assuming this concept has a name, what is it?
  2. Is this a reasonable approach? Why or why not?

Update:

Here's another way to state the idea. The user is sequentially populating fields in a DTO. I (think I) want to save the DTO to disk even in a partially-complete state. Once the user has completed populating the fields, I want to pull out the DTO and process it for structured saving into a table which represents the specific DTO. I can't, however, save a partially complete or (worse) a temporarily incorrect set of input since some of the input really shouldn't be stored as part of the structured record.

My idea is to create some generic way to save any type of DTO and then pull them out for processing in a specific app as needed. So maybe this generic DTO table stores data relating to customer satisfaction surveys right next to questions answered in a new account setup wizard.

4

3 回答 3

1

你说:

我的想法是创建一些通用的方法来保存任何类型的 DTO,然后根据需要将它们拉出来在特定的应用程序中进行处理。

我认为你是一个抽象层次。我认为整个数据库正在履行您希望一组有限的表执行的角色。您可以创建某种复杂的存储模式,它不会以任何方式表示数据,然后(从 DBMS 的角度来看,缓慢而痛苦地)合并并呈现数据视图......但我建议这是过度设计的解决方案。

我编写了几个应用程序,由于自定义用户需求,应用程序的一部分(有时很重要)是动态的——由用户构建,从模式到业务规则。令人惊讶的是,通过执行 CREATE TABLE 和 ALTER TABLE 等语句来制造存储模式的那些是最容易维护的。它们还允许用户以非常直接、预期的方式创建报告。

于 2009-05-21T23:54:29.340 回答
0

You might be speaking about Workflow. You might want to check out Windows Workflow.

The concepts of Workflow are that they mirror the processes of real life. That is to say, you make complete a document, but the document is not complete until it has been approved. In your case, that would be 'Data is entered' but unclassified, so it is stored in the database (dehydrated) and a flag is sent up for whoever needs to deal with the issue. It can persist in this state for as long as necessary. Once someone is able to deal with it, the workflow is kicked off again (hydrated) and continues to the next steps.

Here are some SO questions regarding workflows:

This question: "Is it better to have one big workflow or several smaller specific ones?" clears up some of the ways that workflow can be used, and also highlights some issues with it.

John Saunders has a very good breakdown of what workflow is good for in this question.

于 2009-05-21T21:21:46.810 回答
0

听起来您最初是以标准化形式(通用)存储数据,一旦您拥有完整的数据集,您就会对其进行非标准化(结构化模式)。

于 2009-05-21T22:00:01.363 回答