Adoctor
可以属于subjectCat
(尝试访问的用户)或resourceCat
(对象尝试访问的医学检查的转诊医生)。
在我看来,为了支持这两种情况,我需要分别doctor
为每个类别定义:
namespace subject {
namespace doctor {
attribute id {
category = subjectCat
id = "id"
type = string
}
attribute lastname {
category = subjectCat
id = "lastname"
type = string
}
//and 20 more attributes...
}
}
namespace resource {
namespace doctor {
attribute id {
category = resourceCat //this line is the only difference
id = "id"
type = string
}
attribute lastname {
category = resourceCat //this line is the only difference
id = "lastname"
type = string
}
//and 20 more attributes...
}
}
这很麻烦,而且有很多冗余。我能做些什么来避免这种情况吗?