{"id":765,"date":"2016-06-27T13:50:30","date_gmt":"2016-06-27T13:50:30","guid":{"rendered":"http:\/\/onefact-migrate.zipfish-sites.io\/?p=765"},"modified":"2020-12-16T16:10:20","modified_gmt":"2020-12-16T16:10:20","slug":"model-api","status":"publish","type":"post","link":"https:\/\/onefact.net\/model-api\/","title":{"rendered":"Model API?"},"content":{"rendered":"<div><strong><a href=\"https:\/\/onefact.net\/wp-content\/uploads\/2016\/06\/api.png\"><img alt='api-6443822' class=\"alignnone wp-image-768\" src='https:\/\/onefact.net\/wp-content\/uploads\/2016\/06\/api-6443822.png' alt=\"api\" width=\"200\" height=\"147\" \/><\/a><a href=\"https:\/\/onefact.net\/wp-content\/uploads\/2016\/06\/whatapi.png\"><img alt='whatapi-1197716' class=\"alignnone wp-image-767\" src='https:\/\/onefact.net\/wp-content\/uploads\/2016\/06\/whatapi-1197716.png' alt=\"whatapi\" width=\"162\" height=\"135\" \/><\/a><\/strong><\/div>\n<div><strong>API and MC-Java<\/strong><\/div>\n<div><\/div>\n<div>The API to the xtUML metamodel is simply the xtUML metamodel viewed as an xtUML model.\u00a0 Applications that wish to interface are written in xtUML and operate on the metamodel as they would any other xtUML application model.<\/div>\n<div><\/div>\n<div>Almost nobody access the xtUML metamodel with native hand-craft Java.\u00a0 Of course this is supported, but it is far easier and more portable to build models.<\/div>\n<div><\/div>\n<div>xtUML action language supplies model-level statements that support:<\/div>\n<ul>\n<li>create instance<\/li>\n<li>delete instance<\/li>\n<li>select one\/any\/many from instances of \/\/ table scans<\/li>\n<li>select one\/any\/many related by \/\/ traversal of relationship chains<\/li>\n<li>attribute read\/write \/\/ as action language expressions<\/li>\n<li>etc.<\/li>\n<\/ul>\n<div><\/div>\n<div>There is a Java API &#8220;under the hood in the architecture&#8221;, but\u00a0small amounts of code\u00a0use it.\u00a0 To interface with the tool, developers build xtUML models that operate against the xtUML metamodel (using action language) and then translate the models with MC-Java.<\/div>\n<div><\/div>\n<div>The &#8220;Java API&#8221; will change when we update MC-Java to generate EMF-aware Java.\u00a0 Once we do this, EMF &#8220;stuff&#8221; (hand-craft Java and EMF toolery) can operate against the lower level API.\u00a0 However, developers will continue to interface with the metamodel using xtUML at the model level.\u00a0 This is cool; all this architectural change, and the user API does not change!<\/div>\n<div><\/div>\n<div>Upon introducing EMF, MC-Java will be modified so that the xtUML metamodel structure will translate into classes based on <em>EObject<\/em> rather than simple native Java classes.<\/div>\n<div><\/div>\n<div>MC-Java action language translation will be modified so that the &#8216;create&#8217; statement generates the appropriate EMF constructor rather than the custom native Java constructor used today.\u00a0 The &#8216;select&#8217; statements will translate into EMF &#8216;find&#8217; (or whatever EMF does to search instances of a particular class).\u00a0 The relationship traversal will be interesting; xtUML action language supports traversal across several relationships of varying multiplicity and conditionality in a single statement.\u00a0 So, we will likely generate methods on classes that support selecting <em>through<\/em> them (resulting in an instance or instance set).<\/div>\n","protected":false},"excerpt":{"rendered":"<p>API and MC-Java The API to the xtUML metamodel is simply the xtUML metamodel viewed as an xtUML model.\u00a0 Applications that wish to interface are written in xtUML and operate on the metamodel as they would any other xtUML application model. Almost nobody access the xtUML metamodel with native hand-craft Java.\u00a0 Of course this is [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":779,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-765","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcements"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/posts\/765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/comments?post=765"}],"version-history":[{"count":1,"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/posts\/765\/revisions"}],"predecessor-version":[{"id":1553,"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/posts\/765\/revisions\/1553"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/onefact.net\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/media?parent=765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/categories?post=765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onefact.net\/wp-json\/wp\/v2\/tags?post=765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}