views:

35

answers:

1

I've download a trial of Altova UModel and am starting using UML. As a practical beginning I am modelling a personal information manager application, which includes a web bookmark managing.

A Bookmark can belong to many (or no) Tags at once and a Tag can contain many (or no if all the bookmarks it contained were deleted) bookmarks. The relation has to be both-way navigable - a user has to be able to see all Bookmarks with a particular Tags ans all Tags of a Bookmark.

What is the correct UML relation between Bookmark and Tag classes?

As far as I understand UML now, it is an Association (not an Aggregation). But for a 2-way navigable many-to-many relation I can specify ends roles as "memberEnd" or "when navigableOwnedEnd", graphically the connection looks the same in both cases (an arrow) (which as I understand means navigability) but a property appears in the class box in case only when "memberEnd" is used.

How should I specif it in the model If I mean both-way navigable many-to-many relation there?

+1  A: 

From UML Superstructure Specification, v2.1.2 section 7.3.3:

  • memberEnd : Property [2..*] Each end represents participation of instances of the classifier connected to the end in links of the association. This is ordered association. Subsets Namespace::member.
  • ownedEnd : Property [*] The ends that are owned by the association itself. This is an ordered association. Subsets Association::memberEnd, Classifier::feature, and Namespace::ownedMember.
  • navigableOwnedEnd : Property [*] The navigable ends that are owned by the association itself. Subsets Association::ownedEnd.

So if the end is 'owned' by the association, use the ownedEnd/navigableOwnedEnd type, otherwise use the memberEnd type.

Either can be used for a 'both-way navigable many-to-many relation'; if each relation link is a separate instance in your design, it can own the ends (e.g. class A and class B has a reference to a list of pairs of references to related As and Bs), but if the relation link is implicit then it does not own anything (e.g. class A has a list of references to related Bs, class B has a list of references to related As).

Having used UML since the late `90s, you're the first person I've met who cared about the difference!

Pete Kirkham