SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
MARIONETTE
SHALL WE DANCE?
KSENIA REDUNOVA
BACKBONE.JS
PROS & CONS
• Simple & flexible
• Event-driven architecture
• Model/Collection implementation for REST
• MVW
PROS
• 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
MARIONETTE
Complex lib intended for large-scale apps development
• 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
Marionette.Application
• App management - start, stop, and other
functionality
• Modularity
• “application” is just an object
MODULE
Is deprecated!
use AMD/CommonJS/ES6 modules
MARIONETTE VIEW MAGIC
MARIONETTE VIEW MAGIC
• Rendering connected to model changes
• Template management
• Has UI object
• Has .close() method
• Extensible
TEMPLATE HELPERS
TEMPLATE HELPERS
Marionette.ItemView
• View is rendered based on model data
• “model” attribute
• “template” attribute
• is rendered automatically
• modelEvents – view methods are called on model
events
UI OBJECT
UI hash in the view maps UI elements by their jQuery
selectors
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
COLLECTION VIEWS
Marionette.CompositeView
• CompositeView = CollectionView + template
• combination of ItemView and CollectionView
• renders elements of Backbone.Collection inside
wrapper
• inherits Marionette.CollectionView
MODEL EVENTS & COLLECTION EVENTS
ZOMBIE APOCALYPSE
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
DISPLAY A VIEW
IN A REGION
LAYOUT
• Unlike ItemView it contains regions
• Is good to be a widget with several views
LAYOUT
BACKBONE.WREQR
& BACKBONE.RADIO
MESSAGING BUS
• Event - app-level events
• Commands - run commands
• Request/Response - request of specific
values/states
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
EVENT AGGREGATOR
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
COMMANDS
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'
REQUEST / RESPONSE
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
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
• Child views - Backbone.BabySitter
• Marionette.RegionManager
• Marionette.TemplateCache
OTHER COOL THINGS FOR
VIEWS MANAGEMENT
LINKS
MarionetteJS.com (Derick Bailey)
BackboneRails.com (Brian Mann)
“Marionette: gentle introduction” by David Sulc
http://benmccormick.org/2015/01/26/backbone-radio/
THANK YOU!

Weitere ähnliche Inhalte

Was ist angesagt?

AAI 2235-OpenJPA and EclipseLink Usage Scenarios Explained
AAI 2235-OpenJPA and EclipseLink Usage Scenarios ExplainedAAI 2235-OpenJPA and EclipseLink Usage Scenarios Explained
AAI 2235-OpenJPA and EclipseLink Usage Scenarios ExplainedKevin Sutter
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAidan Casey
 
Kudu voodoo slideshare
Kudu voodoo   slideshareKudu voodoo   slideshare
Kudu voodoo slideshareAidan Casey
 
Optimizing Access with SQL Server
Optimizing Access with SQL ServerOptimizing Access with SQL Server
Optimizing Access with SQL ServerPRPASS Chapter
 
The 7 deadly sins of micro services
The 7 deadly sins of micro servicesThe 7 deadly sins of micro services
The 7 deadly sins of micro servicesAidan Casey
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive uiPaul van Zyl
 
Indic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvmIndic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvmIndicThreads
 
The 7 deadly sins of micro services
The 7 deadly sins of micro servicesThe 7 deadly sins of micro services
The 7 deadly sins of micro servicesAidan Casey
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETAlan Hecht
 
Sql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA'sSql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA'sNavneet Upneja
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprisesMike Slinn
 
KnowItPresentation
KnowItPresentationKnowItPresentation
KnowItPresentationChuan Su
 
SOA with PHP and Symfony
SOA with PHP and SymfonySOA with PHP and Symfony
SOA with PHP and SymfonyMichalSchroeder
 
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSencha
 

Was ist angesagt? (20)

AAI 2235-OpenJPA and EclipseLink Usage Scenarios Explained
AAI 2235-OpenJPA and EclipseLink Usage Scenarios ExplainedAAI 2235-OpenJPA and EclipseLink Usage Scenarios Explained
AAI 2235-OpenJPA and EclipseLink Usage Scenarios Explained
 
OpenFaaS
OpenFaaSOpenFaaS
OpenFaaS
 
Intro to openfaas
Intro to openfaasIntro to openfaas
Intro to openfaas
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Uniqueness of java
Uniqueness of javaUniqueness of java
Uniqueness of java
 
Kudu voodoo slideshare
Kudu voodoo   slideshareKudu voodoo   slideshare
Kudu voodoo slideshare
 
