With “Introduction to Backbone.js” workshop by Tikal’s Oren Farhi, attendees will learn to develop web application using Backbone.js framework. In addition to the basics of Backbone.js, attendees will get familiar with Twitter’s Bootstrap and will finally, connect to a live feed and develop a full working backbone.js application.
This gives a jump start to Backbone.js. The session would cover various topics like Introduction to backbone js / Why would you use Backbone js? / Dependencies for Backbone js. and Getting started with backbone MVC etc.
Migrating MVC to theFront-end usingBackbone JS.
Planbox is a single-page web application for Agile project management. It was built using the traditional MVC stack with CodeIgniter (PHP) and jQuery (Javascript). AJAX was heavily used to update DOM elements to offer a dynamic user experience. UX logic code quickly became spread across Javascript and PHP. The application code base quickly became unmanageable and scaling functionality became difficult. Things had to change.
A decision was made to change architecture: bring all the UX logic in the front-end, and turn the back-end into an engine in charge of business logic.
This talk is about this experience. How we moved the MVC stack from the back-end to the front-end. How we used Backbone JS as the foundation of our front-end framework and built on top. How the backend became a black-box with a Restful API. What lessons we learned, what benefits we gained, and what reflections we made about the future of MVC in Javascript.
With “Introduction to Backbone.js” workshop by Tikal’s Oren Farhi, attendees will learn to develop web application using Backbone.js framework. In addition to the basics of Backbone.js, attendees will get familiar with Twitter’s Bootstrap and will finally, connect to a live feed and develop a full working backbone.js application.
This gives a jump start to Backbone.js. The session would cover various topics like Introduction to backbone js / Why would you use Backbone js? / Dependencies for Backbone js. and Getting started with backbone MVC etc.
Migrating MVC to theFront-end usingBackbone JS.
Planbox is a single-page web application for Agile project management. It was built using the traditional MVC stack with CodeIgniter (PHP) and jQuery (Javascript). AJAX was heavily used to update DOM elements to offer a dynamic user experience. UX logic code quickly became spread across Javascript and PHP. The application code base quickly became unmanageable and scaling functionality became difficult. Things had to change.
A decision was made to change architecture: bring all the UX logic in the front-end, and turn the back-end into an engine in charge of business logic.
This talk is about this experience. How we moved the MVC stack from the back-end to the front-end. How we used Backbone JS as the foundation of our front-end framework and built on top. How the backend became a black-box with a Restful API. What lessons we learned, what benefits we gained, and what reflections we made about the future of MVC in Javascript.
A talk I was asked to give on the various options for building mobile applications / getting content onto mobile devices.
I chose to organize it as gradient surveying the spectrum from web to native, all the stuff in between. Unfortunately for native I've only had experience with iOS so I couldn't really speak towards the other platforms.
I do think that non native solutions can take care of 95% of the use cases, and this gap will only narrow as time goes on - I'm thinking back to early 2010 when cross platform SDKs like Appcelerator Titanium came onto the scene and how much has changed.
Go Fullstack: JSF for Public Sites (CONFESS 2013)Michael Kurz
Slides for session Go Fullstack: JSF for public sites by Michael Kurz held at the CONFESS 2013 in Vienna/Austria. This is an updated version of the same session held at CONFESS 2012 including JSF 2.2 view actions.
The examples for this session can be found at https://github.com/jsflive (see slides for details).
Go Fullstack: JSF for Public Sites (CONFESS 2012)Michael Kurz
Slides for session Go Fullstack: JSF for public sites by Michael Kurz held at the CONFESS 2012 in Leogang/Austria.
The examples for this session can be found at https://github.com/jsflive (see slides for details).
Video of this presentation can be found at http://goo.gl/EmkOP
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalCampDN
Рано или поздно каждый сайт нуждается в мобильной версии. Существует несколько способов реализации мобильной версии: адаптивный сайт, нативное приложение для iOS, Android etc.
В создании нативного приложения нам поможет отличная платформа под названием DrupalGap. DrupalGap - это платформа позволяющая создавать приложения для iOS и Android при помощи Drupal, PhoneGap, jQueryMobile, без непосредственного программирования на языке платформы.
Managing JavaScript Dependencies With RequireJSDen Odell
Learn how to manage and dynamically load JavaScript code files and their dependencies in a robust, scalable way within your large web sites and applications using the RequireJS library.
Backbone to React. What it says about awesome UI Code.Richard Powell
Why is writing React.JS code so simple? Why had writing Backbone.JS code become difficult for us at Server Density. What does this say us about good code vs great code?
In this presentation I cover 3 important concepts:
* Code simplicity vs complexity
* Code predictability
* Composability
Using real-world example I'll share what our 16 month journey migrating a large Backbone codebase, to a large React codebase has taught us.
A Basic tutorial for AngularJS basic features with examples:
2 way data binding
directives
Filters
Views
Providers
Routing
Examples of this presentation can be found here :
https://github.com/msalahat/AngularJS-1.3-Basic-Tutorial#angularjs-13-basic-tutorial
Single-page applications (SPAs) take user interaction with web applications to a new level. This means that more logic will be moved to the web browser and we have to become more familiar with JavaScript. AngularJS is one of the leading JavaScript frameworks when talking about SPAs. In this workshop I will present AngularJS in terms of problems it addresses and how it does this. Together we will develop a single-page application and we will go through how traditional concepts of web applications (data and state management, authentication) can be solved using the framework. Furthermore, we will dive into typical pitfalls when developing applications using AngularJS and will see how we can avoid them.
A talk I was asked to give on the various options for building mobile applications / getting content onto mobile devices.
I chose to organize it as gradient surveying the spectrum from web to native, all the stuff in between. Unfortunately for native I've only had experience with iOS so I couldn't really speak towards the other platforms.
I do think that non native solutions can take care of 95% of the use cases, and this gap will only narrow as time goes on - I'm thinking back to early 2010 when cross platform SDKs like Appcelerator Titanium came onto the scene and how much has changed.
Go Fullstack: JSF for Public Sites (CONFESS 2013)Michael Kurz
Slides for session Go Fullstack: JSF for public sites by Michael Kurz held at the CONFESS 2013 in Vienna/Austria. This is an updated version of the same session held at CONFESS 2012 including JSF 2.2 view actions.
The examples for this session can be found at https://github.com/jsflive (see slides for details).
Go Fullstack: JSF for Public Sites (CONFESS 2012)Michael Kurz
Slides for session Go Fullstack: JSF for public sites by Michael Kurz held at the CONFESS 2012 in Leogang/Austria.
The examples for this session can be found at https://github.com/jsflive (see slides for details).
Video of this presentation can be found at http://goo.gl/EmkOP
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalCampDN
Рано или поздно каждый сайт нуждается в мобильной версии. Существует несколько способов реализации мобильной версии: адаптивный сайт, нативное приложение для iOS, Android etc.
В создании нативного приложения нам поможет отличная платформа под названием DrupalGap. DrupalGap - это платформа позволяющая создавать приложения для iOS и Android при помощи Drupal, PhoneGap, jQueryMobile, без непосредственного программирования на языке платформы.
Managing JavaScript Dependencies With RequireJSDen Odell
Learn how to manage and dynamically load JavaScript code files and their dependencies in a robust, scalable way within your large web sites and applications using the RequireJS library.
Backbone to React. What it says about awesome UI Code.Richard Powell
Why is writing React.JS code so simple? Why had writing Backbone.JS code become difficult for us at Server Density. What does this say us about good code vs great code?
In this presentation I cover 3 important concepts:
* Code simplicity vs complexity
* Code predictability
* Composability
Using real-world example I'll share what our 16 month journey migrating a large Backbone codebase, to a large React codebase has taught us.
A Basic tutorial for AngularJS basic features with examples:
2 way data binding
directives
Filters
Views
Providers
Routing
Examples of this presentation can be found here :
https://github.com/msalahat/AngularJS-1.3-Basic-Tutorial#angularjs-13-basic-tutorial
Single-page applications (SPAs) take user interaction with web applications to a new level. This means that more logic will be moved to the web browser and we have to become more familiar with JavaScript. AngularJS is one of the leading JavaScript frameworks when talking about SPAs. In this workshop I will present AngularJS in terms of problems it addresses and how it does this. Together we will develop a single-page application and we will go through how traditional concepts of web applications (data and state management, authentication) can be solved using the framework. Furthermore, we will dive into typical pitfalls when developing applications using AngularJS and will see how we can avoid them.
Slides from my talk on #ruby-mg meeting.
Intro about how we in catars.me are using postgREST to create fast and simple API that can be represented with various mithril.js components.
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
Using Backbone.js to move state to the client-side and the benefits of using a JavaScript MVC framework.
Delivered at SuperMondays, Newcastle upon Tyne, on 26th September 2011.
MV* presentation frameworks in Javascript: en garde, pret, allez!Roberto Messora
HTML5 is the playing area, the strip, Javascript presentation frameworks are the fences and they are fierce and proud. In this presentation we will attend an interesting match between two of the emerging contenders in the MV* family: KnockoutJS and BackboneJS. We'll try to understand how they solve the same issues in modern web software development to better decide which one is suitable in our scenario.
Creating Single Page Web App using Backbone JSAkshay Mathur
This was presented during the workshop on the topic. The complete code of the app that was created during the workshop is available at Github https://github.com/mathurakshay/explore-venues
This DrupalCon 2019 Amsterdam talk provides a look beyond the world of PHP and Javascript. It explores how other languages such as Ruby, Java, Rust and Perl handle things and highlights some interesting features of those languages. Not all the things that other languages can do can be done in PHP or Javascript but the concepts and ideas can still be used.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
20. Backbone.js
• URL: http://backbonejs.org/
• Created by Jeremy Ashkenas in 2010, an author of
CoffeeScript
• Based on Underscore.js: http://backbonejs.org/
• Requires jQuery or Zepto
#20
30. Define the model and
the collection
// Define new model.
var InvoiceItemModel = Backbone.Model.extend({
calculateAmount: function() {
return this.get('price') * this.get('quantity');
}
});
// Define new collection object.
var InvoiceItemCollection = Backbone.Collection.extend({
model: InvoiceItemModel
});
#30
31. Define the view to
render the model
var InvoiceItemView = Backbone.View.extend({
// Define element tag name.
tagName: 'tr',
// Define template.
template: _.template($('#item-row-template').html()),
// Render the view.
render: function() {
var data = this.model.toJSON();
data.amount = this.model.calculateAmount();
$(this.el).html(this.template(data));
return this;
},
});
#31
32. Define the view to
render the collection
var InvoiceItemListView = Backbone.View.extend({
tagName: 'table',
template: _.template($('#item-table-template').html()),
// Render the view.
render: function() {
$(this.el).html(this.template());
_.each(this.collection.models, function(model, key)
{ this.append(model); }, this);
return this;
},
// Add an invoice item row to the table.
append: function(model) {
$(this.el).append(new InvoiceItemView({ model: model }).render().el);
}
});#32
45. REST in Backbone
var PostModel = Backbone.Model.extend({
// Override id attribute.
idAttribute: '_id',
// Define URL root to access model resource. Otherwise use
// url() method to provide full path to the model resource.
urlRoot: function() { return 'http://example.com/posts/'; }
});
var PostCollection = Backbone.Collection.extend({
model: PostModel,
// Define path to the collection resource.
url: function() { return 'http://example.com/posts/'; }
});
#45
46. REST in Backbone.js
// Fetches data into a model.
model.fetch();
// Saves a model.
model.save();
// Destroys a model.
model.destroy();
// Fetches data into a collection.
collection.fetch();
// Adds models to a collection.
collection.add(models);
// Removes specific models from collection.
collection.remove(models);
#46
47. Backbone module
• URL: http://drupal.org/project/backbone
• Provides models and collections for Drupal entities
via REST:
– Node: Node model
– All node: NodeIndex collection
– Arbitrary view: NodeView collection
• Works with both Services and RESTful Web Services
modules.
#47
48. Backbone module
// Create new NodeView collection.
var viewCollection = new
Drupal.Backbone.Collections.NodeView();
// Set Drupal View name.
viewCollection.viewName = 'backbone_example';
// Fetch data from the collection.
viewCollection.fetch({success: function() {
console.log(viewCollection.toJSON());
});
#48
51. Backbone and Drupal 8
• It is in core!
• Used for In-place editing issue:
http://drupal.org/node/1824500
• Used for layouts issue:http://drupal.org/node/1841584
• Used for toolbar issue:http://drupal.org/node/1860434
• META issue: http://drupal.org/node/1858368
#51
53. One more thing!
• Web services initiative
– REST in core
– Storage controllers
• Twig
– Templating engine
– Twig in core (Twig sandbox)
– Works both for PHP and JS
#53
58. Building Bridges, Connecting Communities
Evaluate this session at:
portland2013.drupal.org/node/1578.
Thank you!
What did you think?
Editor's Notes
Dear ladies and gentlemen. Welcome on the Backbone.js session.
My name is Vadim and I am a lead developer in Trellon. Currently I am writing Backbone.js CooBook for the PACKT Publishing. I am completing finale chapters and I hope it will be punished very soon. If you want to have a discount, please, contact me via email or twitter so I can provide you voucher.
Do you remember those lovely days when everybody was using DHTML pages with some JavaScript inside? For example there were so many scripts that checked if the form was correctly filled and showed dialog boxes if it is not.
Just remind how fun it was in 1995! Actually I started to use Internet in 1999, when I was still in school. There was no so many JavaScript powered web pages, but it was very cool to see snowflakes floating on the screen on the Merry Christmas eve! This is how JS was used at this time.
And then in 2000 Microsoft invented XMLHttpRequest. 5 years (!) had been passed since we called it AJAX. Incredible, but in 1998 people were using iframes to do the same!
In 2006 we first saw jQuery. It was awesome! It allowed do so many new things: * Use CSS selectors for DOM traversing * Do vent handling * Perform AJAX * Make animation * Achieve compatibility with old browsers It was amazing! BTW is is going to be jQuery conference in Portland soon: on June 13 & 14 this year.
And what we are working with in the 2013? There are so many new things that have appeared during recent years. Now it is time remind them.
Alright! * Now we have HTML5 that provides so many cool things. * Fore example in HTML5 there is Local Storage and if is used, your application can keep data in the browser storage when there is no Internet connection, and synchronize data with a remote server when connection is available. * Push state allows to update URL in the browser without need to reload the page.. Remember that before we used # in the URL to be able to change. And now not, this gives us some possibilities to create Search Engines compatible dynamic web apps. * Now we also have JS templating engines on the client-side that allows to unload the server and to transfer JSON instead of HTML code. * We also have REST (Representational State Transfer), which is an architectural style which implies that server deals with data, while client is involved into interaction with a user. With REST we can easily replace the server or the client with alternative server or a cleint.
And what about JS evolution seen last years.
First, clients is eacoming more complex be able to do much more things then ever before.
Second, they became more thick, may contain some business logic and, obviously, perform rendering. Server just stores data and checks access permissions. Also just want to note, that we are seeing this thin-to-thick clients transition once again. TODO: In Unix time there was X Windows System that allowed user to access server resources, and client was very thin.
And third, browsers executes JavaScript 10 times faster then it was 10 years ago. JS client applications works really fast now! And even performance on mobile devices is not bad.
But we still have some problems!
Right now typical AJAX code looks like this. And there is something wrong about it! Here we do: a) Event handling b) AJAX request c) Data rendering d) DOM updates That's to much for the single piece of code! This code looks the same as it was when developers where creating first desktop programs at the dawn of programming. Or the same as website development when there was no many MVC frameworks for the web.
Also, AJAX in Drupal. Have you ever deal with any JavaScript when building AJAX application with Drupal? There is cool form API, AHAH, we are defining AJAX settings in PHP arrays.
D'oh!
Let's do things properly! Can we? I mean use just JavaScript when it is intended to be used, and use proper MVC framework so there is no mess in the code. Yeah, there is a way!
Meet! ... Backbone... JS!
Whoohoo!
Backbone.js was created by Jeremy Ashkenas, author of the CoffeScript in 2010. Backbone.js is based on the Undersore.js library which provides many useful functions to work with arrays, collections, objects, events, and so on. Backbone.js requires jQuery or Zepto Zepto is 99% compatible with jQuety, which is smaller and faster but works only in modern browsers.
Let's speak about Backbone.js advantages. * It is minimalistic and easy integrates with other frameworks. * It is modular, which means you can use only required functionality. * It also has perfect OOP design and can be easily extended and overridden * Also there is a growing amount of Backbone.js extension. And now it is more then 100. * And there is a nice community. 90% of my issues I created on GitHub received feedback. This is really great. Community grows the day after the day. And I like it.
There are many similar frameworks, why we are speaking about Backbone.js now?
Because you should now how new frameworks appears. Look at this slide!
And finally Backbone.js was chosen by many world knows startups and websites. * Groupon Now!'s team decided their first product to be AJAX heavy, but still linkable and shareable. Despite they were completely new in Backbone, they found it's learning curve was incredible quick, so they were able to deliver the working product just in two weeks. * Foursquare used Backbone.js library to create model classes for the entities in foursquare (e.g. venues, checkins, users). They found that Backbone’s model classes provide a simple and lightweight mechanism to capture object data and state, complete with the semantics of classical inheritance. * LinkedIn Mobile used Backbone.js to create it's ts next-generation HTML5 mobile web app. Backbone made it easy to keep the app modular, organized and extensible so that it was possible to program the complexities of LinkedIn's user experience. * Airbnb is a community marketplace for users to list, discover, and book unique spaces around the world. Development team uses Backbone in many latest products. Recently they rebuilt mobile website with Backbone.js and Node.js tied together with a library they're calling Rendr.
Let's learn how to create backbone applications.
Backbone.js operates with following objects * Model contains data and provides business logic used in the application. * Collection is a set of models that can be processed in the loop and supports sorting and filtering. * View renders model or collection and interacts with the user. * Templates are used for separation HTML from JavaSript in the View. By default Undescore template engine is used, but it can be replaced with Twig, which is used in Drupal 8 or Mustache. * Router is similar to hook_menu. It allows to define a path and provide callbacks. * History is global object, which contains router that is currently in use. * Backbone objects such as Models, Collections, Views and Router implements Events object, they can provide own events and listen to events from other objects.
There are some differences in Backbone architecture and traditional MVC pattern. At the left there is a MVC structure . Here we see, that the Model updates the View seen by the user. User can perform actions which are handled by the Controller. Controller manipulates model data and can trigger business logic methods. Also Models is synchronized with a storage. At the right you can see Backbone.js structure. The main difference is that some of the controller functionality is implemented by the View, while other by the router. Typically view can listen model events and update DOM. View also listens to user events and updates model accordingly. Model is synchronized with a server using REST approach. Read ops are typically controlled by the Router, while write ops by the View.
Let's make some demo!
Let's start with some easy example. Here we just render the collection of models with Backbone.js.
Now we can move forward and learn how to add some cool features into our application.
Here is how we can use REST with our models and collections.
Here is how we can use REST with our models and collections.
Here is how we can use REST with our models and collections.
Here is how we can use REST with our models and collections.
Here is how we can use REST with our models and collections.
Some other cool things you will find in Backbone.js CookBook. I am working on final chapters and soon the book will be published. Contact me or leave your business card please, so I can provide you with a discount voucher.
Ok, now let's understand how Backbone deals with Drupal.
To pass data from Drupal to Backbone.js we can use following methods. Bootstrapping. This is the technique we saw above: we can create model and collection objects and populate them with data directly in JS code. In D7 we can pass data as settings into JS code. (TODO: add example). REST (Representational State Transfer) – is an architectural style for designing network applications which communicate between each other using HTTP protocol and passing data in JSON format or any other appropriate HTTP data type. In this case Backbone.js client and Drupal synchronizes data via REST. In Drupal 7 RESTful service can be implemented using Services / RESTful web-services modules. Backbone module provides more convenient way for Backbone client to communicate with Drupal. It is also based on the REST approach. Let's see how those approaches works in detail.
Let's understand how REST works. REST-style architectures consists of clients and servers. Client calls HTTP request method (POST, GET, PUT, DELETE) to perform CRUD (created, read, update, delete) operation over a resource, which can be either a collection or a single element. There can be a resource that represents multiple or single object. Depending on the request and resource type one or another operation can be performed. Following table shows it.
Here is how we can use REST with our models and collections.
Here is how we can use REST or our models and collections.
Here is one more way of dealing with Backbone.js in Drupal. There is Drupal module called Backbone that can provide node, comment and user entities on the client side where Backbone is running. It works via REST and integrates with both Services and RESTful web services modules. It also provides lists of users and nodes and even content of Drupal view to the Backbone app! This module just saves much time.
Let's see how it works. As we said before Backbone is pretty extensible, so we extend default models and collections. This example shows how we can get Drupal entities from the View and work with them as with Backbone Collection. We simply need to know view name and nothing else to get those entities. That's really cool! Thanks to ****, author of this module.
This module is still in development, which means that there will be many new features. Such as bootstrapping support, better views support. It will allow to do in-place content editing, drag and drop support to reorder things. And may be we will see D8 version.
Guess how Bakcbone.js is related to Drupal8?
It's in core! Along with other libraries such as jQuery or jQuery UI! It is event in D8 Wow! Some of the existing functionality is completely being rebuilt using Backbone.js: in-place editing, layouts, toolbar and many other. You can refer to the following links to understand what's going on in D8. You can also take part in the Drupal Code sprint at Friday.
One more thing we need to talk about. Drupal 8 is now much powerful then it was. It is based on Symphony and uses much more OOP then ever before. There can be controller class for operating with entities, configuration, permissions and other data stored in the system. Now logic is completely separated from the representation. And it is quite easy module to define REST resources to access it's data. So REST support is in core and will basically provided by any Drupal 8 module. Also Twig is in core too. Twig is a templating engine that is brought to Drupal 8 to provide better security and convenience when doing theming. There is also Twig implementation for JS.
This is very simplified scheme of how things will work in D8.
Let's imagine that we can use Twig templates on the client side. This means that we can easily re-do some of the front-end functionality with Backbone.js.
And it would work for mobile too.
Even more, we can wrapp such application in a mobile app with PhoneGap or Trigger.io. Those tools allows to build mobile application from HTML5 / CSS3 / JS.