SlideShare una empresa de Scribd logo
1 de 18
Backbone/Marionette
Experience recap in scope of @SoftServeInc projects involvement
Andrii Lundiak @landike
2015
Agenda
• Project’s Technology stack
• SCM project review
• DMG project review
• EWQ project review
Project’s Technology stack
• SCM [2013]:
• [40%] Backbone.JS 1.0.0 + [60%] Marionette.JS
• + Backbone plugins (localStorage, stickit, wreqr, babysitter, syphon, validation), Underscore.JS 1.5.1, Require.JS 2.1.8, jQuery
2.x and plugins(cookie, validate, jasmine-mixture), Bootstrap 2.3.2, Node.JS + Grunt.JS, Jasmine.JS, LESS, i18next.
• DMG [2014]:
• [70%] Backbone.JS 1.0.0 + [30%] feature development,
• + Underscore.JS, jQuery 1.x, jQueryQueryBuilder, Select2.JS, Bootstrap 2.x, Node.JS + Grunt.JS, LESS.
• EWQ [2014]:
• [80%] Backbone.JS 1.0.0 + [20%] Marionette.JS 1.8.x,
• + Underscore.JS, jsRender, jQuery 2.x, Bootstrap 2.x, Node.JS + Grunt.JS.
SCM
• UI part: First what we
implemented was List based on
client UI/UX team rework of
Bootstrap 2.x.
• Backbone part: Based on
backbone plugins (.localStorage,
router), jquery.cookie and auth
token from backnend we
implemented session.JS, and
used over the application.
• Marionette part: Then we
implemented many instances of
Marionette ItemView,
CollectionView, CompositView,
Region, Layout, Routes,
Controllers to manage all
features by Marionette.JS.
SCM: backbone part
• SessionModel = Backbone.Model.extend({ … })
• BaseRouter = Backbone.Router.extend({ … }) then
• Router = BaseRouter.extend({ … }) depends on Session and controllers
SCM: marionette part
• App = new Marionette.Application({ … }) depends on Session and Router.
• We added Regions in MainLayout,
then we created MainController,
depends on MainLayout and
a few other controlers.
SCM: marionette part #2
• We created feature instances as views and
subviews using Marionette.ItemView(),
Marionette.CollectionView(),
Marionette.CompositeView()
• We created a few regions and layout
(including nested) via Marionette.Layout()
but didn’t use directly Marionette.Region and
marionette.RegionManager.
• We didn’t use Marionette.Controller directly.
• We didn’t use Marionette.Module.
DMG
• Existed codebase was on top of Backbone 1.0, and we couldn’t migrate to newest version. So we
extended codebase as much as possible.
DMG: Improvements
• We separate small features into modules/widgets, but modules were NOT
native Backbone code. We wanted to implement it as marionette modules, but Client
declined Marionette.JS usage.
• But we already have known marionette approaches, so we kinda borrowed it, and
reused in codebase.
• Client has old view (BaseView), which was built on top of backbone 0.x version. So
after code research, we simplified view to simple usage Backbone.View().
• There were many not needed dependencies, so we simplified this also.
EWQ
• One of major improvement in EWQ comparing DMG –Widgets flexibility.
EWQ: “Loaders/Builders”
• There were a few entities: plugins, widgets, admin modules,
dashboard modules. And all are quite the same from JavaScript
pov. So we created core.js with loaders, so that their behavior
looks the same, but result different.
EWQ: Worklist #2
• In fact, we reworked worklist from previous project, because client was the
same. But this time we used Marionette.JS, due to “proof-of-concept”
phase. Marionette [.ItemView(), .CollectionView(), .CompositeView()]
were successfully used again.
• Every module has own router, based on Marionette.AppRouter(), so that
we dedicated feature has ~100% independence and behave like Lego
component.
• Every module has controller implemented with Marionette.Controller()
EWQ: modules
• We added many modules, so that
every feature would be separate
independent module.
• In fact we used 2 ways how to
create modules: native Backbone
and Marionette.Module() [but only
one experimental modue]
• For sure, potential way to use
ONLY Marionette.Module().
Otherwise, you have to implement
namespaces (as our client did in
fact before us).
Outcomes
• It’s better to not freeze with old version of 3rd party library. As result migration/extend/override/inheritance might be very
complex and painful.
• Better to follow MV* structure, especially where it’s very needed. Grouping file by system “Feature contains” set of
models, collections, views, templates, controllers, etc. is really good and independent system.
• Implement code as modularized as possible. Marionette.Module() helps here very much, and we got rid of namespaces.
• Better to separate controlling logic using Marionette.Controller()
• Complex lists, sortable tables, scrollable lists are very good implemented with Marionette.*Views().
• UI layout, page containers, separate UI features are very good implemented and scalable by using Marionette.Layout() and
regions.
• In any case, it’s very useful to have global Events bus (Backbone.Wreqr.EventAggregator aka App.vent)
Resources to read
• http://backbonejs.org/, http://underscorejs.org/,
• http://backplug.io/, http://marionettejs.com/
• https://github.com/marionettejs/backbone.marionette/releases
• http://lostechies.com/ - awesome site, very detailed, many examples.
• http://samples.leanpub.com/marionette-gentle-introduction-sample.pdf
• http://ricostacruz.com/backbone-patterns/
• http://blog.shinetech.com/2013/11/26/backbone-antipatterns/
• http://worknme.wordpress.com/2014/08/18/backbone-marionette-short-review-1/
• http://habrahabr.ru/post/207730/ [RU] – Backbone => Marionette
• http://habrahabr.ru/post/177843/ [RU]- Marionette vs. Chaplin.
Resources to try
• https://github.com/theironcook/Backbone.ModelBinder
• https://github.com/NYTimes/backbone.stickit
• https://github.com/marionettejs/backbone.wreqr
• https://github.com/marionettejs/backbone.babysitter
• https://github.com/powmedia/backbone-forms
• https://github.com/malroc/backbone-component
• http://perka.github.io/backbone-ui/
• http://loicfrering.github.io/backbone.datagrid
• https://github.com/nilbus/Backbone.dualStorage
Special Thanks to
• Vasyl Tsarevych, Vitaliy Petrychuk, Dmytro Gorogotskyj, Ievgenii Neiman,
Sviatoslav Novosiadlyj, Ivan Matiishyn, Yuriy Lytvynenko, Dmytro
Yermolayev, Yevgen Motrych, Yuriy Kapechuk.
• All these guys were in my team(s). By working with them I had great
leadership relations with them, and besides I’ve got huge amount of
experience.

