Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の 2 つの集計を含むクラス図があります。
contentCategoriesはカテゴリの動的配列であり、currentCategory常にその配列の要素ですが、個別のメンバー変数として維持されます。contentCategories常にOCLの要素であるという制約を示す必要があります。私はこれを正しく行いましたか?そうでない場合、それを行う正しい方法は何ですか?
contentCategories
currentCategory
事前にご協力いただきありがとうございます。
はい、あなたの考えは正しいです。ただし、コメントに制約を記述しますが、破線はありません
編集:申し訳ありませんが、「学術的に健全」であるためには、OCL制約がなくても正しい必要がありますcurrentCategory。つまり、制約を読んだほうがよい
not currentCategory==null implies contentCategories -> includes(currentCategory)