posted 13 years ago
I'm no UML expert, but I think there is some confusion in what 'static' means; a class diagram should describe the static structure of classes. I think 'static' here is meant as opposed to an object diagram, which describes what the structure of a set of objects could be at a certain point in time.
However, I don't think 'static' means that the relationships described in the class diagram need to be immutable, otherwise you could only describe inheritance in your class diagram, and not composition or aggregation, as composition and aggregation are dynamic relationships.
Therefore I think it is valid to include dependency relationships in your class diagram, even though the relationship is not 'static' as in technically immutable.
If in your application for some reason you decide to include an extra class that gets the Memento from the Originator and hands it over to the Caretaker, and when needed extracts it from the Caretaker to hand it back to the Originator, then ofcourse you would not draw a relationship between Caretaker and Originator.
'Design Patterns for Java' trainer