Why use backbone.js




















Model all that things are already "in the box" you just need to apply your own strategies of implementation. You typically don't deal with one instance of model. You need to group the models into collections. Collection similar to model are able fetch and persist itself, all it needs to know is the actual type of Model and URL.

This is where Backbone. Collection shies. You are keeping all models close together, if some model become destroyed the collection will be updated, so it always in consistent state.

With view is basically render your models as DOM structure. So, the Backbone. View is abstraction with primarily method - render. Backbone does not say, how exactly you are going to do that. Instead, it provides you convenient methods for listening to view events like clicks, focusout or any other DOM supported events. Inside the handlers you either could update related model or apply some changes to view parts, whatever. And finally Backbone. SPA's most popular example is GMail.

You browsing emails, writing and sending - without and page reloads. What's changing is only hash part of URL like inbox, sent, all. Router is handling hash change events and triggers registered handler. Inside the handler, you can initialize the corresponding application. Now, please let me know. How many times did you create read copy-n-paste the code for RESTful data persistence? How many times, you did you create code for validation? How many hours you spend for looking for some event listener provoking the bug in your app and hiding somewhere among If your answer, more that 2 - stop doing that.

Don't repeat yourself - reuse. There is a lot of interactivity on the Facebook site. Usually, if you like the post or add a comment, you will need to reload the entire page to reflect this change. However, developers can work around this by enabling partial reloads. That is, if the message is liked, the Like icon changes color to reflect the change, while the rest of the page remains the same.

Another good example of a React website is Netflix. Many newbies have trained at some point in their development by creating clones of Netflix.

This is how much the video streaming website has come to be associated with the library. Netflix uses it to render the back end of their web pages by preloading React, especially for the registration process. This has improved productivity. Salesforce is another example of React sites that were early adopters.

According to the Salesforce blog, this experience is more like a library than a framework, which drew them to the platform. In particular, because it is presentational and declarative, it can be conveniently integrated into existing projects. Backbone is a relatively simple framework that implements a lot of things for fast SPA development. But to use Backbone to its fullest, you will have to select additional tools: Marionette, Thorax, or Chaplin; Handlebars or Mustache; etc.

However, in most cases, the Backbone, Marionette, and Mustache packages will do the job. You also need to understand high-level MVC architecture in order to get the most out of Backbone. In the case of React, it is one of the most used JavaScript frameworks.

While we acknowledge the huge hype around React, we sincerely think React might be your first choice in case of building an advanced user interface. Although we only mentioned two web frameworks, professional developers should be open-minded as there is no best JavaScript framework. The choice should come out of your preferences, budget, goals, and plans.

Yet not sure what technology to choose? Consult your product with us. Ideamotive can provide you with technical consultancy and experts skilled in both technologies, matched with your product and your industry. The selection of the right technology can determine the success of the project. Do you want to make the right decision? Let us know , we will help you!

Robert is a co-founder and CEO of Ideamotive. Entrepreneur, who with passion spreads digital revolution all around the internet. Mentor and advisor at startup accelerators. Loves to learn and discover new business models. Dawid Karczewski 12 min read.

Dawid Karczewski 6 min read. Robert Krajewski 11 min read. Patrycja Mach 19 min read. Vue vs. Work with software development experts from Ideamotive's talent network. Rated 5. We use technical and analytics cookies to ensure that we give you the best experience on our website.

You can learn more about it in the Privacy Policy page. Looking for top React Developers? They are just a few clicks away. Hire React Developers. What is Backbone. The BackboneJS ecosystem contains: The Backbone library consists of events, models, collections, views, and a router. You can use templating engines like Mustache and jQuery-tmpl. Online BackPlug repository with many ready-made solutions for Backbone applications. Trunk generator command-line interface for creating trunk applications.

JavaScript libraries Marionette, Thorax, and Chaplin for developing the advanced architecture for Backbone applications. What is React? For communication between components, you can use Flux or a similar JS library.

