Community: Applying Common Object-Oriented (OO) Design Patterns to LabVIEW - National Instruments
Design Patterns
- Template Method (aka Channeling) Pattern - To provide a guaranteed pre-processing/post-processing around some dynamic central functionality. Allows child classes ability to override some steps of an algorithm without giving them the ability to change out the entire algorithm.
- Factory Pattern - Provide a way to initialize the value on a parent wire with data from many different child classes based on some input value, such as a selector ring value, enum, or string input.
- Hierarchy Composition Pattern - To represent a single object as a tree of smaller instances of that same object type.
- Delegation Pattern - To have two independent classes share common functionality without putting that functionality into a common parent class.
- Visitor Pattern - To write a traversal algorithm of a set of data such that the traversal can be reused for many different operations.
- Aggregation Pattern - To treat an array of objects as a single object and define special behavior for that particular type of array.
- Specification Pattern - To have different functionality for a class depending upon some value of the class without updating case structures throughout your VI hierarchy when you add another value.
- Singleton Pattern - Guarantee that a given class has only a single instance in memory
- Decorator (Wrapper) Pattern - Extend a concrete object's responsibilities dynamically. Extend the features of an existing class without refactoring tested code.
- Strategy (Policy) Pattern - Change the behavior of a class's method without having to edit the method's implementation.
Application Examples
- State Pattern, Factory Pattern - this is an example of a UI Plugin Framework that il
Read full article from Community: Applying Common Object-Oriented (OO) Design Patterns to LabVIEW - National Instruments
No comments:
Post a Comment