blob: 890865a7ae20a5ed5e5082e758f919197d134dd6 [file] [log] [blame]
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';
package tutorial : tut = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
class Library
{
attribute name : String;
property books#library : Book[*] { composes };
property loans : Loan[*] { composes };
property members#library : Member[*] { composes };
}
class Book
{
invariant SufficientCopies:
library.loans->select(book=self)->size() <= copies;
attribute name : String;
attribute copies : Integer;
property library#books : Library[?];
}
class Member
{
attribute name : String;
property library#members : Library[?];
}
class Loan
{
property book : Book;
property member : Member;
attribute date : ecore::EDate[?];
}
}