数据库表设计问题 [英] Database Table design problem
问题描述
场景:
存在 PROCESS
的层次结构。喜欢
PR-2,PR-3是Pr-1的孩子
,
PR-4,PR-5是PR-2的孩子
叶过程(在我们的情况下PR-3,PR-4和PR-5
可以按照 ACTIVITY
现在, ACTIVITY
只是 PROCESS
但有一些额外的属性,所以
我应该在数据库中创建两个差异表(一个 ACTIVITY
和 PROCESS
)?
或
我应该在 PROCESS
表中添加一些字段(对于 ACTIVITIY
的额外属性),并存储 ACTIVITY
在 PROCESS
表中。
======= ========================== EDITED ===================== =================
其实这里 PROCESS
AND ACTIVITY
是参与BPM(Businees流程管理)的人
有BPM知识的人可以找出 ACTIVITY
和 PROCESS
是。
不知道 BPM
,我解释你 PROCESS
和 ACTIVITY $任何企业都有各种
PROCESS
(如CustomerOrderPlaced,CustomerOrderCancelled等)和 ACTIVIT
因此, ACTIVITY
是 PROCESS
的子级,具有一些额外的属性。
ACTIVITY扩展PROCESS
只要你说 ACTIVITY
都像进程的部分, ACTIVITY
扩展 PROCESS
更长的有效语句。这不是一个关系。这是一个有关系。
在ER术语中,Process和Activity之间存在一对多的关系。如果一个活动属于多个进程,则可能是多对多关系。
例如,CustomerPlacesOrder是一个进程。活动是:
- 客户填充购物车;
- 客户退房;
- 客户输入交货和结算信息,必要时进行注册;
- 工人收到订单;
- ,工人选择合适的包装容器并填充它;
- 工人在每日交货时发送。
或者你想要的复杂。继承这不是。
Scenario:
There is a hierarchy of PROCESS
. Like
PR-2, PR-3 are children of Pr-1
,
PR-4, PR-5 are children of PR-2
Now the leaf processes (in our case PR-3, PR-4 and PR-5
can be described in terms of series of ACTIVITY
Now, ACTIVITY
is just a child of PROCESS
but has some extra attributes, so
Should I make two diff. tables in the database (one for ACTIVITY
and one for PROCESS
)?
or
Should I add some fields (for extra attributes of ACTIVITIY
) in the PROCESS
table and store the ACTIVITY
in PROCESS
table.
=================================== EDITED ======================================
Actually, here PROCESS
AND ACTIVITY
are the one's that involved in BPM (Businees Process Management)
Those who have knowledge of BPM can figure out what ACTIVITY
AND PROCESS
are.
Those who don't know BPM
, I explain you what I mean by PROCESS
and ACTIVITY
.
Any enterprise has various PROCESS
es (like CustomerOrderPlaced, CustomerOrderCancelled etc.) and ACTIVIT
ies are like parts of a process which are to be performed to complete the process.
So, ACTIVITY
is a child of PROCESS
with some extra attributes.
Or in terms of Java, ACTIVITY extends PROCESS
As soon as you say "ACTIVITY
are like parts of a process", "ACTIVITY
extends PROCESS
" is no longer a valid statement. It's not an is-a relationship. It's a has-a relationship.
In ER terms there is a one-to-many relationship between Process and Activity. Or possibly a many-to-many relationship if one Activity belongs to multiple Processes.
For example, CustomerPlacesOrder is a Process. The Activities are:
- Customer fills shopping Cart;
- Customer checks out;
- Customer enters delivery and billing info, registering if necessary;
- Worker receives order;
- If the items are in stock, the Worker selects an appropriate packing container and fills it;
- Worker send it on the daily deliveries.
Or however complicated you want to get. Inheritance this is not.
这篇关于数据库表设计问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!