[sc34wg3] New syntax for (binary) associations

Lars Heuer heuer at semagia.com
Thu Feb 7 08:21:33 EST 2008


Hi Dmitry,

> We can define the property "o:work-for" as:
[...]
> And we also can define the property  "o:has_employee"
[...]
> Now we can have a bidirectional (!)  mapping between CTM "block
> form"  and traditional TMDM-based form of representing associations.

But how is that different from defining a template (in the CTM
context)?

    def works-for($employee, $employer)
        o:works-for(o:Employee: $employee, o:Employer: $employer)
    end

    def has-employee($employer, $employee)
        works-for($employee, $employer) # Calling the "works-for"
                                        # template with flipped vars
    end

    john works-for(o:TheDreamWorldInc).

    o:TheDreamWorldInc has-employee(john).


Best regards,
Lars
-- 
http://www.semagia.com



More information about the sc34wg3 mailing list