Optimizing Access with SQL Server
Optimizing Access with SQL ServerOptimizing Access with SQL Server
Optimizing Access with SQL Server
 
The 7 deadly sins of micro services
The 7 deadly sins of micro servicesThe 7 deadly sins of micro services
The 7 deadly sins of micro services
 
Flywaydb
FlywaydbFlywaydb
Flywaydb
 
Laravel session 1
Laravel  session 1Laravel  session 1
Laravel session 1
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
Indic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvmIndic threads pune12-typesafe stack software development on the jvm
Indic threads pune12-typesafe stack software development on the jvm
 
The 7 deadly sins of micro services
The 7 deadly sins of micro servicesThe 7 deadly sins of micro services
The 7 deadly sins of micro services
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NET
 
Sql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA'sSql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA's
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
 
Flyway
FlywayFlyway
Flyway
 
KnowItPresentation
KnowItPresentationKnowItPresentation
KnowItPresentation
 
SOA with PHP and Symfony
SOA with PHP and SymfonySOA with PHP and Symfony
SOA with PHP and Symfony
 
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen PaganSenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
SenchaCon 2016: Oracle Forms Modernisation - Owen Pagan
 

Andere mochten auch

Unidirectional Data Flow Architecture (Redux) in Swift
Unidirectional Data Flow Architecture (Redux) in SwiftUnidirectional Data Flow Architecture (Redux) in Swift
Unidirectional Data Flow Architecture (Redux) in SwiftSeyhun AKYUREK
 
JavaScript in Mobile Development
JavaScript in Mobile DevelopmentJavaScript in Mobile Development
JavaScript in Mobile DevelopmentDima Maleev
 
DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...
DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...
DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...NoSQLmatters
 
AWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
AWS Simple Workflow: Distributed Out of the Box! - Morning@LohikaAWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
AWS Simple Workflow: Distributed Out of the Box! - Morning@LohikaSerhiy Batyuk
 
Spark - Migration Story
Spark - Migration Story Spark - Migration Story
Spark - Migration Story Roman Chukh
 
Backbone And Marionette : Take Over The World
Backbone And Marionette : Take Over The WorldBackbone And Marionette : Take Over The World
Backbone And Marionette : Take Over The Worldharshit040591
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.jsJonathan Weiss
 
Intro to Backbone.js by Azat Mardanov for General Assembly
Intro to Backbone.js by Azat Mardanov for General AssemblyIntro to Backbone.js by Azat Mardanov for General Assembly
Intro to Backbone.js by Azat Mardanov for General AssemblyAzat Mardanov
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.jsRoman Kalyakin
 
Introduction à Marionette
Introduction à MarionetteIntroduction à Marionette
Introduction à MarionetteRaphaël Lemaire
 
AngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsAngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsMark
 
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
 Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ... Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...Mikko Ohtamaa
 
Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]Andrii Lundiak
 
Introduction to Marionette Collective
Introduction to Marionette CollectiveIntroduction to Marionette Collective
Introduction to Marionette CollectivePuppet
 
Big data analysis in java world
Big data analysis in java worldBig data analysis in java world
Big data analysis in java worldSerg Masyutin
 
Backbone/Marionette introduction
Backbone/Marionette introductionBackbone/Marionette introduction
Backbone/Marionette introductionmatt-briggs
 
Introduction to Backbone.js & Marionette.js
Introduction to Backbone.js & Marionette.jsIntroduction to Backbone.js & Marionette.js
Introduction to Backbone.js & Marionette.jsReturn on Intelligence
 

Andere mochten auch (20)

Unidirectional Data Flow Architecture (Redux) in Swift
Unidirectional Data Flow Architecture (Redux) in SwiftUnidirectional Data Flow Architecture (Redux) in Swift
Unidirectional Data Flow Architecture (Redux) in Swift
 
JavaScript in Mobile Development
JavaScript in Mobile DevelopmentJavaScript in Mobile Development
JavaScript in Mobile Development
 
Creation of ideas
Creation of ideasCreation of ideas
Creation of ideas
 
DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...
DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...
DuyHai DOAN - Real time analytics with Cassandra and Spark - NoSQL matters Pa...
 
AWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
AWS Simple Workflow: Distributed Out of the Box! - Morning@LohikaAWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
AWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
 
Spark - Migration Story
Spark - Migration Story Spark - Migration Story
Spark - Migration Story
 
