(Ampersand’s form component was used for this.) After completing this step, you are directed to the game board. When you open my game app, you will see a simple form to enter players’ names. Jasmin is a testing framework that covers most tasks.Jade functions as an app template engine.They are not coupled with Ampersand, but work well with it: I would also like to note two components that I used in my application. The game logic is developed by Ampersand on the JS side : Sinatra is responsible only for authentication and data/statistics saving. Using this documentation, I created a tic-tac-toe game with Ampersand UI and Sinatra API available here: Also, the application has a pretty nice UI: Sample Application The sample contains a fake API that mocks HTTP responses from the client side and allows you to imagine interaction with real RESTful services. The program contains enough base structure for you to easily understand how to follow best practices when creating applications. This will lead you through instructions on how to generate a sample application to play with. Install Ampersand: npm install ampersand -g To create an app with Ampersand yourself, you need to install the npm. I would also like to emphasize Ampersand’s excellent documentation and scaffolding features that allow you to quickly generate required components. Ampersand, on the other hand, is still being actively developed. Adding new components while maintaining full backward compatibility would be quite difficult. It became popular a few years ago, and many projects still use it. You can also more easily decouple the strong binding of components and introduce new modules.įurthermore, Backbone has not been modified much recently. Ampersand-view includes subview creation, an equivalent to Marionette’s CollectionView. Ampersand-state does not have Backbone’s properties problem because it forces you to define them in the initial state. ampersand-router is similar to Backbone’s router.Īmpersand out of the box solves most of the issues that Backbone has, and therefore it may be worth the time and effort to switch legacy code from Backbone to Ampersand.ampersand-form-view simplifies form creation, as the name implies.ampersand-view is similar to Backbone’s views.It extends ampersand-collection with methods to work with RESTful services. ampersand-rest-collection is like ampersand-state->ampersand-model.ampersand-collection is similar to Backbone’s collections.ampersand-model extends ampersand-state by adding methods to work with RESTful services.This helps you avoid issues when debugging. It’s similar to Backbone’s model, but it forces you to define properties and their types in the initial state. ampersand-state is the most significant change.Although Ampersand and Backbone share similar components, Ampersand does have some differences: The creators chose to base their framework on Backbone because they wanted a stable, well-tried, popular basis for their product. In other words, you can use Ampersand as the main UI framework for your web application, or for only one part or module, like the wizard. The creators also describe Ampersand as “highly modular” and “loosely coupled.” If you don’t need a certain component, you just don’t use it. The creators of this product, &yet, describe Ampersand as a “non-frameworky framework.” This means you are able to assemble the framework from the components they provide. If you are familiar with Backbone, you will find many similar components. What is Ampersand, and how does it work?Īmpersand can be seen as a successor or an improved version of Backbone. It is well-equipped and developer-friendly, so some of its approaches can be helpful when improving existing frameworks or creating your own. I encourage those who interact with the client side to try Ampersand. In this article, I provide an overview of Ampersand.js, a more or less modern framework, that could be a solution to many such problems. A guide that explains using the framework according to best practices/approaches may also be absent. When trying new, modern frameworks, developers often face problems like poor official documentation and a lack of real-world examples. Ampersand.js: An Alternative to Backbone.js
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |