When I have a class with a Map member, I don’t want to draw a separate class/interface object to represent the Map itself, but I’d prefer to treat the map as if it was a native type, rather than a complex object.
Consider the following example
public class IndexManagerImpl implements IndexManager {
/* ... */
private static Map<Searcher, Integer> searcherCache;
}
I’d like to highlight the fact that an IndexManagerImpl holds (although indirectly) references to Searcher instances.
It would be great if the representation could also show the type parameters of searcherCache.
A disagree with Martin… MAP is basic data structure that we learn in any computer graduation course! It exsists in most modern languages and is an important design resource for analysts. A Map may be drawn as an association in some situations, but some kind of extension (stereotypes) will be needed OR you can define a template class. I don’t like the template approach – it hides the associations btw the major players.
The last resource is the AssociationClass, a special UML class used to define nxn relations with attributes, what I think suits your problem, where the “integer” field is some kind of counter of Searchers related to the indexManager.
Remember also that by code you can’t see the other side of the relationship, while UML is designed to show both sides, navigation issues and so forth.