Más contenido relacionado

La actualidad más candente

AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
Kai Koenig
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
Wei Ru
 

La actualidad más candente (20)

Building a Startup Stack with AngularJS
Building a Startup Stack with AngularJSBuilding a Startup Stack with AngularJS
Building a Startup Stack with AngularJS
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
The Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.js
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
 
The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015The Art of AngularJS in 2015 - Angular Summit 2015
The Art of AngularJS in 2015 - Angular Summit 2015
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
 
How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0How to Build SPA with Vue Router 2.0
How to Build SPA with Vue Router 2.0
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
 
Meet VueJs
Meet VueJsMeet VueJs
Meet VueJs
 
Vuex
VuexVuex
Vuex
 
JsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery TemplatesJsViews - Next Generation jQuery Templates
JsViews - Next Generation jQuery Templates
 
Backbone js-slides
Backbone js-slidesBackbone js-slides
Backbone js-slides
 
Intro to Angular.JS Directives
Intro to Angular.JS DirectivesIntro to Angular.JS Directives
Intro to Angular.JS Directives
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
Vue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingVue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thing
 
Angular js
Angular jsAngular js
Angular js
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 

Destacado

Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
Pragnesh Vaghela
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
偉格 高
 

Destacado (20)

Marionette: Building your first app
Marionette: Building your first appMarionette: Building your first app
Marionette: Building your first app
 
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
 
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
 
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
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
Introduction à Marionette
Introduction à MarionetteIntroduction à Marionette
Introduction à Marionette
 
Backbone.js
Backbone.jsBackbone.js
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...
 
MVC & backbone.js
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
 
Introduction to Marionette Collective
Introduction to Marionette CollectiveIntroduction to Marionette Collective
Introduction to Marionette Collective
 
Marionette talk 2016
Marionette talk 2016Marionette talk 2016
Marionette talk 2016
 
Client-side MVC with Backbone.js
Client-side MVC with Backbone.js Client-side MVC with Backbone.js
Client-side MVC with Backbone.js
 
introduction to Marionette.js (jscafe14)
introduction to Marionette.js (jscafe14)introduction to Marionette.js (jscafe14)
introduction to Marionette.js (jscafe14)
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Marionette Theater
Marionette TheaterMarionette Theater
Marionette Theater
 
RequireJS
RequireJSRequireJS
RequireJS
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
RequireJS
RequireJSRequireJS
RequireJS
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
 

Similar a Backbone/Marionette recap [2015]

React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
Marcin Grzywaczewski
 
Knockout implementing mvvm in java script with knockout
Knockout implementing mvvm in java script with knockoutKnockout implementing mvvm in java script with knockout
Knockout implementing mvvm in java script with knockout
Andoni Arroyo
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
Lucas Jellema
 