Backbone And Marionette : Take Over The World
Backbone And Marionette : Take Over The WorldBackbone And Marionette : Take Over The World
Backbone And Marionette : Take Over The World
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
Intro to Backbone.js by Azat Mardanov for General Assembly
Intro to Backbone.js by Azat Mardanov for General AssemblyIntro to Backbone.js by Azat Mardanov for General Assembly
Intro to Backbone.js by Azat Mardanov for General Assembly
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Introduction à Marionette
Introduction à MarionetteIntroduction à Marionette
Introduction à Marionette
 
AngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsAngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.js
 
MVC & backbone.js
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
 
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
 Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ... Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
Beautiful Maintainable ModularJavascript Codebase with RequireJS - HelsinkiJ...
 
Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]Backbone/Marionette recap [2015]
Backbone/Marionette recap [2015]
 
Introduction to Marionette Collective
Introduction to Marionette CollectiveIntroduction to Marionette Collective
Introduction to Marionette Collective
 
Big data analysis in java world
Big data analysis in java worldBig data analysis in java world
Big data analysis in java world
 
Backbone/Marionette introduction
Backbone/Marionette introductionBackbone/Marionette introduction
Backbone/Marionette introduction
 
Introduction to Backbone.js & Marionette.js
Introduction to Backbone.js & Marionette.jsIntroduction to Backbone.js & Marionette.js
Introduction to Backbone.js & Marionette.js
 

Ähnlich wie Marionette talk 2016

Backbone JS for mobile apps
Backbone JS for mobile appsBackbone JS for mobile apps
Backbone JS for mobile appsIvano Malavolta
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesQamar Abbas
 
Siebel Open UI Presentation
Siebel Open UI PresentationSiebel Open UI Presentation
Siebel Open UI PresentationAjeeth Pingle
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applicationsIvano Malavolta
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...Akira Hatsune
 
Highly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaHighly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaMagnolia
 
Client Side MVC with Backbone and Rails
Client Side MVC with Backbone and RailsClient Side MVC with Backbone and Rails
Client Side MVC with Backbone and RailsTom Z Zeng
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Prism Tech Ed India
Prism Tech Ed IndiaPrism Tech Ed India
Prism Tech Ed Indiarsnarayanan
 
Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Adam Mokan
 
Dreamforce 2017 - Up close and personal with Lightning Experience as Platform
Dreamforce 2017 - Up close and personal with Lightning Experience as PlatformDreamforce 2017 - Up close and personal with Lightning Experience as Platform
Dreamforce 2017 - Up close and personal with Lightning Experience as Platformandyinthecloud
 
Android architecture
Android architectureAndroid architecture
Android architectureDeepa Rahul
 
Porting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidancePorting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidanceOur Community Exchange LLC
 

Ähnlich wie Marionette talk 2016 (20)

MVP Clean Architecture
MVP Clean  Architecture MVP Clean  Architecture
MVP Clean Architecture
 
Backbone JS for mobile apps
Backbone JS for mobile appsBackbone JS for mobile apps
Backbone JS for mobile apps
 
[2015/2016] Backbone JS
[2015/2016] Backbone JS[2015/2016] Backbone JS
[2015/2016] Backbone JS
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Chapter 6 implementation support
Chapter 6 implementation supportChapter 6 implementation support
Chapter 6 implementation support
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 
Siebel Open UI Presentation
Siebel Open UI PresentationSiebel Open UI Presentation
Siebel Open UI Presentation
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applications
 
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...MVP Community Camp 2014 - How to useenhanced features of Windows 8.1 Store ...
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
 
Highly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaHighly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and Magnolia
 
Client Side MVC with Backbone and Rails
Client Side MVC with Backbone and RailsClient Side MVC with Backbone and Rails
Client Side MVC with Backbone and Rails
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Prism Tech Ed India
Prism Tech Ed IndiaPrism Tech Ed India
Prism Tech Ed India
 
Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012Single Page Applications - Desert Code Camp 2012
Single Page Applications - Desert Code Camp 2012
 
Dreamforce 2017 - Up close and personal with Lightning Experience as Platform
Dreamforce 2017 - Up close and personal with Lightning Experience as PlatformDreamforce 2017 - Up close and personal with Lightning Experience as Platform
Dreamforce 2017 - Up close and personal with Lightning Experience as Platform
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Porting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidancePorting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application Guidance
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
 

Mehr von Kseniya Redunova

Estimates: is there a silver bullet?
Estimates: is there a silver bullet?Estimates: is there a silver bullet?
Estimates: is there a silver bullet?Kseniya Redunova
 
