Navigability Semantics of Associations [message #625894] |
Sat, 12 January 2008 13:05 |
Felix Dorner Messages: 676 Registered: July 2009 |
Senior Member |
|
|
Hello,
I try to understand the navigability semantics of associations.
Because I am very insure if my below statements are correct, please
correct them if neccessary:
Suppose I have a Class Book and a Class Author.
Task 1 - Bidirectional Navigability:
------------------------------------
I'd like to have an association book_author between the two
Classes which is navigable in both directions:
a. Create an Association book_author.
b. Inside the Author class I create an owned Property "books" of type
Book set its Association Property to "book_author"
c. Inside the Book class I create an owned Property "author" of type
Author and also set its Association Property to "book_author".
Task 2 - Unidirectional Navigability
-------------------------------------
I'd like to restrict navigability, only Author->Book should be
possible.
a. I change the owner of the "author" property from Book to the
Association "book_author".
Conclusion: Since the "author" end is now owned by the Association
it is not navigable from the opposite end "book" anymore.
Task 3 - Restore Navigability by making Use of an Association's
"navigableOwnedEnd" property:
------------------------------------------------------------ ----
If I also add the "author" end to the "ownedNavigableEnds"
property of the Association, navigation from "book" to "author" would
be possible again.
Now I can't see any semantic difference between an end owned by an
opposite end's class and that end owned by the Association and part of
its "ownedNavigableEnd" property. Do I miss something?
Task 4 - Make the Association not navigable at all
--------------------------------------------------
Make all ends owned by the Association. Why should one need this?
Thanks for a discussion.
Felix
|
|
|
Powered by
FUDForum. Page generated in 0.03285 seconds