Premium Partner

Software Construction: Object States

Cards to learn object states

Cards to learn object states


Kartei Details

Karten 13
Sprache Deutsch
Kategorie Informatik
Stufe Universität
Erstellt / Aktualisiert 01.01.2020 / 10.01.2020
Lizenzierung Keine Angabe
Weblink
https://card2brain.ch/box/20200101_software_construction_object_states
Einbinden
<iframe src="https://card2brain.ch/box/20200101_software_construction_object_states/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>

Static perspective on a Software System

Dynamic perspective on a Software System

Object State (Definition)

The state of an object refers to:

  • the pieces of information the object represents at a given moment
  • the actions that the object can perform at a given moment

Object State Definitions (3)

State Space: Set of all possible states for an object.

Concrete State: Value(s) stored at a given moment.

Abstract State: Arbitrarily-defined subset of the state space.

State Space Partitioning (Definition)

The software design task of state space partitioning is to define abstract states that correspond to characteristics that will help construct a clean solution.

State Diagrams (Definition)

State diagrams allow us to self-evaluate the impact of design decisions on the complexity of the abstract state space that must be considered when working with an object.

Here the abstract state space would consist of State A & B.

Example state diagram for an instance of deck (with separate initialization and shuffling)

Design Principle for State Space

Minimize the state space of objects to what is absolutely necessary for the object to fulfill its responsibilities.