-
Notifications
You must be signed in to change notification settings - Fork 15
Model Synchronizations with NMF Synchronizations
Based on NTL and NMF Expressions, NMF also contains a language to synchronize models of heterogeneous metamodels, named NMF Synchronizations. Like NTL, it is also implemented as an internal DSL so that developers can familiarize quickly. This synchronization language is able to support 18 different operation modes out of a single specification: One may choose between three different change propagation modes (none, one-way and two-way) and six different directions (left-to-right and right-to-left in three different variants each). Also much like NTL, it supports the synchronization of arbitrary CLR types, though we require them to correctly implement INotifyPropertyChanged and INotifyCollectionChanged correctly, e.g. by using the model representation generated by NMF from an NMeta metamodel.
Similar to NTL, a synchronization rule in NMF Synchronizations is represented by a class, inferring the synchronization rules by the public nested classes. The synchronization rules each define an isomorphism between the classes they are to synchronize, referred to as left-hand-side (LHS) and right-hand-side (RHS) class. These classes are passed as generic type parameters.
Unlike NTL, NMF Synchronizations does not allow the synchronization body to contain arbitrary code but only expressions without side-effects. Instead, developers can specify a list of synchronization jobs through the specification of lambda expressions from LHS and RHS. If the result types of these lamda expressions differs, an isomorphism between them must be specified in the form of a synchronization rule between them. Depending on the operation mode selected, these lambda expressions are then compiled, inverted, or a dynamic dependency graph is created from them, potentially supporting inversion as well. For example, if the operation mode is two-way change propagation, then an invertible dynamic dependency graph is created for the expressions on both sides.