Similar a Backbone/Marionette recap [2015] (20)

Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Pragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecture
 
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
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
Knockout implementing mvvm in java script with knockout
Knockout implementing mvvm in java script with knockoutKnockout implementing mvvm in java script with knockout
Knockout implementing mvvm in java script with knockout
 
Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
jQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPagesjQuery: The World's Most Popular JavaScript Library Comes to XPages
jQuery: The World's Most Popular JavaScript Library Comes to XPages
 
How You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in ProductionHow You Convince Your Manager To Adopt Scala.js in Production
How You Convince Your Manager To Adopt Scala.js in Production
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
Web QA Gaia/B2G/Firefox OS front-end automation
Web QA Gaia/B2G/Firefox OS front-end automationWeb QA Gaia/B2G/Firefox OS front-end automation
Web QA Gaia/B2G/Firefox OS front-end automation
 
Meteor meetup
Meteor meetupMeteor meetup
Meteor meetup
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
Vue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.jsVue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.js
 
Microservices vs monolithics betabeers
Microservices vs monolithics   betabeersMicroservices vs monolithics   betabeers
Microservices vs monolithics betabeers
 
Shield UI JavaScript Chart
Shield UI JavaScript ChartShield UI JavaScript Chart
Shield UI JavaScript Chart
 
CUST-2 New Client Configuration & Extension Points in Share
CUST-2 New Client Configuration & Extension Points in ShareCUST-2 New Client Configuration & Extension Points in Share
CUST-2 New Client Configuration & Extension Points in Share
 
Getting started with Vue.js - CodeMash 2020
Getting started with Vue.js - CodeMash 2020Getting started with Vue.js - CodeMash 2020
Getting started with Vue.js - CodeMash 2020
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJS
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 

Más de Andrii Lundiak

Más de Andrii Lundiak (8)

React JS & Functional Programming Principles
React JS & Functional Programming PrinciplesReact JS & Functional Programming Principles
React JS & Functional Programming Principles
 
Create ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm packageCreate ReactJS Component & publish as npm package
Create ReactJS Component & publish as npm package
 
