Architecture Overview - STARIONGROUP/COMET-IME-Community-Edition GitHub Wiki
Introduction
The CDP4-COMET-IME is a modular application. Plugins are used to add/remove functionality to and from the application. The PRISM 5 framework from Microsoft is used to provide this capability. This modular aproach requires a Shell application that loads the plugins at startup. The CDP4-COMET-IME provides both a desktop application and Microsoft Excel integration, for each of these there is a shell.
WPF and the MVVM Pattern
WPF
The CDP4-COMET-IME is a Windows Prensentation Framework (WPF). WPF is a UI framework that creates desktop client applications. The WPF development platform supports a broad set of application development features, including an application model, resources, controls, graphics, layout, data binding, documents, and security. WPF uses the Extensible Application Markup Language (XAML) to provide a declarative model for application programming. Even though WPF supports a programming technique called Code Behind to implement GUI behavior, this is NOT being used for CDP4-COMET-IME development. Instead the Model-View-VewModel (MVVM) design pattern is used to implement the behavior that is associated to a GUI element, also called a View.
In some places some code-behind may be required, but it shall be kept to an absolute minimum.
There is little that needs to be done in code-behind. There is little that cannot be solved with Converters, Attached Properties, and (most importantly) Attached Behaviors.
MVVM Pattern
MVVM facilitates a separation of development of the graphical user interface – be it via a markup language or GUI code – from development of the business logic or back-end logic (the data model). There are three core components in the MVVM pattern: the model, the view, and the view model. Each serves a distinct purpose. At a high level, the view "knows about" the view model, and the view model "knows about" the model, but the model is unaware of the view-model, and the view-model is unaware of the view. Therefore, the view-model isolates the view from the model, and allows the model to evolve independently of the view.
View
The view is responsible for defining the structure, layout, and appearance of what the user sees on screen. In the CDP4-COMET-IME views are defined using XAML. View elements, such as Buttons, Text Fields, TreeViews etc. can be bound to properties of a view-model. Data binding can be used to populate the contents of a GUI element, update an underlying view-model property or handle the click-event of a button. For a good overview of data-banding read the data-binding-overview page.
View-Model
The view model implements properties and commands to which the view can data bind to, and notifies the view of any state changes through change notification events. The properties and commands that the view model provides define the functionality to be offered by the UI, but the view determines how that functionality is to be displayed.
Each view model provides data from a model in a form that the view can easily consume. To accomplish this, the view model sometimes performs data conversion. Placing this data conversion in the view model is a good idea because it provides properties that the view can bind to. For example, the view model might combine the values of two properties to make it easier for display by the view
Model
Model classes are non-visual classes that encapsulate the app's data. Therefore, the model can be thought of as representing the app's domain model, which usually includes a data model along with business and validation logic.
The domain model of the CDP4-COMET is the ECSS-E-TM-10-25 Annex A master model. The POCO classes represent the domain model and are exposed through the COMET-SDK-Community-Edition.