3.5-conformancebottom.tex 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. \section{Explicit Modelling of Physical Conformance}
  2. \label{sec:conformancebottom}
  3. Recall that relying on the physical conformance relation was the cause of the problems we have previously observed.
  4. The theoretical limitation, preventing explicit modelling of these algorithms, were the limitations imposed by strict metamodelling: a model cannot span multiple levels.
  5. These problems let to the obfuscation of tool semantics, and the strong reliance on implementation details for all algorithms.
  6. \subsection{Moving Away from Physical Conformance}
  7. As all problems seem to be situated in the physical conformance dimension, the most direct solution would be to do away with this dimension completely.
  8. This is, however, not possible, as each model still requires a physical representation in memory, as well as model management operations defined over it.
  9. The closest we can get, is shifting away many responsibilities of the (hidden) physical conformance dimension, into the (explicitly modelled) linguistic conformance dimension.
  10. There is a natural relation between both physical and linguistic conformance, as both are related to the structure of the model.
  11. To do this, we define a new metamodel, which is identical to the (implicit) metamodel of the implementation layer.
  12. This metamodel, however, is defined in the linguistic dimension, thus making it explicit.
  13. For clarity in our discussion, we call this metamodel $\mathit{LTM}_\perp$, shown in Figure~\ref{fig:LTM_bottom}.
  14. It can be seen that it is a metamodel for basic graphs, where nodes might have values.
  15. These possible values are \textit{Type} (the type of any value type, including itself), \textit{Action} (the type for all action language constructs, such as \textit{While}, \textit{If}, and \textit{FunctionCall}.), \textit{Integer}, \textit{Float}, \textit{Boolean}, and \textit{String}.
  16. Additionaly, edges are a subclass of nodes, meaning that they can have incoming and outgoing edges themself.
  17. Since every element is a subclass of \textit{Node}, an edge can start and end at any element, including itself.
  18. As this is only at the conceptual level, it was done to make reasoning about edges from edges conceptually clearer.
  19. The leftmost association from \textit{Node} to itself represents the type of inheritance relations: since inheritance relations are also explicitly modelled~\cite{MultiConformance}, they require their own metamodel.
  20. And since the $\mathit{LTM}_\perp$ should be self-describing, it contains this type too.
  21. Since any model conforms to the (often implicit) physical metamodel in the physical dimension, they should also, by definition, conform linguistically to $\mathit{LTM}_\perp$.
  22. We call this new linguistic conformance to $\mathit{LTM}_\perp$ $\mathit{conformance}_\perp$.
  23. While it is actually the same as conformance in the physical dimension, we shift this to the linguistic dimension to offer it to the users.
  24. Thanks to the possibility for multiple metamodels for a single metamodel~\cite{MultiConformance}, it is possible for the model to be typed by multiple linguistic metamodels: $\mathit{LTM}_\perp$, and the original linguistic metamodel(s).
  25. Figure~\ref{fig:moving_ltm} shows the 1-to-1 mapping of the Physical Type Model (PTM) to the linguistic dimension.
  26. As each element necessarily conforms to the PTM, it will also, by definition, conform to the new $\mathit{LTM}_\perp$.
  27. \begin{figure}
  28. \centering
  29. \includegraphics[width=0.8\columnwidth]{figures/LTM_bottom.pdf}
  30. \caption{$LTM_\perp$, allowing for any element to connect to any other element.}
  31. \label{fig:LTM_bottom}
  32. \end{figure}
  33. \begin{figure}
  34. \centering
  35. \includegraphics[width=\columnwidth]{figures/moving_ltm.pdf}
  36. \caption{$LTM_\perp$ added in the linguistic dimension, which is identical to the one in the physical dimension.}
  37. \label{fig:moving_ltm}
  38. \end{figure}
  39. \subsection{Coping with Strict Metamodelling}
  40. By lifting the physical conformance relation up to the linguistic conformance dimension, we achieve a way of explicitly modelling, albeit indirectly, in the physical dimension.
  41. Users are therefore able to, using their normal linguistic modelling tools, alter the physical dimension.
  42. The physical representation of the model is thus seen as an instance a linguistic metamodel.
  43. While the tool still complies to strict metamodelling in the linguistic dimension, $\mathit{LTM}_\perp$ is taken so general, that the complete metamodelling hierarchy can be expressed as a direct instance of it.
  44. This effectively flattens the original metamodelling hierarchy into a single level: $\mathit{LTM}_\perp$ at the metamodelling level, and everything else at the modelling level.
  45. In this single model level, which is only a different view on the same model, strict metamodelling does not restrict anything, even links between different levels (of the original hierarchy).
  46. Figure~\ref{fig:different_hierarchies} represents the two possible views on the modelling hierarchy: either through the usual conformance relation (Figure~\ref{fig:different_hierarchies_A}), or the new $\mathit{conformance}_\perp$ relation (Figure~\ref{fig:different_hierarchies_B}).
  47. Depending on the used metamodel and conformance relation, strict metamodelling can thus be interpreted differently.
  48. Note that this is still distinct from dropping strict metamodelling completely: strict metamodelling is still used throughout the complete environment, and still imposed on instances, even with the $\mathit{conformance}_\perp$ relation.
  49. But the implications of strict metamodelling depend entirely on the metamodel: for normal linguistic metamodels, strict metamodelling is as it was originally designed, but for the special metamodel $\mathit{LTM}_\perp$, strict metamodelling does not constrain anything because every element is at the same level.
  50. Coping with strict metamodelling alone does not solve all problems.
  51. While the limitation of not being able to model executable models across levels was removed, these executable models still directly interact with the underlying data structure.
  52. This is still a lingering aspect of the physical dimension, which we tackle next.
  53. \begin{figure*}
  54. \centering
  55. \begin{subfigure}{0.3\textwidth}
  56. \centering
  57. \includegraphics[width=\textwidth]{figures/different_hierarchies_A.pdf}
  58. \caption{Petri nets metamodel}
  59. \label{fig:different_hierarchies_A}
  60. \end{subfigure}
  61. \begin{subfigure}{0.6\textwidth}
  62. \centering
  63. \includegraphics[width=\textwidth]{figures/different_hierarchies_B.pdf}
  64. \caption{$LTM_\perp$}
  65. \label{fig:different_hierarchies_B}
  66. \end{subfigure}
  67. \caption{Different modelling hierarchies for the model \textit{my\_PN}, as seen through two different linguistic views.}
  68. \label{fig:different_hierarchies}
  69. \end{figure*}
  70. \subsection{Abstracting Implementation Details}
  71. The 1-to-1 mapping between the physical metamodel and $\mathit{LTM}_\perp$ made it possible to linguistically access the physical dimension.
  72. But the physical dimension is still part of the implementation, and could therefore change in subsequent versions.
  73. This would bring us to language evolution, as $\mathit{LTM}_\perp$, and possibly $\mathit{conformance}_\perp$, would also have to be updated, together with all saved models.
  74. While some advances are made to language evolution in order to do these changes automatically, we don't want to expose users to these problems.
  75. Users should therefore not be bothered with the internals of the tool, not even the physical data representation.
  76. And while users do need access to a physical-like representation, it can certainly be a different one than that which was implemented, as long as there exists a mapping between them.
  77. $\mathit{LTM}_\perp$ is thus merely a wrapper, or an abstraction of the actual data structure being used.
  78. Modifications on instances of $\mathit{LTM}_\perp$ are mapped over to changes in the physical dimension, and vice versa.
  79. This can be done by having the actually implemented data structure implement an interface as if it were conforming to $\mathit{LTM}_\perp$.
  80. This requires a mapper between $LTM_\perp$ and the physical metamodel, which is similar to physical mappers~\cite{MULTI_Modelverse}.
  81. Now, however, the mapping is only defined for a single metamodel, instead of for each metametamodel individually, greatly relieving users.
  82. This is the mapping shown in Figure~\ref{fig:change_physical}.
  83. Decoupling the implementation of algorithms from the actual internal data structure makes it possible to perform drastic changes internally (\textit{e.g.}, switching between database technologies), without any change whatsoever to the explicit models of model management operations, nor to $\mathit{LTM}_\perp$ or $\mathit{conformance}_\perp$.
  84. Related to this, different tools can implement exactly the same algorithms, which were explicitly modelled, even if their implementation language and internal data structure is completely different.
  85. They only need to agree on $\mathit{LTM}_\perp$ and the corresponding $\mathit{conformance}_\perp$, and an explicitly modelled action language to go along with it.
  86. All other implementation choices become truely that: choices made in the implementation that don't affect functionality at all.
  87. \begin{figure}
  88. \includegraphics[width=\columnwidth]{figures/change_physical.pdf}
  89. \caption{Changing the physical metamodel with something else, as long as there is still a mapping to $LTM_\perp$. SQL metamodel not expanded due to space constraints.}
  90. \label{fig:change_physical}
  91. \end{figure}
  92. \subsection{Overview}
  93. %TODO elaborate
  94. We now relate back to the problems we initially observed.
  95. The strong reliance on the physical dimension were caused by both pragmatic reasons (\textit{i.e.}, developers are more familiar with programming languages) and theoretical limitations (\textit{i.e.}, strict metamodelling prevents a model from referencing two different levels).
  96. While we can't do much about the pragmatic reasons, we have used multi-conformance to offer a different view on the model: instead of being an instance of a user-defined metamodel, it becomes an instance of $\mathit{LTM}_\perp$.
  97. Using the $\mathit{conformance}_\perp$ relation, strict metamodelling does not constrain the user anymore because all model elements reside at the same level.
  98. Similarly, the physical implementation and mapping to $\mathit{LTM}_\perp$ were decoupled from the linguistic metamodel, making it possible to alter the implementation without affecting $\mathit{LTM}_\perp$ or its instances at all.