What is the MVA Framework?
The MVA Framework is a separation of concerns framework (Model-View-ViewModel) that extends NI's Actor Framework shipping with LabVIEW. There is nothing domain or application-specific about this framework; it's just a way to separate business logic from presentation logic (models from views).
For a quick description of MVVM, see https://blogs.msdn.microsoft.com/dphill/2009/01/31/the-viewmodel-pattern/
- Mediated data bus with implicit type safety (Subscribers request data by type)
- Viewable class that provides nesting, launching, and event handling semantics
- API for publish and subscribe to transport data with low coupling between models and views
- Transport abstraction supports many subscription types and non-AF-actors (i.e. actors that are not built on the LabVIEW Actor Framework)
- Policy-based subscriptions and publications to abstract behaviors of publishers and subscribers ("I want 'x' data of type DBL with these conditions...")
- Publication locks for exclusive publication
- Verbose framework event logging via "ENABLE_FRAMEWORK_LOG" conditional flag when all other hope is lost.
How do I get set up?
- The best example is currently available as an add-on G Package. Search GPM for "@cs/carwash".
- Some older getting started examples are just waiting in their old bitbucket repo to be ported to GPM. (So bug me about it if you care)
We have had trouble recently with the LabVIEW linker getting tied up with the relative path change that occurs when installing multi-level package dependencies. We (and others) are working on solutions to this problem. In the meantime, if you install the framework and it is broken, try running gpm relink or gpm recompile on your project directory from a command window. (relink operates only on the gpm_packages folder, recompile operates on your whole project in a more intelligent way than a mass compile.)
Dependencies that will be automatically installed by GPM:
- @cs/actor-framework-messages (used to implement framework messages)
- @cs/event-logger (for framework debug event logging)
- @cs/listbox (used by mediator bus monitor UI)
- @cs/lookup-table (used multiple places)
- @cs/transport (data transport abstraction used in mediation)
- @cs/variant (used in mediation to format unique and human-readable data types)
- Please report issues, bugs, and suggestions using the linked issue tracker.
- Please contact the author if you want to contribute.
Who do I talk to?
- Ethan Stern | Composed Systems, LLC
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[3.0.0-alpha.0] - 2020-06-29
* MAJOR UPDATE PRE-RELEASE *
- Refactored framework to depend on dependency-inverted mva-core and mva-viewable packages. (mva-framework extends with concrete ViewManagers, concrete ListboxBusMonitor, IDialogBox, and dialog box implementations.)
- MonitoredMediator decorates Mediator to allow monitoring. Use MonitoredMediator and inject a concrete bus monitor (e.g. ListboxBusMonitor) to monitor the data bus.
- No public message API for showing bus monitor. (i.e. It is no longer the ViewModel's job to manage this.) Bus monitor constructor binds to published datum. ('Construct Listbox Bus Monitor.vi' establishes the binding.)
- Viewable actors do not limit to launching one dialog box at a time (it is now the developer's option to enforce this rule if/when desired).
- Multiple bus monitors may be injected at application launch. (e.g. one that monitors data values and another that tracks publishers and subscriber counts.)
- Bus monitors may now track number of subscribers to data (implementation in ListboxBusMonitor does not yet exist).
[2.2.3] - 2019-09-12
- Updated Transport dependency to fix returning unnecessary error when Observers request formatted strings with no format specifier
[2.2.2] - 2019-09-09
- Incorrect Transport version dependency (should be 0.0.3)
[2.2.1] - 2019-09-09
- Broken ancestry for all Notification Msg descendants (temporary deprecated ancestor to be removed in major version 3)
[2.2.0] - 2019-09-06 - DO NOT USE THIS RELEASE (see 2.2.1)
- Default framework log state is no logging. Minor log format cleanup. To enable framework log, set ENABLE_FRAMEWORK_LOG conditional flag = True
- Community scoping issue (I somehow messed this up again in the last release)
- Old-fashioned polymorphic Request Synchronous Data API (replace calls with malleable method)
- Malleable Request Synchronous Data compatible with all types
[2.1.3] - 2019-08-02
- Incorrect default value of IViewable:Bind Terminal Enabled State (label and value now match Disabled and Grayed Out)
- Community scoping issue that broke deployments after LV2017 (added friend relationship)
[2.1.2] - 2019-05-10
(2.1.1 was an errant publication with an inaccurate Changelog version and date. Source is identical)
- Minor in-placeness optimization to MediatorBusMonitor
- Deprecated (and disabled) Observe Data method from concrete MediatorBusMonitor
- Stale dependency links in obsolete code and unit tests
[2.1.0] - 2019-05-02
- Framework logging now uses explicit log reference (now local, was global)
- Set Minimum Panel Size message to IViewable
- In-placeness optimization of subscription policy
[2.0.0] - 2019-03-21
- Debug logging (new dependency on @cs/event-logger)
- Project flag to conditionally remove all logging (REMOVE_DEBUG_LOGGING)
- Moved location of applicaiton template on disk so it installs with G Package
- Deprecated framework accessors
- ApplicationStyle injection (removed from framework API)
[1.9.1] - 2019-02-14
All prior GPM versions are incomplete, badly linked, or missing dependencies
- Replaced CurrentValueTable dependency (VIP) with malleable LookupTable (G Package)
- Moved all remaining tests out of Source folder
- Migrated from VI Package to G Package
- Relinked dependencies to G Packages
- TimedAverageBuffer and its associated SubscriptionPolicy (which no one used)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.