鄧禹+劉曉燕



摘要:
微服務架構以其先進的架構風格將應用分割成細小的服務,而MDA(Model Driver Architecture)集成化的模型開發方法也為解決軟件開發效率和可移植性問題提供了實現機制。結合模型驅動實現了微服務架構建模開發,將微服務建模分為概念模型和交互模型兩個過程?;诮换チ鹘UZ言定義概念元模型,設計了模型轉換方法,將概念元模型映射到交互模型,并根據其提供的組件設計出一種微服務模型重用機制,提高了開發效率。最終的交互模型以圖形化方式顯示,提供了直觀的模型視圖。
關鍵詞:
微服務架構;MDA;交互流建模語言;模型轉換;概念元模型
DOIDOI:10.11907/rjdk.172148
中圖分類號:TP319
文獻標識碼:A文章編號文章編號:1672-7800(2018)001-0165-04
Abstract:The Microservice architecture advocates dividing the application into small services with its advanced architectural style,The MDA integrated model development method also provides a mechanism to solve the problem of software development efficiency and portability.Microservice architecture development process and model building are the key research content.On the basis of,this article focuses combined with the model driver to achieve Microservice architecture modeling and development, Microservice modeling is divided into conceptual model and interaction model of the two processes.At the same time, the conceptual meta-model is defined based on the interaction flow modeling language,the design model transformation method maps the conceptual meta-model to the interactive model,and according to the components provided by the design of a Microservice model reuse mechanism,improve development efficiency.The final interaction model is shown in graphical representation, providing an intuitive model view.
Key Words:microservice architecture;model driver architecture;interaction flow modeling language; model transformation;conceptual meta-model
0引言
微服務架構模型[1]將應用分割成一系列細小的服務,每個服務專注于單一的業務功能,每個微服務都是一個架構模型。但由于缺少一種簡潔高效的架構方法,使得手工編碼仍是主要的開發手段,開發出的微服務應用存在移植性低、維護性差的缺點。MDA[2]的核心內容就是建模,從代碼開發為中心過渡到模型架構為中心,并分離系統的業務邏輯和平臺,將設計階段的重點放在業務邏輯上,是實現系統自動轉換的重要工具。MDA框架中的平臺獨立模型PIM和平臺相關模型PSM是模型架構的關鍵技術[3]。模型轉換解決模型到模型及模型到代碼的映射方法,并將方法映射在不同的技術平臺。交互流建模語言作為最新的建模開發語言,以其強大的交互模型和組件完成復雜的建模開發。通過交互設計中的關注點分離(與微服務架構中的服務分割相同)來改進開發過程,同時改善內容、界面組合、交互和導航控制以及與業務邏輯的連接,增強模型組件的重用設計和建模的開發效率。
本文通過模型驅動架構的設計,以交互流建模語言為基礎,結合微服務架構設計特點,建立了一套微服務架構開發方法,設計出微服務重用模塊,以實現模型組件的重復利用。利用交互流建模語言提供的擴展性組件設計微服務架構模型轉換規則,提供了一種微服務開發思路。
1相關研究
1.1微服務架構建模
模型是有關屬性的模擬或表示,微服務圍繞業務能力構建,能夠完全自主化部署[4]。微服務架構模型可以采用模塊化思想分步建模,將建模設計分為微服務概念模型(Mircoservice Conceptual Model,MSCM)和微服務交互模型(Mircoservice Interaction Model,MSLM)兩個過程。MSCM是一個既抽象又與平臺無關的模型(PIM),而MSIM則是具體的平臺相關模型(PSM),完成微服務開發的用戶交互和應用組建。由MSCM到MSIM,符合模型驅動架構過程中PIM到PSM 的模型映射過程,如圖1所示。
在模型驅動的開發過程中,MSCM是一個M1層模型,需要定義一個M2層元模型(Meta-model)對概念模型進行描述。因此,整個開發建模過程的重點是概念元模型的建立和模型轉換。endprint