React router for implementing routes. React Create App, a command-line interface to quickly set up your React project. Libraries based on Axios and Redux, JS libraries that allow you to organize the interaction with the server side. React Developer Tools for Chrome and Firefox browsers. React Native for developing native mobile apps for iOS and Android. Why should we compare them? Winner: React Performance Since its inception, React has changed the way front-end developers think about building web applications.

Winner: React Documentation Shawn Moore , CTO at Solodev , says: Backbone, known for its comprehensive technical documentation and clean code organization, broken down into meaningful JavaScripts, makes collaborative development easier.

Winner: React Popularity According to similartech. Winner: React Community State of JavaScript results show that React has gradually grown in popularity over the course of As per the Stack Overflow Developer Survey , the FB supported framework has gained significant points over the last year: React is the most popular product that one in four developers wants. Winner: React Easiness to learn React is completely beginner-friendly - guides help to cope with any difficulties arising in the learning process.

However, this can be easily learned for many reasons: tons of documentation and tutorials are available for free online. Backbone's creator has posted a detailed tutorial for this framework. It is about 7. It can easily get rid of the jQuery dependency. Backbone is based on Underscores. LayoutManager - provides more rendering options. Stickit and Epoxy - provides better model-to-view binding. Marionette - allows you to better structure your application code.

React - can be used as a view engine. The fact that views directly manipulate the DOM is much more complicated from a developer's point of view. This is why BackboneJS is not so popular with developers and they prefer the same Ember over it. React advantages Backward compatibility. Many things speed up the development process: Ready-made solutions Created components can be reused The ability to customize a web application using "Create React App" which is a starter kit provided by Facebook.

React disadvantages It's not quite a complete framework. It looks more like a library. Using the Flux architecture is not the wisest decision, as not many developers are used to it in the current scenario. On top of that, it uses JSX to render components, which developers hate. For some, the learning curve may seem steep. Integration with popular MVC frameworks requires a lot of customization.

So when should you use Backbone. Need to reduce the number of HTTP requests to the server Typically, most of the data in web applications contains the back end. Simplify complex user interface designs Backbone uses a single view to manage multiple nested views that use the required models. Examples: Trello Foursquare Basecamp Calendar Avoid spaghetti code Traditionally, Backbone has not pushed developers to separate the data and view layers into separate objects.

Dashboard or data visualization tools If you rely on data in some way, it is very important to display it in a clear and visually appealing way for the end-user.

E-commerce or retail websites Unlike standard business websites, e-commerce and retail sites contain many more complex elements such as APIs, filters, internal search engine, and so on. Enterprise web applications The component architecture is the reason why businesses like Walmart or AirBnB have chosen to incorporate React into their tech stacks. Messaging apps Since Facebook created and released React, it's a little surprising that its development team doesn't use it to build Messenger.

Personal or professional blogs with Gatsby While it is possible to create a website using React. Social network This point is closely related to the previous one because it is recommended to create social networks as single-page applications SPA. Netflix Another good example of a React website is Netflix. Salesforce Salesforce is another example of React sites that were early adopters. Summary Backbone is a relatively simple framework that implements a lot of things for fast SPA development.

Software React. Robert Krajewski. Trending articles. We believe in the power of sharing knowledge and expertise: Vue vs. Looking for a specific type of software development service? Angular Developers. Jump to this and get started. The web application development process has been evolving over the years.

Later, in web 2. That was a considerable improvement, and most of the pages served today use this approach. However, providing the website with even more responsiveness, speed, and enhanced user interaction requires bringing the page generation closer to the users in the browser rather than a remote server. However, these require extra plugins and are not as ubiquitous as JavaScript. Web applications nowadays require heavy use of JavaScript to generate content on the fly.

JS allows websites to render only content that changes without reloading the entire page on every request e. A common problem with extensive JS web applications developed is that they can become pretty messy quickly.

The lack of structure makes the code hard to maintain. Enters Backbone. It provides structure to organize the code and increase maintainability. Backbone is not the only framework like this; in fact, many JS frameworks offer similar benefits, like Ember.

It has a vibrant community.



0コメント

  • 1000 / 1000