Download tesi energywise - UniCam - Computer Science Division

Transcript
Energywise Technology & UUDM&M Interfacing
useful. The problem with so many systems is that they may satisfy many or most of their stated
requirements, but are still not really useful because they do not give the users what they want or
need; they do not work the way that people want or expect them to work.
That's why we need a new diagram that explains exactly how the application internally works, the
way in which it is programmed.
The Statechart Diagrams allows to describe the dynamic behaviour of an object or a system. They
describe all the reachable states, and how the state of the concerned object changes in relation to the
occurrence of the events. Therefore a statechart diagram is made by states and transitions.
A State is a situation, during the life of the concerned object, in which it satisfies a condition, it
executes an activity, or it waits for a certain event.
A Transition is a relation which joins a start state and an end state (not necessarily separate). The
transitions that go back to the same state are called self-transitions.
A transition is labeled with three elements, all optional: Event [Condition] / Action.
•
Event (trigger): the occurrence of a stimulus that can trigger a transition between states;
•
Condition (guard): logic expression to evaluate. If from a state come out more transitions,
their conditions must be mutually exclusive;
•
Action: it is associated to the transition, it is considered a rapid process, not interruptible
from an event.
Again, for a detailed description of the statecharts we suggest the reader to consult the book
“Software Engineering 8th edition, Addison Wesley / Pearson Education” [Sommerville, 2007].
71