The “New Project Creation Guide” example presents a basic intuition of some of the core functions of the Virtuoso framework, but the real power of the Virtuoso workflow lies in the host application architecture. For a workflow to be maximally useful, the framework needs to provide a library of reusable code-only components as well as user interface components that can be set up with very little effort using the schematic editor.
For this, the Virtuoso C#/.NET host application and component library was designed to employ the use of a specific design pattern, namely Model-View-ViewModel or “MVVM”. To fully understand the rationale behind the MVVM design pattern, we must first understand the difference between so-called “imperative” and “declarative” programming. Imperative programming is procedural programming: The development of a sequence of instructions and function calls to implement a software solution. This is in contrast to “declarative” programming, which focuses on declaration of how aspects of the software solution should function and interact with other aspects of the software. In application development involving Windows Forms and other Forms-based user interface technologies, the programming to design a user interface is procedural: the form class has a constructor method which is executed procedurally, and code to add each control in the form is executed sequentially. Visual Studio and other IDE’s provide a visual design surface to automate the placement of controls and the corresponding code for control placement for Forms-based user interfaces, but at its heart it is still a procedural, imperative paradigm. The software development community over time began to recognize that imperative programming was not the ideal fit for the design of user interfaces, and conceptualization of a declarative programming pattern began to emerge.
One of the driving reasons behind this was the recognition of the inherently hierarchical nature of user interfaces: A form was a collection of controls, and some “controls” were actually functional collections of other controls, for example a radio button was a collection of labels and grouped toggle buttons. It became more apparent that the layout of the controls in a form was independent of the function of the form as a whole, and the process of moving blocks of imperative programming code around was tedious.
Another driving consideration was the recognition that the logical behavior of a user interface is separate from the look of the user interface, and applications could be developed much faster when the application logic and application presentation concerns could be separated. These reasons, among others, were the motivation of the Extensible Application Markup Language (or XAML, pronounced “Zamel”) as well as Microsoft’s Windows Presentation Foundation and the Model-View-ViewModel (“MVVM”) design pattern.
The “separation of concerns” of application business logic from the view or “look” of the application promotes the highly desirable characteristic of “loose coupling” of application components. Tight coupling of application components occurs when an application grows over time to a monolithic code base that is difficult to understand and even more difficult restructure. Alternatively, a design that promotes loose coupling is easy to understand, easy to modify, and easy to build from smaller, more testable components. The effortless composition of visual and functional components is the primary objective of the Virtuoso host design pattern, thus the WPF application with MVVM was chosen as the optimum virtual device design pattern. It is important to note, however, that while the standard C#/.NET host plugin implements MVVM in C#, different host plugins could be implemented completely differently depending on the host language and host design requirements.