Node js packages [#howto with npm]
Node js packages [#howto with npm]Node js packages [#howto with npm]
Node js packages [#howto with npm]
 
Grunt Delicious
Grunt DeliciousGrunt Delicious
Grunt Delicious
 
Mockups & Requirements [ITdeya @ IF_IT_S]
Mockups & Requirements [ITdeya @ IF_IT_S]Mockups & Requirements [ITdeya @ IF_IT_S]
Mockups & Requirements [ITdeya @ IF_IT_S]
 
Drupal Vs Other
Drupal Vs OtherDrupal Vs Other
Drupal Vs Other
 
Drupal Deployment Troubles and Problems
Drupal Deployment Troubles and ProblemsDrupal Deployment Troubles and Problems
Drupal Deployment Troubles and Problems
 
Election
ElectionElection
Election
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Último (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 

Backbone/Marionette recap [2015]

  • 1. Backbone/Marionette Experience recap in scope of @SoftServeInc projects involvement Andrii Lundiak @landike 2015
  • 2. Agenda • Project’s Technology stack • SCM project review • DMG project review • EWQ project review
  • 3. Project’s Technology stack • SCM [2013]: • [40%] Backbone.JS 1.0.0 + [60%] Marionette.JS • + Backbone plugins (localStorage, stickit, wreqr, babysitter, syphon, validation), Underscore.JS 1.5.1, Require.JS 2.1.8, jQuery 2.x and plugins(cookie, validate, jasmine-mixture), Bootstrap 2.3.2, Node.JS + Grunt.JS, Jasmine.JS, LESS, i18next. • DMG [2014]: • [70%] Backbone.JS 1.0.0 + [30%] feature development, • + Underscore.JS, jQuery 1.x, jQueryQueryBuilder, Select2.JS, Bootstrap 2.x, Node.JS + Grunt.JS, LESS. • EWQ [2014]: • [80%] Backbone.JS 1.0.0 + [20%] Marionette.JS 1.8.x, • + Underscore.JS, jsRender, jQuery 2.x, Bootstrap 2.x, Node.JS + Grunt.JS.
  • 4. SCM • UI part: First what we implemented was List based on client UI/UX team rework of Bootstrap 2.x. • Backbone part: Based on backbone plugins (.localStorage, router), jquery.cookie and auth token from backnend we implemented session.JS, and used over the application. • Marionette part: Then we implemented many instances of Marionette ItemView, CollectionView, CompositView, Region, Layout, Routes, Controllers to manage all features by Marionette.JS.
  • 5. SCM: backbone part • SessionModel = Backbone.Model.extend({ … }) • BaseRouter = Backbone.Router.extend({ … }) then • Router = BaseRouter.extend({ … }) depends on Session and controllers
  • 6. SCM: marionette part • App = new Marionette.Application({ … }) depends on Session and Router. • We added Regions in MainLayout, then we created MainController, depends on MainLayout and a few other controlers.
  • 7. SCM: marionette part #2 • We created feature instances as views and subviews using Marionette.ItemView(), Marionette.CollectionView(), Marionette.CompositeView() • We created a few regions and layout (including nested) via Marionette.Layout() but didn’t use directly Marionette.Region and marionette.RegionManager. • We didn’t use Marionette.Controller directly. • We didn’t use Marionette.Module.
  • 8. DMG • Existed codebase was on top of Backbone 1.0, and we couldn’t migrate to newest version. So we extended codebase as much as possible.
  • 9. DMG: Improvements • We separate small features into modules/widgets, but modules were NOT native Backbone code. We wanted to implement it as marionette modules, but Client declined Marionette.JS usage. • But we already have known marionette approaches, so we kinda borrowed it, and reused in codebase. • Client has old view (BaseView), which was built on top of backbone 0.x version. So after code research, we simplified view to simple usage Backbone.View(). • There were many not needed dependencies, so we simplified this also.
  • 10. EWQ • One of major improvement in EWQ comparing DMG –Widgets flexibility.
  • 11. EWQ: “Loaders/Builders” • There were a few entities: plugins, widgets, admin modules, dashboard modules. And all are quite the same from JavaScript pov. So we created core.js with loaders, so that their behavior looks the same, but result different.
  • 12. EWQ: Worklist #2 • In fact, we reworked worklist from previous project, because client was the same. But this time we used Marionette.JS, due to “proof-of-concept” phase. Marionette [.ItemView(), .CollectionView(), .CompositeView()] were successfully used again. • Every module has own router, based on Marionette.AppRouter(), so that we dedicated feature has ~100% independence and behave like Lego component. • Every module has controller implemented with Marionette.Controller()
  • 13.
  • 14. EWQ: modules • We added many modules, so that every feature would be separate independent module. • In fact we used 2 ways how to create modules: native Backbone and Marionette.Module() [but only one experimental modue] • For sure, potential way to use ONLY Marionette.Module(). Otherwise, you have to implement namespaces (as our client did in fact before us).
  • 15. Outcomes • It’s better to not freeze with old version of 3rd party library. As result migration/extend/override/inheritance might be very complex and painful. • Better to follow MV* structure, especially where it’s very needed. Grouping file by system “Feature contains” set of models, collections, views, templates, controllers, etc. is really good and independent system. • Implement code as modularized as possible. Marionette.Module() helps here very much, and we got rid of namespaces. • Better to separate controlling logic using Marionette.Controller() • Complex lists, sortable tables, scrollable lists are very good implemented with Marionette.*Views(). • UI layout, page containers, separate UI features are very good implemented and scalable by using Marionette.Layout() and regions. • In any case, it’s very useful to have global Events bus (Backbone.Wreqr.EventAggregator aka App.vent)
  • 16. Resources to read • http://backbonejs.org/, http://underscorejs.org/, • http://backplug.io/, http://marionettejs.com/ • https://github.com/marionettejs/backbone.marionette/releases • http://lostechies.com/ - awesome site, very detailed, many examples. • http://samples.leanpub.com/marionette-gentle-introduction-sample.pdf • http://ricostacruz.com/backbone-patterns/ • http://blog.shinetech.com/2013/11/26/backbone-antipatterns/ • http://worknme.wordpress.com/2014/08/18/backbone-marionette-short-review-1/ • http://habrahabr.ru/post/207730/ [RU] – Backbone => Marionette • http://habrahabr.ru/post/177843/ [RU]- Marionette vs. Chaplin.
  • 17. Resources to try • https://github.com/theironcook/Backbone.ModelBinder • https://github.com/NYTimes/backbone.stickit • https://github.com/marionettejs/backbone.wreqr • https://github.com/marionettejs/backbone.babysitter • https://github.com/powmedia/backbone-forms • https://github.com/malroc/backbone-component • http://perka.github.io/backbone-ui/ • http://loicfrering.github.io/backbone.datagrid • https://github.com/nilbus/Backbone.dualStorage
  • 18. Special Thanks to • Vasyl Tsarevych, Vitaliy Petrychuk, Dmytro Gorogotskyj, Ievgenii Neiman, Sviatoslav Novosiadlyj, Ivan Matiishyn, Yuriy Lytvynenko, Dmytro Yermolayev, Yevgen Motrych, Yuriy Kapechuk. • All these guys were in my team(s). By working with them I had great leadership relations with them, and besides I’ve got huge amount of experience.