{"id":44,"date":"2016-02-23T18:46:07","date_gmt":"2016-02-23T18:46:07","guid":{"rendered":"http:\/\/zanavu.com\/blog\/?p=44"},"modified":"2016-02-23T18:46:07","modified_gmt":"2016-02-23T18:46:07","slug":"model-driven-apis-and-service","status":"publish","type":"post","link":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/","title":{"rendered":"Model driven APIs and service"},"content":{"rendered":"<p>In the past few months, I had been building a set of services using <a href=\"http:\/\/nodejs.org\">nodejs<\/a>. After having dabbled in JavaScript over the past year, I was looking for a way to build service side code as well with REST APIs. voila! I discovered nodejs which fits the bill. There are many tutorials online for how to use nodejs (more on that later).\u00a0One common problem\u00a0was that I was creating similar boiler plate code for routing, binding, method call, and storage.\u00a0I was factoring these parts out into separate layers &#8211;\u00a0<em>modules<\/em> in nodejs. Still I wanted a simpler model. Then I discovered <a href=\"https:\/\/strongloop.com\/\">strong loop<\/a>.<\/p>\n<p>StrongLoop provides a simple framework to define the\u00a0<em>model<\/em> which can consist of one or more objects with properties attached to them. Once I have these models with very limited wiring, I have a set of standard REST methods exposed from strong loop. This is cool! Further more the REST methods automatically create, store, and retrieve results from in-memory store. (I found it a bit challenging to deploy strong loop and have to follow their steps methodically.)<\/p>\n<p>Soon we need a way to persist the data. No worries! Strongloop comes with database connectors for standard databases including &#8211; mongodb, sql server, oracle, mysql, etc. That database binding was also not painful to establish. Yes the operational deployment to AWS or Azure is not simple for me. I had to wade through many documents to deal with the linux variations. Nonetheless, the model driven API model is here. I was also able to easily extend the standard methods and add new methods to work with the model objects.<\/p>\n<p>I highly recommend folks to use strong loop for easy prototyping. You will have a bit of learning curve, which the<a href=\"https:\/\/strongloop.com\/node-js\/api-platform\/\"> StrongLoop documentation<\/a>\u00a0can help you with. For big production operations, one has to obtain license from StrongLoop (Which is now part of IBM). Give it a try.<\/p>\n<p>PS: I am not affiliated with StrongLoop or IBM. I happen to be an enthusiastic user of nodejs and I find StrongLoop appealing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the past few months, I had been building a set of services using nodejs. After having dabbled in JavaScript over the past year, I was looking for a way to build service side code as well with REST APIs. voila! I discovered nodejs which fits the bill. There are many tutorials online for how [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[3,11],"class_list":["post-44","post","type-post","status-publish","format-standard","hentry","category-technology","tag-learning","tag-techstuff"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Model driven APIs and service - Bright Possibilities<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Model driven APIs and service - Bright Possibilities\" \/>\n<meta property=\"og:description\" content=\"In the past few months, I had been building a set of services using nodejs. After having dabbled in JavaScript over the past year, I was looking for a way to build service side code as well with REST APIs. voila! I discovered nodejs which fits the bill. There are many tutorials online for how [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/\" \/>\n<meta property=\"og:site_name\" content=\"Bright Possibilities\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-23T18:46:07+00:00\" \/>\n<meta name=\"author\" content=\"Murali\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Murali\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/\"},\"author\":{\"name\":\"Murali\",\"@id\":\"https:\/\/zanavu.com\/notes\/#\/schema\/person\/4bea3834a6b3e94e965b8b15d3a0a022\"},\"headline\":\"Model driven APIs and service\",\"datePublished\":\"2016-02-23T18:46:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/\"},\"wordCount\":348,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/zanavu.com\/notes\/#organization\"},\"keywords\":[\"Learning\",\"TechStuff\"],\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/\",\"url\":\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/\",\"name\":\"Model driven APIs and service - Bright Possibilities\",\"isPartOf\":{\"@id\":\"https:\/\/zanavu.com\/notes\/#website\"},\"datePublished\":\"2016-02-23T18:46:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zanavu.com\/notes\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Model driven APIs and service\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zanavu.com\/notes\/#website\",\"url\":\"https:\/\/zanavu.com\/notes\/\",\"name\":\"Bright Possibilities\",\"description\":\"Welcome to the World of Possibilities\",\"publisher\":{\"@id\":\"https:\/\/zanavu.com\/notes\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zanavu.com\/notes\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/zanavu.com\/notes\/#organization\",\"name\":\"Bright Possibilities\",\"url\":\"https:\/\/zanavu.com\/notes\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zanavu.com\/notes\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/zanavu.com\/notes\/wp-content\/uploads\/2016\/02\/aupic1.bmp\",\"contentUrl\":\"https:\/\/zanavu.com\/notes\/wp-content\/uploads\/2016\/02\/aupic1.bmp\",\"width\":261,\"height\":243,\"caption\":\"Bright Possibilities\"},\"image\":{\"@id\":\"https:\/\/zanavu.com\/notes\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/zanavu.com\/notes\/#\/schema\/person\/4bea3834a6b3e94e965b8b15d3a0a022\",\"name\":\"Murali\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zanavu.com\/notes\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e1bd605071dc5d22ac2ad578e820c974?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e1bd605071dc5d22ac2ad578e820c974?s=96&d=mm&r=g\",\"caption\":\"Murali\"},\"sameAs\":[\"https:\/\/www.hemocoel.com\"],\"url\":\"https:\/\/zanavu.com\/notes\/author\/murali\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Model driven APIs and service - Bright Possibilities","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/","og_locale":"en_US","og_type":"article","og_title":"Model driven APIs and service - Bright Possibilities","og_description":"In the past few months, I had been building a set of services using nodejs. After having dabbled in JavaScript over the past year, I was looking for a way to build service side code as well with REST APIs. voila! I discovered nodejs which fits the bill. There are many tutorials online for how [&hellip;]","og_url":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/","og_site_name":"Bright Possibilities","article_published_time":"2016-02-23T18:46:07+00:00","author":"Murali","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Murali","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/#article","isPartOf":{"@id":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/"},"author":{"name":"Murali","@id":"https:\/\/zanavu.com\/notes\/#\/schema\/person\/4bea3834a6b3e94e965b8b15d3a0a022"},"headline":"Model driven APIs and service","datePublished":"2016-02-23T18:46:07+00:00","mainEntityOfPage":{"@id":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/"},"wordCount":348,"commentCount":0,"publisher":{"@id":"https:\/\/zanavu.com\/notes\/#organization"},"keywords":["Learning","TechStuff"],"articleSection":["Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/","url":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/","name":"Model driven APIs and service - Bright Possibilities","isPartOf":{"@id":"https:\/\/zanavu.com\/notes\/#website"},"datePublished":"2016-02-23T18:46:07+00:00","breadcrumb":{"@id":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zanavu.com\/notes\/2016\/02\/23\/model-driven-apis-and-service\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zanavu.com\/notes\/"},{"@type":"ListItem","position":2,"name":"Model driven APIs and service"}]},{"@type":"WebSite","@id":"https:\/\/zanavu.com\/notes\/#website","url":"https:\/\/zanavu.com\/notes\/","name":"Bright Possibilities","description":"Welcome to the World of Possibilities","publisher":{"@id":"https:\/\/zanavu.com\/notes\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zanavu.com\/notes\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/zanavu.com\/notes\/#organization","name":"Bright Possibilities","url":"https:\/\/zanavu.com\/notes\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zanavu.com\/notes\/#\/schema\/logo\/image\/","url":"https:\/\/zanavu.com\/notes\/wp-content\/uploads\/2016\/02\/aupic1.bmp","contentUrl":"https:\/\/zanavu.com\/notes\/wp-content\/uploads\/2016\/02\/aupic1.bmp","width":261,"height":243,"caption":"Bright Possibilities"},"image":{"@id":"https:\/\/zanavu.com\/notes\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/zanavu.com\/notes\/#\/schema\/person\/4bea3834a6b3e94e965b8b15d3a0a022","name":"Murali","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zanavu.com\/notes\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e1bd605071dc5d22ac2ad578e820c974?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e1bd605071dc5d22ac2ad578e820c974?s=96&d=mm&r=g","caption":"Murali"},"sameAs":["https:\/\/www.hemocoel.com"],"url":"https:\/\/zanavu.com\/notes\/author\/murali\/"}]}},"_links":{"self":[{"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/posts\/44","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/comments?post=44"}],"version-history":[{"count":1,"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/posts\/44\/revisions"}],"predecessor-version":[{"id":45,"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/posts\/44\/revisions\/45"}],"wp:attachment":[{"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/media?parent=44"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/categories?post=44"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zanavu.com\/notes\/wp-json\/wp\/v2\/tags?post=44"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}