一句话:提出代码优先的 MDE 方法,从现有面向对象程序提取视图模型,并通过保守运行时扩展实现按需查询与增量同步。
MDE 工具在既有软件上采用困难:领域模型仍隐式表示,切换常需重构核心、破坏向后兼容并增加培训成本,且缺乏可行性量化证据。本文提出 code-first MDE:半自动从既有面向对象应用抽取显式视图模型,并提供保守运行时扩展,使视图模型查询按需解析、更新增量回传原应用,无需修改原程序。该方法在 Java 与 Eclipse Modeling Framework 上实现,以面向决策支持系统的工业基准评估同步机制的性能与可扩展性;结果表明,对超大型视图的大批量更新反向传播是即时的。
Domain models are the most important asset in widely accepted software development approaches, like Domain-Driven Design (DDD), yet those models are still implicitly represented in programs. Model-Driven Engineering (MDE) regards those models as representable entities that are amenable to automated analysis and processing, facilitating quality assurance while increasing productivity in software development processes. Although this connection is not new, very few approaches facilitate adoption of MDE tooling without compromising existing value, their data. Moreover, switching to MDE tooling usually involves re-engineering core parts of an application, hindering backward compatibility and, thereby, continuous integration, while requiring an up-front investment in training in specialized modeling frameworks. In those approaches that overcome the previous problem, there is no clear indication - from a quantitative point of view - of the extent to which adopting state-of-the-art MDE practices and tooling is feasible or advantageous. In this work, we advocate a code-first approach to modeling through an approach for applying MDE techniques and tools to existing object-oriented software applications that fully preserves the semantics of the original application, which need not be modified. Our approach consists both of a semi-automated method for specifying explicit view models out of existing object-oriented applications and of a conservative extension mechanism that enables the use of such view models at run time, where view model queries are resolved on demand and view model updates are propagated incrementally to the original application. This mechanism enables an iterative, flexible application of MDE tooling to software applications, where metamodels and models do not exist explicitly. An evaluation of this extension mechanism, implemented for Java applications and for view models atop the Eclipse Modeling Framework (EMF), has been conducted with an industry-targeted benchmark for decision support systems, analyzing performance and scalability of the synchronization mechanism. Backward propagation of large updates over very large views is instant.