我有一個類,它存儲了一些攝影EXIF所需的數據。有選擇的requierement:UML類屬性基數:至少有一個這樣的但不是沒有的
我需要FocalLengthIn35mmFilm
或(FocalLength
和FocalPlaneXResolution
和FocalPlaneYResolution
)。
這將對應於SQL語句:
create table Photo(
/* Whatever */
FocalLengthIn35mmFilm FLOAT null,
FocalLength FLOAT null,
FocalPlaneXResolution FLOAT null,
FocalPlaneYResolution FLOAT null,
constraint AtLeastOneFocal CHECK (
FocalLengthIn35mmFilm is not null OR (
FocalLength is not null AND
FocalPlaneXResolution is not null AND
FocalPlaneYResolution is not null
)
)
)
XSD架構會是這樣的this answer
我會定義/得出相應的UML架構,但我不知道如何來模擬這種想法「基數選項「。任何想法?