UML State Machine Diagram

State machine diagrams were covered as part of the Software Engineering module (COM00144M) during my MSc studies with the University of York. This post will detail my findings and provide information and examples on how to create state machine diagrams.

What is a state machine diagram?

State machine diagrams are used to model the events an object can go through. They visualise the steps of a process and show the different paths that can be taken from one state to another during its lifetime.

States

Each state is shown by a single rounded rectangle, the name of the state is written inside.

State machine state example

States can contain further optional detail in the form of these additional properties:

  1. Entry – An action that is performed on entry to the state
  2. Do – An action that is performed while in the state
  3. Exit – An action that is performed on exit of the state
  4. Defer – An action that occurs when the current state is exited and triggered from another state
State machine expanded state example
Read More

UML Use Case Diagrams

Use case diagrams were covered as part of the Software Engineering module (COM00144M) during my MSc studies with the University of York. This post will detail my findings and provide information and examples on how to create use case diagrams.

What is a Use Case Diagram?

A use case diagram is part of the unified modelling language (UML). They are responsible for detailing high-level functionality and system scope by showing user interactions.

The diagrams consist of four main components:

  • Actors
  • Use Cases
  • Relationships
  • System Boundaries
Read More

UML Class Diagrams

As part of the MSc degree with the University of York, I have studied the Unified Modelling Language (UML) during the Software Engineering module (COM00144M). A section of this work has been related to class diagrams.

What is a Class Diagram?

A class diagram is a way to statically represent the structure of a system. This is achieved by modelling the systems classes, attributes, operations and relationships between objects involved.

Class diagrams come in different perspectives, this depends upon the stage of design.

  • Conceptual: represents the early stage concepts in the domain
  • Specification: focuses on the interfaces of abstract data types
  • Implementation: describes how classes will implement interfaces
Read More

Object Constraint Language

The object constraint language was covered as part of the Software Engineering module (COM00144M) during my MSc studies with the University of York. This post will provide information on why OCL is used and examples of how you can implement OCL.

What is OCL?

The object constraint language (OCL) is a declarative ISO standard language created by IBM. OCL was developed to help relieve limitations with UML modelling and to allow the specification of more precise aspects of a system design. OCL is a part of the Unified Modelling Language (UML) set by the Object Management Group (OMG) as a standard for object-oriented design.

OCL is a declarative and side-effect free language which means the constraints only enforce rules, they do not assign values or modify the system.

Some usages of OCL include:

  • Invariants specify constraints that have to equal true during the instance of an objects lifetime
  • Preconditions specify constraints that have to equal true before a method is run
  • Postconditions specify constraints that have to equal true after a method is run
  • Initialisation specify default property values
Read More