[英]Database Table design problem
Scenario:
There is a hierarchy of PROCESS
. Scenario:
存在PROCESS
的层次结构。 Like 喜欢
PR-2, PR-3 are children of Pr-1
, 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
现在,
leaf processes (in our case PR-3, PR-4 and PR-5
可以按照ACTIVITY
系列进行描述
Now, ACTIVITY
is just a child of PROCESS
but has some extra attributes, so 现在,
ACTIVITY
只是PROCESS
的子级,但具有一些额外的属性,因此
Should I make two diff. 我应该做两个比较。 tables in the database (one for
ACTIVITY
and one for PROCESS
)? 数据库中的表(一个用于
ACTIVITY
,一个用于PROCESS
)?
or 要么
Should I add some fields (for extra attributes of ACTIVITIY
) in the PROCESS
table and store the ACTIVITY
in PROCESS
table. 我应该在
PROCESS
表中添加一些字段(用于ACTIVITIY
额外属性),并将ACTIVITY
存储在PROCESS
表中。
=================================== EDITED ====================================== ==================================已编辑=============== ========================
Actually, here PROCESS
AND ACTIVITY
are the one's that involved in BPM (Businees Process Management) 实际上,这里的
PROCESS
和ACTIVITY
是BPM(业务流程管理)所涉及的PROCESS
和ACTIVITY
Those who have knowledge of BPM can figure out what ACTIVITY
AND PROCESS
are. 那些了解BPM的人可以弄清楚什么是
ACTIVITY
和PROCESS
。
Those who don't know BPM
, I explain you what I mean by PROCESS
and ACTIVITY
. 那些不知道
BPM
,我向您解释PROCESS
和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. 任何企业都具有各种
PROCESS
(例如CustomerOrderPlaced,CustomerOrderCancelled等),而ACTIVIT
就像流程的一部分,将执行该流程以完成流程。
So, ACTIVITY
is a child of PROCESS
with some extra attributes. 因此,
ACTIVITY
是PROCESS
的子级,具有一些额外的属性。
Or in terms of Java, ACTIVITY extends PROCESS 或就Java而言,ACTIVITY扩展了PROCESS
As soon as you say " ACTIVITY
are like parts of a process", " ACTIVITY
extends PROCESS
" is no longer a valid statement. 只要你说“
ACTIVITY
就像是过程的一部分 ”,“ ACTIVITY
扩展PROCESS
”不再是一个有效的语句。 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. 用ER术语来说,流程和活动之间存在一对多的关系。 Or possibly a many-to-many relationship if one Activity belongs to multiple Processes.
如果一个活动属于多个流程,则可能是多对多关系。
For example, CustomerPlacesOrder is a Process. 例如,CustomerPlacesOrder是一个流程。 The Activities are:
这些活动是:
Or however complicated you want to get. 或无论您想要变得多么复杂。 Inheritance this is not.
继承不是。
You should have multiple tables. 您应该有多个表。 The tables can be like below:
表格如下所示:
ProcessTable
工艺表
ID (Primary Key)
ID (主密钥)
ProcessName流程名称
ProcessCode ...ProcessCode ...
ActivityTable
活动表
ID (Primary Key)
ID (主密钥)
ActivityName活动名称
ActivityCode活动代码
ActivityDesc活动描述
ProcessID (Foreign Key to ProcessTable) ...ProcessID (ProcessTable的外键)...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.