Some objects are incredibly complex, so statechart diagrams are drawn to describe how they work, as shown in Figure 6. A Statechart Diagram for a Bank Account Figure 6 shows the statechart diagram for a bank account. The rectangles represent states that are stages in the behavior of an object. States are represented by the attribute values of an object. The arrows represent transitions, which are progressions from one state to another and are represented by the invocation of a method on an object class.
Transitions are often a reflection of business rules.
Initial states are shown as solid circles, and final states are shown as an outlined circle surrounding a solid circle. In Figure 6, you can see that when an account is active, you can withdraw from it, deposit to it, query it, and close it. Collaboration Diagrams Unlike some notations that show both state and behavior on class diagrams, the UML separates behavior into collaboration diagrams. The basic difference between the two approaches is that UML class diagrams don't include messages because messages tend to clutter your class diagrams and make them difficult to read. Because UML class diagrams don't show the message flow between classes, a separate diagram, the collaboration diagram, was created.