This document summarizes some key aspects of the Marionette library:
- Marionette provides common design patterns for building large-scale Backbone applications with features like nested views, view rendering on model changes, and region-based view management.
- The library includes classes like ItemView, CollectionView, and CompositeView that automatically render views based on model or collection data. It also has a messaging bus for application-level events.
- The messaging bus includes an event aggregator for pub/sub messaging, commands for triggering actions, and a request/response system for requesting data without tight coupling between components.
Advanced Core Data - The Things You Thought You Could IgnoreAaron Douglas
So you've been using Core Data in your apps and think it's great and simple and super powerful. But now you're starting to run into problems with your apps that you can't explain and possibly even performance issues. This session will cover some of the more advanced topics about Core Data including doing things in the background (concurrency), caching data, migrating schemas, and dealing with undo management.
InterConnect 2016, OpenJPA and EclipseLink Usage Scenarios (PEJ-5303)Kevin Sutter
Presentation given at InterConnect 2016. With the introduction of EclipseLink as another JPA provider for WebSphere, this presentation will help with the usage and migration scenarios.
Advanced Core Data - The Things You Thought You Could IgnoreAaron Douglas
So you've been using Core Data in your apps and think it's great and simple and super powerful. But now you're starting to run into problems with your apps that you can't explain and possibly even performance issues. This session will cover some of the more advanced topics about Core Data including doing things in the background (concurrency), caching data, migrating schemas, and dealing with undo management.
InterConnect 2016, OpenJPA and EclipseLink Usage Scenarios (PEJ-5303)Kevin Sutter
Presentation given at InterConnect 2016. With the introduction of EclipseLink as another JPA provider for WebSphere, this presentation will help with the usage and migration scenarios.
Slides from my talk at ALT.NET Cork.
Unlike centralized version control systems, the distributed nature of Git allows you to be far more flexible in how developers collaborate on projects.In this session I'll take you through a quick tour of the essential git commands with some demos.We'll cover branching and merging strategies, pull requests ,working on open source (GitHub etc), git clients and git deployments to the cloud.
Slides from my last presentation at the Cape Town Meteor meetup, on optimising the UI, specifically for Hybrid apps and for Meteor JS hybrid apps.
The main thrust is really more about design patterns, and carefully controlling data management in your mobile app, with great examples of these patterns out in the real world.
see the mobile patterns video here : https://www.youtube.com/watch?v=e6WWX4TF3UI
Sql developer - Powerful Free tool for Developers and DBA'sNavneet Upneja
SQL Developer is a powerful tool for both Developers and DBA's. With every new version and release, Oracle is making sure that SQL Developer becomes more and more power ful that can bridge gap between DBA and a Developer. It is not longer just a Developer's Friend. Its horizon has increased many folds and I would encourage everyone to start using it. Its easy. Its Free. #Devops
This presentation is for enterprises that are considering adopting Scala. The author is managing editor of http://scalacourses.com, which offers self-paced online courses that teach Introductory and Intermediate Scala and Play Framework.
Lesson learned during new project base on SOA architecture. Technology used in our project:
- Symfony 2.3
- PHPUnit
- SoapUI
- RabbitMQ
- MySQL (Percona)
- Elasticsearch
- Jenkins
- Memcached
- Nagios
- New Relic
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSencha
Is your organization stuck on Oracle Forms technology? The time and cost of migration is only part of the risk associated with converting old logic, then you have to think about UI/UX and mobile platforms. In this session, you'll learn how 4Morphis automatically converts Oracle Forms into Ext JS based web and mobile applications, how the architecture can be maintained into the future, and how to approach projects so you can rapidly deliver value to your organization and users.
Unidirectional Data Flow Architecture (Redux) in SwiftSeyhun AKYUREK
Redux, simply makes your application’s state in single store object. So firing an action from your application/in view’s lifecycle state changes and your reducers for that action generate a new state. In this slideshow I'm explaining how to implement ReSwift in IOS Applications
Slides from my talk at ALT.NET Cork.
Unlike centralized version control systems, the distributed nature of Git allows you to be far more flexible in how developers collaborate on projects.In this session I'll take you through a quick tour of the essential git commands with some demos.We'll cover branching and merging strategies, pull requests ,working on open source (GitHub etc), git clients and git deployments to the cloud.
Slides from my last presentation at the Cape Town Meteor meetup, on optimising the UI, specifically for Hybrid apps and for Meteor JS hybrid apps.
The main thrust is really more about design patterns, and carefully controlling data management in your mobile app, with great examples of these patterns out in the real world.
see the mobile patterns video here : https://www.youtube.com/watch?v=e6WWX4TF3UI
Sql developer - Powerful Free tool for Developers and DBA'sNavneet Upneja
SQL Developer is a powerful tool for both Developers and DBA's. With every new version and release, Oracle is making sure that SQL Developer becomes more and more power ful that can bridge gap between DBA and a Developer. It is not longer just a Developer's Friend. Its horizon has increased many folds and I would encourage everyone to start using it. Its easy. Its Free. #Devops
This presentation is for enterprises that are considering adopting Scala. The author is managing editor of http://scalacourses.com, which offers self-paced online courses that teach Introductory and Intermediate Scala and Play Framework.
Lesson learned during new project base on SOA architecture. Technology used in our project:
- Symfony 2.3
- PHPUnit
- SoapUI
- RabbitMQ
- MySQL (Percona)
- Elasticsearch
- Jenkins
- Memcached
- Nagios
- New Relic
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSencha
Is your organization stuck on Oracle Forms technology? The time and cost of migration is only part of the risk associated with converting old logic, then you have to think about UI/UX and mobile platforms. In this session, you'll learn how 4Morphis automatically converts Oracle Forms into Ext JS based web and mobile applications, how the architecture can be maintained into the future, and how to approach projects so you can rapidly deliver value to your organization and users.
Unidirectional Data Flow Architecture (Redux) in SwiftSeyhun AKYUREK
Redux, simply makes your application’s state in single store object. So firing an action from your application/in view’s lifecycle state changes and your reducers for that action generate a new state. In this slideshow I'm explaining how to implement ReSwift in IOS Applications
Your ideas are really beautiful only inside your head, every time you try to share your idea the other person don't get it.
I want to teach you how to:
- generate many creative ideas
- share your ideas with others
- verify if they are valid
- get feedback on them properly
- present them
- create prototype of your application in a minute
If you are interested in the topics covered, further reading may include:
"Sketching User Experiences" by Bill Buxton
"Design is a Job" by Mike Monteiro
DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...NoSQLmatters
Apache Spark is a general data processing framework which allows you perform map-reduce tasks (but not only) in memory. Apache Cassandra is a highly available and massively scalable NoSQL data-store. By combining Spark flexible API and Cassandra performance, we get an interesting alternative to the Hadoop eco-system for both real-time and batch processing. During this talk we will highlight the tight integration between Spark & Cassandra and demonstrate some usages with live code demo.
AWS Simple Workflow: Distributed Out of the Box! - Morning@LohikaSerhiy Batyuk
Do you have a lot of complex jobs that you need to run as part of your application? Do they consist of multiple tasks and you wonder how to orchestrate them properly? Do you want to be able to easily scale their execution? Is availability of your workers important to you? If you answer “Yes” to these questions then AWS Simple Workflow is the right tool for you.
In this talk we will go through Amazon SWF and Java Flow Framework and you will see how to get a distributed job execution engine right out of the box. We will also compare SWF to alternative solutions, discuss real life experience, and of course enjoy a live demo.
The talk will be most useful to everyone who is interested in the design of distributed systems and is new to AWS SWF.
Spark is fast and general engine for large-scale data processing which can solve all of your problems.
… Or can it?
This talk will cover real-world issues encountered during migration of the existing product to Spark infrastructure.
Aimed at software engineers that just started to evaluate Spark or those who are already using it.
An introduction into Backbone.js – a lightweight MVC framework. Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
The world of JavaScript client-side frameworks is overflowing with contenders vying for the crown, but which one do you choose for your next project? Which one has what it takes?
In this talk we’ll look at the “Big 3”, AngularJS, Ember.js, and Backbone.js. We’ll compare them head to head, toe to toe. We’ll look at the pros and cons of each one. How do they handle form bindings? Talking to APIs? Code organization? Routing? Etc?
Who’ll come out victorious in this battle of the JavaScript frameworks, or will we all just come out bloodied and bruised on the other side? Guess we’ll find out!
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...Mikko Ohtamaa
This presentation is a RequireJS tutorial and targeted for front-end developers who need to maintain Javascript codebases larger than ~5 files. By using RequireJS for client-side Javascript modules, module dependency and minification one can have a project which is easier to maintain and you struggle less with everyday Javascript development tasks like debugging and deployment. The slides and tutorial were originally presented in HelsinkiJS June 2012 meet-up.
Why Backbone
Events
Models
Collections
Views
Routers
Summary
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2015.
http://www.ivanomalavolta.com
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2016.
http://www.ivanomalavolta.com
Backbone.js
This presentation has been developed in the context of the Mobile Applications Development course at the Computer Science Department of the University of L’Aquila (Italy).
http://www.di.univaq.it/malavolta
Mobile App Architectures & Coding guidelinesQamar Abbas
Better coding guidelines and application architectures
SOLID principles by Uncle Bob
Model View Controller
Model View Presenter,
Model View ViewModel
Best practices for Android developers
Best practices for iOS developers
Download original slides http://bit.ly/2HNCcMX
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2014.
http://www.ivanomalavolta.com
Slides of a talk of a seminars series I gave at WebRatio in January 2014.
I implemented many best practices and advices in this presentation in a generic app template available here: https://github.com/iivanoo/cordovaboilerplate
Highly Scalable User Experience Design: Vaadin and MagnoliaMagnolia
In this session, attendees will learn how Magnolia uses Vaadin to implement a dynamic and extensible user interface for its products and custom applications.
In this presentation, I presented how to build an angular JS Application with SPA in mind and also make sure you use up all the available concepts to create versatile and creative web application with less boilerplate javascript code.
Single Page Applications - Desert Code Camp 2012Adam Mokan
Slides from my presentation on Single-Page Applications at Desert Code Camp 2012.
The event was held on November 17th, 2012 at Chandler-Gilbert Community College.
http://nov2012.desertcodecamp.com/session/565
Dreamforce 2017 - Up close and personal with Lightning Experience as Platformandyinthecloud
Lightning Experience is not just a pretty face, it’s a sophisticated application container for modern web applications. Understand how to leverage Lightning's numerous extensibility to build Lightning applications like a pro without reinventing the wheel. We will look in detail at Lightning, Actions, Action Overrides, Utility Bar and the rich features of the multi-tabbed Lighting Console App.
The Model View ViewModel (MVVM) is an architectural pattern originated by Microsoft as a specialization of the Presentation Model (Martin Fowler). Similar to MVC, MVVM is suitable for client applications (Xaml-based, Xamarin, SPA, ...) because it facilitates a clear separation between the UI and the Business Logic. Examples with WPF, MvvmCross, AngularJs. It also contains solutions for common use cases.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
Water billing management system project report.pdfKamal Acharya
Our project entitled “Water Billing Management System” aims is to generate Water bill with all the charges and penalty. Manual system that is employed is extremely laborious and quite inadequate. It only makes the process more difficult and hard.
The aim of our project is to develop a system that is meant to partially computerize the work performed in the Water Board like generating monthly Water bill, record of consuming unit of water, store record of the customer and previous unpaid record.
We used HTML/PHP as front end and MYSQL as back end for developing our project. HTML is primarily a visual design environment. We can create a android application by designing the form and that make up the user interface. Adding android application code to the form and the objects such as buttons and text boxes on them and adding any required support code in additional modular.
MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software. It is a stable ,reliable and the powerful solution with the advanced features and advantages which are as follows: Data Security.MySQL is free open source database that facilitates the effective management of the databases by connecting them to the software.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
6. • Simple :)
• Too easy to go in wrong direction
• No main Application class
• No nesting of views
• No layouts (header/footer/sidebar/content etc)
• Method render does nothing by default
• Memory management
CONS
8. • Has a bunch of common design patterns
• Lowers amount of standard code because of view
types
• Has nested views
• Manages memory
• Combines event-driven architecture and event
aggregator
15. Marionette.ItemView
• View is rendered based on model data
• “model” attribute
• “template” attribute
• is rendered automatically
• modelEvents – view methods are called on model
events
16. UI OBJECT
UI hash in the view maps UI elements by their jQuery
selectors
17. Marionette.CollectionView
• View is rendered based on Collection data
• Automatic re-render on add/remove/reset/etc events
• childView attribute is automatically instantiated and
linked with model
23. REGION
• View intended to manage the lifecycle of other views
• Renders view instance and adds it to DOM
• It’s a bridge between DOM and backbone
• Nested regions - LayoutView class
28. MESSAGING BUS
• Event - app-level events
• Commands - run commands
• Request/Response - request of specific
values/states
29. EVENT AGGREGATOR
• pub/sub
• trigger/bind
• Notifies the app about events in different parts
(“user:logged-in”)
• App level events are like global function calls
• Different event types, namespaces define the
semantics
31. COMMANDS
Commands are used to make any component
tell another component to perform an action
without a direct reference to it.
• Subscribe for a command - only once
• Example: Save command
• cmd-s
• Clicking a toolbar button
• Choosing File => Save from the menubar
33. REQUEST / RESPONSE
• Request Response is a means for any component
to request information from another component
without being tightly coupled.
• For app level data (e. g. shopping cart status)
• Requests have intention
• The requests are 'one-to-one'
35. Backbone.Radio.channel
// Get a reference to the channel named 'user'
var userChannel = Backbone.Radio.channel('user');
userChannel.on('some:event', function() {
console.log('An event has happened!');
});
userChannel.reply('some:request', 'food is good');
userChannel.trigger('some:event');
Combination of Backbone.Events and
Radio.Requests
36. SUMMARY
MESSAGING BUS
• Application.vent - instance of Backbone.Wreqr.EventAggregator.
pub/sub.
• Application.commands - instance of Backbone.Wreqr.Commands.
Subscribe to command execution - once
• Application.reqres - instance of
Backbone.Wreqr.RequestResponse. Only one subscriber
performs the request
• Backbone.Radio.channel
37. • Child views - Backbone.BabySitter
• Marionette.RegionManager
• Marionette.TemplateCache
OTHER COOL THINGS FOR
VIEWS MANAGEMENT
all JS frameworks have pros & cons
no silver bullet
choose the right tool depending on task
-
-
-
-
Application wrapper for a plain Javascript object with a start() method. This can be used to accomplish tasks before the rest of your application begins.
MyApp.on("before:start", function(options){
options.moreData = "…";
});
MyApp.on("start", function(options){
if (Backbone.history){
Backbone.history.start();
}
});
--
Application regions
This feature is deprecated. Instead of using the Application as the root of your view tree, you should use a Layout View. To scope your Layout View to the entire document, you could set its el to 'body'.
V2.0
Modularity is ok
-
Several types of views; bb has the only one – not flexible
Auto render on model change – will show later
Close() method helps avoiding memory leaks
Underscore – by default
Handlebars templates have logic
Template helpers help making templates smarter
When this attribute is present - its contents will be mixed in to the data object - from the
serializeData method. Create helper methods that can be called from within the templates.
As calculated values.
Prefix the data you need with "this". Gives you all of the methods and attributes of the serialized data object, including the other helper methods.
So helper methods can be called from the templates
For one element
Is cached attributes which are mapped to jq object (alias)
To access the same UI element more than once in your view's code.
simply reference it by this.ui.alias
For collection’s add/remove/sort – renders through documentFragment
loop through all of the models in the collection, render each of them using a specified childView,
then append the results of the child view's el to the collection view's el.
By default the CollectionView will maintain a sorted collection's order
in the DOM. This behavior can be disabled by specifying {sort: false} on initialize.
-
Collection with a template:
- both a branch and leaf in a tree structure
- a collection needs to be rendered within a wrapper template
Similar to the events hash, views can specify a configuration hash for collections and models.
how to deal with zombie views
How many alerts can we see?
Instance 1 of zombieView out of scope after the 2nd is created
JS garbage collector can delete 1st instance -> zombieView should get inactive and stop listening to model events
But we get 2 alerts!
Due to model event listener: this.render -> ‘on’ callback => model saves direct link to view instance
So both views react to model events
Solve that: in bb – set method close(), clean/unbind/stopListening
In Marionette: regions!
---
Вопрос: сколько alert() мы увидим?
Поскольку мы используем переменную zombieView для обоих экземпляров представления, первый экземпляр окажется вне области видимости сразу после создания второго экземпляра. Это даст возможность «сборщику мусора» JavaScript уничтожить первый экземпляр, в результате чего представление утратит активность и перестанет реагировать на события изменения модели. Тем не менее если мы запустим этот код, то увидим окно дважды!
Эта проблема вызвана привязкой события модели в методе initialize view. Каждый раз, когда мы передаем this.render в качестве функции callback методу on модели, сама модель получает прямую ссылку на экземпляр view. Наличие этой ссылки в модели приводит к тому, что при присваивании нового экземпляра представления переменной zombieView первое представление остается в области видимости.
Поскольку второе представление появляется в области видимости в тот момент, когда первое представление продолжает находиться в ней, оба представления реагируют на изменение данных модели.
Regions provide consistent methods to manage, show and destroy views.
We bind it to DOM el and it renders view there
Using the LayoutView class you can create nested regions.
auto destroy()
-
You can also add regions via LayoutViews
To scope your Layout View to the entire
document, you could set its el to 'body'. This might look something like the following:
var RootView = Marionette.LayoutView.extend({
el: 'body',
regions: {menu: ‘#menu’, ….}
});
attach an instance of the RootView to your Application instance.
app.rootView = new RootView();
Event-driven architecture
bb.Wreqr – old – deprecated in M3
bb.Radio – isn’t a dependency yet; small snippet to include
--
Clone this repository or install via Bower or npm.
bower install backbone.radio
npm install backbone.radio
A shim to replace Backbone.Wreqr with Backbone.Radio in Marionette. Requires Marionette v2.1+
software architecture model for communicating between two systems. The idea is that instead of referencing each other directly, system components are able to send messages through a shared mediator object.
3 types of events
More complex events comparing to bb
--
Application.vent - instance of Backbone.Wreqr.EventAggregator. pub/sub.
Application.commands - instance of Backbone.Wreqr.Commands. Подписаться на исполнение команды - 1 раз
Application.reqres - instance of Backbone.Wreqr.RequestResponse. Исполняет запрос только один подписчик
Mediator object
Passively sharing info between the pieces of an app when events occur
Global – we can go the wrong way
Add namespaces to events – help sorting things out
Application.vent - instance of Backbone.Wreqr.EventAggregator.
Command pattern
Application.commands – instance of Backbone.Wreqr.Commands
During 2015, Commands were deprecated from Backbone.Radio as part of their 1.0.0 release.
From a code level, they're simply a request that doesn't return a value, so feel free to keep any existing code, but change command to request and comply to reply.
Commands do not add any functionality on top of events; instead, they provide a semantic distinction and enforce simpler logic.
setHandler; execute;
--
var commands = new Backbone.Wreqr.Commands();
commands.setHandler("foo", function(){
console.log("the foo command was executed");
});
commands.execute(“foo");
Requests the status of some object in app
Application.reqres – instance of Backbone.Wreqr.RequestResponse.
* The difference between Events and Requests is that Requests have intention. Requests are asking for a very specific thing to occur.
* The requests are 'one-to-one,' so you cannot have multiple 'listeners' to a single request
* Easy to misuse - like other global objects
--
_.extend(myView, Backbone.Radio.Requests);
---
var reqres = new Backbone.Wreqr.RequestResponse();
// Set up an object to reply to a request. In this case,
// whether or not its visible.
myObject.reply('visible', this.isVisible);
// Get whether it's visible or not.
var isViewVisible = myObject.request('visible');
Radio vs wreqr: channels
A Channel is simply an object that has Backbone.Events and Radio.Requests mixed into it: it's a standalone message bus comprised of both systems.