This post originated from an RSS feed registered with Agile Buzz
by Kevin Rutherford.
Original Post: nothing but "uses" and "implements"
Feed Title: silk and spinach
Feed URL: http://silkandspinach.net/blog/index.xml
Feed Description: kevin rutherford on agile software development and life in macclesfield
A month ago I posted a personal UML style guide, without going into very much background as to why I had arrived at that particular subset and that particular usage. And so I've been asked to "explain the reasoning" behind point 5:
"I use only two kinds of relationship on a class diagram: «implements» and «uses». No containment or aggregation (even when describing C++ code), no bi-directional relationships, no roles or multiplicities, and no navigability."
Looking at it again, I can see it does need some explanation! The statement is based on a whole raft of inter-related beliefs that I've held for a very long time, and which may require several articles to unravel. Anyway, here's a beginning...
Firstly, I should reiterate the goals I have when creating a UML model. I use UML under only two circumstances:
As a design tool, to sketch the main collaborators in a scenario we're about to implement. This happens very frequently during a project, and is a 3-minute process of sketching on a whiteboard or the back of an envelope. The goal is to develop an outline understanding of how to assign responsibilities among the objects involved in one aspect of a system. This model is almost always a collaboration diagram, and will be thrown away very soon after it was drawn.
To create a map of a system as an aid to future travellers. I prefer to let the code and the tests do the talking, and so these after-the-fact UML models are intended only as signposts and summaries. Again, I focus on the system's behaviour, preferring collaboration diagrams, object state diagrams and swim-lane activity diagrams. I do usually include one or two static models, but each will document only a small, tight-knit cluster of classes; I never attempt to use them to show the whole system.