[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"sanity-IBrUgScDX6Xt8h3bUtgZOAl3_UZLqjPaHNi4-O_6nMg":3,"sanity-RTdW4dfY-h7tDBwITFZ71_hSv8gKZkX8C0eIgt4KYDw":2823},{"data":4,"sourceMap":-1},{"latestPodcast":5,"latestReleases":14,"post":39,"recent":2798},[6],{"_id":7,"publishedAt":8,"slug":9,"sponsored":12,"title":13},"65868662-3b7d-4a63-9fa9-e699c48529fc","2026-10-09T07:40:00.000Z",{"_type":10,"current":11},"slug","taking-a-look-under-your-agent-s-hood",null,"Taking a look under your agent’s hood",[15,21,27,33],{"_id":16,"publishedAt":17,"slug":18,"title":20},"7a2d88e5-ee53-4f7c-a46e-47bed1cebadf","2026-09-30T16:00:00.000Z",{"_type":10,"current":19},"anyone-can-start-building-verified-knowledge-with-stack-internal","Anyone can start building verified knowledge with Stack Internal",{"_id":22,"publishedAt":23,"slug":24,"title":26},"12c6a8a7-135f-401f-ac1a-1c26c33e69c0","2026-09-03T16:00:00.000Z",{"_type":10,"current":25},"security-control-and-accessibility-si-2026-6","Elevating security, control, and accessibility: Stack Internal 2026.6",{"_id":28,"publishedAt":29,"slug":30,"title":32},"adcf1bca-3295-4ac5-9b3c-23f337974190","2026-07-30T15:10:00.000Z",{"_type":10,"current":31},"introducing-stack-internal-new-platform-experience","Your trusted knowledge layer: Introducing Stack Internal's new platform experience",{"_id":34,"publishedAt":35,"slug":36,"title":38},"eb5b66eb-9410-4329-83bb-22bbff39402a","2026-04-28T13:00:00.000Z",{"_type":10,"current":37},"turn-scattered-knowledge-into-trusted-intelligence","Turning scattered knowledge into trusted intelligence: Stack Internal 2026.3",{"_createdAt":40,"_id":41,"_rev":42,"_type":43,"_updatedAt":44,"author":45,"body":64,"comments":2716,"dateUrl":2717,"product":12,"publishedAt":2718,"seo":2719,"slug":2722,"sponsored":12,"tags":2724,"title":2797,"visible":2716},"2026-10-09T14:57:28Z","870dcae3-41b2-4900-aa96-bf1a15691828","fu9sqPZhMcjGlu53lMszq5","blogPost","2026-10-09T16:11:49Z",[46],{"_createdAt":47,"_id":48,"_rev":49,"_type":50,"_updatedAt":51,"account_id":52,"avatar":53,"bio":59,"employee":60,"name":61,"slug":62},"2026-10-09T15:00:53Z","c3672485-66a2-4010-93b4-bedcb84f00e6","fu9sqPZhMcjGlu53lLpzOT","blogAuthor","2026-10-09T15:02:01Z",305637,{"_type":54,"alt":55,"asset":56},"image","A middle-aged man with short gray hair looks at the camera outdoors.",{"_ref":57,"_type":58},"image-2975868f285cda38f4c63155c3a613783cf8a593-256x256-png","reference","Although these days I am a vikingship builder, I have enjoyed coding like an excellent beer. My particular passion and experience lies in the realm of modeling and model oriented programming languages. In the late 80s and early 90s, I was involved in early modeling and code generation tools that reached the marketplace, including a tool that modeled FORTRAN programs and generated FORTRAN for parallel supercomputer architectures, and a tool that managed Shlaer-Mellor models and generated C++ code. Over the years, I have applied Shlaer-Mellor, UML, and custom modeling and various code generation techniques to greatly benefit the development of enterprise applications.\n\nIn 2013 I developed the Mo+ model oriented programming language and IDE and used it successfully in developing and maintaining enterprise systemd. The open source is at github.com\u002Fmoplus\u002Fmodelorientedplus.\n\nI would love to help inspire research and development of model oriented programming languages in any way I can.","none","Dave Clemmer",{"_type":10,"current":63},"dave-clemmer",[65,76,84,92,100,109,117,146,155,179,189,197,205,213,218,226,234,239,247,255,263,271,279,287,292,300,308,316,324,332,340,348,352,360,368,376,381,389,397,402,410,418,422,430,437,445,453,461,473,485,497,505,513,521,529,537,545,553,561,569,573,581,589,597,605,613,621,629,634,642,647,655,663,671,679,687,695,703,708,716,721,728,736,744,751,759,767,775,783,787,795,803,807,814,822,830,838,846,854,862,870,878,886,894,902,910,918,926,931,938,946,954,962,969,977,985,993,1001,1009,1016,1024,1032,1040,1048,1064,1079,1094,1109,1117,1125,1133,1138,1149,1157,1165,1177,1185,1193,1201,1204,1211,1218,1226,1234,1241,1265,1273,1280,1295,1303,1319,1322,1329,1337,1340,1372,1380,1383,1399,1407,1410,1417,1425,1428,1436,1439,1447,1450,1458,1478,1486,1501,1509,1517,1520,1527,1551,1559,1591,1594,1601,1622,1630,1638,1641,1655,1658,1665,1673,1676,1691,1699,1715,1718,1734,1742,1747,1755,1767,1774,1782,1790,1798,1806,1814,1822,1851,1859,1862,1870,1873,1881,1889,1897,1905,1910,1918,1921,1929,1932,1940,1948,1960,1968,1976,1984,1992,2008,2023,2038,2046,2054,2069,2077,2085,2099,2107,2122,2134,2142,2150,2158,2166,2174,2182,2189,2197,2205,2213,2216,2224,2232,2240,2247,2255,2263,2271,2283,2295,2307,2319,2326,2334,2342,2353,2364,2375,2383,2391,2398,2406,2414,2422,2425,2433,2441,2449,2461,2473,2485,2493,2501,2509,2517,2520,2528,2531,2539,2547,2555,2563,2571,2579,2587,2595,2603,2618,2626,2634,2642,2650,2657,2665,2673,2681,2689,2697],{"_key":66,"_type":67,"children":68,"markDefs":74,"style":75},"af31bca630d6","block",[69],{"_key":70,"_type":71,"marks":72,"text":73},"91160d520155","span",[],"Thirteen years ago I developed to my knowledge the first and currently the only fully featured model oriented programming language and IDE. I utilized this technology (Mo+) to great effect on my own and workplace enterprise projects, but failed to sell the ideas to a wider audience. Six years ago I left my software engineering career in favor of wielding an ax and building Viking and Anglo Saxon ships in Norway, UK and other future places in Scandinavia. Even so, I still think about model oriented programming from time to time and its potential.",[],"normal",{"_key":77,"_type":67,"children":78,"markDefs":83,"style":75},"6478602b4ea4",[79],{"_key":80,"_type":71,"marks":81,"text":82},"f978b9856b77",[],"The purpose of this article is not about the technology I developed, but to inspire research, development, and use of model oriented languages. Amongst other things, I would love to make a contribution to any research going on at a university or business. Please let me know if you are aware of any research and development of model oriented programming languages going on out there!",[],{"_key":85,"_type":67,"children":86,"markDefs":91,"style":75},"b23dd568d75c",[87],{"_key":88,"_type":71,"marks":89,"text":90},"b612d3441a0b",[],"I firmly believe that the family of model oriented programming languages has great future potential, even and maybe even especially in the current world of AI. I hope this article will inspire a deeper look into such potential.",[],{"_key":93,"_type":67,"children":94,"markDefs":99,"style":75},"5c20f0d0f76d",[95],{"_key":96,"_type":71,"marks":97,"text":98},"bf370b592662",[],"Below, I will outline some principles and features I think are key to make the most of model oriented programming languages. Unless otherwise noted, these principles and features are not pure theory, but were actually utilized in enterprise systems over several years. There are many concepts to go over here. If the earlier sections get a little dry and tedious, at least skip down to the language features section.",[],{"_key":101,"_type":67,"children":102,"markDefs":107,"style":108},"163d568052ed",[103],{"_key":104,"_type":71,"marks":105,"text":106},"b148f9331bd9",[],"What is a Model?",[],"h2",{"_key":110,"_type":67,"children":111,"markDefs":116,"style":75},"2cdac606412c",[112],{"_key":113,"_type":71,"marks":114,"text":115},"2757b50e0c82",[],"There are of course many kinds of models and many ways to describe a model. At its core, the purpose of a model is to concisely represent something else that is larger or more complex. For model oriented programming, we will need an electronic definition of a model, and the following definition can be used:",[],{"_key":118,"_type":67,"children":119,"markDefs":145,"style":75},"128a8f82980b",[120,125,129,133,137,141],{"_key":121,"_type":71,"marks":122,"text":124},"c72181f0b294",[123],"strong","Model",{"_key":126,"_type":71,"marks":127,"text":128},"3788f2f491c2",[]," – A model can be described in terms of ",{"_key":130,"_type":71,"marks":131,"text":132},"a5caaf35bb5d",[123],"structure",{"_key":134,"_type":71,"marks":135,"text":136},"5105de0397e6",[]," and ",{"_key":138,"_type":71,"marks":139,"text":140},"fd0e5890ea2d",[123],"data",{"_key":142,"_type":71,"marks":143,"text":144},"14ea1cc32de9",[],". The structure defines the rules or “schema” of a model and is always hierarchical. A particular model is populated with data that conforms to the model structure.",[],{"_key":147,"_type":67,"children":148,"markDefs":153,"style":154},"1fd8a91110df",[149],{"_key":150,"_type":71,"marks":151,"text":152},"ec673a7e3931",[],"Model Structure and Data",[],"h3",{"_key":156,"_type":67,"children":157,"markDefs":178,"style":75},"6bb519ba02df",[158,162,167,170,174],{"_key":159,"_type":71,"marks":160,"text":161},"52e2d91da4d9",[],"A model structure can simply be defined in terms of ",{"_key":163,"_type":71,"marks":164,"text":166},"c0a86d3bee0a",[123,165],"em","nodes",{"_key":168,"_type":71,"marks":169,"text":136},"f044f709804d",[],{"_key":171,"_type":71,"marks":172,"text":173},"7f4b5ab1e8e7",[123,165],"attributes",{"_key":175,"_type":71,"marks":176,"text":177},"32bb9dee517b",[],":",[],{"_key":180,"_type":67,"children":181,"level":186,"listItem":187,"markDefs":188,"style":75},"16c1e4349de6",[182],{"_key":183,"_type":71,"marks":184,"text":185},"73b632feca26",[],"A model structure has a single root node.",1,"bullet",[],{"_key":190,"_type":67,"children":191,"level":186,"listItem":187,"markDefs":196,"style":75},"b20204a203e8",[192],{"_key":193,"_type":71,"marks":194,"text":195},"93932edb91a7",[],"The root node can have any number of child nodes. Any node in turn can have any number of child nodes to form a hierarchy of any given depth.",[],{"_key":198,"_type":67,"children":199,"level":186,"listItem":187,"markDefs":204,"style":75},"60314577850a",[200],{"_key":201,"_type":71,"marks":202,"text":203},"681e45cf6bc6",[],"Nodes are identified with at least a name. In addition, nodes can be further described with any number of attributes.",[],{"_key":206,"_type":67,"children":207,"markDefs":212,"style":75},"dfa2c7d531f0",[208],{"_key":209,"_type":71,"marks":210,"text":211},"9956af693850",[],"You may not believe me yet that model structures can always be hierarchical with a single root node. Let’s use the following diagram of a portion of the Northwind database as an example:",[],{"_key":214,"_type":54,"alt":215,"asset":216,"markDefs":12},"2ae37367035f","Database schema diagram showing relationships between Customers, Orders, Products, and Order Details tables.",{"_ref":217,"_type":58},"image-42a7fd96b8fd6a62afee09a5aed105dd5a563cfc-731x511-jpg",{"_key":219,"_type":67,"children":220,"markDefs":225,"style":75},"6edd94feacf5",[221],{"_key":222,"_type":71,"marks":223,"text":224},"19b8324fe8e3",[],"You may say “this is not hierarchical!!”. But, what are we looking at here? In our context, it is not model structure, but model data! You can say that the Northwind database schema is an example of populating a standard relational database structure with data. Rows of data in database tables is run time data, and not what I am talking about here. The schema is an example of model data.",[],{"_key":227,"_type":67,"children":228,"markDefs":233,"style":75},"4692af937d73",[229],{"_key":230,"_type":71,"marks":231,"text":232},"7530b5bd7a58",[],"You can see the hierarchical structure in a relational database IDE as the schema can be displayed in a tree view:",[],{"_key":235,"_type":54,"alt":236,"asset":237,"markDefs":12},"ac59aba3b905","A database tree view showing the Northwind database, with the dbo.Customers table expanded to list its columns and keys.",{"_ref":238,"_type":58},"image-80f9a58630d6c0fb98d91110411177fd2a5a762c-387x481-jpg",{"_key":240,"_type":67,"children":241,"markDefs":246,"style":75},"6fd7bbf727dc",[242],{"_key":243,"_type":71,"marks":244,"text":245},"e79196f8ed1e",[],"So the model structure of a relational database includes nodes such as database, table, column, and key that fall neatly into a hierarchy. You may say “wait, the hierarchy is broken, as foreign keys refer to tables!”. This is handled very simply as follows:",[],{"_key":248,"_type":67,"children":249,"level":186,"listItem":187,"markDefs":254,"style":75},"d96d6ff2597f",[250],{"_key":251,"_type":71,"marks":252,"text":253},"de0a424202fa",[],"An attribute of a model structure node can refer to another node in the model structure.",[],{"_key":256,"_type":67,"children":257,"markDefs":262,"style":75},"d98f248b25c4",[258],{"_key":259,"_type":71,"marks":260,"text":261},"51d72b0dc702",[],"With the above rule, we can have very complex model structures that fall neatly into a hierarchy. I would add that in a good model structure definition, nodes are defined at the highest level where they can stand on their own.",[],{"_key":264,"_type":67,"children":265,"markDefs":270,"style":75},"bea07da8cfbe",[266],{"_key":267,"_type":71,"marks":268,"text":269},"12201bca70ec",[],"",[],{"_key":272,"_type":67,"children":273,"markDefs":278,"style":154},"f14180ac1dc9",[274],{"_key":275,"_type":71,"marks":276,"text":277},"d4c79c032254",[],"Example Scenario and Model",[],{"_key":280,"_type":67,"children":281,"markDefs":286,"style":75},"8bbc6f533b52",[282],{"_key":283,"_type":71,"marks":284,"text":285},"5ab8d60ce29b",[],"For the remainder of this article we will use a very simplified restaurant scenario with which we will model in various ways and explain how we could program to the scenario with model oriented programming languages.",[],{"_key":288,"_type":54,"alt":289,"asset":290,"markDefs":12},"c84892aa56b4","A hand-drawn data model diagram for a restaurant system, showing entities: Restaurant, Staff, Food, and Customer, with their attributes and relationships.",{"_ref":291,"_type":58},"image-ffbe657046f29211eecbbfa73a9a2610b3d8bc3e-800x600-jpg",{"_key":293,"_type":67,"children":294,"markDefs":299,"style":75},"5c0fa5fd7cc0",[295],{"_key":296,"_type":71,"marks":297,"text":298},"3d8f6a5ec639",[],"The simplified restaurant scenario is described as such:",[],{"_key":301,"_type":67,"children":302,"level":186,"listItem":187,"markDefs":307,"style":75},"92bdb3512c95",[303],{"_key":304,"_type":71,"marks":305,"text":306},"374bb2f4729b",[],"We want to manage a number of restaurants and need to track their name and location.",[],{"_key":309,"_type":67,"children":310,"level":186,"listItem":187,"markDefs":315,"style":75},"15683f6a187c",[311],{"_key":312,"_type":71,"marks":313,"text":314},"c3c89e42d01e",[],"A restaurant has any number of customers and we want to track customers by name and when they visit (we are ignoring repeat customers in this simple scenario).",[],{"_key":317,"_type":67,"children":318,"level":186,"listItem":187,"markDefs":323,"style":75},"0ec854381454",[319],{"_key":320,"_type":71,"marks":321,"text":322},"625289771c8f",[],"A restaurant has any number of staff, and we want to track staff names and their role.",[],{"_key":325,"_type":67,"children":326,"level":186,"listItem":187,"markDefs":331,"style":75},"75b2bee6a012",[327],{"_key":328,"_type":71,"marks":329,"text":330},"4ac1bb106117",[],"Customer eat food and we want to track what menu items they order.",[],{"_key":333,"_type":67,"children":334,"level":186,"listItem":187,"markDefs":339,"style":75},"f1a6015b11d2",[335],{"_key":336,"_type":71,"marks":337,"text":338},"26e9e4507d56",[],"Staff serve customers and food and we want to track which customers and menu items they serve.",[],{"_key":341,"_type":67,"children":342,"markDefs":347,"style":75},"aaa4d1de53ab",[343],{"_key":344,"_type":71,"marks":345,"text":346},"52c7cb931af2",[],"Following is an entity relationship model (in pseudo Shlaer-Mellor format) illustrating this scenario:",[],{"_key":349,"_type":54,"asset":350,"markDefs":12},"cf7ed324e3a2",{"_ref":351,"_type":58},"image-08c1db5ff9d61f645c5a2e1fb9d411c42df2bf46-511x321-jpg",{"_key":353,"_type":67,"children":354,"markDefs":359,"style":75},"b18971c8fd68",[355],{"_key":356,"_type":71,"marks":357,"text":358},"426487caa2b2",[],"Again, in our scenario this model represents data, not structure. So now let’s get into some model structures!",[],{"_key":361,"_type":67,"children":362,"markDefs":367,"style":154},"9b55a524a90f",[363],{"_key":364,"_type":71,"marks":365,"text":366},"c38a6c36a3a7",[],"Example Model Structures",[],{"_key":369,"_type":67,"children":370,"markDefs":375,"style":75},"f9b579989954",[371],{"_key":372,"_type":71,"marks":373,"text":374},"cabb9a0e7126",[],"Consider the following entity relationship diagram that can represent a structure to support the model data above:",[],{"_key":377,"_type":54,"alt":378,"asset":379,"markDefs":12},"ad8dce7b919f","Class diagram showing Model, Entity, Property, and Relationship classes with their connections.",{"_ref":380,"_type":58},"image-92f16255db68c9d2429b758d4cece51c22f8c96c-584x501-jpg",{"_key":382,"_type":67,"children":383,"markDefs":388,"style":75},"972858f6a3c4",[384],{"_key":385,"_type":71,"marks":386,"text":387},"9389193b363f",[],"The structure has a root node of Model and child nodes of Entity and Relationship, etc. The solid lines represent the model structure hierarchy, while dashed lines alternate associations (note for these that I need to add some reference properties to “formalize” these associations). In populating this structure, instances of Entity include Restaurant, Customer, Staff, etc. and instances of Restaurant Entity properties include Id, Name, and Location, etc.",[],{"_key":390,"_type":67,"children":391,"markDefs":396,"style":75},"64c72cba75bd",[392],{"_key":393,"_type":71,"marks":394,"text":395},"8cdbc5b448c0",[],"Is this the only or best structure to represent our data? Certainly not, there are many possibilities. Consider the following alternate entity-relationship model structure:",[],{"_key":398,"_type":54,"alt":399,"asset":400,"markDefs":12},"222e210fc27e","UML class diagram illustrating a data modeling framework with Model, Entity, Property, and Relationship classes, showing their associations.",{"_ref":401,"_type":58},"image-f3cafc405cbe1b83e5ed58b8d0fbff6ee72bdd2c-741x282-jpg",{"_key":403,"_type":67,"children":404,"markDefs":409,"style":75},"5c54a7b88860",[405],{"_key":406,"_type":71,"marks":407,"text":408},"759b0f9c5f4d",[],"This structure puts Entity, Relationship, and Property on the same level. This might make sense if relationships and properties can exist in their own right independent of entities.",[],{"_key":411,"_type":67,"children":412,"markDefs":417,"style":75},"a1a315667c58",[413],{"_key":414,"_type":71,"marks":415,"text":416},"0e3ad302c58c",[],"Finally consider this alternative entity relationship model structure:",[],{"_key":419,"_type":54,"asset":420,"markDefs":12},"33558639e7c8",{"_ref":421,"_type":58},"image-dbcd5146fbaf8a8ab821fb5aa8ebab962b57dfae-566x411-jpg",{"_key":423,"_type":67,"children":424,"markDefs":429,"style":75},"98c9218fbb99",[425],{"_key":426,"_type":71,"marks":427,"text":428},"76b47f3dfbcc",[],"In this structure, relationships and properties need an entity to exist and the relationships are children of their source entity. The reason I bring up alternative structures is this has some effect on a model oriented programming language, where hierarchies are slightly more convenient to traverse. This will be explained in more detail later.",[],{"_key":431,"_type":67,"children":432,"markDefs":436,"style":75},"cbbb4052f528",[433],{"_key":434,"_type":71,"marks":435,"text":269},"e60d868f6f42",[],[],{"_key":438,"_type":67,"children":439,"markDefs":444,"style":154},"39f680462e20",[440],{"_key":441,"_type":71,"marks":442,"text":443},"1cefaab9d487",[],"A Model In Summary",[],{"_key":446,"_type":67,"children":447,"markDefs":452,"style":75},"b01f3ba89937",[448],{"_key":449,"_type":71,"marks":450,"text":451},"4dcdcdf12e28",[],"I strongly feel that the definition of a model in terms of structure and data is an extremely important foundational principle that opens up a family of model oriented programming languages. I will explain more as we dig deeper below.",[],{"_key":454,"_type":67,"children":455,"markDefs":460,"style":75},"97a20caa81eb",[456],{"_key":457,"_type":71,"marks":458,"text":459},"c21c0dd60720",[],"Before we continue, here are a few more definitions:",[],{"_key":462,"_type":67,"children":463,"markDefs":472,"style":75},"c74a08c93796",[464,468],{"_key":465,"_type":71,"marks":466,"text":467},"21a5c8e8d4d5",[123],"Modeling",{"_key":469,"_type":71,"marks":470,"text":471},"20a72b635042",[]," – Modeling can simply be defined as the process of populating a model structure with data.",[],{"_key":474,"_type":67,"children":475,"markDefs":484,"style":75},"5186686866d6",[476,480],{"_key":477,"_type":71,"marks":478,"text":479},"08d085444467",[123],"Model Oriented Programming (MOP)",{"_key":481,"_type":71,"marks":482,"text":483},"92c5209300a4",[]," – MOP can simply be defined as the process of utilizing a model to create and maintain a system (for the purpose of this article a software system).",[],{"_key":486,"_type":67,"children":487,"markDefs":496,"style":75},"8c6338ec7f2b",[488,492],{"_key":489,"_type":71,"marks":490,"text":491},"5ef22c5707cc",[123],"Model Oriented Development (MOD)",{"_key":493,"_type":71,"marks":494,"text":495},"a3a4bdc88ab9",[]," – MOD can simply be defined as the process of creating and utilizing a model to create and maintain a system. In other words, MOD includes Modeling and MOP.",[],{"_key":498,"_type":67,"children":499,"markDefs":504,"style":75},"d4fb886a3098",[500],{"_key":501,"_type":71,"marks":502,"text":503},"584ed7e8ec32",[],"I will use MOP and MOD acronyms in the remainder of the article for convenience.",[],{"_key":506,"_type":67,"children":507,"markDefs":512,"style":108},"7b9625cd62da",[508],{"_key":509,"_type":71,"marks":510,"text":511},"b0b5280920e8",[],"Forms of Model Oriented Development (MOD)",[],{"_key":514,"_type":67,"children":515,"markDefs":520,"style":75},"9b9757e0d0ea",[516],{"_key":517,"_type":71,"marks":518,"text":519},"caebdd40fb78",[],"To my knowledge, there are no standard names for the different forms of MOD, but I feel it is useful to describe them and their implications for MOP.",[],{"_key":522,"_type":67,"children":523,"markDefs":528,"style":154},"2745149d5e17",[524],{"_key":525,"_type":71,"marks":526,"text":527},"e8d158825a49",[],"Informal MOD",[],{"_key":530,"_type":67,"children":531,"markDefs":536,"style":75},"29cef5c5c068",[532],{"_key":533,"_type":71,"marks":534,"text":535},"42939a64e588",[],"Informal MOD involves utilizing any form of non-standard model. The model could be ideas in your head, chicken scratchings on a piece of paper or whiteboard, or utilizing a drawing tool. There are no rules that constrain how you create and utilize an informal model.",[],{"_key":538,"_type":67,"children":539,"markDefs":544,"style":75},"f70d529950c1",[540],{"_key":541,"_type":71,"marks":542,"text":543},"b1c467a30439",[],"Informal MOD for our purposes can be roughly defined as:",[],{"_key":546,"_type":67,"children":547,"level":186,"listItem":187,"markDefs":552,"style":75},"e264e4e62321",[548],{"_key":549,"_type":71,"marks":550,"text":551},"937284a48cac",[],"Having an ad hoc model definition outside of your source code. The models might just be ideas in your head, written descriptions, drawings, or diagrams of your own design or standard.",[],{"_key":554,"_type":67,"children":555,"level":186,"listItem":187,"markDefs":560,"style":75},"0c72f39a170f",[556],{"_key":557,"_type":71,"marks":558,"text":559},"0f390e5132ec",[],"There are no software tools that can utilize your model towards managing source code.",[],{"_key":562,"_type":67,"children":563,"markDefs":568,"style":75},"0545e17cee26",[564],{"_key":565,"_type":71,"marks":566,"text":567},"54a449e07e9f",[],"Following is a little whiteboard drawing (repeated from above) that models the basic ideas for our restaurant scenario. We will go over a potential model structure for this later on:",[],{"_key":570,"_type":54,"alt":571,"asset":572,"markDefs":12},"3732c5b51810","A hand-drawn diagram illustrating a restaurant system with interconnected entities: Restaurant, Staff, Customer, and Food.",{"_ref":291,"_type":58},{"_key":574,"_type":67,"children":575,"markDefs":580,"style":154},"644de6bc2ecf",[576],{"_key":577,"_type":71,"marks":578,"text":579},"9781d2b65ebe",[],"Inline MOD",[],{"_key":582,"_type":67,"children":583,"markDefs":588,"style":75},"3e82ae8f1649",[584],{"_key":585,"_type":71,"marks":586,"text":587},"fa1366cfe083",[],"The inline form of MOD is very popular these days with the advent and use of many frameworks that greatly enable you to effectively design and develop your applications.",[],{"_key":590,"_type":67,"children":591,"markDefs":596,"style":75},"a8bae551fed0",[592],{"_key":593,"_type":71,"marks":594,"text":595},"6643e0a7ed15",[],"Inline MOD can be roughly defined as:",[],{"_key":598,"_type":67,"children":599,"level":186,"listItem":187,"markDefs":604,"style":75},"895bec5e923f",[600],{"_key":601,"_type":71,"marks":602,"text":603},"147045e44950",[],"Having a formal model defined in your source code. That model is usually relevant to a particular layer in your application.",[],{"_key":606,"_type":67,"children":607,"level":186,"listItem":187,"markDefs":612,"style":75},"0e38f29f1ca0",[608],{"_key":609,"_type":71,"marks":610,"text":611},"35f53c511e21",[],"Having a framework that typically has supporting infrastructure to allow you to manage and utilize your model, create some code for you, and\u002For provide infrastructure software to help manage part of your system.",[],{"_key":614,"_type":67,"children":615,"markDefs":620,"style":75},"3e54d8fa52e1",[616],{"_key":617,"_type":71,"marks":618,"text":619},"42a01447255a",[],"Some of many examples of Inline MOD include ORMs such as Entity Framework or NHibernate and UI frameworks such as Angular and React.",[],{"_key":622,"_type":67,"children":623,"markDefs":628,"style":75},"f82ce9cb4820",[624],{"_key":625,"_type":71,"marks":626,"text":627},"f3bd30489785",[],"Models for inline MOD are often defined in code. Below is an example Entity Framework (code first) model definition for our restaurant scenario:",[],{"_key":630,"_type":631,"code":632,"language":633,"markDefs":12},"ea8846d44681","code","public class Restaurant\n{\n\tpublic int Id { get; set; } \n\tpublic string Name { get; set; }\n\tpublic string Location { get; set; }\n\n\tpublic ICollection\u003CCustomer> Customers { get; set; }\n\tpublic ICollection\u003CStaff> Staff { get; set; }\n}\npublic class Staff\n{\n\tpublic int Id { get; set; } \n\tpublic string Name { get; set; }\n\tpublic string Role { get; set; }\n\n\tpublic ICollection\u003CCustomer> CustomersServed { get; set; }\n\tpublic ICollection\u003CFood> FoodServed { get; set; }\n}\npublic class Customer\n{\n\tpublic int Id { get; set; } \n\tpublic string Name { get; set; }\n\tpublic DateTime VisitedDate { get; set; }\n\n\tpublic ICollection\u003CFood> FoodEaten { get; set; }\n}\npublic class Food\n{\n\tpublic int Id { get; set; } \n\tpublic string MenuItemName { get; set; }\n\tpublic string Ingredients { get; set; }\n}\n","csharp",{"_key":635,"_type":67,"children":636,"markDefs":641,"style":75},"da62467af281",[637],{"_key":638,"_type":71,"marks":639,"text":640},"3d52e2749b8b",[],"Any of the entity-relationship model structures presented above could be utilized to manage the above data, or a specific structure with nodes such as Table, Column, etc. could also be utilized such as the following simplified structure:",[],{"_key":643,"_type":54,"alt":644,"asset":645,"markDefs":12},"3f86476fb8ad","A class diagram illustrating the hierarchy of database components: Database contains Tables, Tables contain Columns, and Tables relate to Keys.",{"_ref":646,"_type":58},"image-8ec0d87d05b3b202f73562ca4a94d83afb9c5878-546x381-jpg",{"_key":648,"_type":67,"children":649,"markDefs":654,"style":154},"6846d68b9004",[650],{"_key":651,"_type":71,"marks":652,"text":653},"77f50cd556f1",[],"Coupled MOD",[],{"_key":656,"_type":67,"children":657,"markDefs":662,"style":75},"5dc870238ddb",[658],{"_key":659,"_type":71,"marks":660,"text":661},"90d8aa0b405d",[],"The standard UML modeling language and tools that support UML modeling and source code management with those models is the most common example of the coupled form of MOD.",[],{"_key":664,"_type":67,"children":665,"markDefs":670,"style":75},"2a1a5ac0e7f0",[666],{"_key":667,"_type":71,"marks":668,"text":669},"4c98f6678461",[],"Coupled MOD can be roughly defined as:",[],{"_key":672,"_type":67,"children":673,"level":186,"listItem":187,"markDefs":678,"style":75},"09294215fe78",[674],{"_key":675,"_type":71,"marks":676,"text":677},"f095e57d33f0",[],"Having a formal model defined outside of your source code.",[],{"_key":680,"_type":67,"children":681,"level":186,"listItem":187,"markDefs":686,"style":75},"f2af71ece37c",[682],{"_key":683,"_type":71,"marks":684,"text":685},"6cf864741d84",[],"There is a strong correlation (often one-to-one) between model elements and your source code. Thus, the model incorporates elements of software design.",[],{"_key":688,"_type":67,"children":689,"level":186,"listItem":187,"markDefs":694,"style":75},"31eaf9a32b9d",[690],{"_key":691,"_type":71,"marks":692,"text":693},"d53e812504a0",[],"There are software tools that can manage your model and utilize that model for managing source code.",[],{"_key":696,"_type":67,"children":697,"markDefs":702,"style":75},"552ac3794c49",[698],{"_key":699,"_type":71,"marks":700,"text":701},"9f511d0b6553",[],"Many of the UML diagrams are intended to clarify the design of a system. Below is a class model diagram that outlines our restaurant scenario:",[],{"_key":704,"_type":54,"alt":705,"asset":706,"markDefs":12},"0c489960f3f7","UML class diagram illustrating the relationships between Restaurant, Staff, Customer, and Food entities, with attributes and cardinalities.",{"_ref":707,"_type":58},"image-4160e4c529b51148f701189d26ed422748cb2dbd-521x319-jpg",{"_key":709,"_type":67,"children":710,"markDefs":715,"style":75},"405f7790ac22",[711],{"_key":712,"_type":71,"marks":713,"text":714},"2822b448e8e8",[],"We could utilize a generic entity-relationship model structure to support class model data, but for this form of MOD, we might prefer a more design centric structure such as the following to represent a class model:",[],{"_key":717,"_type":54,"alt":718,"asset":719,"markDefs":12},"59b496d4cf4a","A class diagram of a meta-model showing ClassModel containing Classes and Associations, Class containing Attributes, and Associations linking Classes through R1 and R2.",{"_ref":720,"_type":58},"image-06676cd7b11d15982e70b56cc7469a44a87ff93c-584x501-jpg",{"_key":722,"_type":67,"children":723,"markDefs":727,"style":75},"4143e38aaea5",[724],{"_key":725,"_type":71,"marks":726,"text":269},"c3b7babcd3df",[],[],{"_key":729,"_type":67,"children":730,"markDefs":735,"style":154},"5b4fc9ca1ed3",[731],{"_key":732,"_type":71,"marks":733,"text":734},"b84e24489b01",[],"Decoupled MOD",[],{"_key":737,"_type":67,"children":738,"markDefs":743,"style":75},"0c220e81bea0",[739],{"_key":740,"_type":71,"marks":741,"text":742},"fea84d33ccdb",[],"With the heavier use of UML for specifying design, I think the decoupled form of MOD has had less attention in the industry in general. Decoupled MOD can be roughly defined as:",[],{"_key":745,"_type":67,"children":746,"level":186,"listItem":187,"markDefs":750,"style":75},"341f72a62f59",[747],{"_key":748,"_type":71,"marks":749,"text":677},"55f204103e7b",[],[],{"_key":752,"_type":67,"children":753,"level":186,"listItem":187,"markDefs":758,"style":75},"cd5fa34d1451",[754],{"_key":755,"_type":71,"marks":756,"text":757},"684316813b2d",[],"There is a weak correlation between model elements and your source code. Your source code is decoupled from the model. The abstract models tend to have very little if any design information. The detailed design is also decoupled from the model.",[],{"_key":760,"_type":67,"children":761,"level":186,"listItem":187,"markDefs":766,"style":75},"0d3a910c1f1a",[762],{"_key":763,"_type":71,"marks":764,"text":765},"337a9c371efb",[],"There are software tools that can utilize your model for managing source code.",[],{"_key":768,"_type":67,"children":769,"markDefs":774,"style":75},"3ec55400ecc7",[770],{"_key":771,"_type":71,"marks":772,"text":773},"1f84ce1f0da9",[],"The key in recognizing this form is that the purpose of the models is to clarify ideas and requirements. Instead of modeling down to the design or component level, modeling is generally limited to requirements, primarily as data and workflow. I prefer to use the early Shlaer-Mellor method for modeling data and workflow.",[],{"_key":776,"_type":67,"children":777,"markDefs":782,"style":75},"f083031cb633",[778],{"_key":779,"_type":71,"marks":780,"text":781},"553067dda3d9",[],"Following is an information model for our restaurant scenario, repeated from above:",[],{"_key":784,"_type":54,"alt":785,"asset":786,"markDefs":12},"512434499b7b","An Entity-Relationship Diagram (ERD) illustrating a restaurant system's data model with entities for Restaurant, Staff, Customer, and Food, and their relationships.",{"_ref":351,"_type":58},{"_key":788,"_type":67,"children":789,"markDefs":794,"style":75},"be85c1a28df3",[790],{"_key":791,"_type":71,"marks":792,"text":793},"b3838be83930",[],"In decoupled MOD, elements in the model such as Restaurant don’t refer to a specific component, but outline requirements for any number of related components such as tables, classes, web services, UI components, etc.",[],{"_key":796,"_type":67,"children":797,"markDefs":802,"style":75},"b84cfbb38f1c",[798],{"_key":799,"_type":71,"marks":800,"text":801},"acc97d049a01",[],"A generic entity-relationship model structure works well with decoupled MOD. As we get into coding examples below, I will utilize the following structure repeated from above:",[],{"_key":804,"_type":54,"alt":805,"asset":806,"markDefs":12},"a62754589985","UML class diagram showing Model, Entity, Property, and Relationship classes and their associations within a data modeling structure.",{"_ref":421,"_type":58},{"_key":808,"_type":67,"children":809,"markDefs":813,"style":75},"164d32ea0bd0",[810],{"_key":811,"_type":71,"marks":812,"text":269},"154e3bbd776c",[],[],{"_key":815,"_type":67,"children":816,"markDefs":821,"style":108},"a7dd94e79e4f",[817],{"_key":818,"_type":71,"marks":819,"text":820},"4780614fde41",[],"Potential for MOP Languages by MOD Form",[],{"_key":823,"_type":67,"children":824,"markDefs":829,"style":75},"c32184bd3f65",[825],{"_key":826,"_type":71,"marks":827,"text":828},"88075b7ba2eb",[],"Can a MOP language be developed to support any of the above forms of MOD? Yes! Can a single MOP language be developed to support all of the above forms of MOD? Call me crazy, but yes! That said, I think the potential for a MOP language is least to greatest in the order below.",[],{"_key":831,"_type":67,"children":832,"markDefs":837,"style":154},"b2da40023a40",[833],{"_key":834,"_type":71,"marks":835,"text":836},"7ade284fad42",[],"Potential for Informal MOD",[],{"_key":839,"_type":67,"children":840,"markDefs":845,"style":75},"3c6603930b66",[841],{"_key":842,"_type":71,"marks":843,"text":844},"c39fb9fbb99a",[],"There is potential for a MOP language to support informal MOD. The main issue is to be able to represent an informal model in an electronic form so that a language interpreter can understand the structure and data. A MOP language could indeed understand and utilize a completely nonstandard structure! I will explain how this can be done below. The benefit for supporting informal models is relatively low and probably relevant to a particular workplace or team.",[],{"_key":847,"_type":67,"children":848,"markDefs":853,"style":154},"00ae1695d859",[849],{"_key":850,"_type":71,"marks":851,"text":852},"eb250d54cc72",[],"Potential for Inline MOD",[],{"_key":855,"_type":67,"children":856,"markDefs":861,"style":75},"9b734c77801f",[857],{"_key":858,"_type":71,"marks":859,"text":860},"339c4c27a321",[],"Speaking in terms of frameworks such as ORMs and UI frameworks, such frameworks utilize a standard model structure to do their work. So certainly a MOP language could be developed to utilize those models to further develop such frameworks and their use. The scope of the language might be limited to the scope of the framework. In addition, organizations that develop frameworks might want the MOP language only for internal development purposes.",[],{"_key":863,"_type":67,"children":864,"markDefs":869,"style":75},"33a328d9e2fa",[865],{"_key":866,"_type":71,"marks":867,"text":868},"f91e7ec79b3e",[],"As a side note, I implemented this to some degree years ago for the Entity Framework and VITA ORMs, which you can see in some of my Code Project articles.",[],{"_key":871,"_type":67,"children":872,"markDefs":877,"style":154},"ecfeac3144a7",[873],{"_key":874,"_type":71,"marks":875,"text":876},"b89741211a98",[],"Potential for Coupled MOD",[],{"_key":879,"_type":67,"children":880,"markDefs":885,"style":75},"7eb931942223",[881],{"_key":882,"_type":71,"marks":883,"text":884},"8e94c0a9974b",[],"With standard industry wide model structures such as UML and lots of tools to manage and utilize coupled MOD models, there is great potential here for MOP languages to be utilized at large with this form of MOD. Such languages could be utilized to create and maintain systems directly from UML models. Existing tools that translate models to code and vice versa could also be super sized with a MOP language.",[],{"_key":887,"_type":67,"children":888,"markDefs":893,"style":154},"7ba416850cd7",[889],{"_key":890,"_type":71,"marks":891,"text":892},"886693a11af3",[],"Potential for Decoupled MOD",[],{"_key":895,"_type":67,"children":896,"markDefs":901,"style":75},"446e4e1ba2f6",[897],{"_key":898,"_type":71,"marks":899,"text":900},"321c9af8b435",[],"I believe the potential for MOP languages to support decoupled MOD is even greater than coupled MOD. In addition to many industry wide benefits, putting design more in the realm of code and requirements in the realm of models makes both the modeling process and coding process more streamlined. At least that has been my personal experience.",[],{"_key":903,"_type":67,"children":904,"markDefs":909,"style":108},"442a9f0925f3",[905],{"_key":906,"_type":71,"marks":907,"text":908},"401c6d7bc9e3",[],"Where to Apply Model Oriented Programming (MOP)",[],{"_key":911,"_type":67,"children":912,"markDefs":917,"style":75},"d126c98e09aa",[913],{"_key":914,"_type":71,"marks":915,"text":916},"ee7e82a9327e",[],"Before we talk about potential MOP language features, it is useful to describe different places where model oriented programming can be applied, as each of these places has different implications on MOP language needs and capabilities.",[],{"_key":919,"_type":67,"children":920,"markDefs":925,"style":75},"e7340cf5d2ee",[921],{"_key":922,"_type":71,"marks":923,"text":924},"1d2ccc9fe8d2",[],"Consider the following diagram which illustrates the realms of modeling and system programming, and different places where MOP could be applied:",[],{"_key":927,"_type":54,"alt":928,"asset":929,"markDefs":12},"78e86cdadeed","A diagram showing 'Model' in a 'Modeling' stage, influenced by 'Modeling MOP's, connected by a 'Transitional MOP' to a 'System' in a 'System Programing' stage, which also receives a 'Target MOP'.",{"_ref":930,"_type":58},"image-6f06054a013ca61a4cee52d050124a8a1802315c-807x341-jpg",{"_key":932,"_type":67,"children":933,"markDefs":937,"style":75},"7e3aa742117e",[934],{"_key":935,"_type":71,"marks":936,"text":269},"528013f5abdc",[],[],{"_key":939,"_type":67,"children":940,"markDefs":945,"style":154},"9922977d1bc3",[941],{"_key":942,"_type":71,"marks":943,"text":944},"043361a9853b",[],"Transitional MOP",[],{"_key":947,"_type":67,"children":948,"markDefs":953,"style":75},"cedb6f0682bb",[949],{"_key":950,"_type":71,"marks":951,"text":952},"6b68ed8c3f81",[],"The purpose of transitional MOP is to interpret and utilize model structure and data towards creating and maintaining a target system environment. The target system environment could include source code in any language, documents, configuration files, etc. It is assumed that the target environment would be further enhanced with additional programming, etc. directly in the target environment.",[],{"_key":955,"_type":67,"children":956,"markDefs":961,"style":75},"e2ab435720e9",[957],{"_key":958,"_type":71,"marks":959,"text":960},"c11e2b199289",[],"In this case, the MOP language wouldn’t need to be the language used in the target environment, but would support languages and other document standards used in the target environment. The discussion below of MOP language features will begin with this case.",[],{"_key":963,"_type":67,"children":964,"markDefs":968,"style":75},"b7608e7fea2b",[965],{"_key":966,"_type":71,"marks":967,"text":269},"00d9b5dc5614",[],[],{"_key":970,"_type":67,"children":971,"markDefs":976,"style":154},"78cb1e56471b",[972],{"_key":973,"_type":71,"marks":974,"text":975},"aed0fd6fdede",[],"Modeling MOP",[],{"_key":978,"_type":67,"children":979,"markDefs":984,"style":75},"2fa186386abe",[980],{"_key":981,"_type":71,"marks":982,"text":983},"4b40f636b2f9",[],"The purpose of modeling MOP is to help create and maintain the structure and data of a model. Information to create and maintain the model could come from the system itself such as source code, or come from other external sources such as models, databases, documents, etc.",[],{"_key":986,"_type":67,"children":987,"markDefs":992,"style":75},"a092e06d7918",[988],{"_key":989,"_type":71,"marks":990,"text":991},"8fa615fabb6e",[],"A MOP language to support modeling will likely need to have some features not utilized in the other cases.",[],{"_key":994,"_type":67,"children":995,"markDefs":1000,"style":154},"b36d30fc8950",[996],{"_key":997,"_type":71,"marks":998,"text":999},"452ddb723d59",[],"Target MOP",[],{"_key":1002,"_type":67,"children":1003,"markDefs":1008,"style":75},"924a412e5a2d",[1004],{"_key":1005,"_type":71,"marks":1006,"text":1007},"289e3f1be0d6",[],"The purpose of target MOP is to directly create and maintain a target system environment. In this case, the MOP language would be directly used in the target environment, and would likely need to be more “feature rich” than in the other cases.",[],{"_key":1010,"_type":67,"children":1011,"markDefs":1015,"style":75},"886a0e192334",[1012],{"_key":1013,"_type":71,"marks":1014,"text":269},"f632f490bd63",[],[],{"_key":1017,"_type":67,"children":1018,"markDefs":1023,"style":108},"d36f6a8f89cc",[1019],{"_key":1020,"_type":71,"marks":1021,"text":1022},"d22f9fd8127e",[],"MOP Language Features for Transitional MOP",[],{"_key":1025,"_type":67,"children":1026,"markDefs":1031,"style":75},"638c3d4e3309",[1027],{"_key":1028,"_type":71,"marks":1029,"text":1030},"ee25d60bb09f",[],"Comparing with Object Oriented Languages",[],{"_key":1033,"_type":67,"children":1034,"markDefs":1039,"style":75},"6e768de59117",[1035],{"_key":1036,"_type":71,"marks":1037,"text":1038},"110424b390a2",[],"That was a lot to talk about above to set the stage in talking about MOP languages, I hope you are still with me! Now we can talk about various potential features of MOP languages. I will compare at a high level some differences with object oriented languages to illustrate additional potential benefits of MOP languages.",[],{"_key":1041,"_type":67,"children":1042,"markDefs":1047,"style":75},"bd4376b68c2f",[1043],{"_key":1044,"_type":71,"marks":1045,"text":1046},"faba181d178f",[],"We will now start going over some simple coding examples. We will use the following colors for syntax highlighting:",[],{"_key":1049,"_type":67,"children":1050,"level":186,"listItem":187,"markDefs":1063,"style":75},"ecd31b7b9fd8",[1051,1055,1059],{"_key":1052,"_type":71,"marks":1053,"text":1054},"040a7bcfb0b5",[],"Core language grammar such as statements will be written in ",{"_key":1056,"_type":71,"marks":1057,"text":1058},"2892f3329232",[123],"blue",{"_key":1060,"_type":71,"marks":1061,"text":1062},"7c6ca27e7dd3",[],".",[],{"_key":1065,"_type":67,"children":1066,"level":186,"listItem":187,"markDefs":1078,"style":75},"c31d887abcfe",[1067,1071,1075],{"_key":1068,"_type":71,"marks":1069,"text":1070},"44aaaf7d2b4b",[],"Model structure grammar will be written in ",{"_key":1072,"_type":71,"marks":1073,"text":1074},"48f01315f57e",[123],"teal",{"_key":1076,"_type":71,"marks":1077,"text":1062},"058ba8d22c78",[],[],{"_key":1080,"_type":67,"children":1081,"level":186,"listItem":187,"markDefs":1093,"style":75},"df17959de337",[1082,1086,1090],{"_key":1083,"_type":71,"marks":1084,"text":1085},"c98bb517949d",[],"Model oriented property references will be written in ",{"_key":1087,"_type":71,"marks":1088,"text":1089},"c52a2773a954",[123],"brown",{"_key":1091,"_type":71,"marks":1092,"text":1062},"18d10e9b83d9",[],[],{"_key":1095,"_type":67,"children":1096,"level":186,"listItem":187,"markDefs":1108,"style":75},"5dc343d827be",[1097,1101,1105],{"_key":1098,"_type":71,"marks":1099,"text":1100},"e83b8a9228dd",[],"Output will be written in ",{"_key":1102,"_type":71,"marks":1103,"text":1104},"ca88c971ad17",[123],"green",{"_key":1106,"_type":71,"marks":1107,"text":1062},"cb85aa9322d2",[],[],{"_key":1110,"_type":67,"children":1111,"markDefs":1116,"style":75},"fc438bf9f3f5",[1112],{"_key":1113,"_type":71,"marks":1114,"text":1115},"8cb8573e0c88",[],"Incidentally, the language grammar presented below may or may not be similar to the language I implemented, Mo+. The grammar presented here is done for clarity.",[],{"_key":1118,"_type":67,"children":1119,"markDefs":1124,"style":154},"8ce93aa13c21",[1120],{"_key":1121,"_type":71,"marks":1122,"text":1123},"69a710747296",[],"Programming Session",[],{"_key":1126,"_type":67,"children":1127,"markDefs":1132,"style":75},"0a07ec1bf9be",[1128],{"_key":1129,"_type":71,"marks":1130,"text":1131},"619cc2a152ea",[],"For fully featured MOP languages, I think it is useful, perhaps critical, to have the notion of a programming session. To start a session, a MOP language interpreter would need to interpret and load a model structure, then load that structure with the available model data, to create a snapshot of the model as it were:",[],{"_key":1134,"_type":54,"alt":1135,"asset":1136,"markDefs":12},"fa85b036dd85","A flowchart illustrating the transition from a Model to a Model Snapshot, then to a System, across Modeling, Programming Session, and System Programming stages, guided by various MOPs.",{"_ref":1137,"_type":58},"image-f448b7982faccf8029157ad7a305b608ef9c6210-819x361-jpg",{"_key":1139,"_type":67,"children":1140,"markDefs":1148,"style":75},"a64032719c29",[1141,1144],{"_key":1142,"_type":71,"marks":1143,"text":1123},"379f5572c545",[123],{"_key":1145,"_type":71,"marks":1146,"text":1147},"cf092e6ffc70",[]," – A period of time where a model structure is known and the model data is sealed (read only). Working within the realm of a session (however long or short) opens up the possibility of several MOP language features.",[],{"_key":1150,"_type":67,"children":1151,"markDefs":1156,"style":154},"03795658222a",[1152],{"_key":1153,"_type":71,"marks":1154,"text":1155},"bbb368908fb0",[],"Utilizing Model Structure as Language Grammar",[],{"_key":1158,"_type":67,"children":1159,"markDefs":1164,"style":75},"aecbdda980f3",[1160],{"_key":1161,"_type":71,"marks":1162,"text":1163},"3065c9a05eed",[],"Knowing that a model structure is hierarchical and known at run time, and to make maximum use of such structure, it is very useful to add that structure as part of the language grammar! So, using our entity relationship example model, with the structure as part of the grammar, you can just “do stuff” with entities, relationships, properties, etc. For an object oriented language, you would have to create structures or classes for entity, relationship, property, etc. and instantiate them to have a model structure to work with. This will become clearer below when we will utilize this grammar.",[],{"_key":1166,"_type":67,"children":1167,"markDefs":1176,"style":75},"501678e840bb",[1168,1172],{"_key":1169,"_type":71,"marks":1170,"text":1171},"8305ed58e774",[123],"Model Structure as Grammar",{"_key":1173,"_type":71,"marks":1174,"text":1175},"7d759089801d",[]," – It is very useful to include the nodes and attributes of a hierarchical model structure into the language grammar. Adding model structure to the model grammar makes coding to the model much simpler without having to create and instantiate special classes or structures.",[],{"_key":1178,"_type":67,"children":1179,"markDefs":1184,"style":154},"2868d41aab8f",[1180],{"_key":1181,"_type":71,"marks":1182,"text":1183},"69bf486c531e",[],"Utilizing Model Data as Model Context",[],{"_key":1186,"_type":67,"children":1187,"markDefs":1192,"style":75},"9c21b4ee20d7",[1188],{"_key":1189,"_type":71,"marks":1190,"text":1191},"870e864b56f2",[],"Knowing that the model data is read only at run time and conforming to a hierarchical structure, you can imagine that it is very easy to traverse the tree of model data to get access to anything you want. It is very useful to add the notion of model context to the language grammar. Unlike object context in an object oriented language, there is no need to create specific variables or instances to hold the context. You merely need a reference to a node in the tree of model data.",[],{"_key":1194,"_type":67,"children":1195,"markDefs":1200,"style":75},"e18b962a0b81",[1196],{"_key":1197,"_type":71,"marks":1198,"text":1199},"ad16876408d6",[],"Using our decoupled MOD entity-relationship structure, this is a tree view of our restaurant scenario model data:",[],{"_key":1202,"_type":631,"code":1203,"markDefs":12},"2425fb78429c","Model: Name=My Model\n    Entity: Name=Restaurant\n        Property list: {Id, Name, Location}\n        Relationship list: {Hires(Staff), Has(Customer)}\n    Entity: Name=Staff\n        Property list: {Id, Name, Role}\n        Relationship list: {Serves(Customer), Serves to Customers(Food)}\n    Entity: Name=Customer\n        Property list: {Id, Name, VisitedDate}\n        Relationship list: {Eats(Food)}\n    Entity: Name=Food\n        Property list: {Id, MenuItemName, Ingredients}\n",{"_key":1205,"_type":67,"children":1206,"markDefs":1210,"style":75},"cb096a93bc9f",[1207],{"_key":1208,"_type":71,"marks":1209,"text":269},"6a1c6d7c9f52",[],[],{"_key":1212,"_type":67,"children":1213,"markDefs":1217,"style":75},"30f9a974ce7d",[1214],{"_key":1215,"_type":71,"marks":1216,"text":269},"3d7e16108220",[],[],{"_key":1219,"_type":67,"children":1220,"markDefs":1225,"style":75},"e26da758f1a6",[1221],{"_key":1222,"_type":71,"marks":1223,"text":1224},"8301a72ba2ca",[],"Let’s say for example that the model context is referring to the Location property under the Restaurant entity. Consider the following statement:",[],{"_key":1227,"_type":67,"children":1228,"markDefs":1233,"style":75},"adec9b47b335",[1229],{"_key":1230,"_type":71,"marks":1231,"text":1232},"cf7e4b8fc5f8",[631],"print(Entity.Name, “.”, Name)",[],{"_key":1235,"_type":67,"children":1236,"markDefs":1240,"style":75},"4ab89c12e365",[1237],{"_key":1238,"_type":71,"marks":1239,"text":269},"c3633f6664a1",[],[],{"_key":1242,"_type":67,"children":1243,"markDefs":1264,"style":75},"69184022e3a8",[1244,1248,1252,1256,1260],{"_key":1245,"_type":71,"marks":1246,"text":1247},"86583ce9c315",[],"The output of this statement would be ",{"_key":1249,"_type":71,"marks":1250,"text":1251},"8e2795c3be51",[631],"Restaurant.Location",{"_key":1253,"_type":71,"marks":1254,"text":1255},"686413c8b45f",[],". How does this work? Since the model structure is part of the grammar, and model context is on the Location property, Name yields Location. Because of the structure\u002Fdata hierarchy, it is easy to get data anywhere up the tree, thus ",{"_key":1257,"_type":71,"marks":1258,"text":1259},"12c7cd451cf1",[631],"Entity.Name",{"_key":1261,"_type":71,"marks":1262,"text":1263},"926715e396fb",[]," yields Restaurant. Going a little further:",[],{"_key":1266,"_type":67,"children":1267,"markDefs":1272,"style":75},"1c918955ae60",[1268],{"_key":1269,"_type":71,"marks":1270,"text":1271},"043888fcb67b",[631],"print(Model.Name, “: “, Entity.Name, “.”, Name)",[],{"_key":1274,"_type":67,"children":1275,"markDefs":1279,"style":75},"ebf37efb239c",[1276],{"_key":1277,"_type":71,"marks":1278,"text":269},"bfadabb6eb04",[],[],{"_key":1281,"_type":67,"children":1282,"markDefs":1294,"style":75},"5fb40067d067",[1283,1287,1290],{"_key":1284,"_type":71,"marks":1285,"text":1286},"4e0133e4969f",[],"Yields My Model: ",{"_key":1288,"_type":71,"marks":1289,"text":1251},"624df4936a8b",[631],{"_key":1291,"_type":71,"marks":1292,"text":1293},"d5c9f38de24b",[],". Now how about accessing child data and doing more complex things?",[],{"_key":1296,"_type":67,"children":1297,"markDefs":1302,"style":75},"de2f5721dd9b",[1298],{"_key":1299,"_type":71,"marks":1300,"text":1301},"dc1530ec1b70",[],"In addition, it is useful to implement model context as a stack to enable access to the entire model tree in many different ways.",[],{"_key":1304,"_type":67,"children":1305,"markDefs":1318,"style":75},"d7156ec41e63",[1306,1310,1314],{"_key":1307,"_type":71,"marks":1308,"text":1309},"505c00a0f4bb",[],"Now let’s say for example that the model context is referring to the ",{"_key":1311,"_type":71,"marks":1312,"text":1313},"cb9c3e99e4e3",[631],"Restaurant ",{"_key":1315,"_type":71,"marks":1316,"text":1317},"f7660d4c338c",[],"entity. Consider the following statements:",[],{"_key":1320,"_type":631,"code":1321,"language":633,"markDefs":12},"f24e5bdfbe3b","foreach (Property)\n{\n\tprint(Entity.Name, “.”, Name)\n}\nforeach (Relationship)\n{\n\tprint(Entity.Name, “.”, Name, “:”, DestinationEntity.Name)\n}\n",{"_key":1323,"_type":67,"children":1324,"markDefs":1328,"style":75},"b9a635d4af9f",[1325],{"_key":1326,"_type":71,"marks":1327,"text":269},"8f3c83bb7d82",[],[],{"_key":1330,"_type":67,"children":1331,"markDefs":1336,"style":75},"e371ec03f54e",[1332],{"_key":1333,"_type":71,"marks":1334,"text":1335},"8dd19e1e074c",[],"This yields the following output:",[],{"_key":1338,"_type":631,"code":1339,"markDefs":12},"0e4efdbc2c5e","Restaurant.Id\n\nRestaurant.Name\n\nRestaurant.Location\n\nRestaurant.Hires:Staff\n\nRestaurant.Has:Customer",{"_key":1341,"_type":67,"children":1342,"markDefs":1371,"style":75},"b4d7c6ef8753",[1343,1347,1351,1355,1359,1363,1367],{"_key":1344,"_type":71,"marks":1345,"text":1346},"caa793c17b9a",[],"Now what is happening here? Since the model structure is part of the grammar, it is also possible to access children. The ",{"_key":1348,"_type":71,"marks":1349,"text":1350},"db8e6dffd38f",[631],"foreach",{"_key":1352,"_type":71,"marks":1353,"text":1354},"0561d10fb7fa",[]," statement allows you to iterate through the children of the indicated type. Notice that there are no variables in the foreach statement. Instead, an item in the collection is pushed onto the model context stack at the beginning of the iteration and popped off at the end of the iteration statements. For example, within ",{"_key":1356,"_type":71,"marks":1357,"text":1358},"7d6f34c61209",[631],"foreach (Property)",{"_key":1360,"_type":71,"marks":1361,"text":1362},"0380cd26a6db",[],", the current model context at the bottom of the stack is the current ",{"_key":1364,"_type":71,"marks":1365,"text":1366},"736f86fe0c94",[631],"Property ",{"_key":1368,"_type":71,"marks":1369,"text":1370},"ffcabbf6d8fe",[],"in the collection. As before, you have easy access to data up the tree.",[],{"_key":1373,"_type":67,"children":1374,"markDefs":1379,"style":75},"532d588342c6",[1375],{"_key":1376,"_type":71,"marks":1377,"text":1378},"bc5451a83790",[],"What else can you do with a model context stack? The following statements will yield the same results:",[],{"_key":1381,"_type":631,"code":1382,"language":633,"markDefs":12},"48f46ae48c61","foreach (Property)\n{\n\tprint(..\u002FName, “.”, Name)\n}\nforeach (Relationship)\n{\n\tprint(..\u002FName, “.”, Name, “:”, DestinationEntity.Name)\n}\n",{"_key":1384,"_type":67,"children":1385,"markDefs":1398,"style":75},"1c89e88fc175",[1386,1390,1394],{"_key":1387,"_type":71,"marks":1388,"text":1389},"0b7608ff877c",[],"It’s possible and at times very useful to access model context elements up the stack with the ",{"_key":1391,"_type":71,"marks":1392,"text":1393},"cf23d17802b8",[631],"..\u002F, ..\u002F ..\u002F",{"_key":1395,"_type":71,"marks":1396,"text":1397},"d4874d721f5e",[]," notation, etc. In this case, we use this notation to get the Restaurant entity model context.",[],{"_key":1400,"_type":67,"children":1401,"markDefs":1406,"style":75},"48a2f2b7d55e",[1402],{"_key":1403,"_type":71,"marks":1404,"text":1405},"585c157af8f7",[],"It’s also possible to easily access children of children at any level in the model hierarchy:",[],{"_key":1408,"_type":631,"code":1409,"language":633,"markDefs":12},"c0e2e1387201","foreach (Property in Model orderby Entity.Name, Property.Name)\n{\n\tprint(Entity.Name, “.”, Name)\n}\n",{"_key":1411,"_type":67,"children":1412,"markDefs":1416,"style":75},"f08440335617",[1413],{"_key":1414,"_type":71,"marks":1415,"text":269},"1319977e4f54",[],[],{"_key":1418,"_type":67,"children":1419,"markDefs":1424,"style":75},"f0493c2796f0",[1420],{"_key":1421,"_type":71,"marks":1422,"text":1423},"9f8df4746d2e",[],"This retrieves a sorted list of all of the properties in the entire model, and yields the following output:",[],{"_key":1426,"_type":631,"code":1427,"markDefs":12},"80fe8160259f","Customer.Id\n\nCustomer.Name\n\nCustomer.VisitedDate\n\nFood.Id\n\nFood.Ingredients\n\nFood.MenuItemName\n\nStaff.Id\n\nStaff.Name\n\nStaff.Role",{"_key":1429,"_type":67,"children":1430,"markDefs":1435,"style":75},"494c8d11d11c",[1431],{"_key":1432,"_type":71,"marks":1433,"text":1434},"243c1a83fe86",[],"We will do one more model context example with search. Consider the following statements:",[],{"_key":1437,"_type":631,"code":1438,"language":633,"markDefs":12},"7df881c92d18","with (Entity in Model where Name=”Food”)\n{\n\tforeach (Relationship in Model where DestinationEntity.Name=”Customer”)\n\t{\n\t\tprint(Entity.Name, “.”, Name, “:”, ..\u002FName)\n\t}\n}\n",{"_key":1440,"_type":67,"children":1441,"markDefs":1446,"style":75},"9646cb93a68d",[1442],{"_key":1443,"_type":71,"marks":1444,"text":1445},"1ee34e0b1dae",[],"This nested search yields the following output:",[],{"_key":1448,"_type":631,"code":1449,"markDefs":12},"ba2deca3e311","Restaurant.Has:Food\nServer.Serves:Food",{"_key":1451,"_type":67,"children":1452,"markDefs":1457,"style":75},"7c13028682e6",[1453],{"_key":1454,"_type":71,"marks":1455,"text":1456},"af0dcc4c146e",[],"This last example is a little non-sensical and I’m sure there are more elegant ways to do more complex things with a model context stack, but I hope these examples give you an idea of the great variety of things you can do with model context.",[],{"_key":1459,"_type":67,"children":1460,"markDefs":1477,"style":75},"e0c55d5d08e6",[1461,1465,1469,1473],{"_key":1462,"_type":71,"marks":1463,"text":1464},"990d58b107c3",[123],"Model Context –",{"_key":1466,"_type":71,"marks":1467,"text":1468},"c66a3bd4c472",[]," It is very useful to include the notion of model context into the language grammar. ",{"_key":1470,"_type":71,"marks":1471,"text":1472},"ab401022ede5",[165],"Model Context",{"_key":1474,"_type":71,"marks":1475,"text":1476},"6e8ff4000bdb",[]," provides a means to access model data from a particular point in the tree. Especially if implemented as a stack to better support browsing and searching of the model data, it becomes much simpler to access overall model data without having to instantiate special context variables.",[],{"_key":1479,"_type":67,"children":1480,"markDefs":1485,"style":108},"2b85c4261810",[1481],{"_key":1482,"_type":71,"marks":1483,"text":1484},"501319cdc1ed",[],"Model Oriented Properties",[],{"_key":1487,"_type":67,"children":1488,"markDefs":1500,"style":75},"e1109cf04eeb",[1489,1493,1496],{"_key":1490,"_type":71,"marks":1491,"text":1492},"1fe0a07b2b7b",[],"This is where I think it gets really interesting with MOP languages. With the model structure as grammar, I mentioned that you can just “do stuff” with entities, relationships, properties, etc. And with ",{"_key":1494,"_type":71,"marks":1495,"text":1472},"917ba8f4dd89",[165],{"_key":1497,"_type":71,"marks":1498,"text":1499},"97f2785a3b13",[]," you have ready access to the tree of model data. It all comes together with model oriented properties!",[],{"_key":1502,"_type":67,"children":1503,"markDefs":1508,"style":75},"d290d4931e51",[1504],{"_key":1505,"_type":71,"marks":1506,"text":1507},"aa7d907b03cf",[],"Unlike object oriented properties or members that are part of a class definition, model oriented properties with the model structure as grammar become much more independent bits of code.",[],{"_key":1510,"_type":67,"children":1511,"markDefs":1516,"style":75},"da7d9c184e3c",[1512],{"_key":1513,"_type":71,"marks":1514,"text":1515},"fc8bb951220f",[],"To begin with, each model oriented property is associated with a particular node in the model structure. Consider the following property:",[],{"_key":1518,"_type":631,"code":1519,"language":633,"markDefs":12},"f4236263e92e","Entity property PublicClassDeclaration\nget\n{\n\tprint( “public class “, Name)\n}\n",{"_key":1521,"_type":67,"children":1522,"markDefs":1526,"style":75},"51f13fde005b",[1523],{"_key":1524,"_type":71,"marks":1525,"text":269},"90c4a6cd3990",[],[],{"_key":1528,"_type":67,"children":1529,"markDefs":1550,"style":75},"2f1df3464c79",[1530,1534,1538,1542,1546],{"_key":1531,"_type":71,"marks":1532,"text":1533},"d22750d7962e",[],"This model oriented property only works if given an instance of ",{"_key":1535,"_type":71,"marks":1536,"text":1537},"55e198ab617f",[631],"Entity",{"_key":1539,"_type":71,"marks":1540,"text":1541},"ba64722c94b4",[],". If given the ",{"_key":1543,"_type":71,"marks":1544,"text":1545},"140ef2da5810",[631],"Staff ",{"_key":1547,"_type":71,"marks":1548,"text":1549},"531741adb4b8",[],"instance, the output is:",[],{"_key":1552,"_type":67,"children":1553,"markDefs":1558,"style":75},"bf0b18d9e343",[1554],{"_key":1555,"_type":71,"marks":1556,"text":1557},"a1f940ff1e14",[631],"     public class Staff",[],{"_key":1560,"_type":67,"children":1561,"markDefs":1590,"style":75},"6d9f66209663",[1562,1566,1570,1574,1578,1582,1586],{"_key":1563,"_type":71,"marks":1564,"text":1565},"f74f0930d77e",[],"For this article I will use ",{"_key":1567,"_type":71,"marks":1568,"text":1569},"f5684fdc2f65",[631],"print ",{"_key":1571,"_type":71,"marks":1572,"text":1573},"09c071054e00",[],"and ",{"_key":1575,"_type":71,"marks":1576,"text":1577},"9abd501e7f8b",[631],"println ",{"_key":1579,"_type":71,"marks":1580,"text":1581},"59fac3c6d565",[],"to build up content within a property get method that will subsequently be returned. Now let’s define a similar ",{"_key":1583,"_type":71,"marks":1584,"text":1585},"ab21723338c0",[631],"Property",{"_key":1587,"_type":71,"marks":1588,"text":1589},"f8bbf95a3b3d",[]," level model oriented property:",[],{"_key":1592,"_type":631,"code":1593,"language":633,"markDefs":12},"d8432e6e2e9e","Property property PublicPropertyDeclaration\nget\n{\n\tprint( “public “, Datatype, “ “, Name, “ {get; set;}”)\n}\n",{"_key":1595,"_type":67,"children":1596,"markDefs":1600,"style":75},"b1d5d6412186",[1597],{"_key":1598,"_type":71,"marks":1599,"text":269},"a6320e522ff4",[],[],{"_key":1602,"_type":67,"children":1603,"markDefs":1621,"style":75},"b3dd7a85f36a",[1604,1607,1610,1613,1617],{"_key":1605,"_type":71,"marks":1606,"text":1533},"b002a9aa915e",[],{"_key":1608,"_type":71,"marks":1609,"text":1585},"191b9116777b",[631],{"_key":1611,"_type":71,"marks":1612,"text":1541},"b8880b0f907c",[],{"_key":1614,"_type":71,"marks":1615,"text":1616},"ff1b82cf3fbc",[631],"Staff.Role",{"_key":1618,"_type":71,"marks":1619,"text":1620},"7e8000af2a6a",[]," instance, the output is:",[],{"_key":1623,"_type":67,"children":1624,"markDefs":1629,"style":75},"9fed478e8146",[1625],{"_key":1626,"_type":71,"marks":1627,"text":1628},"43c05b58a63d",[631],"     public string Role {get; set;}",[],{"_key":1631,"_type":67,"children":1632,"markDefs":1637,"style":75},"3abd247e120a",[1633],{"_key":1634,"_type":71,"marks":1635,"text":1636},"f8aed83a7914",[],"Model oriented properties can utilize other model oriented properties. Consider the following:",[],{"_key":1639,"_type":631,"code":1640,"language":633,"markDefs":12},"8c292c093f75","Entity property PublicClassCode\nget\n{\n\tprintln( PublicClassDeclaration)\n\tprintln(“{”)\n    foreach (Property)\n\t{\n\t\tprintln(“\\t”, PublicPropertyDeclaration)\n\t}\n\tprintln(“}”)\n}\n",{"_key":1642,"_type":67,"children":1643,"markDefs":1654,"style":75},"347e5e2c9c6b",[1644,1648,1651],{"_key":1645,"_type":71,"marks":1646,"text":1647},"e2f51cb75b23",[],"If given the ",{"_key":1649,"_type":71,"marks":1650,"text":1545},"365bdf6baad5",[631],{"_key":1652,"_type":71,"marks":1653,"text":1549},"30c18b40ea97",[],[],{"_key":1656,"_type":631,"code":1657,"language":633,"markDefs":12},"12a485a380cb","public class Staff\n{\n\tpublic int Id {get; set}\n\tpublic string Name {get; set}\n\tpublic string Role {get; set}\n}\n",{"_key":1659,"_type":67,"children":1660,"markDefs":1664,"style":75},"a679489e724a",[1661],{"_key":1662,"_type":71,"marks":1663,"text":269},"7e9e608920f9",[],[],{"_key":1666,"_type":67,"children":1667,"markDefs":1672,"style":75},"dd3570f73bc4",[1668],{"_key":1669,"_type":71,"marks":1670,"text":1671},"ed64b54c4064",[],"Finally, since model oriented properties are independent bits of code, they can be used in many different ways such as part of expressions:",[],{"_key":1674,"_type":631,"code":1675,"language":633,"markDefs":12},"6ee153dc449e","foreach (Entity in Model where PublicClassCode.Contains(“Role”) == true)\n{\n\tprint(Name)\n}\n",{"_key":1677,"_type":67,"children":1678,"markDefs":1690,"style":75},"df90261c2122",[1679,1683,1686],{"_key":1680,"_type":71,"marks":1681,"text":1682},"cd63bdcda549",[],"This silly example finds all entities that contain “Role” in the class code, which finds the ",{"_key":1684,"_type":71,"marks":1685,"text":1545},"562ccab6a24b",[631],{"_key":1687,"_type":71,"marks":1688,"text":1689},"3d6de5a79ca5",[],"entity:",[],{"_key":1692,"_type":67,"children":1693,"markDefs":1698,"style":75},"345e649724ec",[1694],{"_key":1695,"_type":71,"marks":1696,"text":1697},"73d9522f0630",[631],"Staff",[],{"_key":1700,"_type":67,"children":1701,"markDefs":1714,"style":75},"fc2f78890135",[1702,1706,1710],{"_key":1703,"_type":71,"marks":1704,"text":1705},"0c453ec977fe",[],"What other methods can model oriented properties have? For transitional MOP where the model is sealed in a session, it doesn’t make sense to have a set method to update the model. But a put method makes sense to add and update information in the target system. Here, a put method is added to the ",{"_key":1707,"_type":71,"marks":1708,"text":1709},"e20a159cd72a",[631],"PublicClassCode ",{"_key":1711,"_type":71,"marks":1712,"text":1713},"2cf2ac622ca2",[],"method:",[],{"_key":1716,"_type":631,"code":1717,"language":633,"markDefs":12},"929ddefd5a80","Entity property PublicClassCode\nget\n{\n\tprintln( PublicClassDeclaration)\n\tprintln(“{”)\n    foreach (Property)\n\t{\n\t\tprintln(“\\t”, PublicPropertyDeclaration)\n\t}\n\tprintln(“}”)\n}\nput\n{\n\tsave(content,  PublicClassFilePath)\n}\n",{"_key":1719,"_type":67,"children":1720,"markDefs":1733,"style":75},"f252898010e8",[1721,1725,1729],{"_key":1722,"_type":71,"marks":1723,"text":1724},"83d98beda757",[],"The put method saves the class code to a file location specified by the ",{"_key":1726,"_type":71,"marks":1727,"text":1728},"60dd958935c0",[631],"PublicClassFilePath",{"_key":1730,"_type":71,"marks":1731,"text":1732},"8fca90c5cfbb",[]," property. The content keyword is a shorthand for getting the results from the get method.",[],{"_key":1735,"_type":67,"children":1736,"markDefs":1741,"style":75},"fe0c073a2b10",[1737],{"_key":1738,"_type":71,"marks":1739,"text":1740},"b898a66618cb",[],"To create or maintain a system, essentially a “bag” of model oriented properties can be chosen that meets the technical requirements for that system. A program run is initiated with a top (model) level property that in turn initiates high level component (project) properties which in turn initiate lower level properties, etc.",[],{"_key":1743,"_type":54,"alt":1744,"asset":1745,"markDefs":12},"2baaa2f5d529","Diagram showing a transitional MOP system update flow, from top-level to high-level to lower-level model-oriented properties.",{"_ref":1746,"_type":58},"image-55ac56b67b3428a71118520217b4eaa6552376c0-747x491-jpg",{"_key":1748,"_type":67,"children":1749,"markDefs":1754,"style":75},"3f3085ebbd11",[1750],{"_key":1751,"_type":71,"marks":1752,"text":1753},"0ef021542467",[],"With the ability to define and use model oriented properties without instantiating classes or containers, the ability to utilize model oriented properties as building blocks for much more complex properties, and the ability to freely utilize model oriented properties in expressions, I hope you get the picture on how versatile these properties can be.",[],{"_key":1756,"_type":67,"children":1757,"markDefs":1766,"style":75},"6e900a91c7df",[1758,1762],{"_key":1759,"_type":71,"marks":1760,"text":1761},"ff13e6ddf34c",[123],"Model Oriented Property –",{"_key":1763,"_type":71,"marks":1764,"text":1765},"12e32c6ec386",[]," A model oriented property is an independent bit of code associated with a node in the model structure (such as Entity). At run time, a model oriented property can be evaluated when given an instance of the same node (such as Entity) as the Model Context. A model oriented property can be evaluated many different times with different instances of the same node, and can be utilized in many more ways than object oriented properties.",[],{"_key":1768,"_type":67,"children":1769,"markDefs":1773,"style":75},"53941b1c59fa",[1770],{"_key":1771,"_type":71,"marks":1772,"text":269},"2e6750c07a7c",[],[],{"_key":1775,"_type":67,"children":1776,"markDefs":1781,"style":154},"d23adac6800e",[1777],{"_key":1778,"_type":71,"marks":1779,"text":1780},"4efc639695af",[],"Dynamic Grammar",[],{"_key":1783,"_type":67,"children":1784,"markDefs":1789,"style":75},"4f2b643a2884",[1785],{"_key":1786,"_type":71,"marks":1787,"text":1788},"1768c0ee4e52",[],"A dynamic grammar for a programming language is a grammar that can change or be augmented at runtime. Do any other programming languages out there have a dynamic grammar?",[],{"_key":1791,"_type":67,"children":1792,"markDefs":1797,"style":75},"9703c32297ac",[1793],{"_key":1794,"_type":71,"marks":1795,"text":1796},"06d007d2105a",[],"If a model structure is hierarchical and is part of the language grammar, it is possible and actually useful for a MOP language to have a dynamic grammar. It is actually very straightforward for a MOP language interpreter to implement a grammar builder that reads in a model structure and add that structure to the grammar at the beginning of a session. It’s just a matter of adding nodes and attributes to the model hierarchy grammar. I will cover some examples of extending a model hierarchy in the Modeling MOP section below.",[],{"_key":1799,"_type":67,"children":1800,"markDefs":1805,"style":75},"3bc4169d3e84",[1801],{"_key":1802,"_type":71,"marks":1803,"text":1804},"471fad93bf14",[],"Now why would a dynamic grammar be useful? I will give a couple of examples.",[],{"_key":1807,"_type":67,"children":1808,"markDefs":1813,"style":75},"bdc7cbe6859e",[1809],{"_key":1810,"_type":71,"marks":1811,"text":1812},"d371de7c464b",[123],"Insufficient Model",[],{"_key":1815,"_type":67,"children":1816,"markDefs":1821,"style":75},"d940742900d2",[1817],{"_key":1818,"_type":71,"marks":1819,"text":1820},"b0fa816cfafb",[],"Even with a standardized model, I often find that the standard model sometimes lacks some information that I need to have to effectively program against it. There is a cheap way to add data to nodes in the form of tags that is described in more detail below, but sometimes this is not sufficient, and we may need to add more attributes to nodes or even new nodes to the model structure.",[],{"_key":1823,"_type":67,"children":1824,"markDefs":1850,"style":75},"3761d10c16c2",[1825,1829,1833,1837,1840,1844,1847],{"_key":1826,"_type":71,"marks":1827,"text":1828},"e4373ef8e990",[],"In our case we decided we need to add the ",{"_key":1830,"_type":71,"marks":1831,"text":1832},"a0a1a34aedba",[165],"MaxLength",{"_key":1834,"_type":71,"marks":1835,"text":1836},"d00206693212",[]," attribute to the ",{"_key":1838,"_type":71,"marks":1839,"text":1585},"cf3abf10385a",[165],{"_key":1841,"_type":71,"marks":1842,"text":1843},"26787465f833",[]," node in our model structure. When the grammar builder recognizes and adds this attribute to the grammar, it can be used just like any other attribute of ",{"_key":1845,"_type":71,"marks":1846,"text":1585},"48e31ec97c88",[165],{"_key":1848,"_type":71,"marks":1849,"text":1062},"8c045cf325e2",[],[],{"_key":1852,"_type":67,"children":1853,"markDefs":1858,"style":75},"55f3c3f17925",[1854],{"_key":1855,"_type":71,"marks":1856,"text":1857},"d5a1ff27cc71",[],"Here is a new property and updated class code property to make use of MaxLength:",[],{"_key":1860,"_type":631,"code":1861,"language":633,"markDefs":12},"79e047ad39df","Property property StringLengthAttribute\nget\n{\n\tif ( MaxLength > 0)\n\t{\n\t\tprint(“ [StringLength(“, MaxLength, “)]”)\n\t}\n}\nEntity property PublicClassCode\nget\n{\n\tprintln( PublicClassDeclaration)\n\tprintln(“{”)\n    foreach (Property)\n\t{\n\t\tif ( StringLengthAttribute != “”)\n\t\t{\n\t\t\tprintln(“\\t”, StringLengthAttribute)\n\t\t}\n\t\tprintln(“\\t”, PublicPropertyDeclaration)\n\t}\n\tprintln(“}”)\n}\nput\n{\n\tsave(content,  PublicClassFilePath)\n}\n",{"_key":1863,"_type":67,"children":1864,"markDefs":1869,"style":75},"d4f7e15429ab",[1865],{"_key":1866,"_type":71,"marks":1867,"text":1868},"2397233203e9",[],"And the updated class code for Staff looks like (MaxLength only set on Name):",[],{"_key":1871,"_type":631,"code":1872,"language":633,"markDefs":12},"d17cb66862fb","public class Staff\n{\n\tpublic int Id {get; set}\n\t[StringLength(255)]\n\tpublic string Name {get; set}\n\tpublic string Role {get; set}\n}\n",{"_key":1874,"_type":67,"children":1875,"markDefs":1880,"style":75},"3306e7ff0574",[1876],{"_key":1877,"_type":71,"marks":1878,"text":1879},"8cd8ea428307",[123],"Non standard Model",[],{"_key":1882,"_type":67,"children":1883,"markDefs":1888,"style":75},"7ba77ceb2e30",[1884],{"_key":1885,"_type":71,"marks":1886,"text":1887},"59cf376caafd",[],"Now what if a model structure is partially or completely non-standard or otherwise specific to an organization or industry? We would need to interpret and build the grammar for the whole model structure. Again, the grammar builder could easily do that.",[],{"_key":1890,"_type":67,"children":1891,"markDefs":1896,"style":75},"25d712df59ac",[1892],{"_key":1893,"_type":71,"marks":1894,"text":1895},"ac0fa78c1a20",[],"A model for informal MOD would be non-standard, and having a dynamic grammar to load informal model structure and data is the only way that Informal MOD can be effectively supported.",[],{"_key":1898,"_type":67,"children":1899,"markDefs":1904,"style":75},"376040a11db4",[1900],{"_key":1901,"_type":71,"marks":1902,"text":1903},"f493f087e746",[],"Let’s do something completely different. Using the informal drawing of the restaurant scenario above, here is a more literal model structure:",[],{"_key":1906,"_type":54,"alt":1907,"asset":1908,"markDefs":12},"a2f370e0bf69","An Entity-Relationship diagram illustrating a restaurant management system with entities: Restaurant, Customer, Staff, and Food, linked by relationships such as 'eats at', 'manages', and 'serves'.",{"_ref":1909,"_type":58},"image-3ede33f9f0b4226ebc3f0d045fc0ae93fc7e2e83-555x461-jpg",{"_key":1911,"_type":67,"children":1912,"markDefs":1917,"style":75},"1eb882eb2776",[1913],{"_key":1914,"_type":71,"marks":1915,"text":1916},"2a1c3d6e38bb",[],"This structure probably wouldn’t make sense if we were building an enterprise application, but if this is the structure, what is the data? It would be the same as the run time data! So in effect our language could become a query language. Here is an example query:",[],{"_key":1919,"_type":631,"code":1920,"language":633,"markDefs":12},"ea67fc3846f9","foreach (Restaurant)\n{\n    println(Name, “:   ”, Location)\n    foreach (Staff)\n\t{\n\t\tprintln(“\\tStaff: ”, Name, “,   ”, Role)\n\t}\n    foreach (Customer)\n\t{\n\t\tprintln(“\\tCustomer: ”, Name)\n\t}\n}\n",{"_key":1922,"_type":67,"children":1923,"markDefs":1928,"style":75},"9ac55fe19891",[1924],{"_key":1925,"_type":71,"marks":1926,"text":1927},"d5c256335e16",[],"Some query output might look like:",[],{"_key":1930,"_type":631,"code":1931,"markDefs":12},"51aa58f72582","Chez Food: London\n\tStaff: Verity Jones, Chef\n\tStaff: Nigel Walker, Server\n\tCustomer: David Spencer\n\tCustomer: Catherine Rees\nChez Food: Paris\n\tStaff: Monique Dubois, Chef\n\tStaff: Henrique Bernard, Server\n\tStaff: Michelle Fontaine, Server\n\tCustomer: Pierre Simon\n\tCustomer: Camille Fournier\n",{"_key":1933,"_type":67,"children":1934,"markDefs":1939,"style":75},"8e64aaad7fce",[1935],{"_key":1936,"_type":71,"marks":1937,"text":1938},"99f34a9587cc",[],"I haven’t tried reading in a literal structure to do queries, so this is pure conjecture. It wouldn’t be practical to load lots of runtime data into a session.",[],{"_key":1941,"_type":67,"children":1942,"markDefs":1947,"style":75},"91f66f77dd7d",[1943],{"_key":1944,"_type":71,"marks":1945,"text":1946},"bd7df65be8c5",[],"Perhaps another reason to have very specific elements in your model structure such as Restaurant may be to allow you to write very specific model oriented code for an element that is much different than others. In practice, I have only found the need for a generic structure.",[],{"_key":1949,"_type":67,"children":1950,"markDefs":1959,"style":75},"9b6a0944232c",[1951,1955],{"_key":1952,"_type":71,"marks":1953,"text":1954},"5494880a317f",[123],"Grammar Builder",{"_key":1956,"_type":71,"marks":1957,"text":1958},"41eae8f23702",[]," – A language interpreter mechanism that modifies or augments the language grammar at runtime. A MOP language interpreter can read in a model structure and add that structure to the grammar at the beginning of a session.",[],{"_key":1961,"_type":67,"children":1962,"markDefs":1967,"style":154},"321915b3b5e7",[1963],{"_key":1964,"_type":71,"marks":1965,"text":1966},"f43f8ceceaff",[],"Contextual Grammar",[],{"_key":1969,"_type":67,"children":1970,"markDefs":1975,"style":75},"993793be681f",[1971],{"_key":1972,"_type":71,"marks":1973,"text":1974},"7248f70ccefd",[],"Perhaps not as important as dynamic grammar, but I think the concept of contextual grammar is useful for MOP languages, especially since MOP can be applied in different places such as to support modeling, transitioning from a model, and target programming. As with a dynamic grammar, it is very straightforward for a MOP language interpreter to implement a grammar filter to make the appropriate grammar available by context to help prevent coding that can cause unintended consequences.",[],{"_key":1977,"_type":67,"children":1978,"markDefs":1983,"style":75},"04eecbed1c69",[1979],{"_key":1980,"_type":71,"marks":1981,"text":1982},"123b27048117",[123],"Globally",[],{"_key":1985,"_type":67,"children":1986,"markDefs":1991,"style":75},"e32761105517",[1987],{"_key":1988,"_type":71,"marks":1989,"text":1990},"5e12247ef2f7",[],"For certain model oriented property methods, I think it is useful to limit the ability of what can be coded to enforce division of responsibility and help prevent unintended consequences. We may want filters such as:",[],{"_key":1993,"_type":67,"children":1994,"level":186,"listItem":187,"markDefs":2007,"style":75},"93a75ef29af9",[1995,1999,2003],{"_key":1996,"_type":71,"marks":1997,"text":1998},"c31ef7346b0f",[],"Within model oriented property ",{"_key":2000,"_type":71,"marks":2001,"text":2002},"c2b4a435ee9f",[123,165],"get",{"_key":2004,"_type":71,"marks":2005,"text":2006},"09db9b547dcc",[]," methods, inhibit the ability to write information to other places in any way. Filter out language grammar to prevent statements that can write data anywhere.",[],{"_key":2009,"_type":67,"children":2010,"level":186,"listItem":187,"markDefs":2022,"style":75},"1eb3559690a1",[2011,2014,2018],{"_key":2012,"_type":71,"marks":2013,"text":1998},"5916793d0006",[],{"_key":2015,"_type":71,"marks":2016,"text":2017},"68ce343d8d13",[123,165],"put",{"_key":2019,"_type":71,"marks":2020,"text":2021},"51c7d6ddc252",[]," methods, allow the ability to write information to other places other than the model. Filter out language grammar to prevent statements that can write data outside of models.",[],{"_key":2024,"_type":67,"children":2025,"level":186,"listItem":187,"markDefs":2037,"style":75},"c3d196a438be",[2026,2029,2033],{"_key":2027,"_type":71,"marks":2028,"text":1998},"24c228e79dba",[],{"_key":2030,"_type":71,"marks":2031,"text":2032},"52f7ebfd03dd",[123,165],"set",{"_key":2034,"_type":71,"marks":2035,"text":2036},"2b7dce85fb61",[]," methods, allow the ability to write information only to the model. Filter out language grammar to prevent statements that can write data to models.",[],{"_key":2039,"_type":67,"children":2040,"markDefs":2045,"style":75},"7f191a400d1f",[2041],{"_key":2042,"_type":71,"marks":2043,"text":2044},"10d9ec41b043",[123],"Transitional MOP Filter",[],{"_key":2047,"_type":67,"children":2048,"markDefs":2053,"style":75},"d07efa2da8f0",[2049],{"_key":2050,"_type":71,"marks":2051,"text":2052},"c0501de44bd3",[],"For programming to support utilizing a model to manage a target environment, we may want filters such as:",[],{"_key":2055,"_type":67,"children":2056,"level":186,"listItem":187,"markDefs":2068,"style":75},"97e35cda8afe",[2057,2061,2064],{"_key":2058,"_type":71,"marks":2059,"text":2060},"a3d3b9bea322",[],"Inhibit the ability to create ",{"_key":2062,"_type":71,"marks":2063,"text":2032},"44cddb3f7110",[123,165],{"_key":2065,"_type":71,"marks":2066,"text":2067},"bb61c3d83fe1",[]," methods in model oriented properties that are used to update models and invalidate programming sessions.",[],{"_key":2070,"_type":67,"children":2071,"markDefs":2076,"style":75},"c1db8217b308",[2072],{"_key":2073,"_type":71,"marks":2074,"text":2075},"3442eaafc3e2",[123],"Modeling MOP Filter",[],{"_key":2078,"_type":67,"children":2079,"markDefs":2084,"style":75},"0a1de3644896",[2080],{"_key":2081,"_type":71,"marks":2082,"text":2083},"df0a223f9962",[],"For programming to manage a model, we may want filters such as:",[],{"_key":2086,"_type":67,"children":2087,"level":186,"listItem":187,"markDefs":2098,"style":75},"670fe6105ad1",[2088,2091,2094],{"_key":2089,"_type":71,"marks":2090,"text":2060},"eca0e6c47a3b",[],{"_key":2092,"_type":71,"marks":2093,"text":2017},"e28038782b35",[123,165],{"_key":2095,"_type":71,"marks":2096,"text":2097},"ee454d2b1197",[]," methods in model oriented properties that are used to update information outside of models.",[],{"_key":2100,"_type":67,"children":2101,"markDefs":2106,"style":75},"ada489f71d12",[2102],{"_key":2103,"_type":71,"marks":2104,"text":2105},"83c804242665",[123],"Target MOP Filter",[],{"_key":2108,"_type":67,"children":2109,"markDefs":2121,"style":75},"06d96f14c849",[2110,2114,2117],{"_key":2111,"_type":71,"marks":2112,"text":2113},"368407ce2101",[],"For programming to manage a target environment directly, there probably would be a more robust grammar to support anything target programmers may need to do. Perhaps in this case it is desired to allow all types of model oriented property methods with the appropriate grammar filters within them, knowing that ",{"_key":2115,"_type":71,"marks":2116,"text":2032},"b3f53bb09510",[123,165],{"_key":2118,"_type":71,"marks":2119,"text":2120},"fd09b468bd6e",[]," methods can invalidate the programming session.",[],{"_key":2123,"_type":67,"children":2124,"markDefs":2133,"style":75},"233363200159",[2125,2129],{"_key":2126,"_type":71,"marks":2127,"text":2128},"797c5be4f519",[123],"Grammar Filter",{"_key":2130,"_type":71,"marks":2131,"text":2132},"7521465f1510",[]," – A language interpreter mechanism that filters the overall language grammar based on context to help prevent coding that can cause unintended consequences.",[],{"_key":2135,"_type":67,"children":2136,"markDefs":2141,"style":154},"b9daaa21f74a",[2137],{"_key":2138,"_type":71,"marks":2139,"text":2140},"caf53f6386ff",[],"Almost No Variables!",[],{"_key":2143,"_type":67,"children":2144,"markDefs":2149,"style":75},"ff5d33240de5",[2145],{"_key":2146,"_type":71,"marks":2147,"text":2148},"d8e7104ca354",[],"Transitional MOP requires very few variables! With Model Context and having access to the entire tree of model data, there are many cases where variables are not needed where they are required in other languages:",[],{"_key":2151,"_type":67,"children":2152,"level":186,"listItem":187,"markDefs":2157,"style":75},"c1223c5f8a39",[2153],{"_key":2154,"_type":71,"marks":2155,"text":2156},"0a24d8c3bad9",[],"No variables are required for holding iterations when searching or browsing.",[],{"_key":2159,"_type":67,"children":2160,"level":186,"listItem":187,"markDefs":2165,"style":75},"b0ddef15c653",[2161],{"_key":2162,"_type":71,"marks":2163,"text":2164},"44af2a0f0c4d",[],"No variables are required to evaluate model oriented properties.",[],{"_key":2167,"_type":67,"children":2168,"level":186,"listItem":187,"markDefs":2173,"style":75},"b63ebaf86d1c",[2169],{"_key":2170,"_type":71,"marks":2171,"text":2172},"a709aad5d8bd",[],"Model oriented properties can be utilized in many different places such as part of expressions.",[],{"_key":2175,"_type":67,"children":2176,"markDefs":2181,"style":75},"0d26a87d8fd3",[2177],{"_key":2178,"_type":71,"marks":2179,"text":2180},"6c892248bafe",[],"In fact, I only implemented support for variables very late in the process. For transitional MOP, aside from a handful of global (state) settings, I only used variables for maybe 1% of model oriented properties I developed at most, and perhaps all of those cases could have been handled with better model oriented programming or augmenting the model structure a bit. I found that I almost always could write a model oriented property to express what I would do in another language and hold in variables.",[],{"_key":2183,"_type":67,"children":2184,"markDefs":2188,"style":75},"86b7f6370560",[2185],{"_key":2186,"_type":71,"marks":2187,"text":269},"2f4d275fab05",[],[],{"_key":2190,"_type":67,"children":2191,"markDefs":2196,"style":154},"3a82877523d5",[2192],{"_key":2193,"_type":71,"marks":2194,"text":2195},"44eebd4f46b9",[],"Massive Reusability",[],{"_key":2198,"_type":67,"children":2199,"markDefs":2204,"style":75},"e5fbdef784fb",[2200],{"_key":2201,"_type":71,"marks":2202,"text":2203},"a94c9caa6bc6",[],"As mentioned above, model oriented properties are extremely flexible, being independent bits of code that utilized almost anywhere. This flexibility enables massive reusability, both within a program and across programs. I have found in practice that model oriented properties are often essentially codified best practices that transcend functional requirements of any given project.",[],{"_key":2206,"_type":67,"children":2207,"markDefs":2212,"style":75},"8cde89a2677d",[2208],{"_key":2209,"_type":71,"marks":2210,"text":2211},"2b2c091e746c",[],"The following is a very simple example of a class naming convention that can be reused hundreds of times. Of course much more complex “best practice” properties can be reused time and time again.",[],{"_key":2214,"_type":631,"code":2215,"language":633,"markDefs":12},"3fd26ab35817","Entity property ClassName\nget\n{\n\tprint( Name.PascalCase())\n}\n",{"_key":2217,"_type":67,"children":2218,"markDefs":2223,"style":154},"29afdee3675e",[2219],{"_key":2220,"_type":71,"marks":2221,"text":2222},"77ad1e2e1c6e",[],"Massive Parallelism",[],{"_key":2225,"_type":67,"children":2226,"markDefs":2231,"style":75},"9714c8705d6a",[2227],{"_key":2228,"_type":71,"marks":2229,"text":2230},"e14a124de031",[],"If almost no variables are required and the model data is sealed in read only in a programming session, you can infer that there is potential for massive parallelism in evaluating model oriented properties.",[],{"_key":2233,"_type":67,"children":2234,"markDefs":2239,"style":75},"269c1907ff06",[2235],{"_key":2236,"_type":71,"marks":2237,"text":2238},"597f0d50786a",[],"I didn’t implement parallelism, but I did implement caching. The interpreter would cache certain results of evaluating a model oriented property for a particular model context (instance of a node), so that those results could be utilized many times later. I found great performance gains in just doing this.",[],{"_key":2241,"_type":67,"children":2242,"markDefs":2246,"style":75},"8fa0f2e6a9c8",[2243],{"_key":2244,"_type":71,"marks":2245,"text":269},"6a656b81f6ef",[],[],{"_key":2248,"_type":67,"children":2249,"markDefs":2254,"style":154},"3a3b0c00d3f8",[2250],{"_key":2251,"_type":71,"marks":2252,"text":2253},"ac6efe0ab0e4",[],"Integration with Target Language (Custom) Code",[],{"_key":2256,"_type":67,"children":2257,"markDefs":2262,"style":75},"9d7d8fbdc099",[2258],{"_key":2259,"_type":71,"marks":2260,"text":2261},"6c036e667100",[],"My experience with Transitional MOP is that with a reasonable amount of effort you can manage 80% of a target enterprise environment to best practices, and maybe with double or more the effort, you could get to 90%. In any case, you need to have an approach to be able to maintain the target environment 100% to best practices, especially when making updates with Transitional MOP.",[],{"_key":2264,"_type":67,"children":2265,"markDefs":2270,"style":75},"9d55524b900b",[2266],{"_key":2267,"_type":71,"marks":2268,"text":2269},"fd561903504c",[],"This is an area that requires more thought and sophistication. None of the following is ideal, but here are a few things that can be done:",[],{"_key":2272,"_type":67,"children":2273,"level":186,"listItem":187,"markDefs":2282,"style":75},"6329be4a50b2",[2274,2278],{"_key":2275,"_type":71,"marks":2276,"text":2277},"3d685df86a23",[123],"Partial files",{"_key":2279,"_type":71,"marks":2280,"text":2281},"a9156b814d4d",[]," – The easiest starting point is to have files created and updated by the MOP language interpreter is to keep them separate from files created or modified in the target language directly. Partial class files are an example of this.",[],{"_key":2284,"_type":67,"children":2285,"level":186,"listItem":187,"markDefs":2294,"style":75},"51aa30839a22",[2286,2290],{"_key":2287,"_type":71,"marks":2288,"text":2289},"53ab2aaf1660",[123],"Customization points",{"_key":2291,"_type":71,"marks":2292,"text":2293},"0e4c483177ec",[]," – Partial files often only go so far to support customization. The ability to define flexible customization points (such as named regions or comments) within files managed by the interpreter. Thus, custom code can be added within these points, and the interpreter can reapply the custom code if the overall file needs to be updated.",[],{"_key":2296,"_type":67,"children":2297,"level":186,"listItem":187,"markDefs":2306,"style":75},"eedff2e8031b",[2298,2302],{"_key":2299,"_type":71,"marks":2300,"text":2301},"5f42ae94102c",[123],"File update and deletion policy",{"_key":2303,"_type":71,"marks":2304,"text":2305},"d2fbbbf02e42",[]," – The interpreter should only update and delete files it manages, and should leave other custom files alone. In addition, if there is any custom code within managed files, those should not be deleted.",[],{"_key":2308,"_type":67,"children":2309,"level":186,"listItem":187,"markDefs":2318,"style":75},"2f1e4ab00dda",[2310,2314],{"_key":2311,"_type":71,"marks":2312,"text":2313},"39e62aa0363b",[123],"Ignore policy",{"_key":2315,"_type":71,"marks":2316,"text":2317},"10824e34f4bd",[]," – Finally, if any files that were managed by the interpreter need to be heavily customized, they can be marked as ignore so that the interpreter in the future will leave them alone.",[],{"_key":2320,"_type":67,"children":2321,"markDefs":2325,"style":75},"12df01679e5e",[2322],{"_key":2323,"_type":71,"marks":2324,"text":269},"4b0392200108",[],[],{"_key":2327,"_type":67,"children":2328,"markDefs":2333,"style":154},"6cef1e170d70",[2329],{"_key":2330,"_type":71,"marks":2331,"text":2332},"f1aabdaa1621",[],"Implications by MOD Form",[],{"_key":2335,"_type":67,"children":2336,"markDefs":2341,"style":75},"5fa5eb4bbe0f",[2337],{"_key":2338,"_type":71,"marks":2339,"text":2340},"75962aff8e96",[],"All of the above features could be utilized in each of the forms of MOD, with some possible caveats:",[],{"_key":2343,"_type":67,"children":2344,"markDefs":2352,"style":75},"0007187dda6d",[2345,2348],{"_key":2346,"_type":71,"marks":2347,"text":1123},"59d2fa65d34e",[123],{"_key":2349,"_type":71,"marks":2350,"text":2351},"2a860e1b672b",[]," – Programming sessions would likely get stale more often with Coupled MOD, as design changes and enhancements happen very frequently. In addition, since detailed design models are much larger than for other forms, more memory would be required to load the model data.",[],{"_key":2354,"_type":67,"children":2355,"markDefs":2363,"style":75},"36b105d33e5d",[2356,2359],{"_key":2357,"_type":71,"marks":2358,"text":1780},"fb2044755dfd",[123],{"_key":2360,"_type":71,"marks":2361,"text":2362},"f7c5f0ea6fbc",[]," – Having a dynamic grammar and a grammar builder would be a requirement for Informal MOD, as there is no model structure standard.",[],{"_key":2365,"_type":67,"children":2366,"markDefs":2374,"style":75},"50dbfaa6abe7",[2367,2370],{"_key":2368,"_type":71,"marks":2369,"text":2195},"01ce58122582",[123],{"_key":2371,"_type":71,"marks":2372,"text":2373},"b41ffe7c4c14",[]," – This is more of a hunch than empirical data, but I feel that there would be greater usability when utilized with Decoupled MOD. With this form, I found that most of my model oriented properties were essentially codified best practices that I could reuse many times within and across many projects.",[],{"_key":2376,"_type":67,"children":2377,"markDefs":2382,"style":108},"2b49bb56a837",[2378],{"_key":2379,"_type":71,"marks":2380,"text":2381},"b9058eb047e5",[],"Implications for Modeling MOP",[],{"_key":2384,"_type":67,"children":2385,"markDefs":2390,"style":75},"97672e0c5f44",[2386],{"_key":2387,"_type":71,"marks":2388,"text":2389},"cfdf31740875",[],"As the purpose of modeling MOP is to create and maintain the structure and data of a model, some requirements for a MOP language differ than that of Transitional MOP. Creating and maintaining a model structure and data of course can be done manually with an IDE, but here are also some desirable features to help support modeling programmatically:",[],{"_key":2392,"_type":67,"children":2393,"markDefs":2397,"style":75},"3f26cdce5859",[2394],{"_key":2395,"_type":71,"marks":2396,"text":269},"aebe057b9499",[],[],{"_key":2399,"_type":67,"children":2400,"markDefs":2405,"style":154},"31698dc33f45",[2401],{"_key":2402,"_type":71,"marks":2403,"text":2404},"3f9b37d65f8c",[],"Defining Model Structure",[],{"_key":2407,"_type":67,"children":2408,"markDefs":2413,"style":75},"505cf4575aa6",[2409],{"_key":2410,"_type":71,"marks":2411,"text":2412},"69d43587d4df",[],"Being able to define or augment a model structure I think is a critical feature for a MOP language in order to handle many programming scenarios. Basic features include being able to add and edit nodes in a hierarchical model structure, and being able to add and edit attributes to these nodes. In turn, this information can be passed on to the grammar builder to add the structure to the model grammar.",[],{"_key":2415,"_type":67,"children":2416,"markDefs":2421,"style":75},"259d4828e1c6",[2417],{"_key":2418,"_type":71,"marks":2419,"text":2420},"ca7257f68c76",[],"Below is an example of simple statements to create our restaurant model structure with Restaurant as the root node:",[],{"_key":2423,"_type":631,"code":2424,"language":633,"markDefs":12},"d6735bdb45bc","createModel (“Restaurant”)\naddNode (Restaurant, “Customer”)\naddNode (Restaurant, “Staff”)\naddNode (Restaurant, “Food”)\naddAttribute (Restaurant, “Id”)\naddAttribute (Restaurant, “Name”)\naddAttribute (Restaurant, “Location”)\naddAttribute (Staff, “Id”)\naddAttribute (Staff, “Name”)\naddAttribute (Staff, “Role”)\naddAttribute (Customer, “Id”)\naddAttribute (Customer, “Name”)\naddAttribute (Customer, “VisitedDate”)\naddAttribute (Food, “Id”)\naddAttribute (Food, “MenuItemName”)\naddAttribute (Food, “Ingredients”)\n",{"_key":2426,"_type":67,"children":2427,"markDefs":2432,"style":75},"c3db030ca3ae",[2428],{"_key":2429,"_type":71,"marks":2430,"text":2431},"1fb477d6b4c7",[],"Notice that statements to add or edit model structure can immediately update the grammar with the grammar builder so that new model elements can be utilized right away. A complete statement set to manage model structures would contain more features such as edit and delete and more information such as data types, etc.",[],{"_key":2434,"_type":67,"children":2435,"markDefs":2440,"style":154},"0c21bd989638",[2436],{"_key":2437,"_type":71,"marks":2438,"text":2439},"c2bb78e16ea3",[],"Import\u002FExport",[],{"_key":2442,"_type":67,"children":2443,"markDefs":2448,"style":75},"7d46b162c2df",[2444],{"_key":2445,"_type":71,"marks":2446,"text":2447},"7ed71b544703",[],"An important feature for supporting modeling MOP is to support import\u002Fexport with other sources of model data. Some examples include:",[],{"_key":2450,"_type":67,"children":2451,"level":186,"listItem":187,"markDefs":2460,"style":75},"979f89092838",[2452,2456],{"_key":2453,"_type":71,"marks":2454,"text":2455},"1aa78e1be306",[123],"XML documents",{"_key":2457,"_type":71,"marks":2458,"text":2459},"c1ac11314d41",[]," – XML import\u002Fexport requires being able to determine the structure of the input XML and how nodes and attributes in the XML correspond to the model structure being used in order to perform the import of model data.",[],{"_key":2462,"_type":67,"children":2463,"level":186,"listItem":187,"markDefs":2472,"style":75},"f70ecdb4bee5",[2464,2468],{"_key":2465,"_type":71,"marks":2466,"text":2467},"005181cc3819",[123],"Databases",{"_key":2469,"_type":71,"marks":2470,"text":2471},"e23712608adf",[]," – Database import requires being able to set up connection strings for supported database types, being able to read the schema for a database, and how the schema elements correspond to the model structure being used in order to perform the import of model data.",[],{"_key":2474,"_type":67,"children":2475,"level":186,"listItem":187,"markDefs":2484,"style":75},"230f15aa095a",[2476,2480],{"_key":2477,"_type":71,"marks":2478,"text":2479},"e6651842e78c",[123],"Other models",{"_key":2481,"_type":71,"marks":2482,"text":2483},"f1ab4910800f",[]," – Similar to the above examples, model import\u002Fexport requires being able to understand corresponding model structures in order to perform the import or export of model data.",[],{"_key":2486,"_type":67,"children":2487,"markDefs":2492,"style":75},"b52bab3aeb57",[2488],{"_key":2489,"_type":71,"marks":2490,"text":2491},"91d26171a770",[],"In actual practice, I utilized import from other model sources for the majority of my modeling work for enterprise projects. If you are doing manual modeling as well as import, it is important for the IDE to keep track and maintain manual changes to the model when subsequent imports of model data occur.",[],{"_key":2494,"_type":67,"children":2495,"markDefs":2500,"style":154},"366c074a814e",[2496],{"_key":2497,"_type":71,"marks":2498,"text":2499},"4abeb10b5ef8",[],"Tagging",[],{"_key":2502,"_type":67,"children":2503,"markDefs":2508,"style":75},"227c0cf9cb78",[2504],{"_key":2505,"_type":71,"marks":2506,"text":2507},"f06b14d5e3c7",[],"Tagging is a simple way of adding some unstructured data to any element in the tree of model data as a way of specifying additional requirements. The tags could just be a list of string values or name\u002Fvalue pairs attached to a model element to differentiate it from other elements.",[],{"_key":2510,"_type":67,"children":2511,"markDefs":2516,"style":75},"3d6ef582041a",[2512],{"_key":2513,"_type":71,"marks":2514,"text":2515},"bc6678124a47",[],"Say for example that staff names are confidential and we have an attribute to encrypt a property. We can add a tag to the Staff Name property such as “secure”, and that tag can be utilized to handle the Staff Name property differently:",[],{"_key":2518,"_type":631,"code":2519,"language":633,"markDefs":12},"f834b21f2754","Entity property PublicClassCode\nget\n{\n\tprintln( PublicClassDeclaration)\n\tprintln(“{”)\n    foreach (Property)\n\t{\n\t\tif (Tags.Contains(“secure”))\n\t\t{\n\t\t\tprintln(“\\t[Encrpyt]”)\n\t\t}\n\t\tprintln(“\\t”, PublicPropertyDeclaration)\n\t}\n\tprintln(“}”)\n}\n",{"_key":2521,"_type":67,"children":2522,"markDefs":2527,"style":75},"612af986e400",[2523],{"_key":2524,"_type":71,"marks":2525,"text":2526},"43fae0df4d1a",[],"And the class code for Staff looks like:",[],{"_key":2529,"_type":631,"code":2530,"language":633,"markDefs":12},"b2aff3522d03","{\n\tpublic int Id {get; set}\n\t[Encrypt]\n\tpublic string Name {get; set}\n\tpublic string Role {get; set}\n}\n",{"_key":2532,"_type":67,"children":2533,"markDefs":2538,"style":108},"58d953a85438",[2534],{"_key":2535,"_type":71,"marks":2536,"text":2537},"08f106e30f85",[],"Implications for Target MOP",[],{"_key":2540,"_type":67,"children":2541,"markDefs":2546,"style":75},"409672179dc0",[2542],{"_key":2543,"_type":71,"marks":2544,"text":2545},"a2f9a3698e40",[],"Since I did not implement a MOP language as a target language, this section is pure conjecture on my part and would be a main area for ongoing research.",[],{"_key":2548,"_type":67,"children":2549,"markDefs":2554,"style":154},"19b28da01325",[2550],{"_key":2551,"_type":71,"marks":2552,"text":2553},"aa598488162b",[],"Language Grammar",[],{"_key":2556,"_type":67,"children":2557,"markDefs":2562,"style":75},"d78715c3c41e",[2558],{"_key":2559,"_type":71,"marks":2560,"text":2561},"93a87c63f3e7",[],"A target MOP language would undoubtedly need a more extensive grammar than that for Transitional MOP to handle all of the things that a target language programmer would need to do. Amongst other things, type safety is not necessary for Transitional MOP but would probably be essential for target MOP.",[],{"_key":2564,"_type":67,"children":2565,"markDefs":2570,"style":154},"6066a564c0c7",[2566],{"_key":2567,"_type":71,"marks":2568,"text":2569},"ed26886e797f",[],"Integration with Transitional MOP",[],{"_key":2572,"_type":67,"children":2573,"markDefs":2578,"style":75},"a5f38f6321d5",[2574],{"_key":2575,"_type":71,"marks":2576,"text":2577},"aff75da3203f",[],"I think this is a very interesting area and would require much thought on how to manage this integration. I mentioned above with Transitional MOP that you could define customization points to manage and maintain custom code. I think for a true target MOP language, we would need to be much smarter than that.",[],{"_key":2580,"_type":67,"children":2581,"markDefs":2586,"style":75},"799b426db4aa",[2582],{"_key":2583,"_type":71,"marks":2584,"text":2585},"6cb660ceb1b0",[],"Let’s imagine that Transitional MOP is used to utilize the model and build and maintain the basic or even very sophisticated enterprise framework for your project. How will you add your target code to this framework? If updates happen to the framework based on Transitional MOP (best practice or other) changes, how will you be able to manage changes to your target code? I don’t have any specific ideas on this, but I can at a high level imagine a smart IDE that allows the programmer to view updates to the framework vs target code and help with the help with the process of updating target code. What do you think?",[],{"_key":2588,"_type":67,"children":2589,"markDefs":2594,"style":154},"1f5e3194ac43",[2590],{"_key":2591,"_type":71,"marks":2592,"text":2593},"23dd46e84330",[],"Integration with Modeling MOP",[],{"_key":2596,"_type":67,"children":2597,"markDefs":2602,"style":75},"8d927486950f",[2598],{"_key":2599,"_type":71,"marks":2600,"text":2601},"c1b694dda046",[],"Modeling MOP or manually updating the model data would have the same implications for target programming as above. When a session and the framework is updated, as with above, I think we would need a smart and graphical IDE to help manage changes to the target code.",[],{"_key":2604,"_type":67,"children":2605,"markDefs":2617,"style":75},"47ee05c02a86",[2606,2610,2613],{"_key":2607,"_type":71,"marks":2608,"text":2609},"299ad8ac7f49",[],"Now, what happens when we change the model ",{"_key":2611,"_type":71,"marks":2612,"text":132},"7eda5b78334d",[123],{"_key":2614,"_type":71,"marks":2615,"text":2616},"c4a85071de0a",[]," manually or through Modeling MOP? This would change the MOP language grammar! How would this be managed? Hmmm!!",[],{"_key":2619,"_type":67,"children":2620,"markDefs":2625,"style":75},"3c72ee8689aa",[2621],{"_key":2622,"_type":71,"marks":2623,"text":2624},"f356a0cbbdc5",[],"With Transitional MOP, deletion of elements of the model structure would create compilation errors that can be resolved and addition of model structure would only be utilized in model oriented property changes.",[],{"_key":2627,"_type":67,"children":2628,"markDefs":2633,"style":75},"f0d9760c0631",[2629],{"_key":2630,"_type":71,"marks":2631,"text":2632},"18d8baac2d2c",[],"To manage target code when the language grammar changes, again I think we would need a smart IDE to manage this. Exactly how, I have no great ideas. What do you think?",[],{"_key":2635,"_type":67,"children":2636,"markDefs":2641,"style":154},"c22ac8199ff0",[2637],{"_key":2638,"_type":71,"marks":2639,"text":2640},"a669d165af4d",[],"Variables",[],{"_key":2643,"_type":67,"children":2644,"markDefs":2649,"style":75},"4fff52855708",[2645],{"_key":2646,"_type":71,"marks":2647,"text":2648},"fd045aafa774",[],"Certainly as a target language, there would be more of a need for variables to handle any kind of user or other I\u002FO. Even so, I believe that variable use would be much lower than with other languages.",[],{"_key":2651,"_type":67,"children":2652,"markDefs":2656,"style":75},"c1c21aaf235e",[2653],{"_key":2654,"_type":71,"marks":2655,"text":269},"10b61a685390",[],[],{"_key":2658,"_type":67,"children":2659,"markDefs":2664,"style":154},"a67f6f6b842c",[2660],{"_key":2661,"_type":71,"marks":2662,"text":2663},"ff4cbcdb14cb",[],"New Language or Supersize an Object Oriented Language?",[],{"_key":2666,"_type":67,"children":2667,"markDefs":2672,"style":75},"24f4be18e990",[2668],{"_key":2669,"_type":71,"marks":2670,"text":2671},"b380eb9aa046",[],"As a target language, I think there might be a significant overlap in the language grammar with an object oriented language. So, should a MOP language as a target language be a separate language in its own right, or an enhancement to an existing object oriented language? Food for thought!",[],{"_key":2674,"_type":67,"children":2675,"markDefs":2680,"style":108},"dc9e6e267785",[2676],{"_key":2677,"_type":71,"marks":2678,"text":2679},"98c30fa8734a",[],"In Conclusion",[],{"_key":2682,"_type":67,"children":2683,"markDefs":2688,"style":75},"a005beb292a4",[2684],{"_key":2685,"_type":71,"marks":2686,"text":2687},"20b687749729",[],"I hope this article helps inspire looking into the potential of model oriented languages. There are a lot of concepts to digest here, and please review and let me know how I can make this more clear in any way, and if there is any related work out there that I can refer to. I will happily update this article with more feedback.",[],{"_key":2690,"_type":67,"children":2691,"markDefs":2696,"style":75},"faffa8520138",[2692],{"_key":2693,"_type":71,"marks":2694,"text":2695},"8f00c9ac0ed0",[],"Several years ago, I wrote a number of articles related to model oriented languages and development on codeproject.com. I hope the site become active again in the future.",[],{"_key":2698,"_type":67,"children":2699,"markDefs":2713,"style":75},"b0cc8a5e6383",[2700,2704,2709],{"_key":2701,"_type":71,"marks":2702,"text":2703},"54f486c8ae94",[],"If you want to explore the language and IDE I developed years ago, Mo+, it is still available on ",{"_key":2705,"_type":71,"marks":2706,"text":2708},"12702982190f",[2707],"a7bb9d192091","https:\u002F\u002Fgithub.com\u002Fmoplus",{"_key":2710,"_type":71,"marks":2711,"text":2712},"e74004443777",[],". It was last available as a Visual Studio add-on in 2014 but the source code and standalone installer is still available. The IDE includes a full help system and online reference to try out the language. The project includes templates (packages of model oriented properties) that you can use to create some sample projects.",[2714],{"_key":2707,"_type":2715,"href":2708,"reference":12},"link",true,"2026\u002F10\u002F09","2026-10-09T14:59:04.056Z",{"_type":2720,"canonicalUrl":2721},"seo","https:\u002F\u002Fgithub.com\u002Fmoplus\u002Fmodelorientedplus\u002Fblob\u002Fmaster\u002FA%20Treatise%20on%20Model%20Oriented%20Programming%20Languages%20academ.pdf?fbclid=Iwb21leATsOSVjbGNrBOw5FHBkb2YFZXh0bgNhZW0CMTEAc3J0YwZhcHBfaWQMMzUwNjg1NTMxNzI4AAEeR_eKIS9Yv8HZgoxv_L9EWebZoHZeZVbk-nGauPvd8B1s1ApX4qgekQITwX4_aem_XCdsIyiby86FcaJlAqeZkA",{"_type":10,"current":2723},"a-treatise-on-model-oriented-programming-languages",[2725,2733,2744,2767],{"_createdAt":2726,"_id":2727,"_rev":2728,"_type":2729,"_updatedAt":2726,"slug":2730,"title":2732},"2024-02-12T14:32:28Z","53789ffd-a446-49fe-b34e-4449a13e4c0b","I2JFaJlmKKIZMkCzMq7ibc","blogTag",{"_type":10,"current":2731},"programming-language","programming language",{"_createdAt":2734,"_id":2735,"_rev":2736,"_system":2737,"_type":2729,"_updatedAt":2740,"slug":2741,"title":2743},"2026-06-12T16:16:20Z","51c761d7-73f7-42f4-aa49-8484e3849e7c","P0qLqkXH0zpkT6RRZ9Iwel",{"base":2738},{"id":2735,"rev":2739},"MwgZb85ftkde1TTvQsHYa6","2026-09-28T16:40:45Z",{"_type":10,"current":2742},"building-software","Building software",{"_createdAt":2745,"_id":2746,"_rev":2747,"_system":2748,"_type":2729,"_updatedAt":2751,"description":2752,"featuredPosts":2761,"slug":2764,"title":2766},"2025-04-24T16:28:57Z","797b8797-6e65-4723-b53f-8bc005305384","46s78gX2DRxVswzX0kQ1Ty",{"base":2749},{"id":2746,"rev":2750},"IpfPEqg1c3Byvj9RrB3Xaj","2026-10-07T20:13:00Z",[2753],{"_key":2754,"_type":67,"children":2755,"markDefs":2760,"style":75},"bb32f75814b4",[2756],{"_key":2757,"_type":71,"marks":2758,"text":2759},"dbcf27ef29b3",[],"Community-generated articles submitted for your reading pleasure. If you’re interested in seeing your work here, log in with your Stack Overflow account and click the link below. Articles will be licensed under a CC BY-SA 4.0 grant. ",[],[2762],{"_key":2763,"_type":58},"9d9ea8c4082d",{"_type":10,"current":2765},"contributed","The Heap",{"_createdAt":2768,"_id":2769,"_rev":2770,"_system":2771,"_type":2729,"_updatedAt":2774,"description":2775,"slug":2794,"title":2796},"2025-08-08T15:49:22Z","39391cf4-6f9a-4238-8670-c1e44b66db9e","09X6HDzCi2VfMov6gSLf7H",{"base":2772},{"id":2769,"rev":2773},"TdCcmC7LyfLVwjB8GEXoh6","2025-12-10T19:34:33Z",[2776,2784],{"_key":2777,"_type":67,"children":2778,"markDefs":2783,"style":75},"a4b1a37cbbcc",[2779],{"_key":2780,"_type":71,"marks":2781,"text":2782},"d8e8f3e0fd9c",[],"These articles are licensed under a Creative Commons Attribution-ShareAlike 4.0 International license. ",[],{"_key":2785,"_type":67,"children":2786,"markDefs":2792,"style":75},"7effd489c71f",[2787],{"_key":2788,"_type":71,"marks":2789,"text":2791},"538808bb5325",[2790],"fd643b288690","creativecommons.org\u002Flicenses\u002Fby-sa\u002F4.0\u002Fdeed.en",[2793],{"_key":2790,"_type":2715},{"_type":10,"current":2795},"cc-by-sa","CC BY-SA 4.0","A Treatise on Model Oriented Programming Languages",[2799,2805,2811,2817],{"_id":2800,"publishedAt":2801,"slug":2802,"sponsored":12,"title":2804},"f13e8883-6d06-432d-9f93-10ae8b0fd048","2026-10-08T20:22:56.685Z",{"_type":10,"current":2803},"production-grade-llms-and-agents-a-field-guide","Production-grade LLMs and agents: a field guide",{"_id":2806,"publishedAt":2807,"slug":2808,"sponsored":12,"title":2810},"004e0789-dc2d-496b-a8af-b6e6aefde5f7","2026-10-08T20:08:53.629Z",{"_type":10,"current":2809},"part-5-operating-an-llm-system-observability-cost-routing-and-the-platform-underneath","Part 5: Operating an LLM system: observability, cost, routing, and the platform underneath",{"_id":2812,"publishedAt":2813,"slug":2814,"sponsored":12,"title":2816},"358fa8ac-2467-4ef4-893c-dad3490046df","2026-10-08T14:00:00.000Z",{"_type":10,"current":2815},"a-green-exit-code-is-not-evidence-that-the-work-happened","A green exit code is not evidence that the work happened",{"_id":2818,"publishedAt":2819,"slug":2820,"sponsored":12,"title":2822},"4ae1a4e4-cb6e-4110-b6f3-50b8afa09f49","2026-10-07T20:48:55.325Z",{"_type":10,"current":2821},"part-4-safety-and-governance-for-llm-systems-guardrails-pii-audit-and-memory","Part 4: Safety and governance for LLM systems: guardrails, PII, audit, and memory",{"data":2824,"sourceMap":-1},{"count":2825,"lastTimestamp":12},0]