Course Title: CS2002
Instructor: Dr. Rumyana Neykova
Contact: Rumyana.neykova@brunel.ac.uk
Diagram representation of states and transitions.
occupy() Method: Changes the state to occupied.
release() Method: Changes the state to free.
Textbook: UML @ Classroom: An Introduction to Object-Oriented Modeling
Authors: Martina Seidl, Marion Scholz, Christian Huemer, Gerti Kappel
Publisher: Springer Publishing, 2015
ISBN: 3319127411
Topics Covered:
Use Case Diagram
Structure Modeling
State Machine Diagram
Sequence Diagram
Activity Diagram
Introduction
States
Transitions
Types of Events
Types of States
Entry and Exit Points
Structural Diagrams:
Classes, Objects, Packages, Components
Behavioral Diagrams:
State Machine, Use Case, Sequence, Activity Diagrams
Definition: Models the states of a system or object.
Functionality:
Shows possible states
Illustrates state transitions via events
Describes system behavior in each state
Example: Lecture hall object states.
Class Structure:
class LectureHall {
private boolean free;
public void occupy() { free=false; }
public void release() { free=true; }
}
Clock Functionality:
Methods: set(), inc()
Entry Activities: beep on entry, show current time.
Entry Activity: Action performed when entering a state.
Do Activity: Action performed during the state.
Exit Activity: Action performed when exiting the state.
Deferrable Trigger: Events that remain in the event pool if they do not trigger a transition.
States: Nodes representing active conditions of an object.
Activity Types:
entry: Executed upon entering a state.
exit: Executed upon exiting a state.
do: Executed while active in the state.
Definition: Change from one state to another.
Components:
Source State
Target State
Event Trigger
Guard Condition
Activities Executed During Transition
Event (Trigger): Stimulus initiating a transition.
Guard (Condition): Boolean expression that must be true to proceed with the transition.
Activity (Effect): Actions performed as a result of the transition.
Internal Transition: Remains in current state while executing actions.
External Transition: Leaves current state to enter a different state while executing actions.
Scenario: Evaluating variable 'x' during transitions between states.
States: Not registered, registered.
Transitions: Registration potential, withdrawal options.
Signal Event: Triggered by receiving a signal.
Call Event: Triggered by operation calls.
Time Event: Based on relative or absolute timing.
Change Event: Checked continuously for condition changes.
Guard: Checked only when an event occurs.
Definition: Starting point in a state machine; cannot stay in this state.
Final State: Represents the logical end of the state's sequence.
Terminate Node: Ends the state machine and ceases object existence.
Functionality: Models alternative transitions based on conditions.
Parallelization Node: Splits control flow into multiple paths.
Synchronization Node: Merges multiple flows back into one.
State: Defined period of object life during which activities can occur.
Transition: Movement from one state to another.
Initial State: Start of the state machine.
Final State: Conclusion of the state machine.
Terminate Node: Marks the end of the object's lifecycle.