State vs Status

本人一直很困惑的一个问题:“状态”有时候叫Status,有时候叫State。这两个词有什么区别?我们在设计数据表或者对象时怎么取舍?

最近google到一个合理的解释:

http://stackoverflow.com/questions/1162816/naming-conventions-state-versus-status 写道
It depends on the context

State generally refers to the entire state of an entity - all its values and relationships at a particular point in time (usually, current)

Status is more of a time-point, say, where something is at in a process or workflow - is it dirty (therefore requiring saving), is it complete, is it pending input, etc
 翻译如下:
power1128 写道
这取决于使用环境。
State一般囊括了一个实体的所有状态。
Status更像是一个时间点,比如在一个流程中,这个对象是dirty、complete或者pending input等等。
 

猜你喜欢

转载自power1128.iteye.com/blog/1399371