ECMAScript: past, present and future
ECMAScript: past, present and futureECMAScript: past, present and future
ECMAScript: past, present and futureKseniya Redunova
 
MarionetteJS. Shall we dance?
MarionetteJS. Shall we dance?MarionetteJS. Shall we dance?
MarionetteJS. Shall we dance?Kseniya Redunova
 
Stylish visualisations with D3.js (OdessaJS)
Stylish visualisations with D3.js (OdessaJS)Stylish visualisations with D3.js (OdessaJS)
Stylish visualisations with D3.js (OdessaJS)Kseniya Redunova
 
JavaScript design patterns overview
JavaScript design patterns overview JavaScript design patterns overview
JavaScript design patterns overview Kseniya Redunova
 

Mehr von Kseniya Redunova (6)

Estimates: is there a silver bullet?
Estimates: is there a silver bullet?Estimates: is there a silver bullet?
Estimates: is there a silver bullet?
 
ECMAScript: past, present and future
ECMAScript: past, present and futureECMAScript: past, present and future
ECMAScript: past, present and future
 
MarionetteJS. Shall we dance?
MarionetteJS. Shall we dance?MarionetteJS. Shall we dance?
MarionetteJS. Shall we dance?
 
Stylish visualisations with D3.js (OdessaJS)
Stylish visualisations with D3.js (OdessaJS)Stylish visualisations with D3.js (OdessaJS)
Stylish visualisations with D3.js (OdessaJS)
 
JavaScript design patterns overview
JavaScript design patterns overview JavaScript design patterns overview
JavaScript design patterns overview
 
RaphaëlJS magic
RaphaëlJS magicRaphaëlJS magic
RaphaëlJS magic
 

Kürzlich hochgeladen

Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProRay Yuan Liu
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfalokitpathak01
 
ADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studyADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studydhruvamdhruvil123
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxStephen Sitton
 
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...arifengg7
 
Substation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHSubstation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHbirinder2
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labsamber724300
 
Module-1-Building Acoustics(Introduction)(Unit-1).pdf
Module-1-Building Acoustics(Introduction)(Unit-1).pdfModule-1-Building Acoustics(Introduction)(Unit-1).pdf
Module-1-Building Acoustics(Introduction)(Unit-1).pdfManish Kumar
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...KrishnaveniKrishnara1
 
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Amil baba
 
STATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectSTATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectGayathriM270621
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxLina Kadam
 
tourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdftourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdfchess188chess188
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfShreyas Pandit
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 

Kürzlich hochgeladen (20)

Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision Pro
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdf
 
ADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studyADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain study
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptx
 
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
 
Substation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHSubstation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRH
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labs
 
Module-1-Building Acoustics(Introduction)(Unit-1).pdf
Module-1-Building Acoustics(Introduction)(Unit-1).pdfModule-1-Building Acoustics(Introduction)(Unit-1).pdf
Module-1-Building Acoustics(Introduction)(Unit-1).pdf
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
 
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
 
STATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectSTATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subject
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptx
 
tourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdftourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdf
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdf
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 

Marionette talk 2016

Hinweis der Redaktion

  1. -
  2. -
  3. -
  4. all JS frameworks have pros & cons no silver bullet choose the right tool depending on task
  5. -
  6. -
  7. -
  8. -
  9. 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'.
  10. V2.0 Modularity is ok
  11. -
  12. 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
  13. 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.
  14. 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
  15. For one element
  16. 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
  17. 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.
  18. -
  19. Collection with a template: - both a branch and leaf in a tree structure - a collection needs to be rendered within a wrapper template
  20. Similar to the events hash, views can specify a configuration hash for collections and models.
  21. how to deal with zombie views
  22. 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 первое представление остается в области видимости. Поскольку второе представление появляется в области видимости в тот момент, когда первое представление продолжает находиться в ней, оба представления реагируют на изменение данных модели.
  23. 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.
  24. auto destroy()
  25. -
  26. 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();
  27. 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+
  28. 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. Исполняет запрос только один подписчик
  29. 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
  30. Application.vent - instance of Backbone.Wreqr.EventAggregator.
  31. 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.
  32. setHandler; execute; -- var commands = new Backbone.Wreqr.Commands(); commands.setHandler("foo", function(){ console.log("the foo command was executed"); }); commands.execute(“foo");
  33. 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);
  34. --- 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');
  35. 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.
  36. -
  37. -
  38. -
  39. -