Software Construction: Object States
Cards to learn object states
Cards to learn object states
Fichier Détails
Cartes-fiches | 13 |
---|---|
Langue | Deutsch |
Catégorie | Informatique |
Niveau | Université |
Crée / Actualisé | 01.01.2020 / 10.01.2020 |
Lien de web |
https://card2brain.ch/box/20200101_software_construction_object_states
|
Intégrer |
<iframe src="https://card2brain.ch/box/20200101_software_construction_object_states/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>
|
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.
Design Principle for State Space
Minimize the state space of objects to what is absolutely necessary for the object to fulfill its responsibilities.
Final Fields & Variables (Definition)
Java final variable: If you make any variable as final, you cannot change the value of final variable (It will be constant). A blank (null) final variable can only be initialized in the constructor!
Java final method: If you make any method as final, you cannot override it. A constructor can never be declared final (because it's never inherited)!
Java final class (object): If you make any class as final, you cannot extend it. Final fields do not make the referenced objects immutable! (i.e. only the reference pointer is immutable, but not the object itself)