Mo+面向模型的编程语言
Mo+ 是首个完全支持面向模型开发的编程语言和集成开发环境。Model Oriented Development (MOD) 可以让你通过简单、模型聚焦的方法进行开发。你可以将模型信息转换成源码。
模型示例:
<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%%> } } %%>
评论