It seems that whether we may use a button depends only on the current state of the list selection. Before we can discuss the behavior of the system, we need at least a basic structural model. For that, we use an object diagram rather than a class diagram. This conforms to XP in the sense that we start with the concrete problem and find abstractions later. In Figure 2, we present a first UML object diagram for the modeled sub-system.
Arrow heads show the navigation direction of an association.
Such associations are used as an appropriate means to describe object-valued attributes of an object. The diagram introduces a buttonDisabler object, which has one attribute called selectedIndex of type int and is associated with three objects called removeButton , upButton , and downButton , which all own an attribute called label of type String and one called enabled of type boolean . Also, the buttonDisabler knows a list , which has an attribute size which is some int . This model describes a state of the system in terms of objects, attributes with values, and associations. A first addition is to introduce types or classes for the objects.