Mo+面向模型的编程语言

联合创作 · 2023-10-01 23:08

Mo+ 是首个完全支持面向模型开发的编程语言和集成开发环境。Model Oriented Development (MOD) 可以让你通过简单、模型聚焦的方法进行开发。你可以将模型信息转换成源码。

MoPlusUI.png

MoPlusWorkflow.png

模型示例:

<Solution>
    <SolutionName>MyOrders</SolutionName>
    <TemplatePath>
        C:\MyCodeTemplates\EntityAndPropertyReport.mpt
    </TemplatePath>
    <FeatureList>
        <Feature>
            <FeatureName>Orders</FeatureName>
            <EntityList>
                <Entity>
                    <EntityName>Customer</EntityName>
                    <PropertyList>
                        <Property>
                            <PropertyName>CustomerID</PropertyName>
                        </Property>
                        <Property>
                            <PropertyName>CustomerName</PropertyName>
                        </Property>
                    </PropertyList>
                </Entity>
                <Entity>
                    <EntityName>Order</EntityName>
                    <PropertyList>
                        <Property>
                            <PropertyName>OrderID</PropertyName>
                        </Property>
                        <Property>
                            <PropertyName>OrderName</PropertyName>
                        </Property>
                        <Property>
                            <PropertyName>CustomerID</PropertyName>
                        </Property>
                    </PropertyList>
                </Entity>
            </EntityList>
        </Feature>
    </FeatureList>
</Solution>

代码模板

<CONFIG>
    NAME EntityAndPropertyReport
    CATEGORY Test
    NODE Solution
    TOPLEVEL True
</CONFIG>
<CONTENT>
<%%-List of entities and their properties:%%>
<%%:
foreach (Entity)
{
    <%%-
    Entity: %%><%%=EntityName%%>
    foreach (Property)
    {
        <%%-
        Property: %%><%%=PropertyName%%>
    }
}
%%>
浏览 7
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报