140 likes | 340 Views
Statechart diagrams. P5 T120B029 2012 pavasario sem. What is state ?. State = set of values that describe an object (its condition/situation) at a specific moment in time State is determined based on the attribute values. states. Where to use ? For what purpose ?.
E N D
Statechartdiagrams P5 T120B029 2012 pavasario sem.
Whatisstate? • State = set of values that describe an object (its condition/situation) at a specific moment in time • State is determined based on the attribute values states
Where to use? Forwhatpurpose? • useful to model reactive systemsthat responds to external or internal events. • states are defined as a condition in which an object exists and it changes when some event is triggered. • the purpose is to model life time of an object from creation to termination. • do not have to refer to classes or objects, they can also refer to subsystems etc…
How to draw Statechart Diagram? • Identify important objects to be analyzed. • Identify the objectstates. • Identify the eventsresponsible for state changes. • Model object‘sbehaviour
Event(arguments)[condition]/action State-A State-B Notation • Transition: • Event(arguments) • Guardconditions • Action
Transitions • Are there any logical differences? • (1) • (2)
Problem: Cancel the order • Want to be able to cancel at any time? • Solutions • Transitions from every state to state “cancelled” • Superstate (composite) and single transition
Superstate Event A Planuojama Nauja Event C Event B Composite state: Sequential substates Atvažiavo Vėluoja Compositestateexample
Concurrentstate (and-state) Planuojama Atvažiavo Išvažiavo Iškrautas [OUT] Kraunasi Pakrautas [IN]
Statechart benefits • Ability to analyze the influence of events on the object states. • It is used as book of knowledge during implementation of the system. • Helpful to understand the system’s behaviour during its execution
Individualios temos • Android, žaidimas Gyvatėlė • Android, žaidimas Hide and seek • Android, Valiutų kursai • Android, C++ 3D varikliukas • Kinect • eTaksi • Smegenų balionas • Kitos ???
Užduotis kitai paskaitai • Individualios temos pristatymas • 10 min kiekvienai grupei • Ne daugiau 10 skaidrių • Atskleisti užduoties esmę • Pristatyti sistemos funkcionalumą • Pabrėžti pagrindinius funkcinius reikalavimus • Išreikšti kuriamą sistemą skaičiais! • Pateikti darbų pasiskirstymą ir realizavimo planą