NI State Pattern Actor
No ratings yet
The state pattern is a behavioral design pattern that ?allow[s] an object to alter its behavior when its internal state changes.  The object will appear to change its class.?[1]  Use this pattern if an object must change its behavior based on its internal state (i.e. if the class has two or more modes of operation such that the mode change alters the behavior of most of the class methods).  This pattern lets you avoid adding case structures that test for mode to all of your VIs, generally making for more maintainable code. This package demonstrates a straightforward way to create a family of actors that together implement the state pattern. We refer to this collection of actors as a State Pattern Actor.

This package adds a new actor, called State Actor, to your user.lib folder. It also adds the State Pattern Actor project to your list of available sample projects.

[1] Gamma, Helm, Johnson, and Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software, 1994, p. 305
Release Notes
                    Two changes to State Actor.lvclass. and are no longer marked "child class must override". That proved to be overly restrictive.

Actor now calls just before exiting.
Release date
August 25, 2016
Version history