{"id":1862,"date":"2023-05-25T08:47:10","date_gmt":"2023-05-25T08:47:10","guid":{"rendered":"https:\/\/blog.amt.in\/?p=1862"},"modified":"2023-05-25T08:47:10","modified_gmt":"2023-05-25T08:47:10","slug":"insights-on-backbone-js","status":"publish","type":"post","link":"https:\/\/blog.amt.in\/index.php\/2023\/05\/25\/insights-on-backbone-js\/","title":{"rendered":"Insights on Backbone.js"},"content":{"rendered":"<p>Backbone.js\u00c2\u00a0is a\u00c2\u00a0JavaScript\u00c2\u00a0library with a\u00c2\u00a0RESTful\u00c2\u00a0JSON\u00c2\u00a0interface and is based on the\u00c2\u00a0Model\u00e2\u20ac\u201cview\u00e2\u20ac\u201cpresenter\u00c2\u00a0(MVP) application design paradigm. Backbone is known for being lightweight, as its only hard dependency is on one\u00c2\u00a0JavaScript library,\u00c2\u00a0Underscore.js, plus\u00c2\u00a0jQuery\u00c2\u00a0for use of the full library.\u00c2\u00a0It is designed for developing\u00c2\u00a0single-page web applications,\u00c2\u00a0and for keeping various parts of web applications (e.g. multiple clients and the server) synchronized.\u00c2\u00a0Backbone was created by\u00c2\u00a0Jeremy Ashkenas,\u00c2\u00a0who is also known for\u00c2\u00a0CoffeeScript\u00c2\u00a0and\u00c2\u00a0Underscore.js.<\/p>\n<p>When handling the\u00c2\u00a0DOM\u00c2\u00a0Backbone.js adopts an\u00c2\u00a0imperative programming\u00c2\u00a0style, in contrast with a\u00c2\u00a0declarative programming\u00c2\u00a0style (common in\u00c2\u00a0AngularJS\u00c2\u00a0using data-attributes).<\/p>\n<p>Trying to provide &#8220;the minimal set of data-structuring (models and collections) and user interface (views and URLs)&#8221;,\u00c2\u00a0leaves to the developer the choice of extensions for enhanced functionality. For example, one can use nested views with Backbone Layout Manager or model-view binding with ReSTbasis.<\/p>\n<p>Representational state transfer\u00c2\u00a0(REST) is a\u00c2\u00a0software architectural\u00c2\u00a0style that defines a set of constraints to be used for creating\u00c2\u00a0Web services. Web services that conform to the REST architectural style, called\u00c2\u00a0<i>RESTful<\/i>\u00c2\u00a0Web services, provide interoperability between computer systems on the\u00c2\u00a0internet. RESTful Web services allow the requesting systems to access and manipulate textual representations of\u00c2\u00a0Web resources\u00c2\u00a0by using a uniform and predefined set of\u00c2\u00a0stateless\u00c2\u00a0operations. Other kinds of Web services, such as\u00c2\u00a0SOAP\u00c2\u00a0Web services, expose their own arbitrary sets of operations.<\/p>\n<p>&#8220;Web resources&#8221; were first defined on the\u00c2\u00a0World Wide Web\u00c2\u00a0as documents or files identified by their\u00c2\u00a0URLs. However, today they have a much more generic and abstract definition that encompasses every thing, entity, or action that can be identified, named, addressed, handled, or performed, in any way whatsoever, on the Web. In a RESTful Web service, requests made to a resource&#8217;s\u00c2\u00a0URI\u00c2\u00a0will elicit a response with a\u00c2\u00a0payload\u00c2\u00a0formatted in\u00c2\u00a0HTML,\u00c2\u00a0XML,\u00c2\u00a0JSON, or some other format. The response can confirm that some alteration has been made to the resource state, and the response can provide\u00c2\u00a0hypertext\u00c2\u00a0links to other related resources. When\u00c2\u00a0HTTP\u00c2\u00a0is used, as is most common, the operations (HTTP methods) available are GET, HEAD, POST, PUT, PATCH, DELETE, CONNECT, OPTIONS and TRACE.<\/p>\n<p>By using a stateless protocol and standard operations, RESTful systems aim for fast performance, reliability, and the ability to grow by reusing components that can be managed and updated without affecting the system as a whole, even while it is running.<\/p>\n<p>The term\u00c2\u00a0representational state transfer\u00c2\u00a0was introduced and defined in 2000 by\u00c2\u00a0Roy Fielding\u00c2\u00a0in his doctoral dissertation.\u00c2\u00a0Fielding&#8217;s dissertation explained the REST principles that were known as the &#8220;HTTP object model&#8221; beginning in 1994, and were used in designing the\u00c2\u00a0HTTP\u00c2\u00a01.1 and\u00c2\u00a0Uniform Resource Identifiers\u00c2\u00a0(URI) standards.\u00c2\u00a0The term is intended to evoke an image of how a well-designed Web application behaves: it is a network of Web resources (a virtual state-machine) where the user progresses through the application by selecting resource identifiers such as http:\/\/www.example.com\/articles\/21 and resource operations such as GET or POST (application state transitions), resulting in the next resource&#8217;s representation (the next application state) being transferred to the end user for their use.<\/p>\n<p>The constraints of the REST architectural style affect the following architectural properties:<\/p>\n<ul>\n<li>performance in component interactions, which can be the dominant factor in user-perceived performance and network efficiency;<\/li>\n<li>scalability\u00c2\u00a0allowing the support of large numbers of components and interactions among components.<\/li>\n<li>simplicity of a uniform interface;<\/li>\n<li>modifiability of components to meet changing needs (even while the application is running);<\/li>\n<li>visibility of communication between components by service agents;<\/li>\n<li>portability of components by moving program code with the data;<\/li>\n<li>reliability in the resistance to failure at the system level in the presence of failures within components, connectors, or data.<\/li>\n<\/ul>\n<p>JavaScript Object Notation\u00c2\u00a0JSON\u00c2\u00a0is an\u00c2\u00a0open standard\u00c2\u00a0file format, and data interchange format, that uses\u00c2\u00a0human-readable\u00c2\u00a0text to store and transmit data objects consisting of\u00c2\u00a0attribute\u00e2\u20ac\u201cvalue pairs\u00c2\u00a0and\u00c2\u00a0array data types\u00c2\u00a0(or any other\u00c2\u00a0serializable\u00c2\u00a0value). It is a very common\u00c2\u00a0data\u00c2\u00a0format, with a diverse range of applications, such as serving as a replacement for\u00c2\u00a0XML\u00c2\u00a0in\u00c2\u00a0AJAX\u00c2\u00a0systems.<\/p>\n<p>JSON is a\u00c2\u00a0language-independent\u00c2\u00a0data format. It was derived from\u00c2\u00a0JavaScript, but many modern\u00c2\u00a0programming languages\u00c2\u00a0include code to generate and\u00c2\u00a0parse\u00c2\u00a0JSON-format data. The official Internet\u00c2\u00a0media type\u00c2\u00a0for JSON is\u00c2\u00a0<code>application\/json<\/code>. JSON filenames use the extension\u00c2\u00a0<code>.json<\/code>.<\/p>\n<p>The above is a brief about Backbone.js. Watch this space for more updates on the latest trends in Technology.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Backbone.js\u00c2\u00a0is a\u00c2\u00a0JavaScript\u00c2\u00a0library with a\u00c2\u00a0RESTful\u00c2\u00a0JSON\u00c2\u00a0interface and<\/p>\n","protected":false},"author":1,"featured_media":1864,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[416,30,7],"tags":[417,14,18],"class_list":["post-1862","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backbone-js","category-javascript","category-techtrends","tag-backbone-js","tag-javascript","tag-technology"],"_links":{"self":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/comments?post=1862"}],"version-history":[{"count":1,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1862\/revisions"}],"predecessor-version":[{"id":1863,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1862\/revisions\/1863"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media\/1864"}],"wp:attachment":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media?parent=1862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/categories?post=1862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/tags?post=1862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}