As I read through The Unified Modeling Language Reference Manual Second Edition
Attributes are generally used for pure data values without identity, such as numbers and strings.
Associations are used for connections among objects with identity.
I wonder if there is simple example explain what with/without identity means?
At first, ignore "identity" and think of the situation without it.
Now, look at the following example: a class, User, with three attributes, one of which is another class, Address.
class User {
String firstName;
String lastName;
Address address;
}
class Address {
String streetName;
int streetNumber;
String postalCode;
}
If you want to draw the UML diagram of the above situation, which is an association, you will have something like this:
|User |---->| Address|
As you see, although User has three attributes, in the diagram, you show only one, the one for which you have another class in your model, Address. You can show the other two attributes, firstName and lastName, INSIDE the box of User. But, as far as association is concerned, that is it, User and Address.
Now, going back to "identity" part. First of all you should note that the discussion of identity is not needed in the general formulation of Association. Like shown above, you can talk about association without reference to the concept of "identity". I suspect, they talked about identity in some a particular context. For example, if you consider the above example again, firstName and lastName cannot have identities, only Address can have identity.