SlideServe
Menu
Préférences
© SlideServe · v2026

Statecharts

imala avatar
18 diapositives · 425 Views · Sep 29, 2014

Statecharts. Executable Visual Languages for System Development, Fall 2010. This lecture. The Rhapsody semantics of statecharts Rhapsody basics Examples The Rhapsody tool Basic statecharts concepts are included for reference. Implementation.

Statecharts - slide 1
01 / 18Statecharts
1 / 17

Télécharger la présentation

Statecharts
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Statecharts Executable Visual Languages for System Development, Fall 2010

  2. This lecture • The Rhapsody semantics of statecharts • Rhapsody basics • Examples • The Rhapsody tool • Basic statecharts concepts are included for reference Executable Visual Languages for System Development

  3. Implementation • We will discuss the Rhapsody implementation which is object oriented • Every object can have a statechart describing its behavior (the essence of intra-object) • In Rhapsody events are associated with an object, but can be also sent to other objects (itsOtherObj – need to specify the connection) Executable Visual Languages for System Development

  4. Structure vs. Behavior Behavior [Statecharts] • Consider the system structure and behavior Structure [OMD] Executable Visual Languages for System Development

  5. Structure vs. Behavior • Structure – objects and how they are connected • E.g. Lecturer, student, laptop • Behavior – what can each object do, what are its states. • E.g. Stand / Sit, Standby / On / Off • The behavioral connection between the objects is not part of the statecharts language itself. Executable Visual Languages for System Development

  6. Rhapsody Implementation • Rhapsody generates code (in Java / C++ / C) for all the statecharts. This code collectively can be fully executed. • During code generation, syntax errors in the statecharts are reported. • It is necessary to initialize the static objects, through Rhapsody configuration menu. Executable Visual Languages for System Development

  7. Object Model Diagram • Static structure model • It is necessary to have a connection to refer from one object to another • Objects can have methods, attributes • Each object can have a statechart Executable Visual Languages for System Development

  8. Rhapsody Statechart Syntax • Rountangle inside a Roundtangle creates hierarchy • Arrow connection between states, is a change in behavior. Change a transition  get a behavior change. • Let’s go to semantics… Executable Visual Languages for System Development

  9. Start working with Rhapsody • Choose your language • Define object(s) in the OMD • Define statechart for an object • Set the configuration • Initialize to have animation • Initialize object instantiation • Generate code from statecharts (resolve errors) • Compile the code (java/c++) (resolve errors) Executable Visual Languages for System Development

  10. Start working with Rhapsody • Run in animation mode • In animation mode you can choose an object instance and open the instance of the statechart • Insert an event to start the behavior. Executable Visual Languages for System Development

  11. Small Example in Rhapsody • Add class Light • Add On and Off states • Generate / Compile / Run • Add printfs and inject events • Add animation • View instance statechart Executable Visual Languages for System Development

  12. Small Example in Rhapsody Executable Visual Languages for System Development

  13. Small Example in Rhapsody • Add Orthogonality Executable Visual Languages for System Development

  14. Statecharts Usage • Useful for those with systematic perspective (perhaps less for software developers) • Consider that procedural planning is not the same as Statecharts planning. Executable Visual Languages for System Development

  15. Modeling Tips • Try to think what are the states, and what are the transitions. • Operations that take time are usually better in states and not on transitions. • In some cases to model an interaction it’s useful to have an interaction object. • Think what is really independent to create orthogonality. • Many ways to do the same thing – condition, additional states, actions, etc. Executable Visual Languages for System Development

  16. Home Alarm Example • Elaborate example with multiple objects • Includes GUI, not necessary in our projects Executable Visual Languages for System Development

  17. Dishwasher Example • Note: Rhapsody also has inheritance and abstract classes Executable Visual Languages for System Development

  18. Technical • Directions, Tips, Frequently Asked Questions on the web: http://www.wisdom.weizmann.ac.il/~michalk/VisLang2011/ • After selecting a project to model, consult with one of the TAs, schedule meetings by email: michal.gordon / shahar.maoz. • If you encounter problems (that can’t be solved using the help, the web, your friends) ask us for help by email: michal.gordon / naamah.bloch. • Submission date for 1st project: 1.1.2011 Executable Visual Languages for System Development